merge: 合并远程 A2 告警引擎分布式安全更新,保留本地日志中心等最新改动

This commit is contained in:
Logan committed 2026-06-26 23:19:42 +08:00
commit 23e9e3da62
137 files changed
+947 -611

No files matched your search

@@ -4,6 +4,7 @@ import {
formatK8sTime, formatDuration, elapsedSeconds, STATUS_COLORS,
} from '../k8s-yaml-utils';
import type { PodItem } from './types';
import type { JsonData } from '@/types/common';
export interface PodStage {
label: string;
@@ -13,15 +14,15 @@ export interface PodStage {
// Pod 条件时间线提取 // Logan.Li
export function getPodTimeline(pod: PodItem) {
const cond: Record<string, any>[] = (pod as Record<string, any>).conditions || (pod as Record<string, any>).pod_conditions || [];
const find = (t: string) => cond.find((c: any) => (c.type || c.Type) === t);
const ts = (c: any) => c?.lastTransitionTime || c?.LastTransitionTime || c?.last_transition_time;
const cond: JsonData[] = (pod as JsonData).conditions || (pod as JsonData).pod_conditions || [];
const find = (t: string) => cond.find((c: JsonData) => (c.type || c.Type) === t);
const ts = (c: JsonData) => c?.lastTransitionTime || c?.LastTransitionTime || c?.last_transition_time;
return {
scheduled: ts(find('PodScheduled') || {}),
initialized: ts(find('Initialized') || {}),
containersReady: ts(find('ContainersReady') || {}),
ready: ts(find('Ready') || {}),
startTime: pod.start_time || (pod as Record<string, any>).startTime,
startTime: pod.start_time || (pod as JsonData).startTime,
};
}