import { IconBrandSpeedtest, IconReload } 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, setProxyGroupByProxyName, delayTestByProxyGroupName, updateProxyProviderByProviderName, } = useProxies() const [collapsedMap, setCollapsedMap] = createSignal>( {}, ) onMount(async () => { await updateProxy() }) const onProxyNodeClick = async (proxy: Proxy, proxyName: string) => { setProxyGroupByProxyName(proxy, proxyName) } const onSpeedTestClick = (e: MouseEvent, name: string) => { e.stopPropagation() delayTestByProxyGroupName(name) } const onUpdateProviderClick = (e: MouseEvent, name: string) => { e.stopPropagation() updateProxyProviderByProviderName(name) } return (

Proxies

{(proxy) => { const title = (
{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}
{proxyProvider.vehicleType} :: Updated at{' '} {new Date(proxyProvider.updatedAt).toLocaleString()}
) const content = ( {(proxy) => } ) return ( setCollapsedMap({ ...collapsedMap(), [`provider-${proxyProvider.name}`]: val, }) } /> ) }}
) }