发布 0.1.0:通知渠道、告警规则与多项体验修复
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import type { AliveStatus } from '@/types/api'
|
||||
|
||||
/** 测活状态 → 展示标签与徽标语义;suspended 来自云端账户能力接口的暂停标记 */
|
||||
export const aliveStatusMeta: Record<
|
||||
AliveStatus,
|
||||
{ label: string; kind: 'run' | 'term' | 'warn' | 'check' }
|
||||
> = {
|
||||
alive: { label: '存活', kind: 'run' },
|
||||
dead: { label: '失联', kind: 'term' },
|
||||
suspended: { label: '暂停', kind: 'warn' },
|
||||
unknown: { label: '未测', kind: 'check' },
|
||||
}
|
||||
|
||||
/** 兜底取值:后端新增状态时前端旧包不至于崩 */
|
||||
export function aliveMeta(status: string) {
|
||||
return aliveStatusMeta[status as AliveStatus] ?? aliveStatusMeta.unknown
|
||||
}
|
||||
Reference in New Issue
Block a user