refactor(frontend): services/api 迁至 src/api,http 迁至 utils/request

对齐 Vue 后台惯例:
- src/api/          域 API(原 services/api)
- src/utils/request.ts  HTTP 封装(原 services/http.ts)
- src/utils/export.ts  客户端导出工具
- src/utils/index.ts   工具统一出口

全局导入改为 @/api 与 @/utils/request,tsc + build 通过。
This commit is contained in:
Logan.Li committed 2026-06-26 00:09:07 +08:00
1 parent 9bf35b369c
commit d19a03d427
145 files changed
+156 -142

No files matched your search

+14
View File
@@ -0,0 +1,14 @@
// 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}`),
};