import { useI18n } from '@solid-primitives/i18n' import { IconBrandSpeedtest } from '@tabler/icons-solidjs' import { Show, createSignal } from 'solid-js' import { Button, Collapse, ForTwoColumns, ProxyCardGroups, ProxyNodePreview, } from '~/components' import { getBtnElFromClickEvent, sortProxiesByOrderingType } from '~/helpers' import { proxiesOrderingType, useProxies } from '~/signals' import type { Proxy } from '~/types' export default () => { const [t] = useI18n() const { proxies, setProxyGroupByProxyName, delayTestByProxyGroupName, latencyMap, } = useProxies() const [collapsedMap, setCollapsedMap] = createSignal>( {}, ) const onProxyNodeClick = async (proxy: Proxy, proxyName: string) => { setProxyGroupByProxyName(proxy, proxyName) } const onSpeedTestClick = async (e: MouseEvent, name: string) => { const el = getBtnElFromClickEvent(e) el.classList.add('animate-pulse') e.stopPropagation() await delayTestByProxyGroupName(name) el.classList.remove('animate-pulse') } return (

{t('proxies')}

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