mirror of
https://github.com/MetaCubeX/metacubexd.git
synced 2024-11-27 22:54:03 +08:00
fix(proxy): fetch proxies after latency test
This commit is contained in:
parent
355b237387
commit
81fe550912
@ -15,7 +15,6 @@ import {
|
||||
favNightTheme,
|
||||
setCurTheme,
|
||||
setLatestConnectionMsg,
|
||||
useProxies,
|
||||
useTwemoji,
|
||||
useWsRequest,
|
||||
} from '~/signals'
|
||||
@ -29,10 +28,6 @@ const Rules = lazy(() => import('~/pages/Rules'))
|
||||
const Config = lazy(() => import('~/pages/Config'))
|
||||
|
||||
const ProtectedResources = () => {
|
||||
const { fetchProxies } = useProxies()
|
||||
|
||||
onMount(fetchProxies)
|
||||
|
||||
const latestConnectionMsg = useWsRequest<WsMsg>('connections')
|
||||
|
||||
createEffect(() => {
|
||||
|
@ -3,7 +3,7 @@ import {
|
||||
IconReload,
|
||||
IconSettings,
|
||||
} from '@tabler/icons-solidjs'
|
||||
import { For, Show, createMemo, createSignal } from 'solid-js'
|
||||
import { For, Show, createMemo, createSignal, onMount } from 'solid-js'
|
||||
import { twMerge } from 'tailwind-merge'
|
||||
import {
|
||||
Button,
|
||||
@ -38,6 +38,7 @@ export default () => {
|
||||
const [t] = useI18n()
|
||||
|
||||
const {
|
||||
fetchProxies,
|
||||
proxies,
|
||||
selectProxyInGroup,
|
||||
latencyTestByProxyGroupName,
|
||||
@ -48,6 +49,8 @@ export default () => {
|
||||
healthCheckByProviderName,
|
||||
} = useProxies()
|
||||
|
||||
onMount(fetchProxies)
|
||||
|
||||
const { map: collapsedMap, set: setCollapsedMap } = useStringBooleanMap()
|
||||
const { map: latencyTestingMap, setWithCallback: setLatencyTestingMap } =
|
||||
useStringBooleanMap()
|
||||
@ -100,7 +103,7 @@ export default () => {
|
||||
return (
|
||||
<div class="flex h-full flex-col gap-2">
|
||||
<div class="flex items-center gap-2">
|
||||
<div class="tabs tabs-boxed gap-2">
|
||||
<div class="tabs-boxed tabs gap-2">
|
||||
<For each={tabs()}>
|
||||
{(tab) => (
|
||||
<button
|
||||
|
@ -120,11 +120,12 @@ export const useProxies = () => {
|
||||
latencyTestTimeoutDuration(),
|
||||
)
|
||||
|
||||
await fetchProxies()
|
||||
setLatencyMap({
|
||||
...latencyMap(),
|
||||
...data,
|
||||
})
|
||||
|
||||
await fetchProxies()
|
||||
}
|
||||
|
||||
const updateProviderByProviderName = async (providerName: string) => {
|
||||
|
Loading…
Reference in New Issue
Block a user