refine Semi UI telemetry details
This commit is contained in:
@@ -16,6 +16,25 @@ export function telemetryQualityLabel(quality: string) {
|
||||
return '异常';
|
||||
}
|
||||
|
||||
export function telemetryQualityColor(quality: string) {
|
||||
return quality === 'good' ? 'green' : quality === 'stale' ? 'orange' : 'red';
|
||||
}
|
||||
|
||||
export function telemetryValueTypeLabel(value?: string) {
|
||||
const normalized = value?.trim().toLowerCase();
|
||||
if (!normalized) return '—';
|
||||
const labels: Record<string, string> = {
|
||||
array: '列表',
|
||||
boolean: '布尔值',
|
||||
dynamic: '动态值',
|
||||
number: '数值',
|
||||
numeric: '数值',
|
||||
object: '对象',
|
||||
string: '文本'
|
||||
};
|
||||
return labels[normalized] ?? value!;
|
||||
}
|
||||
|
||||
export function formatTelemetryTime(value?: string) {
|
||||
if (!value) return '—';
|
||||
const local = formatShanghaiDateTime(value);
|
||||
|
||||
Reference in New Issue
Block a user