diff --git a/src-tauri/src/cmds.rs b/src-tauri/src/cmds.rs index 4ff3a2d..4ff20db 100644 --- a/src-tauri/src/cmds.rs +++ b/src-tauri/src/cmds.rs @@ -146,7 +146,7 @@ pub fn patch_profile( /// run vscode command to edit the profile #[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 items = profiles.items.take().unwrap_or(vec![]); diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index f9d497c..7097d52 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -80,7 +80,7 @@ fn main() -> std::io::Result<()> { cmds::get_verge_config, cmds::patch_verge_config, // profile - cmds::edit_profile, + cmds::view_profile, cmds::patch_profile, cmds::import_profile, cmds::update_profile, diff --git a/src/components/profile-item.tsx b/src/components/profile-item.tsx index 6096410..542e452 100644 --- a/src/components/profile-item.tsx +++ b/src/components/profile-item.tsx @@ -14,7 +14,7 @@ import { import { useSWRConfig } from "swr"; import { RefreshRounded } from "@mui/icons-material"; import { CmdType } from "../services/types"; -import { updateProfile, deleteProfile, editProfile } from "../services/cmds"; +import { updateProfile, deleteProfile, viewProfile } from "../services/cmds"; import Notice from "./notice"; import parseTraffic from "../utils/parse-traffic"; import relativeTime from "dayjs/plugin/relativeTime"; @@ -59,10 +59,10 @@ const ProfileItem: React.FC = (props) => { const progress = Math.round(((download + upload) * 100) / (total + 0.1)); const fromnow = updated > 0 ? dayjs(updated * 1000).fromNow() : ""; - const onEdit = async () => { + const onView = async () => { setAnchorEl(null); try { - await editProfile(index); + await viewProfile(index); } catch (err: any) { Notice.error(err.toString()); } @@ -217,7 +217,7 @@ const ProfileItem: React.FC = (props) => { anchorReference="anchorPosition" > Select - Edit(VScode) + View Update Update(Proxy) Delete diff --git a/src/services/cmds.ts b/src/services/cmds.ts index faca55f..6f5703f 100644 --- a/src/services/cmds.ts +++ b/src/services/cmds.ts @@ -9,8 +9,8 @@ export async function syncProfiles() { return invoke("sync_profiles"); } -export async function editProfile(index: number) { - return invoke("edit_profile", { index }); +export async function viewProfile(index: number) { + return invoke("view_profile", { index }); } export async function importProfile(url: string) {