feat(admin): show Probe status and retry links
This commit is contained in:
1 parent
97ab3cc740
commit
efb50d0efe
7 files changed
+172
-21
No files matched your search
+19
-1
@@ -1,8 +1,9 @@
|
||||
import { useEffect, useMemo, useState } from 'react'
|
||||
import { api } from './api/client'
|
||||
import type { NodeInfoDto, Page } from './api/types'
|
||||
import type { NodeInfoDto, NodeRuntimeStatus, Page } from './api/types'
|
||||
import { useQuery } from './hooks'
|
||||
import { OsIcon } from './osIcon'
|
||||
import { Chip } from './ui'
|
||||
import mobileIcon from './assets/isp/mobile.svg?url'
|
||||
import telecomIcon from './assets/isp/telecom.svg?url'
|
||||
import unicomIcon from './assets/isp/unicom.svg?url'
|
||||
@@ -102,3 +103,20 @@ export function NodeTag({ info, geoOnly }: TagProps) {
|
||||
</span>
|
||||
)
|
||||
}
|
||||
|
||||
const RUNTIME_STATUS: Record<NodeRuntimeStatus, { label: string; tone: 'ok' | 'warn' | 'bad' | 'accent' | '' }> = {
|
||||
initializing: { label: '初始化中', tone: 'warn' },
|
||||
running: { label: '运行中', tone: 'ok' },
|
||||
probe_paused: { label: '暂停探测', tone: 'warn' },
|
||||
maintenance: { label: '维护中', tone: 'warn' },
|
||||
stopping: { label: '停止中', tone: 'warn' },
|
||||
offline: { label: '失联', tone: 'bad' },
|
||||
updating: { label: '更新中', tone: 'accent' },
|
||||
}
|
||||
|
||||
export function RuntimeStatusChip({ status }: { status: NodeRuntimeStatus }) {
|
||||
const value = RUNTIME_STATUS[status] ?? { label: status, tone: '' as const }
|
||||
return <Chip tone={value.tone}>{value.label}</Chip>
|
||||
}
|
||||
|
||||
export const runtimeStatusLabel = (status: NodeRuntimeStatus) => RUNTIME_STATUS[status]?.label ?? status
|
||||
@@ -988,6 +988,16 @@ pre.code {
|
||||
}
|
||||
|
||||
/* ── 节点的国旗、运营商图标、系统和架构 ── */
|
||||
.flag {
|
||||
display: inline-block;
|
||||
flex: none;
|
||||
width: 18px;
|
||||
max-width: 18px;
|
||||
height: 13.5px;
|
||||
border-radius: 2px;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
.node-tag {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
|
||||
Reference in new issue
Block a user