+ {/* Header */}
+
+
+
+
+
+
+
{name}
+ {kind}
+ {namespace}
+ {isHealthy
+ ? 健康
+ : 更新中}
+
+
集群: {clusterCode}
+
+
+
+ {/* Mode tabs */}
+
+
+
+
+ {/* Actions */}
+ {isSts && (
+
+ )}
+
+
+
+
+
+ {loading ? (
+
加载中...
+ ) : mode === 'yaml' ? (
+
+
+ {}}
+ inline
+ autoEdit
+ />
+
+
+ ) : (
+ <>
+ {/* Status cards */}
+
+ {isSts ? (
+ <>
+
+
+
+
+
+ {formatK8sTime(manifest?.metadata?.creationTimestamp)}} color="#94a3b8" />
+ >
+ ) : (
+ <>
+
+
+
+
+
+ {formatK8sTime(manifest?.metadata?.creationTimestamp)}} color="#94a3b8" />
+ >
+ )}
+
+
+ {/* Update Strategy + Selector */}
+
+
+
+
+ 更新策略
+
+
+
+
+ 策略类型
+ {strategyType}
+
+ {strategyType === 'RollingUpdate' && isSts && updateStrategy.rollingUpdate && (
+ <>
+
+ 分区 (partition)
+ {updateStrategy.rollingUpdate.partition ?? 0}
+
+ {updateStrategy.rollingUpdate.maxUnavailable && (
+
+ 最大不可用
+ {typeof updateStrategy.rollingUpdate.maxUnavailable === 'object' ? JSON.stringify(updateStrategy.rollingUpdate.maxUnavailable) : updateStrategy.rollingUpdate.maxUnavailable}
+
+ )}
+ >
+ )}
+ {strategyType === 'RollingUpdate' && !isSts && updateStrategy.rollingUpdate && (
+ <>
+ {updateStrategy.rollingUpdate.maxUnavailable && (
+
+ 最大不可用
+ {typeof updateStrategy.rollingUpdate.maxUnavailable === 'object' ? JSON.stringify(updateStrategy.rollingUpdate.maxUnavailable) : updateStrategy.rollingUpdate.maxUnavailable}
+
+ )}
+ {updateStrategy.rollingUpdate.maxSurge && (
+
+ 最大 surge
+ {typeof updateStrategy.rollingUpdate.maxSurge === 'object' ? JSON.stringify(updateStrategy.rollingUpdate.maxSurge) : updateStrategy.rollingUpdate.maxSurge}
+
+ )}
+ >
+ )}
+ {isSts && (
+
+ Pod 管理策略
+ {spec.podManagementPolicy || 'OrderedReady'}
+
+ )}
+
+ 修订历史限制
+ {spec.revisionHistoryLimit ?? 10}
+
+
+
+
+
+
+
+ 选择器与标签
+
+
+
+
+
Selector (matchLabels)
+
+
+
+ {Object.keys(annotations).length > 0 && (
+
+
Annotations
+
+ {Object.entries(annotations).slice(0, 8).map(([k, v]) => (
+
+ {k}
+
+ ))}
+
+
+ )}
+
+
+
+
+ {/* VolumeClaimTemplates (StatefulSet only) */}
+ {isSts && vcts.length > 0 && (
+
+
+
+ 存储卷声明模板 (VolumeClaimTemplates)
+
+
+
+
+
+
+ 名称
+ 访问模式
+ 存储类
+ 大小
+
+
+
+ {vcts.map((vct: any, idx: number) => {
+ const accessModes = (vct.spec?.accessModes || []).join(', ');
+ const storageClass = vct.spec?.storageClassName || vct.spec?.storageClassName || '-';
+ const size = vct.spec?.resources?.requests?.storage || '-';
+ return (
+
+ {vct.metadata?.name || '-'}
+ {accessModes || '-'}
+ {storageClass}
+ {size}
+
+ );
+ })}
+
+
+
+
+ )}
+
+ {/* Container template */}
+
+
+
+ 容器模板(Pod Template)
+
+
+
+ {initContainers.length > 0 && (
+
+
Init Containers
+
+ {initContainers.map((c: any, idx: number) => (
+
+ ))}
+
+
+ )}
+ {containers.length === 0 ? (
+ 暂无容器数据,请查看 YAML
+ ) : (
+
+
Containers
+ {containers.map((c: any, idx: number) => (
+
+ ))}
+
+ )}
+
+
+
+ {/* Pod list */}
+
+
+
+ Pod 实例 ({pods.length})
+
+
+
+
+
+
+ Pod 名称
+ 状态
+ 所在节点
+ Pod IP
+ 重启
+ 操作
+
+
+
+ {pods.length === 0 ? (
+ 暂无 Pod
+ ) : pods.map((pod: any) => (
+
+ {pod.name}
+
+
+ {pod.status || 'Unknown'}
+
+
+ {pod.node_name || pod.node || '-'}
+ {pod.ip || pod.pod_ip || '-'}
+ 0 ? 'text-yellow-400' : 'text-slate-500'}>{pod.restart_count || 0}
+
+
+
+
+
+
+
+ ))}
+
+
+
+
+ >
+ )}
+
+ {/* Scale modal */}
+ {scaleModal && (
+
setScaleModal(false)}>
+
e.stopPropagation()}>
+
伸缩 StatefulSet
+
+
+
{scaleValue}
+
+
+
+
+
+
+
+
+ )}
+
+ {/* YAML modal */}
+ {yamlModal && (
+
setYamlModal(false)}
+ />
+ )}
+
+ {/* Pod terminal */}
+ {terminalPod && (
+ { if (!o) setTerminalPod(null); }}
+ clusterId={clusterCode}
+ namespace={namespace}
+ podName={terminalPod.name}
+ containers={terminalPod.containers?.map((c: any) => c.name).filter(Boolean) || []}
+ />
+ )}
+
+ {/* Pod file browser */}
+ {fileBrowserPod && (
+ { if (!o) setFileBrowserPod(null); }}
+ clusterCode={clusterCode}
+ namespace={namespace}
+ podName={fileBrowserPod.name}
+ containers={fileBrowserPod.containers?.map((c: any) => c.name).filter(Boolean) || []}
+ />
+ )}
+
+ );
+}
+
+// Container info sub-component
+function ContainerInfo({ c }: { c: any }) {
+ return (
+