- 抽取 YamlCodeMirror/YamlEditorToolbar,修复弹窗滚动与固定高度布局 - 对齐集群导出精简规则(Service/Ingress/Workload/PVC 注解等) - Deployment/Pod/Service/Ingress 分资源配置:Pod 只读,支持单文件下载 - 修复 Deployment Pod YAML 弹窗未渲染,补全 PodsTab 与详情页 YAML 入口 - 命名空间列表页新增导出 YAML(tar.gz),与集群导出 API 一致
17 lines
1.1 KiB
TypeScript
17 lines
1.1 KiB
TypeScript
// Kubernetes Namespace API // Logan.Li
|
||
|
||
import { http } from '@/utils/request';
|
||
|
||
export const namespaceApi = {
|
||
getNamespaces: async (clusterCode: string) => http.get(`/kubernetes/${clusterCode}/namespaces`),
|
||
getNamespacesDetail: async (clusterCode: string) => http.get(`/kubernetes/${clusterCode}/namespaces/detail`),
|
||
getNamespaceDetail: async (clusterCode: string, namespace: string) =>
|
||
http.get(`/kubernetes/${clusterCode}/namespace/${namespace}/detail`),
|
||
createNamespace: async (clusterCode: string, name: string, labels?: Record<string, string>) =>
|
||
http.post(`/kubernetes/${clusterCode}/namespaces`, { name, labels: labels || {} }),
|
||
deleteNamespace: async (clusterCode: string, namespace: string) =>
|
||
http.delete(`/kubernetes/${clusterCode}/namespaces/${namespace}`),
|
||
/** 导出命名空间资源 tar.gz(Deployment/Service/Ingress/ConfigMap/Secret)// Logan.Li */
|
||
exportNamespaceResources: async (clusterCode: string, namespace: string) =>
|
||
http.download(`/kubernetes/${clusterCode}/namespace/${namespace}/export`, `${namespace}-resources.tar.gz`),
|
||
}; |