diff --git a/src/components/ProxyNodeCard.tsx b/src/components/ProxyNodeCard.tsx index 45ded0a..25bd983 100644 --- a/src/components/ProxyNodeCard.tsx +++ b/src/components/ProxyNodeCard.tsx @@ -55,7 +55,7 @@ export default (props: {
{formatProxyType(proxyNode().type)} - {proxyNode().udp ? ' :: udp' : ''} + {proxyNode().udp && ' :: udp'}
{Delay(proxyName)}
diff --git a/src/pages/Proxies.tsx b/src/pages/Proxies.tsx index 279e748..3384993 100644 --- a/src/pages/Proxies.tsx +++ b/src/pages/Proxies.tsx @@ -1,4 +1,4 @@ -import { IconBrandSpeedtest } from '@tabler/icons-solidjs' +import { IconBrandSpeedtest, IconReload } from '@tabler/icons-solidjs' import { For, createSignal, onMount } from 'solid-js' import Collapse from '~/components/Collpase' import ProxyNodeCard from '~/components/ProxyNodeCard' @@ -10,8 +10,9 @@ export default () => { proxies, proxyProviders, updateProxy, - setProxiesByProxyName, + setProxyGroupByProxyName, delayTestByProxyGroupName, + updateProxyProviderByProviderName, } = useProxies() const [collapsedMap, setCollapsedMap] = createSignal>( @@ -23,7 +24,7 @@ export default () => { }) const onProxyNodeClick = async (proxy: Proxy, proxyName: string) => { - setProxiesByProxyName(proxy, proxyName) + setProxyGroupByProxyName(proxy, proxyName) } const onSpeedTestClick = (e: MouseEvent, name: string) => { @@ -31,6 +32,11 @@ export default () => { delayTestByProxyGroupName(name) } + const onUpdateProviderClick = (e: MouseEvent, name: string) => { + e.stopPropagation() + updateProxyProviderByProviderName(name) + } + return (
@@ -94,7 +100,27 @@ export default () => {
{(proxyProvider) => { - const title = <>{proxyProvider.name} + const title = ( +
+
+ {proxyProvider.name} + +
+ {proxyProvider.vehicleType} :: Updated at{' '} + {new Date(proxyProvider.updatedAt).toLocaleString()} +
+
+ + +
+ ) const content = ( {(proxy) => } diff --git a/src/pages/Rules.tsx b/src/pages/Rules.tsx index 9c2d1d0..53cae5e 100644 --- a/src/pages/Rules.tsx +++ b/src/pages/Rules.tsx @@ -26,13 +26,13 @@ export default () => {

Rules

-
+
{(rule) => (
-
{rule.payload}
-
- {rule.type}: {rule.proxy} +
{rule.payload}
+
+ {rule.type} :: {rule.proxy}
)} @@ -43,13 +43,13 @@ export default () => {

Rules Providers

-
+
{(rulesProvider) => (
{rulesProvider.name}
-
- {rulesProvider.vehicleType}: {rulesProvider.behavior} ( +
+ {rulesProvider.vehicleType} :: {rulesProvider.behavior} ( {rulesProvider.ruleCount})
diff --git a/src/signals/proxies.ts b/src/signals/proxies.ts index 8ead3bb..1be968b 100644 --- a/src/signals/proxies.ts +++ b/src/signals/proxies.ts @@ -50,7 +50,7 @@ export function useProxies() { ) } - const setProxiesByProxyName = async (proxy: Proxy, proxyName: string) => { + const setProxyGroupByProxyName = async (proxy: Proxy, proxyName: string) => { await request.put(`proxies/${proxy.name}`, { body: JSON.stringify({ name: proxyName, @@ -74,6 +74,13 @@ export function useProxies() { setDelayMap({ ...dMap }) } + const updateProxyProviderByProviderName = async ( + proxyProviderName: string, + ) => { + await request.put(`/providers/proxies/${proxyProviderName}`) + await updateProxy() + } + return { proxies, proxyProviders, @@ -81,6 +88,7 @@ export function useProxies() { proxyNodeMap, delayMap, updateProxy, - setProxiesByProxyName, + setProxyGroupByProxyName, + updateProxyProviderByProviderName, } }