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
57357197
There was an error fetching the commit references. Please try again later.
Unverified
Commit
57357197
authored
3 years ago
by
GyDi
Committed by
GitHub
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
chore: adjust
parent
dc492a2a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src-tauri/src/core/clash.rs
+7
-19
7 additions, 19 deletions
src-tauri/src/core/clash.rs
with
7 additions
and
19 deletions
src-tauri/src/core/clash.rs
+
7
−
19
View file @
57357197
...
@@ -47,20 +47,15 @@ impl ClashInfo {
...
@@ -47,20 +47,15 @@ impl ClashInfo {
},
},
};
};
// `external-controller` could be
// "127.0.0.1:9090" or ":9090"
// "9090" or 9090 (clash do not support this)
let
server
=
match
config
.get
(
&
key_server
)
{
let
server
=
match
config
.get
(
&
key_server
)
{
Some
(
value
)
=>
match
value
{
Some
(
value
)
=>
match
value
{
Value
::
String
(
val_str
)
=>
{
Value
::
String
(
val_str
)
=>
match
val_str
.starts_with
(
":"
)
{
// `external-controller` could be
true
=>
Some
(
format!
(
"127.0.0.1{val_str}"
)),
// "127.0.0.1:9090" or ":9090"
false
=>
Some
(
val_str
.clone
()),
// Todo: maybe it could support single port
},
let
server
=
val_str
.clone
();
let
server
=
match
server
.starts_with
(
":"
)
{
true
=>
format!
(
"127.0.0.1{server}"
),
false
=>
server
,
};
Some
(
server
)
}
_
=>
None
,
_
=>
None
,
},
},
_
=>
None
,
_
=>
None
,
...
@@ -115,13 +110,6 @@ impl Clash {
...
@@ -115,13 +110,6 @@ impl Clash {
)
)
}
}
/// todo: delete
/// update the clash info
pub
fn
update_config
(
&
mut
self
)
{
self
.config
=
Clash
::
read_config
();
self
.info
=
ClashInfo
::
from
(
&
self
.config
);
}
/// patch update the clash config
/// patch update the clash config
/// if the port is changed then return true
/// if the port is changed then return true
pub
fn
patch_config
(
&
mut
self
,
patch
:
Mapping
)
->
Result
<
bool
>
{
pub
fn
patch_config
(
&
mut
self
,
patch
:
Mapping
)
->
Result
<
bool
>
{
...
...
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