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
0d5bfc09
There was an error fetching the commit references. Please try again later.
Unverified
Commit
0d5bfc09
authored
3 years ago
by
GyDi
Browse files
Options
Downloads
Patches
Plain Diff
feat: rename edit as view
parent
4f02c373
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src-tauri/src/cmds.rs
+1
-1
1 addition, 1 deletion
src-tauri/src/cmds.rs
src-tauri/src/main.rs
+1
-1
1 addition, 1 deletion
src-tauri/src/main.rs
src/components/profile-item.tsx
+4
-4
4 additions, 4 deletions
src/components/profile-item.tsx
src/services/cmds.ts
+2
-2
2 additions, 2 deletions
src/services/cmds.ts
with
8 additions
and
8 deletions
src-tauri/src/cmds.rs
+
1
−
1
View file @
0d5bfc09
...
@@ -146,7 +146,7 @@ pub fn patch_profile(
...
@@ -146,7 +146,7 @@ pub fn patch_profile(
/// run vscode command to edit the profile
/// run vscode command to edit the profile
#[tauri::command]
#[tauri::command]
pub
fn
edit
_profile
(
index
:
usize
,
profiles_state
:
State
<
'_
,
ProfilesState
>
)
->
Result
<
(),
String
>
{
pub
fn
view
_profile
(
index
:
usize
,
profiles_state
:
State
<
'_
,
ProfilesState
>
)
->
Result
<
(),
String
>
{
let
mut
profiles
=
profiles_state
.0
.lock
()
.unwrap
();
let
mut
profiles
=
profiles_state
.0
.lock
()
.unwrap
();
let
items
=
profiles
.items
.take
()
.unwrap_or
(
vec!
[]);
let
items
=
profiles
.items
.take
()
.unwrap_or
(
vec!
[]);
...
...
This diff is collapsed.
Click to expand it.
src-tauri/src/main.rs
+
1
−
1
View file @
0d5bfc09
...
@@ -80,7 +80,7 @@ fn main() -> std::io::Result<()> {
...
@@ -80,7 +80,7 @@ fn main() -> std::io::Result<()> {
cmds
::
get_verge_config
,
cmds
::
get_verge_config
,
cmds
::
patch_verge_config
,
cmds
::
patch_verge_config
,
// profile
// profile
cmds
::
edit
_profile
,
cmds
::
view
_profile
,
cmds
::
patch_profile
,
cmds
::
patch_profile
,
cmds
::
import_profile
,
cmds
::
import_profile
,
cmds
::
update_profile
,
cmds
::
update_profile
,
...
...
This diff is collapsed.
Click to expand it.
src/components/profile-item.tsx
+
4
−
4
View file @
0d5bfc09
...
@@ -14,7 +14,7 @@ import {
...
@@ -14,7 +14,7 @@ import {
import
{
useSWRConfig
}
from
"
swr
"
;
import
{
useSWRConfig
}
from
"
swr
"
;
import
{
RefreshRounded
}
from
"
@mui/icons-material
"
;
import
{
RefreshRounded
}
from
"
@mui/icons-material
"
;
import
{
CmdType
}
from
"
../services/types
"
;
import
{
CmdType
}
from
"
../services/types
"
;
import
{
updateProfile
,
deleteProfile
,
edit
Profile
}
from
"
../services/cmds
"
;
import
{
updateProfile
,
deleteProfile
,
view
Profile
}
from
"
../services/cmds
"
;
import
Notice
from
"
./notice
"
;
import
Notice
from
"
./notice
"
;
import
parseTraffic
from
"
../utils/parse-traffic
"
;
import
parseTraffic
from
"
../utils/parse-traffic
"
;
import
relativeTime
from
"
dayjs/plugin/relativeTime
"
;
import
relativeTime
from
"
dayjs/plugin/relativeTime
"
;
...
@@ -59,10 +59,10 @@ const ProfileItem: React.FC<Props> = (props) => {
...
@@ -59,10 +59,10 @@ const ProfileItem: React.FC<Props> = (props) => {
const
progress
=
Math
.
round
(((
download
+
upload
)
*
100
)
/
(
total
+
0.1
));
const
progress
=
Math
.
round
(((
download
+
upload
)
*
100
)
/
(
total
+
0.1
));
const
fromnow
=
updated
>
0
?
dayjs
(
updated
*
1000
).
fromNow
()
:
""
;
const
fromnow
=
updated
>
0
?
dayjs
(
updated
*
1000
).
fromNow
()
:
""
;
const
on
Edit
=
async
()
=>
{
const
on
View
=
async
()
=>
{
setAnchorEl
(
null
);
setAnchorEl
(
null
);
try
{
try
{
await
edit
Profile
(
index
);
await
view
Profile
(
index
);
}
catch
(
err
:
any
)
{
}
catch
(
err
:
any
)
{
Notice
.
error
(
err
.
toString
());
Notice
.
error
(
err
.
toString
());
}
}
...
@@ -217,7 +217,7 @@ const ProfileItem: React.FC<Props> = (props) => {
...
@@ -217,7 +217,7 @@ const ProfileItem: React.FC<Props> = (props) => {
anchorReference
=
"anchorPosition"
anchorReference
=
"anchorPosition"
>
>
<
MenuItem
onClick
=
{
onForceSelect
}
>
Select
</
MenuItem
>
<
MenuItem
onClick
=
{
onForceSelect
}
>
Select
</
MenuItem
>
<
MenuItem
onClick
=
{
on
Edit
}
>
Edit(VScode)
</
MenuItem
>
<
MenuItem
onClick
=
{
on
View
}
>
View
</
MenuItem
>
<
MenuItem
onClick
=
{
onUpdateWrapper
(
false
)
}
>
Update
</
MenuItem
>
<
MenuItem
onClick
=
{
onUpdateWrapper
(
false
)
}
>
Update
</
MenuItem
>
<
MenuItem
onClick
=
{
onUpdateWrapper
(
true
)
}
>
Update(Proxy)
</
MenuItem
>
<
MenuItem
onClick
=
{
onUpdateWrapper
(
true
)
}
>
Update(Proxy)
</
MenuItem
>
<
MenuItem
onClick
=
{
onDelete
}
>
Delete
</
MenuItem
>
<
MenuItem
onClick
=
{
onDelete
}
>
Delete
</
MenuItem
>
...
...
This diff is collapsed.
Click to expand it.
src/services/cmds.ts
+
2
−
2
View file @
0d5bfc09
...
@@ -9,8 +9,8 @@ export async function syncProfiles() {
...
@@ -9,8 +9,8 @@ export async function syncProfiles() {
return
invoke
<
void
>
(
"
sync_profiles
"
);
return
invoke
<
void
>
(
"
sync_profiles
"
);
}
}
export
async
function
edit
Profile
(
index
:
number
)
{
export
async
function
view
Profile
(
index
:
number
)
{
return
invoke
<
void
>
(
"
edit
_profile
"
,
{
index
});
return
invoke
<
void
>
(
"
view
_profile
"
,
{
index
});
}
}
export
async
function
importProfile
(
url
:
string
)
{
export
async
function
importProfile
(
url
:
string
)
{
...
...
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