fix: some error
Some checks are pending
Alpha Build / alpha (macos-latest, aarch64-apple-darwin) (push) Waiting to run
Alpha Build / alpha (macos-latest, x86_64-apple-darwin) (push) Waiting to run
Alpha Build / alpha (windows-latest, aarch64-pc-windows-msvc) (push) Waiting to run
Alpha Build / alpha (windows-latest, i686-pc-windows-msvc) (push) Waiting to run
Alpha Build / alpha (windows-latest, x86_64-pc-windows-msvc) (push) Waiting to run
Alpha Build / alpha-for-linux (ubuntu-latest, aarch64-unknown-linux-gnu) (push) Waiting to run
Alpha Build / alpha-for-linux (ubuntu-latest, armv7-unknown-linux-gnueabihf) (push) Waiting to run
Alpha Build / alpha-for-linux (ubuntu-latest, i686-unknown-linux-gnu) (push) Waiting to run
Alpha Build / alpha-for-linux (ubuntu-latest, x86_64-unknown-linux-gnu) (push) Waiting to run
Alpha Build / alpha-for-fixed-webview2 (arm64, windows-latest, aarch64-pc-windows-msvc) (push) Waiting to run
Alpha Build / alpha-for-fixed-webview2 (x64, windows-latest, x86_64-pc-windows-msvc) (push) Waiting to run
Alpha Build / alpha-for-fixed-webview2 (x86, windows-latest, i686-pc-windows-msvc) (push) Waiting to run
Alpha Build / Update tag (push) Blocked by required conditions

This commit is contained in:
MystiPanda 2024-07-06 09:54:16 +08:00
parent 38eb3123be
commit 905353d540
No known key found for this signature in database
7 changed files with 79 additions and 45 deletions

View File

@ -137,7 +137,7 @@ export const GroupItem = (props: Props) => {
); );
}; };
const StyledPrimary = styled("span")` const StyledPrimary = styled("div")`
font-size: 15px; font-size: 15px;
font-weight: 700; font-weight: 700;
line-height: 1.5; line-height: 1.5;

View File

