|
@@ -78,10 +78,18 @@ export const GroupsEditorViewer = (props: Props) => {
|
|
const [appendSeq, setAppendSeq] = useState<IProxyGroupConfig[]>([]);
|
|
const [appendSeq, setAppendSeq] = useState<IProxyGroupConfig[]>([]);
|
|
const [deleteSeq, setDeleteSeq] = useState<string[]>([]);
|
|
const [deleteSeq, setDeleteSeq] = useState<string[]>([]);
|
|
|
|
|
|
|
|
+ const filteredPrependSeq = useMemo(
|
|
|
|
+ () => prependSeq.filter((group) => match(group.name)),
|
|
|
|
+ [prependSeq, match]
|
|
|
|
+ );
|
|
const filteredGroupList = useMemo(
|
|
const filteredGroupList = useMemo(
|
|
() => groupList.filter((group) => match(group.name)),
|
|
() => groupList.filter((group) => match(group.name)),
|
|
[groupList, match]
|
|
[groupList, match]
|
|
);
|
|
);
|
|
|
|
+ const filteredAppendSeq = useMemo(
|
|
|
|
+ () => appendSeq.filter((group) => match(group.name)),
|
|
|
|
+ [appendSeq, match]
|
|
|
|
+ );
|
|
|
|
|
|
const sensors = useSensors(
|
|
const sensors = useSensors(
|
|
useSensor(PointerSensor),
|
|
useSensor(PointerSensor),
|
|
@@ -376,6 +384,7 @@ export const GroupsEditorViewer = (props: Props) => {
|
|
}}
|
|
}}
|
|
multiple
|
|
multiple
|
|
options={proxyPolicyList}
|
|
options={proxyPolicyList}
|
|
|
|
+ disableCloseOnSelect
|
|
onChange={(_, value) => value && field.onChange(value)}
|
|
onChange={(_, value) => value && field.onChange(value)}
|
|
renderInput={(params) => <TextField {...params} />}
|
|
renderInput={(params) => <TextField {...params} />}
|
|
/>
|
|
/>
|
|
@@ -393,6 +402,7 @@ export const GroupsEditorViewer = (props: Props) => {
|
|
sx={{ width: "calc(100% - 150px)" }}
|
|
sx={{ width: "calc(100% - 150px)" }}
|
|
multiple
|
|
multiple
|
|
options={proxyProviderList}
|
|
options={proxyProviderList}
|
|
|
|
+ disableCloseOnSelect
|
|
onChange={(_, value) => value && field.onChange(value)}
|
|
onChange={(_, value) => value && field.onChange(value)}
|
|
renderInput={(params) => <TextField {...params} />}
|
|
renderInput={(params) => <TextField {...params} />}
|
|
/>
|
|
/>
|
|
@@ -541,23 +551,33 @@ export const GroupsEditorViewer = (props: Props) => {
|
|
<Autocomplete
|
|
<Autocomplete
|
|
multiple
|
|
multiple
|
|
options={[
|
|
options={[
|
|
- "ss",
|
|
|
|
- "ssr",
|
|
|
|
- "direct",
|
|
|
|
- "dns",
|
|
|
|
- "snell",
|
|
|
|
- "http",
|
|
|
|
- "trojan",
|
|
|
|
- "hysteria",
|
|
|
|
- "hysteria2",
|
|
|
|
- "tuic",
|
|
|
|
- "wireguard",
|
|
|
|
- "ssh",
|
|
|
|
- "socks5",
|
|
|
|
- "vmess",
|
|
|
|
- "vless",
|
|
|
|
|
|
+ "Direct",
|
|
|
|
+ "Reject",
|
|
|
|
+ "RejectDrop",
|
|
|
|
+ "Compatible",
|
|
|
|
+ "Pass",
|
|
|
|
+ "Dns",
|
|
|
|
+ "Shadowsocks",
|
|
|
|
+ "ShadowsocksR",
|
|
|
|
+ "Snell",
|
|
|
|
+ "Socks5",
|
|
|
|
+ "Http",
|
|
|
|
+ "Vmess",
|
|
|
|
+ "Vless",
|
|
|
|
+ "Trojan",
|
|
|
|
+ "Hysteria",
|
|
|
|
+ "Hysteria2",
|
|
|
|
+ "WireGuard",
|
|
|
|
+ "Tuic",
|
|
|
|
+ "Relay",
|
|
|
|
+ "Selector",
|
|
|
|
+ "Fallback",
|
|
|
|
+ "URLTest",
|
|
|
|
+ "LoadBalance",
|
|
|
|
+ "Ssh",
|
|
]}
|
|
]}
|
|
size="small"
|
|
size="small"
|
|
|
|
+ disableCloseOnSelect
|
|
sx={{ width: "calc(100% - 150px)" }}
|
|
sx={{ width: "calc(100% - 150px)" }}
|
|
value={field.value?.split("|")}
|
|
value={field.value?.split("|")}
|
|
onChange={(_, value) => {
|
|
onChange={(_, value) => {
|
|
@@ -576,7 +596,6 @@ export const GroupsEditorViewer = (props: Props) => {
|
|
<ListItemText primary={t("Expected Status")} />
|
|
<ListItemText primary={t("Expected Status")} />
|
|
<TextField
|
|
<TextField
|
|
autoComplete="off"
|
|
autoComplete="off"
|
|
- type="number"
|
|
|
|
size="small"
|
|
size="small"
|
|
sx={{ width: "calc(100% - 150px)" }}
|
|
sx={{ width: "calc(100% - 150px)" }}
|
|
onChange={(e) => {
|
|
onChange={(e) => {
|
|
@@ -705,13 +724,13 @@ export const GroupsEditorViewer = (props: Props) => {
|
|
style={{ height: "calc(100% - 24px)", marginTop: "8px" }}
|
|
style={{ height: "calc(100% - 24px)", marginTop: "8px" }}
|
|
totalCount={
|
|
totalCount={
|
|
filteredGroupList.length +
|
|
filteredGroupList.length +
|
|
- (prependSeq.length > 0 ? 1 : 0) +
|
|
|
|
- (appendSeq.length > 0 ? 1 : 0)
|
|
|
|
|
|
+ (filteredPrependSeq.length > 0 ? 1 : 0) +
|
|
|
|
+ (filteredAppendSeq.length > 0 ? 1 : 0)
|
|
}
|
|
}
|
|
increaseViewportBy={256}
|
|
increaseViewportBy={256}
|
|
itemContent={(index) => {
|
|
itemContent={(index) => {
|
|
- let shift = prependSeq.length > 0 ? 1 : 0;
|
|
|
|
- if (prependSeq.length > 0 && index === 0) {
|
|
|
|
|
|
+ let shift = filteredPrependSeq.length > 0 ? 1 : 0;
|
|
|
|
+ if (filteredPrependSeq.length > 0 && index === 0) {
|
|
return (
|
|
return (
|
|
<DndContext
|
|
<DndContext
|
|
sensors={sensors}
|
|
sensors={sensors}
|
|
@@ -719,11 +738,11 @@ export const GroupsEditorViewer = (props: Props) => {
|
|
onDragEnd={onPrependDragEnd}
|
|
onDragEnd={onPrependDragEnd}
|
|
>
|
|
>
|
|
<SortableContext
|
|
<SortableContext
|
|
- items={prependSeq.map((x) => {
|
|
|
|
|
|
+ items={filteredPrependSeq.map((x) => {
|
|
return x.name;
|
|
return x.name;
|
|
})}
|
|
})}
|
|
>
|
|
>
|
|
- {prependSeq.map((item, index) => {
|
|
|
|
|
|
+ {filteredPrependSeq.map((item, index) => {
|
|
return (
|
|
return (
|
|
<GroupItem
|
|
<GroupItem
|
|
key={`${item.name}-${index}`}
|
|
key={`${item.name}-${index}`}
|
|
@@ -779,11 +798,11 @@ export const GroupsEditorViewer = (props: Props) => {
|
|
onDragEnd={onAppendDragEnd}
|
|
onDragEnd={onAppendDragEnd}
|
|
>
|
|
>
|
|
<SortableContext
|
|
<SortableContext
|
|
- items={appendSeq.map((x) => {
|
|
|
|
|
|
+ items={filteredAppendSeq.map((x) => {
|
|
return x.name;
|
|
return x.name;
|
|
})}
|
|
})}
|
|
>
|
|
>
|
|
- {appendSeq.map((item, index) => {
|
|
|
|
|
|
+ {filteredAppendSeq.map((item, index) => {
|
|
return (
|
|
return (
|
|
<GroupItem
|
|
<GroupItem
|
|
key={`${item.name}-${index}`}
|
|
key={`${item.name}-${index}`}
|