From 62c0cd9a634f768a970afc66e15968f5f8821c5a Mon Sep 17 00:00:00 2001 From: kunish Date: Sun, 29 Oct 2023 20:02:10 +0800 Subject: [PATCH] feat(proxy): add back the render proxies in two columns option, closes #360 --- src/components/ProxiesSettingsModal.tsx | 15 +++++++++++++++ src/components/ProxyPreviewBar.tsx | 10 +++++----- src/pages/Proxies.tsx | 20 +++++++++++++++----- src/signals/config.ts | 6 ++++++ 4 files changed, 41 insertions(+), 10 deletions(-) diff --git a/src/components/ProxiesSettingsModal.tsx b/src/components/ProxiesSettingsModal.tsx index 75e091b..2d8873e 100644 --- a/src/components/ProxiesSettingsModal.tsx +++ b/src/components/ProxiesSettingsModal.tsx @@ -9,11 +9,13 @@ import { latencyTestTimeoutDuration, proxiesOrderingType, proxiesPreviewType, + renderProxiesInTwoColumns, setAutoCloseConns, setHideUnAvailableProxies, setLatencyTestTimeoutDuration, setProxiesOrderingType, setProxiesPreviewType, + setRenderProxiesInTwoColumns, setUrlForLatencyTest, setUrlIPv6SupportTest, urlForIPv6SupportTest, @@ -113,6 +115,19 @@ export const ProxiesSettingsModal: Component<{ +
+ {t('renderInTwoColumns')} + +
+ setRenderProxiesInTwoColumns(e.target.checked)} + /> +
+
+
{t('proxiesPreviewType')} diff --git a/src/components/ProxyPreviewBar.tsx b/src/components/ProxyPreviewBar.tsx index ece2de2..5c9549c 100644 --- a/src/components/ProxyPreviewBar.tsx +++ b/src/components/ProxyPreviewBar.tsx @@ -42,27 +42,27 @@ export const ProxyPreviewBar = (props: { return (
-
+
{
- +
{(proxyGroup) => { const sortedProxyNames = createMemo(() => @@ -222,11 +227,16 @@ export default () => { ) }} - +
- +
{(proxyProvider) => { const sortedProxyNames = createMemo(() => @@ -318,7 +328,7 @@ export default () => { ) }} - +
diff --git a/src/signals/config.ts b/src/signals/config.ts index 1d4dd0a..bad4500 100644 --- a/src/signals/config.ts +++ b/src/signals/config.ts @@ -32,6 +32,12 @@ export const [hideUnAvailableProxies, setHideUnAvailableProxies] = storage: localStorage, }) +export const [renderProxiesInTwoColumns, setRenderProxiesInTwoColumns] = + makePersisted(createSignal(true), { + name: 'renderProxiesInTwoColumns', + storage: localStorage, + }) + export const [urlForLatencyTest, setUrlForLatencyTest] = makePersisted( createSignal('https://www.gstatic.com/generate_204'), { name: 'urlForLatencyTest', storage: localStorage },