import { IconBrandSpeedtest, IconReload } from '@tabler/icons-solidjs' import { For, Show, createSignal, onMount } from 'solid-js' import Collapse from '~/components/Collpase' import ProxyCardGroups from '~/components/ProxyCardGroups' import ProxyNodeDots from '~/components/ProxyNodeDots' import SubscriptionInfo from '~/components/SubscriptionInfo' import { useProxies } from '~/signals/proxies' import type { Proxy } from '~/types' import { formatTimeFromNow } from '~/utils/proxies' export default () => { const { proxies, proxyProviders, updateProxy, setProxyGroupByProxyName, delayTestByProxyGroupName, updateProviderByProviderName, healthCheckByProviderName, } = useProxies() const [collapsedMap, setCollapsedMap] = createSignal>( {}, ) onMount(async () => { await updateProxy() }) const onProxyNodeClick = async (proxy: Proxy, proxyName: string) => { setProxyGroupByProxyName(proxy, proxyName) } const onSpeedTestClick = async (e: MouseEvent, name: string) => { const el = e.target as HTMLElement el.classList.add('animate-pulse') e.stopPropagation() await delayTestByProxyGroupName(name) el.classList.remove('animate-pulse') } const onHealthCheckClick = async (e: MouseEvent, name: string) => { const el = e.target as HTMLElement el.classList.add('animate-pulse') e.stopPropagation() await healthCheckByProviderName(name) el.classList.remove('animate-pulse') } const onUpdateProviderClick = async (e: MouseEvent, name: string) => { const el = e.target as HTMLElement el.classList.add('animate-spin') e.stopPropagation() await updateProviderByProviderName(name) el.classList.remove('animate-spin') } return (

Proxies

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

Proxy Providers

{(proxyProvider) => { const title = ( <>
{proxyProvider.name}
{proxyProvider.vehicleType} :: Updated{' '} {formatTimeFromNow(proxyProvider.updatedAt)}
i.name) ?? [] } /> ) const content = ( i.name)} /> ) return (
setCollapsedMap({ ...collapsedMap(), [`provider-${proxyProvider.name}`]: val, }) } />
) }}
) }