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