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:
1 parent
eeba677850
commit
fd7b04b9d6
15 files changed
+651
-150
No files matched your search
@@ -14,6 +14,7 @@ import { DeploymentPodsTab } from './deployment-detail/DeploymentPodsTab';
|
||||
import { DeploymentLogsTab } from './deployment-detail/DeploymentLogsTab';
|
||||
import { DeploymentHpaTab } from './deployment-detail/DeploymentHpaTab';
|
||||
import { DeploymentPodModals } from './deployment-detail/DeploymentPodModals';
|
||||
import { YamlViewer } from './YamlViewer';
|
||||
|
||||
export function DeploymentDetail({ clusterCode, namespace, deploymentName, onBack }: DeploymentDetailProps) {
|
||||
const { toast } = useToast();
|
||||
@@ -33,6 +34,7 @@ export function DeploymentDetail({ clusterCode, namespace, deploymentName, onBac
|
||||
const [logsViewerOpen, setLogsViewerOpen] = useState(false);
|
||||
const [fileBrowserPod, setFileBrowserPod] = useState<PodWithContainers | null>(null);
|
||||
const [fileBrowserOpen, setFileBrowserOpen] = useState(false);
|
||||
const [yamlPodName, setYamlPodName] = useState<string | null>(null);
|
||||
const [logsTabPod, setLogsTabPod] = useState<string>('');
|
||||
|
||||
const loadData = useCallback(async () => {
|
||||
@@ -187,6 +189,7 @@ export function DeploymentDetail({ clusterCode, namespace, deploymentName, onBac
|
||||
onOpenLogsViewer={(pod) => { setLogsViewerPod(pod); setLogsViewerOpen(true); }}
|
||||
onOpenExec={(pod) => { setExecPod(pod); setExecOpen(true); }}
|
||||
onOpenFileBrowser={(pod) => { setFileBrowserPod(pod); setFileBrowserOpen(true); }}
|
||||
onOpenYaml={setYamlPodName}
|
||||
/>
|
||||
<DeploymentLogsTab
|
||||
pods={pods}
|
||||
@@ -206,6 +209,17 @@ export function DeploymentDetail({ clusterCode, namespace, deploymentName, onBac
|
||||
/>
|
||||
</Tabs>
|
||||
|
||||
{yamlPodName && (
|
||||
<YamlViewer
|
||||
clusterCode={clusterCode}
|
||||
namespace={namespace}
|
||||
resource="pods"
|
||||
name={yamlPodName}
|
||||
readOnly
|
||||
onClose={() => setYamlPodName(null)}
|
||||
/>
|
||||
)}
|
||||
|
||||
<DeploymentPodModals
|
||||
clusterCode={clusterCode}
|
||||
namespace={namespace}
|
||||
|
||||
Reference in new issue
Block a user