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

@@ -335,15 +335,16 @@ export const RulesEditorViewer = (props: Props) => {
let moreAppendGroups = moreGroupsObj?.["append"] || [];
let moreDeleteGroups =
moreGroupsObj?.["delete"] || ([] as string[] | { name: string }[]);
let groups = originGroups
.filter((group: any) => {
let groups = morePrependGroups.concat(
originGroups.filter((group: any) => {
if (group.name) {
return !moreDeleteGroups.includes(group.name);
} else {
return !moreDeleteGroups.includes(group);
}
})
.concat(morePrependGroups, moreAppendGroups);
}),
moreAppendGroups
);
let originRuleSetObj = yaml.load(data) as { "rule-providers": {} } | null;
let originRuleSet = originRuleSetObj?.["rule-providers"] || {};
@@ -375,6 +376,7 @@ export const RulesEditorViewer = (props: Props) => {
};
useEffect(() => {
if (!open) return;
fetchContent();
fetchProfile();
}, [open]);