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
9a29c9ab
There was an error fetching the commit references. Please try again later.
Unverified
Commit
9a29c9ab
authored
2 years ago
by
GyDi
Browse files
Options
Downloads
Patches
Plain Diff
feat: add restart core button
parent
66d93ea0
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/components/setting/mods/clash-core-viewer.tsx
+27
-3
27 additions, 3 deletions
src/components/setting/mods/clash-core-viewer.tsx
src/locales/en.json
+1
-0
1 addition, 0 deletions
src/locales/en.json
src/locales/zh.json
+1
-0
1 addition, 0 deletions
src/locales/zh.json
with
29 additions
and
3 deletions
src/components/setting/mods/clash-core-viewer.tsx
+
27
−
3
View file @
9a29c9ab
...
...
@@ -5,8 +5,15 @@ import { useTranslation } from "react-i18next";
import
{
useVerge
}
from
"
@/hooks/use-verge
"
;
import
{
useLockFn
}
from
"
ahooks
"
;
import
{
Lock
}
from
"
@mui/icons-material
"
;
import
{
IconButton
,
List
,
ListItemButton
,
ListItemText
}
from
"
@mui/material
"
;
import
{
changeClashCore
}
from
"
@/services/cmds
"
;
import
{
Box
,
Button
,
IconButton
,
List
,
ListItemButton
,
ListItemText
,
}
from
"
@mui/material
"
;
import
{
changeClashCore
,
restartSidecar
}
from
"
@/services/cmds
"
;
import
{
closeAllConnections
}
from
"
@/services/api
"
;
import
{
grantPermission
}
from
"
@/services/cmds
"
;
import
getSystem
from
"
@/utils/get-system
"
;
...
...
@@ -58,10 +65,27 @@ export const ClashCoreViewer = forwardRef<DialogRef>((props, ref) => {
}
});
const
onRestart
=
useLockFn
(
async
()
=>
{
try
{
await
restartSidecar
();
Notice
.
success
(
`Successfully restart core`
,
1000
);
}
catch
(
err
:
any
)
{
Notice
.
error
(
err
?.
message
||
err
.
toString
());
}
});
return
(
<
BaseDialog
open
=
{
open
}
title
=
{
t
(
"
Clash Core
"
)
}
title
=
{
<
Box
display
=
"flex"
justifyContent
=
"space-between"
>
{
t
(
"
Clash Core
"
)
}
<
Button
variant
=
"contained"
size
=
"small"
onClick
=
{
onRestart
}
>
{
t
(
"
Restart
"
)
}
</
Button
>
</
Box
>
}
contentSx
=
{
{
pb
:
0
,
width
:
320
,
...
...
This diff is collapsed.
Click to expand it.
src/locales/en.json
+
1
−
0
View file @
9a29c9ab
...
...
@@ -91,6 +91,7 @@
"Clash Field"
:
"Clash Field"
,
"Runtime Config"
:
"Runtime Config"
,
"ReadOnly"
:
"ReadOnly"
,
"Restart"
:
"Restart"
,
"Back"
:
"Back"
,
"Save"
:
"Save"
,
...
...
This diff is collapsed.
Click to expand it.
src/locales/zh.json
+
1
−
0
View file @
9a29c9ab
...
...
@@ -95,6 +95,7 @@
"Clash Field"
:
"Clash 字段"
,
"Runtime Config"
:
"运行配置"
,
"ReadOnly"
:
"只读"
,
"Restart"
:
"重启内核"
,
"Back"
:
"返回"
,
"Save"
:
"保存"
,
...
...
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