Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Clash Verge
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
many-archive
Clash Verge
Commits
220a4946
There was an error fetching the commit references. Please try again later.
Unverified
Commit
220a4946
authored
3 years ago
by
GyDi
Browse files
Options
Downloads
Patches
Plain Diff
chore: adjust log field
parent
db6bc101
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src-tauri/src/core/clash.rs
+2
-2
2 additions, 2 deletions
src-tauri/src/core/clash.rs
src-tauri/src/core/verge.rs
+13
-10
13 additions, 10 deletions
src-tauri/src/core/verge.rs
with
15 additions
and
12 deletions
src-tauri/src/core/clash.rs
+
2
−
2
View file @
220a4946
...
...
@@ -128,8 +128,8 @@ impl Clash {
tauri
::
async_runtime
::
spawn
(
async
move
{
while
let
Some
(
event
)
=
rx
.recv
()
.await
{
match
event
{
CommandEvent
::
Stdout
(
line
)
=>
log
::
info!
(
"[
stdout
]: {}"
,
line
),
CommandEvent
::
Stderr
(
err
)
=>
log
::
error!
(
"[
stderr
]: {}"
,
err
),
CommandEvent
::
Stdout
(
line
)
=>
log
::
info!
(
"[
clash
]: {}"
,
line
),
CommandEvent
::
Stderr
(
err
)
=>
log
::
error!
(
"[
clash
]: {}"
,
err
),
_
=>
{}
}
}
...
...
This diff is collapsed.
Click to expand it.
src-tauri/src/core/verge.rs
+
13
−
10
View file @
220a4946
use
crate
::{
core
::
Clash
,
log_if_err
,
utils
::{
config
,
dirs
,
sysopt
::
SysProxyConfig
},
};
use
anyhow
::{
bail
,
Result
};
...
...
@@ -58,13 +59,18 @@ impl VergeConfig {
/// Verge App abilities
#[derive(Debug)]
pub
struct
Verge
{
/// manage the verge config
pub
config
:
VergeConfig
,
pub
old_sysproxy
:
Option
<
SysProxyConfig
>
,
/// current system proxy setting
pub
cur_sysproxy
:
Option
<
SysProxyConfig
>
,
pub
auto_launch
:
Option
<
AutoLaunch
>
,
/// record the original system proxy
/// recover it when exit
old_sysproxy
:
Option
<
SysProxyConfig
>
,
/// helps to auto launch the app
auto_launch
:
Option
<
AutoLaunch
>
,
/// record whether the guard async is running or not
guard_state
:
Arc
<
Mutex
<
bool
>>
,
...
...
@@ -282,7 +288,7 @@ impl Verge {
loop
{
sleep
(
Duration
::
from_secs
(
wait_secs
))
.await
;
log
::
debug!
(
"
[G
uard
]:
heartbeat detection"
);
log
::
debug!
(
"
g
uard heartbeat detection"
);
let
verge
=
Verge
::
new
();
...
...
@@ -298,7 +304,7 @@ impl Verge {
break
;
}
log
::
info!
(
"
[Guard]:
try to guard proxy"
);
log
::
info!
(
"try to guard proxy"
);
let
clash
=
Clash
::
new
();
...
...
@@ -307,12 +313,9 @@ impl Verge {
let
bypass
=
verge
.config.system_proxy_bypass
.clone
();
let
sysproxy
=
SysProxyConfig
::
new
(
true
,
port
.clone
(),
bypass
);
if
let
Err
(
err
)
=
sysproxy
.set_sys
()
{
log
::
error!
(
"[Guard]: {err}"
);
log
::
error!
(
"[Guard]: fail to set system proxy"
);
}
log_if_err!
(
sysproxy
.set_sys
());
}
None
=>
log
::
error!
(
"
[Guard]:
fail to parse clash port"
),
None
=>
log
::
error!
(
"fail to parse clash port"
),
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment