feat(k8s): 统一 YAML 查看编辑并补齐 Pod/导出能力

- 抽取 YamlCodeMirror/YamlEditorToolbar,修复弹窗滚动与固定高度布局
- 对齐集群导出精简规则(Service/Ingress/Workload/PVC 注解等)
- Deployment/Pod/Service/Ingress 分资源配置:Pod 只读,支持单文件下载
- 修复 Deployment Pod YAML 弹窗未渲染,补全 PodsTab 与详情页 YAML 入口
- 命名空间列表页新增导出 YAML(tar.gz),与集群导出 API 一致
This commit is contained in:
Logan.Li committed 2026-06-26 15:25:46 +08:00
1 parent eeba677850
commit fd7b04b9d6
15 files changed
+651 -150

No files matched your search

+10
View File
@@ -22,4 +22,14 @@ export function exportAsJSON(filename: string, data: unknown[]): void {
a.download = filename;
a.click();
URL.revokeObjectURL(a.href);
}
/** 下载 YAML 文本(对齐集群资源导出单文件)// Logan.Li */
export function downloadYamlFile(filename: string, content: string): void {
const blob = new Blob([content], { type: 'application/x-yaml;charset=utf-8' });
const a = document.createElement('a');
a.href = URL.createObjectURL(blob);
a.download = filename.endsWith('.yaml') ? filename : `${filename}.yaml`;
a.click();
URL.revokeObjectURL(a.href);
}