import { IconBrandSpeedtest } from '@tabler/icons-solidjs' import { For, createSignal, onMount } from 'solid-js' import Collapse from '~/components/Collpase' import ProxyNodeCard from '~/components/ProxyNodeCard' import { useProxies } from '~/signals/proxies' import type { Proxy } from '~/types' export default () => { const { proxies, proxyProviders, updateProxy, setProxiesByProxyName, delayTestByProxyGroupName, } = useProxies() const [collapsedMap, setCollapsedMap] = createSignal>( {}, ) onMount(async () => { await updateProxy() }) const onProxyNodeClick = async (proxy: Proxy, proxyName: string) => { setProxiesByProxyName(proxy, proxyName) } const onSpeedTestClick = (e: MouseEvent, name: string) => { e.stopPropagation() delayTestByProxyGroupName(name) } return (

Proxies

{(proxy) => { const title = ( <>
{proxy.name} onSpeedTestClick(e, proxy.name)} />
{proxy.type} :: {proxy.now}
) const content = ( {(proxyName) => ( onProxyNodeClick(proxy, proxyName)} /> )} ) return ( setCollapsedMap({ ...collapsedMap(), [`group-${proxy.name}`]: val, }) } > ) }}

Proxy Providers

{(proxyProvider) => { const title = <>{proxyProvider.name} const content = ( {(proxy) => } ) return ( setCollapsedMap({ ...collapsedMap(), [`provider-${proxyProvider.name}`]: val, }) } /> ) }}
) }