fix(dashboard): улучшить логику загрузки данных на странице панели управления
Docker images / prepare-release (push) Successful in 6s
Docker images / backend-image (push) Successful in 1m43s
Docker images / frontend-image (push) Successful in 1m47s
Docker images / updater-image (push) Successful in 54s
Docker images / notify-webhook (push) Has been skipped
Docker images / publish-release (push) Successful in 7s
Docker images / prepare-release (push) Successful in 6s
Docker images / backend-image (push) Successful in 1m43s
Docker images / frontend-image (push) Successful in 1m47s
Docker images / updater-image (push) Successful in 54s
Docker images / notify-webhook (push) Has been skipped
Docker images / publish-release (push) Successful in 7s
This commit is contained in:
@@ -691,7 +691,8 @@ export default function DashboardPage() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const loadingBlock = probesLoading && liveProbes === null
|
const liveDataPending = liveServersResolved === null || liveProbes === null
|
||||||
|
const loadingBlock = liveDataPending || (probesLoading && liveProbes === null)
|
||||||
const srvList = liveServersResolved ?? []
|
const srvList = liveServersResolved ?? []
|
||||||
const totalSrv = srvList.length
|
const totalSrv = srvList.length
|
||||||
const onlineSrv = srvList.filter((s) => s.status === "online").length
|
const onlineSrv = srvList.filter((s) => s.status === "online").length
|
||||||
|
|||||||
+3
-7
@@ -59,13 +59,9 @@ function normalizeBackendUrl(url: string): string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function DataSourceProvider({ children }: { children: React.ReactNode }) {
|
export function DataSourceProvider({ children }: { children: React.ReactNode }) {
|
||||||
const [mode, setModeState] = useState<DataSourceMode>(() =>
|
const [mode, setModeState] = useState<DataSourceMode>(defaultDataSourceMode)
|
||||||
typeof window === "undefined" ? defaultDataSourceMode() : readStoredMode(),
|
const [backendUrl, setBackendUrlState] = useState(LOCAL_DEFAULT_BACKEND_URL)
|
||||||
)
|
const [prefsHydrated, setPrefsHydrated] = useState(false)
|
||||||
const [backendUrl, setBackendUrlState] = useState(() =>
|
|
||||||
typeof window === "undefined" ? LOCAL_DEFAULT_BACKEND_URL : readStoredBackendUrl(),
|
|
||||||
)
|
|
||||||
const [prefsHydrated, setPrefsHydrated] = useState(() => typeof window !== "undefined")
|
|
||||||
const [backendStatus, setBackendStatus] = useState<boolean | undefined>(undefined)
|
const [backendStatus, setBackendStatus] = useState<boolean | undefined>(undefined)
|
||||||
const backendUrlLocked = isBackendUrlLocked()
|
const backendUrlLocked = isBackendUrlLocked()
|
||||||
const mockModeAvailable = isMockDataSourceAvailable()
|
const mockModeAvailable = isMockDataSourceAvailable()
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user