@ -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", "Direct",
"ssr", "Reject",
"direct", "RejectDrop",
"dns", "Compatible",
"snell", "Pass",
"http", "Dns",
"trojan", "Shadowsocks",
"hysteria", "ShadowsocksR",
"hysteria2", "Snell",
"tuic", "Socks5",
"wireguard", "Http",
"ssh", "Vmess",
"socks5", "Vless",
"vmess", "Trojan",
"vless", "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) + (filteredPrependSeq.length > 0 ? 1 : 0) +
(appendSeq.length > 0 ? 1 : 0) (filteredAppendSeq.length > 0 ? 1 : 0)
} }
increaseViewportBy={256} increaseViewportBy={256}
itemContent={(index) => { itemContent={(index) => {
let shift = prependSeq.length > 0 ? 1 : 0; let shift = filteredPrependSeq.length > 0 ? 1 : 0;
if (prependSeq.length > 0 && index === 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}`}

View File

@ -61,10 +61,18 @@ export const ProxiesEditorViewer = (props: Props) => {
const [appendSeq, setAppendSeq] = useState<IProxyConfig[]>([]); const [appendSeq, setAppendSeq] = useState<IProxyConfig[]>([]);
const [deleteSeq, setDeleteSeq] = useState<string[]>([]); const [deleteSeq, setDeleteSeq] = useState<string[]>([]);
const filteredPrependSeq = useMemo(
() => prependSeq.filter((proxy) => match(proxy.name)),
[prependSeq, match]
);
const filteredProxyList = useMemo( const filteredProxyList = useMemo(
() => proxyList.filter((proxy) => match(proxy.name)), () => proxyList.filter((proxy) => match(proxy.name)),
[proxyList, match] [proxyList, match]
); );
const filteredAppendSeq = useMemo(
() => appendSeq.filter((proxy) => match(proxy.name)),
[appendSeq, match]
);
const sensors = useSensors( const sensors = useSensors(
useSensor(PointerSensor), useSensor(PointerSensor),
@ -228,7 +236,6 @@ export const ProxiesEditorViewer = (props: Props) => {
placeholder={t("Use newlines for multiple uri")} placeholder={t("Use newlines for multiple uri")}
fullWidth fullWidth
rows={9} rows={9}
sx={{ height: "100px" }}
multiline multiline
size="small" size="small"
onChange={(e) => setProxyUri(e.target.value)} onChange={(e) => setProxyUri(e.target.value)}
@ -297,13 +304,13 @@ export const ProxiesEditorViewer = (props: Props) => {
style={{ height: "calc(100% - 24px)", marginTop: "8px" }} style={{ height: "calc(100% - 24px)", marginTop: "8px" }}
totalCount={ totalCount={
filteredProxyList.length + filteredProxyList.length +
(prependSeq.length > 0 ? 1 : 0) + (filteredPrependSeq.length > 0 ? 1 : 0) +
(appendSeq.length > 0 ? 1 : 0) (filteredAppendSeq.length > 0 ? 1 : 0)
} }
increaseViewportBy={256} increaseViewportBy={256}
itemContent={(index) => { itemContent={(index) => {
let shift = prependSeq.length > 0 ? 1 : 0; let shift = filteredPrependSeq.length > 0 ? 1 : 0;
if (prependSeq.length > 0 && index === 0) { if (filteredPrependSeq.length > 0 && index === 0) {
return ( return (
<DndContext <DndContext
sensors={sensors} sensors={sensors}
@ -311,11 +318,11 @@ export const ProxiesEditorViewer = (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 (
<ProxyItem <ProxyItem
key={`${item.name}-${index}`} key={`${item.name}-${index}`}
@ -371,11 +378,11 @@ export const ProxiesEditorViewer = (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 (
<ProxyItem <ProxyItem
key={`${item.name}-${index}`} key={`${item.name}-${index}`}

View File

@ -90,7 +90,7 @@ export const ProxyItem = (props: Props) => {
); );
}; };
const StyledPrimary = styled("span")` const StyledPrimary = styled("div")`
font-size: 15px; font-size: 15px;
font-weight: 700; font-weight: 700;
line-height: 1.5; line-height: 1.5;

View File

@ -92,7 +92,7 @@ export const RuleItem = (props: Props) => {
); );
}; };
const StyledPrimary = styled("span")` const StyledPrimary = styled("div")`
font-size: 15px; font-size: 15px;
font-weight: 700; font-weight: 700;
line-height: 1.5; line-height: 1.5;

View File

@ -254,10 +254,18 @@ export const RulesEditorViewer = (props: Props) => {
const [appendSeq, setAppendSeq] = useState<string[]>([]); const [appendSeq, setAppendSeq] = useState<string[]>([]);
const [deleteSeq, setDeleteSeq] = useState<string[]>([]); const [deleteSeq, setDeleteSeq] = useState<string[]>([]);
const filteredPrependSeq = useMemo(
() => prependSeq.filter((rule) => match(rule)),
[prependSeq, match]
);
const filteredRuleList = useMemo( const filteredRuleList = useMemo(
() => ruleList.filter((rule) => match(rule)), () => ruleList.filter((rule) => match(rule)),
[ruleList, match] [ruleList, match]
); );
const filteredAppendSeq = useMemo(
() => appendSeq.filter((rule) => match(rule)),
[appendSeq, match]
);
const sensors = useSensors( const sensors = useSensors(
useSensor(PointerSensor), useSensor(PointerSensor),
@ -573,13 +581,13 @@ export const RulesEditorViewer = (props: Props) => {
style={{ height: "calc(100% - 24px)", marginTop: "8px" }} style={{ height: "calc(100% - 24px)", marginTop: "8px" }}
totalCount={ totalCount={
filteredRuleList.length + filteredRuleList.length +
(prependSeq.length > 0 ? 1 : 0) + (filteredPrependSeq.length > 0 ? 1 : 0) +
(appendSeq.length > 0 ? 1 : 0) (filteredAppendSeq.length > 0 ? 1 : 0)
} }
increaseViewportBy={256} increaseViewportBy={256}
itemContent={(index) => { itemContent={(index) => {
let shift = prependSeq.length > 0 ? 1 : 0; let shift = filteredPrependSeq.length > 0 ? 1 : 0;
if (prependSeq.length > 0 && index === 0) { if (filteredPrependSeq.length > 0 && index === 0) {
return ( return (
<DndContext <DndContext
sensors={sensors} sensors={sensors}
@ -587,11 +595,11 @@ export const RulesEditorViewer = (props: Props) => {
onDragEnd={onPrependDragEnd} onDragEnd={onPrependDragEnd}
> >
<SortableContext <SortableContext
items={prependSeq.map((x) => { items={filteredPrependSeq.map((x) => {
return x; return x;
})} })}
> >
{prependSeq.map((item, index) => { {filteredPrependSeq.map((item, index) => {
return ( return (
<RuleItem <RuleItem
key={`${item}-${index}`} key={`${item}-${index}`}
@ -643,11 +651,11 @@ export const RulesEditorViewer = (props: Props) => {
onDragEnd={onAppendDragEnd} onDragEnd={onAppendDragEnd}
> >
<SortableContext <SortableContext
items={appendSeq.map((x) => { items={filteredAppendSeq.map((x) => {
return x; return x;
})} })}
> >
{appendSeq.map((item, index) => { {filteredAppendSeq.map((item, index) => {
return ( return (
<RuleItem <RuleItem
key={`${item}-${index}`} key={`${item}-${index}`}

View File

@ -223,7 +223,7 @@ interface IProxyGroupConfig {
filter?: string; filter?: string;
"exclude-filter"?: string; "exclude-filter"?: string;
"exclude-type"?: string; "exclude-type"?: string;
"expected-status"?: number; "expected-status"?: string;
hidden?: boolean; hidden?: boolean;
icon?: string; icon?: string;
} }