feat: support visual edit for proxy group

This commit is contained in:
MystiPanda
2024-07-04 13:54:20 +08:00
parent 43f901eeb9
commit 12a80f35fe
9 changed files with 1053 additions and 15 deletions

View File

@@ -24,6 +24,7 @@ import {
saveProfileFile,
} from "@/services/cmds";
import { Notice } from "@/components/base";
import { GroupsEditorViewer } from "@/components/profile/groups-editor-viewer";
import { RulesEditorViewer } from "@/components/profile/rules-editor-viewer";
import { EditorViewer } from "@/components/profile/editor-viewer";
import { ProfileBox } from "./profile-box";
@@ -501,14 +502,13 @@ export const ProfileItem = (props: Props) => {
}}
onClose={() => setProxiesOpen(false)}
/>
<EditorViewer
<GroupsEditorViewer
mergeUid={option?.merge ?? ""}
proxiesUid={option?.proxies ?? ""}
profileUid={uid}
property={option?.groups ?? ""}
open={groupsOpen}
initialData={readProfileFile(option?.groups ?? "")}
language="yaml"
onSave={async (prev, curr) => {
await saveProfileFile(option?.groups ?? "", curr ?? "");
onSave && onSave(prev, curr);
}}
onSave={onSave}
onClose={() => setGroupsOpen(false)}
/>
<EditorViewer