|
@@ -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, editProfile } from "../services/cmds";
|
|
|
|
|
|
+import { updateProfile, deleteProfile, viewProfile } 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) => {
|
|
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 onEdit = async () => {
|
|
|
|
|
|
+ const onView = async () => {
|
|
setAnchorEl(null);
|
|
setAnchorEl(null);
|
|
try {
|
|
try {
|
|
- await editProfile(index);
|
|
|
|
|
|
+ await viewProfile(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) => {
|
|
anchorReference="anchorPosition"
|
|
anchorReference="anchorPosition"
|
|
>
|
|
>
|
|
<MenuItem onClick={onForceSelect}>Select</MenuItem>
|
|
<MenuItem onClick={onForceSelect}>Select</MenuItem>
|
|
- <MenuItem onClick={onEdit}>Edit(VScode)</MenuItem>
|
|
|
|
|
|
+ <MenuItem onClick={onView}>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>
|