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:
1 parent
9bf35b369c
commit
d19a03d427
145 files changed
+156
-142
No files matched your search
@@ -1,7 +1,7 @@
|
|||||||
// Agent 管理
|
// Agent 管理
|
||||||
// 从 services/api.ts 拆分 — Q3 api.ts 模块化
|
// 从 services/api.ts 拆分 — Q3 api.ts 模块化
|
||||||
|
|
||||||
import { http, type ListResponse } from '../http';
|
import { http, type ListResponse } from '@/utils/request';
|
||||||
|
|
||||||
export const agentApi = {
|
export const agentApi = {
|
||||||
getLatest: () => http.get('/agent/latest'),
|
getLatest: () => http.get('/agent/latest'),
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
// AI 智能运维 (LLM 对话/告警分析/容量预测)
|
// AI 智能运维 (LLM 对话/告警分析/容量预测)
|
||||||
// 从 services/api.ts 拆分 — Q3 api.ts 模块化
|
// 从 services/api.ts 拆分 — Q3 api.ts 模块化
|
||||||
|
|
||||||
import { http } from '../http';
|
import { http } from '@/utils/request';
|
||||||
import { useUserStore } from '@/store';
|
import { useUserStore } from '@/store';
|
||||||
|
|
||||||
export interface LLMConfigData {
|
export interface LLMConfigData {
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
// 用户认证 & LDAP
|
// 用户认证 & LDAP
|
||||||
// 从 services/api.ts 拆分 — Q3 api.ts 模块化
|
// 从 services/api.ts 拆分 — Q3 api.ts 模块化
|
||||||
|
|
||||||
import { http, getApiBase, type ListResponse } from '../http';
|
import { http, getApiBase, type ListResponse } from '@/utils/request';
|
||||||
import { useUserStore } from '@/store';
|
import { useUserStore } from '@/store';
|
||||||
|
|
||||||
export const userApi = {
|
export const userApi = {
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
// 自动化运维 (定时任务/脚本/Ansible)
|
// 自动化运维 (定时任务/脚本/Ansible)
|
||||||
// 从 services/api.ts 拆分 — Q3 api.ts 模块化
|
// 从 services/api.ts 拆分 — Q3 api.ts 模块化
|
||||||
|
|
||||||
import { http, type ListResponse } from '../http';
|
import { http, type ListResponse } from '@/utils/request';
|
||||||
|
|
||||||
export const cronJobApi = {
|
export const cronJobApi = {
|
||||||
getJobs: async (params?: { page?: number; page_size?: number }) => {
|
getJobs: async (params?: { page?: number; page_size?: number }) => {
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
// 云账号/平台/账单
|
// 云账号/平台/账单
|
||||||
// 从 services/api.ts 拆分 — Q3 api.ts 模块化
|
// 从 services/api.ts 拆分 — Q3 api.ts 模块化
|
||||||
|
|
||||||
import { http, type ListResponse } from '../http';
|
import { http, type ListResponse } from '@/utils/request';
|
||||||
|
|
||||||
export const cloudApi = {
|
export const cloudApi = {
|
||||||
getAccounts: async () => {
|
getAccounts: async () => {
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
// Dashboard 统计数据
|
// Dashboard 统计数据
|
||||||
// 从 services/api.ts 拆分 — Q3 api.ts 模块化
|
// 从 services/api.ts 拆分 — Q3 api.ts 模块化
|
||||||
|
|
||||||
import { http } from '../http';
|
import { http } from '@/utils/request';
|
||||||
|
|
||||||
export const dashboardStatsApi = {
|
export const dashboardStatsApi = {
|
||||||
getStats: async () => {
|
getStats: async () => {
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
// CI/CD 流水线/发布配置/凭证
|
// CI/CD 流水线/发布配置/凭证
|
||||||
// 从 services/api.ts 拆分 — Q3 api.ts 模块化
|
// 从 services/api.ts 拆分 — Q3 api.ts 模块化
|
||||||
|
|
||||||
import { http, type ListResponse } from '../http';
|
import { http, type ListResponse } from '@/utils/request';
|
||||||
|
|
||||||
export const pipelineApi = {
|
export const pipelineApi = {
|
||||||
getPipelines: async (params?: { page?: number; page_size?: number }) => {
|
getPipelines: async (params?: { page?: number; page_size?: number }) => {
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
// API 统一出口 — 从各域模块 re-export
|
// API 统一出口 — 从各域模块 re-export
|
||||||
// 所有 API 方法通过 `import { xxxApi } from "@/services/api"` 访问
|
// 所有 API 方法通过 `import { xxxApi } from "@/api"` 访问 // Logan.Li
|
||||||
|
|
||||||
export * from './auth';
|
export * from './auth';
|
||||||
export * from './dashboard';
|
export * from './dashboard';
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
// Kubernetes API — 子模块 re-export(保持 @/api 导入路径不变) // Logan.Li
|
||||||
|
|
||||||
|
export { kubernetesApi } from './kubernetes/index';
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
// Kubernetes 集群管理 API // Logan.Li
|
// Kubernetes 集群管理 API // Logan.Li
|
||||||
|
|
||||||
import { http, type ListResponse } from '../../http';
|
import { http, type ListResponse } from '@/utils/request';
|
||||||
|
|
||||||
export const clusterApi = {
|
export const clusterApi = {
|
||||||
getClusters: async () => http.get<ListResponse>('/kubernetes-clusters'),
|
getClusters: async () => http.get<ListResponse>('/kubernetes-clusters'),
|
||||||
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
// Kubernetes API 辅助:流式 URL / WebSocket / 导出 // Logan.Li
|
// Kubernetes API 辅助:流式 URL / WebSocket / 导出 // Logan.Li
|
||||||
|
|
||||||
import { buildApiUrl, getAuthToken, getWsBase, http } from '../../http';
|
import { buildApiUrl, getAuthToken, getWsBase, http } from '@/utils/request';
|
||||||
import { exportAsCSV, exportAsJSON } from '@/lib/export-utils';
|
import { exportAsCSV, exportAsJSON } from '@/utils/export';
|
||||||
|
|
||||||
export { exportAsCSV, exportAsJSON };
|
export { exportAsCSV, exportAsJSON };
|
||||||
|
|
||||||
File renamed without changes.
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
// Kubernetes Namespace API // Logan.Li
|
// Kubernetes Namespace API // Logan.Li
|
||||||
|
|
||||||
import { http } from '../../http';
|
import { http } from '@/utils/request';
|
||||||
|
|
||||||
export const namespaceApi = {
|
export const namespaceApi = {
|
||||||
getNamespaces: async (clusterCode: string) => http.get(`/kubernetes/${clusterCode}/namespaces`),
|
getNamespaces: async (clusterCode: string) => http.get(`/kubernetes/${clusterCode}/namespaces`),
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
// Kubernetes 节点 API // Logan.Li
|
// Kubernetes 节点 API // Logan.Li
|
||||||
|
|
||||||
import { http } from '../../http';
|
import { http } from '@/utils/request';
|
||||||
|
|
||||||
export const nodeApi = {
|
export const nodeApi = {
|
||||||
getNodes: async (clusterId: number | string) => http.get(`/kubernetes-clusters/${clusterId}/nodes`),
|
getNodes: async (clusterId: number | string) => http.get(`/kubernetes-clusters/${clusterId}/nodes`),
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
// Kubernetes Pod API(日志 / Exec / 文件 / 指标) // Logan.Li
|
// Kubernetes Pod API(日志 / Exec / 文件 / 指标) // Logan.Li
|
||||||
|
|
||||||
import { http } from '../../http';
|
import { http } from '@/utils/request';
|
||||||
import {
|
import {
|
||||||
buildPodExecWsUrl,
|
buildPodExecWsUrl,
|
||||||
buildPodFileDownloadUrl,
|
buildPodFileDownloadUrl,
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
// Kubernetes 命名空间资源 / YAML / 事件 / 容量 API // Logan.Li
|
// Kubernetes 命名空间资源 / YAML / 事件 / 容量 API // Logan.Li
|
||||||
|
|
||||||
import { http } from '../../http';
|
import { http } from '@/utils/request';
|
||||||
|
|
||||||
export const resourceApi = {
|
export const resourceApi = {
|
||||||
getNamespaceServices: async (clusterCode: string, namespace: string) =>
|
getNamespaceServices: async (clusterCode: string, namespace: string) =>
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
// Kubernetes 工作负载 API(Deployment / StatefulSet / HPA / CronJob) // Logan.Li
|
// Kubernetes 工作负载 API(Deployment / StatefulSet / HPA / CronJob) // Logan.Li
|
||||||
|
|
||||||
import { http } from '../../http';
|
import { http } from '@/utils/request';
|
||||||
|
|
||||||
export const workloadApi = {
|
export const workloadApi = {
|
||||||
scaleDeployment: async (clusterCode: string, namespace: string, name: string, replicas: number) =>
|
scaleDeployment: async (clusterCode: string, namespace: string, name: string, replicas: number) =>
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
// 监控告警 (规则/通知/大屏/Prometheus/Zabbix)
|
// 监控告警 (规则/通知/大屏/Prometheus/Zabbix)
|
||||||
// 从 services/api.ts 拆分 — Q3 api.ts 模块化
|
// 从 services/api.ts 拆分 — Q3 api.ts 模块化
|
||||||
|
|
||||||
import { http, type ListResponse } from '../http';
|
import { http, type ListResponse } from '@/utils/request';
|
||||||
|
|
||||||
export const alertApi = {
|
export const alertApi = {
|
||||||
getAlerts: async (params?: { page?: number; page_size?: number; status?: string; severity?: string }) => {
|
getAlerts: async (params?: { page?: number; page_size?: number; status?: string; severity?: string }) => {
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
// 服务器/资产/区域/资源型号
|
// 服务器/资产/区域/资源型号
|
||||||
// 从 services/api.ts 拆分 — Q3 api.ts 模块化
|
// 从 services/api.ts 拆分 — Q3 api.ts 模块化
|
||||||
|
|
||||||
import { http, type ListResponse } from '../http';
|
import { http, type ListResponse } from '@/utils/request';
|
||||||
|
|
||||||
export const serverApi = {
|
export const serverApi = {
|
||||||
getServers: async (params?: { page?: number; page_size?: number; keyword?: string; status?: string }) => {
|
getServers: async (params?: { page?: number; page_size?: number; keyword?: string; status?: string }) => {
|
||||||
File renamed without changes.
@@ -1,6 +1,6 @@
|
|||||||
// 审批流程 API // Logan.Li
|
// 审批流程 API // Logan.Li
|
||||||
|
|
||||||
import { http } from '../../http';
|
import { http } from '@/utils/request';
|
||||||
|
|
||||||
export const approvalWorkflowApi = {
|
export const approvalWorkflowApi = {
|
||||||
list: async (params?: { category?: string }) => http.get('/approval-workflows', params),
|
list: async (params?: { category?: string }) => http.get('/approval-workflows', params),
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
// 审计日志 API // Logan.Li
|
// 审计日志 API // Logan.Li
|
||||||
|
|
||||||
import { http, type ListResponse } from '../../http';
|
import { http, type ListResponse } from '@/utils/request';
|
||||||
|
|
||||||
export const auditApi = {
|
export const auditApi = {
|
||||||
getLogs: async (params?: {
|
getLogs: async (params?: {
|
||||||
File renamed without changes.
@@ -1,6 +1,6 @@
|
|||||||
// 终端会话 / 命令 / 登录日志 API // Logan.Li
|
// 终端会话 / 命令 / 登录日志 API // Logan.Li
|
||||||
|
|
||||||
import { http, type ListResponse } from '../../http';
|
import { http, type ListResponse } from '@/utils/request';
|
||||||
|
|
||||||
export const terminalSessionApi = {
|
export const terminalSessionApi = {
|
||||||
list: async (params?: {
|
list: async (params?: {
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
import { useState, useEffect, useCallback } from 'react';
|
import { useState, useEffect, useCallback } from 'react';
|
||||||
import { toast } from 'sonner';
|
import { toast } from 'sonner';
|
||||||
import { useConfirm } from '@/components/ui/confirm-dialog';
|
import { useConfirm } from '@/components/ui/confirm-dialog';
|
||||||
import { agentApi } from '@/services/api';
|
import { agentApi } from '@/api';
|
||||||
import { Card, CardContent } from '@/components/ui/card';
|
import { Card, CardContent } from '@/components/ui/card';
|
||||||
import { Button } from '@/components/ui/button';
|
import { Button } from '@/components/ui/button';
|
||||||
import { Badge } from '@/components/ui/badge';
|
import { Badge } from '@/components/ui/badge';
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { useState, useEffect, useRef, useCallback } from 'react';
|
import { useState, useEffect, useRef, useCallback } from 'react';
|
||||||
import { toast } from 'sonner';
|
import { toast } from 'sonner';
|
||||||
import { agentApi } from '@/services/api';
|
import { agentApi } from '@/api';
|
||||||
import { AgentWizard } from './AgentWizard';
|
import { AgentWizard } from './AgentWizard';
|
||||||
import { HostDetailDialog } from './HostDetailDialog';
|
import { HostDetailDialog } from './HostDetailDialog';
|
||||||
import { isOnline, timeAgo, asList } from './agentUtils';
|
import { isOnline, timeAgo, asList } from './agentUtils';
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
// Agent 告警规则编辑/新建弹窗(自包含表单状态,从 AgentAlerts.tsx 提取) // Logan.Li
|
// Agent 告警规则编辑/新建弹窗(自包含表单状态,从 AgentAlerts.tsx 提取) // Logan.Li
|
||||||
import { useState, useEffect } from 'react';
|
import { useState, useEffect } from 'react';
|
||||||
import { toast } from 'sonner';
|
import { toast } from 'sonner';
|
||||||
import { agentApi } from '@/services/api';
|
import { agentApi } from '@/api';
|
||||||
import { Button } from '@/components/ui/button';
|
import { Button } from '@/components/ui/button';
|
||||||
import { Input } from '@/components/ui/input';
|
import { Input } from '@/components/ui/input';
|
||||||
import { Label } from '@/components/ui/label';
|
import { Label } from '@/components/ui/label';
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import { Button } from '@/components/ui/button';
|
|||||||
import { Input } from '@/components/ui/input';
|
import { Input } from '@/components/ui/input';
|
||||||
import { Label } from '@/components/ui/label';
|
import { Label } from '@/components/ui/label';
|
||||||
import { Copy, Check, Terminal, Download, Settings, Play, Cpu, Zap, Loader2, Server, Shield } from 'lucide-react';
|
import { Copy, Check, Terminal, Download, Settings, Play, Cpu, Zap, Loader2, Server, Shield } from 'lucide-react';
|
||||||
import { serverApi } from '@/services/api';
|
import { serverApi } from '@/api';
|
||||||
import { toast } from 'sonner';
|
import { toast } from 'sonner';
|
||||||
|
|
||||||
interface AgentWizardProps {
|
interface AgentWizardProps {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// 主机详情弹窗:展示历史指标趋势图 + 端口发现列表(从 AgentMonitor.tsx 提取) // Logan.Li
|
// 主机详情弹窗:展示历史指标趋势图 + 端口发现列表(从 AgentMonitor.tsx 提取) // Logan.Li
|
||||||
import { useState, useEffect } from 'react';
|
import { useState, useEffect } from 'react';
|
||||||
import { agentApi } from '@/services/api';
|
import { agentApi } from '@/api';
|
||||||
import { isOnline, timeAgo, asList } from './agentUtils';
|
import { isOnline, timeAgo, asList } from './agentUtils';
|
||||||
import { Button } from '@/components/ui/button';
|
import { Button } from '@/components/ui/button';
|
||||||
import { Badge } from '@/components/ui/badge';
|
import { Badge } from '@/components/ui/badge';
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { useState, useEffect } from 'react';
|
|||||||
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
|
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
|
||||||
import { Badge } from '@/components/ui/badge';
|
import { Badge } from '@/components/ui/badge';
|
||||||
import { ScrollArea } from '@/components/ui/scroll-area';
|
import { ScrollArea } from '@/components/ui/scroll-area';
|
||||||
import { alertApi, aiApi } from '@/services/api';
|
import { alertApi, aiApi } from '@/api';
|
||||||
import {
|
import {
|
||||||
AlertTriangle,
|
AlertTriangle,
|
||||||
Brain,
|
Brain,
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import {
|
|||||||
} from '@/components/ui/select';
|
} from '@/components/ui/select';
|
||||||
import { Switch } from '@/components/ui/switch';
|
import { Switch } from '@/components/ui/switch';
|
||||||
import { toast } from 'sonner';
|
import { toast } from 'sonner';
|
||||||
import { aiApi, alertApi, agentApi, dashboardStatsApi, type LLMConfigData, type ChatHistoryItem } from '@/services/api';
|
import { aiApi, alertApi, agentApi, dashboardStatsApi, type LLMConfigData, type ChatHistoryItem } from '@/api';
|
||||||
import {
|
import {
|
||||||
Bot,
|
Bot,
|
||||||
Send,
|
Send,
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ import {
|
|||||||
Minus,
|
Minus,
|
||||||
Loader2,
|
Loader2,
|
||||||
} from 'lucide-react';
|
} from 'lucide-react';
|
||||||
import { dashboardStatsApi, serverApi, alertApi } from '@/services/api';
|
import { dashboardStatsApi, serverApi, alertApi } from '@/api';
|
||||||
import { PredictiveCapacityTab } from './PredictiveCapacityTab';
|
import { PredictiveCapacityTab } from './PredictiveCapacityTab';
|
||||||
import {
|
import {
|
||||||
computePredictions,
|
computePredictions,
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import {
|
|||||||
} from '@/components/ui/dialog';
|
} from '@/components/ui/dialog';
|
||||||
import { Loader2 } from 'lucide-react';
|
import { Loader2 } from 'lucide-react';
|
||||||
import { toast } from 'sonner';
|
import { toast } from 'sonner';
|
||||||
import { approvalApi } from '@/services/api';
|
import { approvalApi } from '@/api';
|
||||||
import { parseFields, APPROVAL_TYPE_OPTIONS } from './helpers';
|
import { parseFields, APPROVAL_TYPE_OPTIONS } from './helpers';
|
||||||
|
|
||||||
interface ApprovalCreateDialogProps {
|
interface ApprovalCreateDialogProps {
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import {
|
|||||||
Plus,
|
Plus,
|
||||||
} from 'lucide-react';
|
} from 'lucide-react';
|
||||||
import { toast } from 'sonner';
|
import { toast } from 'sonner';
|
||||||
import { approvalApi } from '@/services/api';
|
import { approvalApi } from '@/api';
|
||||||
import { ApprovalProcessTab } from './ApprovalProcessTab';
|
import { ApprovalProcessTab } from './ApprovalProcessTab';
|
||||||
import { ApprovalTemplateTab } from './ApprovalTemplateTab';
|
import { ApprovalTemplateTab } from './ApprovalTemplateTab';
|
||||||
import { ApprovalDetailDialog } from './ApprovalDetailDialog';
|
import { ApprovalDetailDialog } from './ApprovalDetailDialog';
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { useState, useEffect } from 'react';
|
|||||||
import { useNavigate } from 'react-router-dom';
|
import { useNavigate } from 'react-router-dom';
|
||||||
import { User, Lock, Palette, Check, Loader2, AlertCircle, Eye, EyeOff } from 'lucide-react';
|
import { User, Lock, Palette, Check, Loader2, AlertCircle, Eye, EyeOff } from 'lucide-react';
|
||||||
import { useUserStore } from '@/store';
|
import { useUserStore } from '@/store';
|
||||||
import { userApi } from '@/services/api';
|
import { userApi } from '@/api';
|
||||||
import { useTheme, THEME_OPTIONS } from '@/hooks/useTheme';
|
import { useTheme, THEME_OPTIONS } from '@/hooks/useTheme';
|
||||||
import { cn } from '@/lib/utils';
|
import { cn } from '@/lib/utils';
|
||||||
import {
|
import {
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import { Textarea } from '@/components/ui/textarea';
|
|||||||
import { Label } from '@/components/ui/label';
|
import { Label } from '@/components/ui/label';
|
||||||
import { Badge } from '@/components/ui/badge';
|
import { Badge } from '@/components/ui/badge';
|
||||||
import { toast } from 'sonner';
|
import { toast } from 'sonner';
|
||||||
import { cronJobApi, scriptApi } from '@/services/api';
|
import { cronJobApi, scriptApi } from '@/api';
|
||||||
|
|
||||||
// 定时任务类型定义 // Logan.Li
|
// 定时任务类型定义 // Logan.Li
|
||||||
const jobTypes = [
|
const jobTypes = [
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import {
|
|||||||
PackageOpen,
|
PackageOpen,
|
||||||
} from 'lucide-react';
|
} from 'lucide-react';
|
||||||
import { toast } from 'sonner';
|
import { toast } from 'sonner';
|
||||||
import { cronJobApi } from '@/services/api';
|
import { cronJobApi } from '@/api';
|
||||||
import { useConfirm } from '@/components/ui/confirm-dialog';
|
import { useConfirm } from '@/components/ui/confirm-dialog';
|
||||||
import { getStatusBadge, parseCron } from './cronJobHelpers';
|
import { getStatusBadge, parseCron } from './cronJobHelpers';
|
||||||
import { CronJobFormDialog } from './CronJobFormDialog';
|
import { CronJobFormDialog } from './CronJobFormDialog';
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import {
|
|||||||
TableRow,
|
TableRow,
|
||||||
} from '@/components/ui/table';
|
} from '@/components/ui/table';
|
||||||
import { History, Loader2, Terminal } from 'lucide-react';
|
import { History, Loader2, Terminal } from 'lucide-react';
|
||||||
import { taskExecutionApi } from '@/services/api';
|
import { taskExecutionApi } from '@/api';
|
||||||
import { getStatusBadge } from './cronJobHelpers';
|
import { getStatusBadge } from './cronJobHelpers';
|
||||||
|
|
||||||
// 定时任务执行历史弹窗(打开时自动加载,点击行展开输出) // Logan.Li
|
// 定时任务执行历史弹窗(打开时自动加载,点击行展开输出) // Logan.Li
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs';
|
|||||||
import { Checkbox } from '@/components/ui/checkbox';
|
import { Checkbox } from '@/components/ui/checkbox';
|
||||||
import { toast } from 'sonner';
|
import { toast } from 'sonner';
|
||||||
import { useConfirm } from '@/components/ui/confirm-dialog';
|
import { useConfirm } from '@/components/ui/confirm-dialog';
|
||||||
import { scriptApi, taskExecutionApi } from '@/services/api';
|
import { scriptApi, taskExecutionApi } from '@/api';
|
||||||
import {
|
import {
|
||||||
type Script, type ExecutionRecord, mapScript, scriptTypes, genCode,
|
type Script, type ExecutionRecord, mapScript, scriptTypes, genCode,
|
||||||
} from './script-helpers';
|
} from './script-helpers';
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import {
|
|||||||
} from '@/components/ui/select';
|
} from '@/components/ui/select';
|
||||||
import { Loader2 } from 'lucide-react';
|
import { Loader2 } from 'lucide-react';
|
||||||
import { toast } from 'sonner';
|
import { toast } from 'sonner';
|
||||||
import { billingApi } from '@/services/api';
|
import { billingApi } from '@/api';
|
||||||
import { providerLabels } from './CloudBillingHelpers';
|
import { providerLabels } from './CloudBillingHelpers';
|
||||||
|
|
||||||
const emptyRecord = {
|
const emptyRecord = {
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import {
|
|||||||
} from '@/components/ui/select';
|
} from '@/components/ui/select';
|
||||||
import { Loader2 } from 'lucide-react';
|
import { Loader2 } from 'lucide-react';
|
||||||
import { toast } from 'sonner';
|
import { toast } from 'sonner';
|
||||||
import { billingApi } from '@/services/api';
|
import { billingApi } from '@/api';
|
||||||
import { providerLabels } from './CloudBillingHelpers';
|
import { providerLabels } from './CloudBillingHelpers';
|
||||||
|
|
||||||
const emptyRule = { name: '', provider: '', metric: 'daily', threshold: '', operator: '>', enabled: true };
|
const emptyRule = { name: '', provider: '', metric: 'daily', threshold: '', operator: '>', enabled: true };
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ import {
|
|||||||
RefreshCw,
|
RefreshCw,
|
||||||
Loader2,
|
Loader2,
|
||||||
} from 'lucide-react';
|
} from 'lucide-react';
|
||||||
import { cloudApi } from '@/services/api';
|
import { cloudApi } from '@/api';
|
||||||
import { CloudBrandIcon, getProviderColor } from '@/components/icons/CloudBrandIcon';
|
import { CloudBrandIcon, getProviderColor } from '@/components/icons/CloudBrandIcon';
|
||||||
|
|
||||||
const providerLabels: Record<string, string> = {
|
const providerLabels: Record<string, string> = {
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ import {
|
|||||||
} from 'lucide-react';
|
} from 'lucide-react';
|
||||||
import { toast } from 'sonner';
|
import { toast } from 'sonner';
|
||||||
import { useConfirm } from '@/components/ui/confirm-dialog';
|
import { useConfirm } from '@/components/ui/confirm-dialog';
|
||||||
import { billingApi } from '@/services/api';
|
import { billingApi } from '@/api';
|
||||||
import { formatCurrency, StatCard, TrendChart, providerLabels, providerColors } from './CloudBillingHelpers';
|
import { formatCurrency, StatCard, TrendChart, providerLabels, providerColors } from './CloudBillingHelpers';
|
||||||
import { StatStrip } from '@/components/ui/stat-strip';
|
import { StatStrip } from '@/components/ui/stat-strip';
|
||||||
import { BillingRecordDialog } from './BillingRecordDialog';
|
import { BillingRecordDialog } from './BillingRecordDialog';
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ import {
|
|||||||
RefreshCw,
|
RefreshCw,
|
||||||
Loader2,
|
Loader2,
|
||||||
} from 'lucide-react';
|
} from 'lucide-react';
|
||||||
import { cloudApi } from '@/services/api';
|
import { cloudApi } from '@/api';
|
||||||
|
|
||||||
export function DomainManager() {
|
export function DomainManager() {
|
||||||
const [domains, setDomains] = useState<any[]>([]);
|
const [domains, setDomains] = useState<any[]>([]);
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ import {
|
|||||||
ExternalLink,
|
ExternalLink,
|
||||||
Loader2,
|
Loader2,
|
||||||
} from 'lucide-react';
|
} from 'lucide-react';
|
||||||
import { platformApi } from '@/services/api';
|
import { platformApi } from '@/api';
|
||||||
|
|
||||||
const typeLabels: Record<string, string> = {
|
const typeLabels: Record<string, string> = {
|
||||||
public: '公有云',
|
public: '公有云',
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ import {
|
|||||||
XCircle,
|
XCircle,
|
||||||
Loader2,
|
Loader2,
|
||||||
} from 'lucide-react';
|
} from 'lucide-react';
|
||||||
import { regionApi } from '@/services/api';
|
import { regionApi } from '@/api';
|
||||||
import { useConfirm } from '@/components/ui/confirm-dialog';
|
import { useConfirm } from '@/components/ui/confirm-dialog';
|
||||||
import { toast } from 'sonner';
|
import { toast } from 'sonner';
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { useNavigate } from 'react-router-dom';
|
|||||||
import { Button } from '@/components/ui/button';
|
import { Button } from '@/components/ui/button';
|
||||||
import { cn } from '@/lib/utils';
|
import { cn } from '@/lib/utils';
|
||||||
import { Clock, Server, ArrowRight } from 'lucide-react';
|
import { Clock, Server, ArrowRight } from 'lucide-react';
|
||||||
import { dashboardStatsApi, serverApi, kubernetesApi } from '@/services/api';
|
import { dashboardStatsApi, serverApi, kubernetesApi } from '@/api';
|
||||||
import { StatStrip } from '@/components/ui/stat-strip';
|
import { StatStrip } from '@/components/ui/stat-strip';
|
||||||
import { CostOverviewCard, TopResourceUsageCard, ResourceUsageCard } from './DashboardCharts';
|
import { CostOverviewCard, TopResourceUsageCard, ResourceUsageCard } from './DashboardCharts';
|
||||||
import {
|
import {
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ import {
|
|||||||
History,
|
History,
|
||||||
Loader2,
|
Loader2,
|
||||||
} from 'lucide-react';
|
} from 'lucide-react';
|
||||||
import { releaseApi } from '@/services/api';
|
import { releaseApi } from '@/api';
|
||||||
import { toast } from 'sonner';
|
import { toast } from 'sonner';
|
||||||
import { getStatusBadge, getEnvBadge } from './releaseHelpers';
|
import { getStatusBadge, getEnvBadge } from './releaseHelpers';
|
||||||
import { ReleaseDetailDialog } from './ReleaseDetailDialog';
|
import { ReleaseDetailDialog } from './ReleaseDetailDialog';
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import { Label } from '@/components/ui/label';
|
|||||||
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select';
|
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select';
|
||||||
import { Plus, Key, Globe, Container } from 'lucide-react';
|
import { Plus, Key, Globe, Container } from 'lucide-react';
|
||||||
import { toast } from 'sonner';
|
import { toast } from 'sonner';
|
||||||
import { credentialApi, deployApi } from '@/services/api';
|
import { credentialApi, deployApi } from '@/api';
|
||||||
|
|
||||||
interface Repo {
|
interface Repo {
|
||||||
id: number; name: string; url: string; credential_id: number | null;
|
id: number; name: string; url: string; credential_id: number | null;
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, Di
|
|||||||
|
|
||||||
import { toast } from 'sonner';
|
import { toast } from 'sonner';
|
||||||
import { useConfirm } from '@/components/ui/confirm-dialog';
|
import { useConfirm } from '@/components/ui/confirm-dialog';
|
||||||
import { credentialApi } from '@/services/api';
|
import { credentialApi } from '@/api';
|
||||||
|
|
||||||
// ────── Types ──────
|
// ────── Types ──────
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@
|
|||||||
import { Dialog, DialogContent, DialogHeader, DialogTitle } from '@/components/ui/dialog';
|
import { Dialog, DialogContent, DialogHeader, DialogTitle } from '@/components/ui/dialog';
|
||||||
import { toast } from 'sonner';
|
import { toast } from 'sonner';
|
||||||
import { useConfirm } from '@/components/ui/confirm-dialog';
|
import { useConfirm } from '@/components/ui/confirm-dialog';
|
||||||
import { deployApi } from '@/services/api';
|
import { deployApi } from '@/api';
|
||||||
import CredentialFormDialog from './CredentialFormDialog';
|
import CredentialFormDialog from './CredentialFormDialog';
|
||||||
import ToolConfigTab from './ToolConfigTab';
|
import ToolConfigTab from './ToolConfigTab';
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import { Badge } from '@/components/ui/badge';
|
|||||||
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select';
|
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select';
|
||||||
import { Label } from '@/components/ui/label';
|
import { Label } from '@/components/ui/label';
|
||||||
import { toast } from 'sonner';
|
import { toast } from 'sonner';
|
||||||
import { deployApi, userApi, pipelineApi } from '@/services/api';
|
import { deployApi, userApi, pipelineApi } from '@/api';
|
||||||
import { useConfirm } from '@/components/ui/confirm-dialog';
|
import { useConfirm } from '@/components/ui/confirm-dialog';
|
||||||
|
|
||||||
interface ItemRole {
|
interface ItemRole {
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import {
|
|||||||
Minimize2,
|
Minimize2,
|
||||||
} from 'lucide-react';
|
} from 'lucide-react';
|
||||||
import { cn } from '@/lib/utils';
|
import { cn } from '@/lib/utils';
|
||||||
import { pipelineApi } from '@/services/api';
|
import { pipelineApi } from '@/api';
|
||||||
import { useUserStore } from '@/store';
|
import { useUserStore } from '@/store';
|
||||||
|
|
||||||
interface FileItem {
|
interface FileItem {
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ import { Switch } from '@/components/ui/switch';
|
|||||||
import { Label } from '@/components/ui/label';
|
import { Label } from '@/components/ui/label';
|
||||||
import { Dialog, DialogContent, DialogHeader, DialogTitle } from '@/components/ui/dialog';
|
import { Dialog, DialogContent, DialogHeader, DialogTitle } from '@/components/ui/dialog';
|
||||||
import { toast } from 'sonner';
|
import { toast } from 'sonner';
|
||||||
import { pipelineApi, deployApi } from '@/services/api';
|
import { pipelineApi, deployApi } from '@/api';
|
||||||
import { useConfirm } from '@/components/ui/confirm-dialog';
|
import { useConfirm } from '@/components/ui/confirm-dialog';
|
||||||
|
|
||||||
// ---- types ----
|
// ---- types ----
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ import {
|
|||||||
Package,
|
Package,
|
||||||
} from 'lucide-react';
|
} from 'lucide-react';
|
||||||
|
|
||||||
import { credentialApi, deployApi, pipelineApi } from '@/services/api';
|
import { credentialApi, deployApi, pipelineApi } from '@/api';
|
||||||
import { useConfirm } from '@/components/ui/confirm-dialog';
|
import { useConfirm } from '@/components/ui/confirm-dialog';
|
||||||
import { toast } from 'sonner';
|
import { toast } from 'sonner';
|
||||||
import { nameToCode, getStatusBadge } from './pipeline-helpers';
|
import { nameToCode, getStatusBadge } from './pipeline-helpers';
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import { Button } from '@/components/ui/button';
|
|||||||
import { Badge } from '@/components/ui/badge';
|
import { Badge } from '@/components/ui/badge';
|
||||||
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
|
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
|
||||||
import { toast } from 'sonner';
|
import { toast } from 'sonner';
|
||||||
import { pipelineApi } from '@/services/api';
|
import { pipelineApi } from '@/api';
|
||||||
import { FileBrowserDialog } from './FileBrowserDialog';
|
import { FileBrowserDialog } from './FileBrowserDialog';
|
||||||
|
|
||||||
// ═══════════ 阶段定义 (与 PipelineManager 共用) ═══════════
|
// ═══════════ 阶段定义 (与 PipelineManager 共用) ═══════════
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import {
|
|||||||
SelectValue,
|
SelectValue,
|
||||||
} from '@/components/ui/select';
|
} from '@/components/ui/select';
|
||||||
import { Loader2 } from 'lucide-react';
|
import { Loader2 } from 'lucide-react';
|
||||||
import { releaseApi } from '@/services/api';
|
import { releaseApi } from '@/api';
|
||||||
import { toast } from 'sonner';
|
import { toast } from 'sonner';
|
||||||
|
|
||||||
interface ReleaseApplyDialogProps {
|
interface ReleaseApplyDialogProps {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import {
|
|||||||
} from '@/components/ui/dialog';
|
} from '@/components/ui/dialog';
|
||||||
import { Button } from '@/components/ui/button';
|
import { Button } from '@/components/ui/button';
|
||||||
import { AlertCircle, X, Check, Loader2 } from 'lucide-react';
|
import { AlertCircle, X, Check, Loader2 } from 'lucide-react';
|
||||||
import { releaseApi } from '@/services/api';
|
import { releaseApi } from '@/api';
|
||||||
import { toast } from 'sonner';
|
import { toast } from 'sonner';
|
||||||
|
|
||||||
interface ReleaseApproveDialogProps {
|
interface ReleaseApproveDialogProps {
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import {
|
|||||||
SelectValue,
|
SelectValue,
|
||||||
} from '@/components/ui/select';
|
} from '@/components/ui/select';
|
||||||
import { Plus, Loader2 } from 'lucide-react';
|
import { Plus, Loader2 } from 'lucide-react';
|
||||||
import { releaseApi } from '@/services/api';
|
import { releaseApi } from '@/api';
|
||||||
import { toast } from 'sonner';
|
import { toast } from 'sonner';
|
||||||
|
|
||||||
interface ReleaseCreateDialogProps {
|
interface ReleaseCreateDialogProps {
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import {
|
|||||||
DialogTitle,
|
DialogTitle,
|
||||||
} from '@/components/ui/dialog';
|
} from '@/components/ui/dialog';
|
||||||
import { Rocket, CheckCircle, Loader2, RotateCcw } from 'lucide-react';
|
import { Rocket, CheckCircle, Loader2, RotateCcw } from 'lucide-react';
|
||||||
import { releaseApi } from '@/services/api';
|
import { releaseApi } from '@/api';
|
||||||
import { toast } from 'sonner';
|
import { toast } from 'sonner';
|
||||||
import { PIPELINE_STEPS } from './releaseHelpers';
|
import { PIPELINE_STEPS } from './releaseHelpers';
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ import {
|
|||||||
Play,
|
Play,
|
||||||
PackageOpen,
|
PackageOpen,
|
||||||
} from 'lucide-react';
|
} from 'lucide-react';
|
||||||
import { releaseApi } from '@/services/api';
|
import { releaseApi } from '@/api';
|
||||||
import { useConfirm } from '@/components/ui/confirm-dialog';
|
import { useConfirm } from '@/components/ui/confirm-dialog';
|
||||||
import { toast } from 'sonner';
|
import { toast } from 'sonner';
|
||||||
import { getStatusBadge, getEnvironmentBadge } from './releaseManagerHelpers';
|
import { getStatusBadge, getEnvironmentBadge } from './releaseManagerHelpers';
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { Badge } from '@/components/ui/badge';
|
|||||||
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select';
|
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select';
|
||||||
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription } from '@/components/ui/dialog';
|
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription } from '@/components/ui/dialog';
|
||||||
import { toast } from 'sonner';
|
import { toast } from 'sonner';
|
||||||
import { deployApi } from '@/services/api';
|
import { deployApi } from '@/api';
|
||||||
|
|
||||||
interface ToolConfig {
|
interface ToolConfig {
|
||||||
id: number; name: string; display_name: string; description: string;
|
id: number; name: string; display_name: string; description: string;
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import { Dialog, DialogContent, DialogHeader, DialogTitle } from '@/components/u
|
|||||||
import { Label } from '@/components/ui/label';
|
import { Label } from '@/components/ui/label';
|
||||||
import { toast } from 'sonner';
|
import { toast } from 'sonner';
|
||||||
import { useConfirm } from '@/components/ui/confirm-dialog';
|
import { useConfirm } from '@/components/ui/confirm-dialog';
|
||||||
import { deployApi } from '@/services/api';
|
import { deployApi } from '@/api';
|
||||||
|
|
||||||
interface Group {
|
interface Group {
|
||||||
id: number; name: string; description: string;
|
id: number; name: string; description: string;
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import 'xterm/css/xterm.css';
|
|||||||
import { Maximize2, Minimize2, X, FolderOpen } from 'lucide-react';
|
import { Maximize2, Minimize2, X, FolderOpen } from 'lucide-react';
|
||||||
import { cn } from '@/lib/utils';
|
import { cn } from '@/lib/utils';
|
||||||
import { useUserStore } from '@/store';
|
import { useUserStore } from '@/store';
|
||||||
import { pipelineApi } from '@/services/api';
|
import { pipelineApi } from '@/api';
|
||||||
|
|
||||||
interface WorkspaceTermDialogProps {
|
interface WorkspaceTermDialogProps {
|
||||||
open: boolean;
|
open: boolean;
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import {
|
|||||||
Table, TableBody, TableCell, TableHead, TableHeader, TableRow,
|
Table, TableBody, TableCell, TableHead, TableHeader, TableRow,
|
||||||
} from '@/components/ui/table';
|
} from '@/components/ui/table';
|
||||||
import { RefreshCw, ChevronRight, BarChart3, Download, Cpu, HardDrive } from 'lucide-react';
|
import { RefreshCw, ChevronRight, BarChart3, Download, Cpu, HardDrive } from 'lucide-react';
|
||||||
import { kubernetesApi } from '@/services/api';
|
import { kubernetesApi } from '@/api';
|
||||||
|
|
||||||
export default function CapacityPage() {
|
export default function CapacityPage() {
|
||||||
const { clusterCode } = useParams<{ clusterCode: string }>();
|
const { clusterCode } = useParams<{ clusterCode: string }>();
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ import {
|
|||||||
TrendingUp,
|
TrendingUp,
|
||||||
} from 'lucide-react';
|
} from 'lucide-react';
|
||||||
|
|
||||||
import { kubernetesApi } from '@/services/api';
|
import { kubernetesApi } from '@/api';
|
||||||
|
|
||||||
const CHART_COLORS = ['#3B82F6', '#207060', '#F59E0B', '#EF4444', '#8B5CF6', '#EC4899', '#14B8A6', '#F97316'];
|
const CHART_COLORS = ['#3B82F6', '#207060', '#F59E0B', '#EF4444', '#8B5CF6', '#EC4899', '#14B8A6', '#F97316'];
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import {
|
|||||||
Activity,
|
Activity,
|
||||||
} from 'lucide-react';
|
} from 'lucide-react';
|
||||||
|
|
||||||
import { kubernetesApi } from '@/services/api';
|
import { kubernetesApi } from '@/api';
|
||||||
import { useToast } from '@/hooks/use-toast';
|
import { useToast } from '@/hooks/use-toast';
|
||||||
|
|
||||||
const NAMESPACE_ICON: Record<string, React.ComponentType<any>> = {
|
const NAMESPACE_ICON: Record<string, React.ComponentType<any>> = {
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ import {
|
|||||||
FolderOpen,
|
FolderOpen,
|
||||||
} from 'lucide-react';
|
} from 'lucide-react';
|
||||||
|
|
||||||
import { kubernetesApi } from '@/services/api';
|
import { kubernetesApi } from '@/api';
|
||||||
import { useToast } from '@/hooks/use-toast';
|
import { useToast } from '@/hooks/use-toast';
|
||||||
import { PodExecTerminal } from './PodExecTerminal';
|
import { PodExecTerminal } from './PodExecTerminal';
|
||||||
import { PodLogsViewer } from './PodLogsViewer';
|
import { PodLogsViewer } from './PodLogsViewer';
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import {
|
|||||||
Save, Loader2, Settings, RefreshCw, Shield, Clock, Network,
|
Save, Loader2, Settings, RefreshCw, Shield, Clock, Network,
|
||||||
} from 'lucide-react';
|
} from 'lucide-react';
|
||||||
import { useToast } from '@/hooks/use-toast';
|
import { useToast } from '@/hooks/use-toast';
|
||||||
import { kubernetesApi } from '@/services/api';
|
import { kubernetesApi } from '@/api';
|
||||||
import { SchedulingSection, type ScheduleMode } from './deployment-edit-advanced/SchedulingSection';
|
import { SchedulingSection, type ScheduleMode } from './deployment-edit-advanced/SchedulingSection';
|
||||||
import { DnsHostSection } from './deployment-edit-advanced/DnsHostSection';
|
import { DnsHostSection } from './deployment-edit-advanced/DnsHostSection';
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import { Label } from '@/components/ui/label';
|
|||||||
import { Badge } from '@/components/ui/badge';
|
import { Badge } from '@/components/ui/badge';
|
||||||
import { Plus, Trash2, Save, Loader2, Tags, FileText, Hash, Lock } from 'lucide-react';
|
import { Plus, Trash2, Save, Loader2, Tags, FileText, Hash, Lock } from 'lucide-react';
|
||||||
import { useToast } from '@/hooks/use-toast';
|
import { useToast } from '@/hooks/use-toast';
|
||||||
import { kubernetesApi } from '@/services/api';
|
import { kubernetesApi } from '@/api';
|
||||||
|
|
||||||
interface DeploymentEditBasicProps {
|
interface DeploymentEditBasicProps {
|
||||||
clusterCode: string;
|
clusterCode: string;
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import {
|
|||||||
} from 'lucide-react';
|
} from 'lucide-react';
|
||||||
|
|
||||||
import { useToast } from '@/hooks/use-toast';
|
import { useToast } from '@/hooks/use-toast';
|
||||||
import { kubernetesApi } from '@/services/api';
|
import { kubernetesApi } from '@/api';
|
||||||
|
|
||||||
import { ContainerGroupSection } from './deployment-edit/ContainerGroupSection';
|
import { ContainerGroupSection } from './deployment-edit/ContainerGroupSection';
|
||||||
import {
|
import {
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import {
|
|||||||
} from 'lucide-react';
|
} from 'lucide-react';
|
||||||
|
|
||||||
import { useToast } from '@/hooks/use-toast';
|
import { useToast } from '@/hooks/use-toast';
|
||||||
import { kubernetesApi } from '@/services/api';
|
import { kubernetesApi } from '@/api';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
clusterCode: string;
|
clusterCode: string;
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import {
|
|||||||
Plus, Trash2, Save, Loader2, HardDrive, Database, Folder, Lock, File, Disc, Server,
|
Plus, Trash2, Save, Loader2, HardDrive, Database, Folder, Lock, File, Disc, Server,
|
||||||
} from 'lucide-react';
|
} from 'lucide-react';
|
||||||
import { useToast } from '@/hooks/use-toast';
|
import { useToast } from '@/hooks/use-toast';
|
||||||
import { kubernetesApi } from '@/services/api';
|
import { kubernetesApi } from '@/api';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
clusterCode: string;
|
clusterCode: string;
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ import {
|
|||||||
Loader2,
|
Loader2,
|
||||||
} from 'lucide-react';
|
} from 'lucide-react';
|
||||||
|
|
||||||
import { kubernetesApi } from '@/services/api';
|
import { kubernetesApi } from '@/api';
|
||||||
import { useToast } from '@/hooks/use-toast';
|
import { useToast } from '@/hooks/use-toast';
|
||||||
import {
|
import {
|
||||||
formatK8sTime, formatDuration, elapsedSeconds, statusColor, STATUS_COLORS,
|
formatK8sTime, formatDuration, elapsedSeconds, statusColor, STATUS_COLORS,
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ import {
|
|||||||
Database,
|
Database,
|
||||||
} from 'lucide-react';
|
} from 'lucide-react';
|
||||||
|
|
||||||
import { kubernetesApi } from '@/services/api';
|
import { kubernetesApi } from '@/api';
|
||||||
import { useToast } from '@/hooks/use-toast';
|
import { useToast } from '@/hooks/use-toast';
|
||||||
import { useUserStore } from '@/store';
|
import { useUserStore } from '@/store';
|
||||||
import { YamlViewer } from './YamlViewer';
|
import { YamlViewer } from './YamlViewer';
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import {
|
|||||||
Cell,
|
Cell,
|
||||||
} from 'recharts';
|
} from 'recharts';
|
||||||
import { RefreshCw, ChevronRight, Bell, AlertTriangle, Info, Activity, Server, Layers } from 'lucide-react';
|
import { RefreshCw, ChevronRight, Bell, AlertTriangle, Info, Activity, Server, Layers } from 'lucide-react';
|
||||||
import { kubernetesApi } from '@/services/api';
|
import { kubernetesApi } from '@/api';
|
||||||
|
|
||||||
// Color palette for charts
|
// Color palette for charts
|
||||||
const CHART_COLORS = ['#EF4444', '#F59E0B', '#3B82F6', '#8B5CF6', '#EC4899', '#14B8A6', '#F97316', '#6366F1', '#84CC16', '#06B6D4'];
|
const CHART_COLORS = ['#EF4444', '#F59E0B', '#3B82F6', '#8B5CF6', '#EC4899', '#14B8A6', '#F97316', '#6366F1', '#84CC16', '#06B6D4'];
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { Button } from '@/components/ui/button';
|
|||||||
import { Badge } from '@/components/ui/badge';
|
import { Badge } from '@/components/ui/badge';
|
||||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs';
|
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs';
|
||||||
import { Cloud, XCircle } from 'lucide-react';
|
import { Cloud, XCircle } from 'lucide-react';
|
||||||
import { kubernetesApi } from '@/services/api';
|
import { kubernetesApi } from '@/api';
|
||||||
import {
|
import {
|
||||||
AreaChart,
|
AreaChart,
|
||||||
Area,
|
Area,
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import {
|
|||||||
DialogHeader,
|
DialogHeader,
|
||||||
DialogTitle,
|
DialogTitle,
|
||||||
} from '@/components/ui/dialog';
|
} from '@/components/ui/dialog';
|
||||||
import { kubernetesApi } from '@/services/api';
|
import { kubernetesApi } from '@/api';
|
||||||
import { toast } from 'sonner';
|
import { toast } from 'sonner';
|
||||||
|
|
||||||
// 名称即 code,只允许英文/数字/连字符
|
// 名称即 code,只允许英文/数字/连字符
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ import {
|
|||||||
Container,
|
Container,
|
||||||
Download,
|
Download,
|
||||||
} from 'lucide-react';
|
} from 'lucide-react';
|
||||||
import { kubernetesApi } from '@/services/api';
|
import { kubernetesApi } from '@/api';
|
||||||
import { toast } from 'sonner';
|
import { toast } from 'sonner';
|
||||||
import type { KubernetesCluster } from '@/types';
|
import type { KubernetesCluster } from '@/types';
|
||||||
import { KubernetesClusterDetail } from './KubernetesClusterDetail';
|
import { KubernetesClusterDetail } from './KubernetesClusterDetail';
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import {
|
|||||||
Table, TableBody, TableCell, TableHead, TableHeader, TableRow,
|
Table, TableBody, TableCell, TableHead, TableHeader, TableRow,
|
||||||
} from '@/components/ui/table';
|
} from '@/components/ui/table';
|
||||||
import { RefreshCw, Search, Server, Loader2 } from 'lucide-react';
|
import { RefreshCw, Search, Server, Loader2 } from 'lucide-react';
|
||||||
import { kubernetesApi } from '@/services/api';
|
import { kubernetesApi } from '@/api';
|
||||||
|
|
||||||
export function KubernetesNodes() {
|
export function KubernetesNodes() {
|
||||||
const [clusters, setClusters] = useState<any[]>([]);
|
const [clusters, setClusters] = useState<any[]>([]);
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import {
|
|||||||
Eye,
|
Eye,
|
||||||
} from 'lucide-react';
|
} from 'lucide-react';
|
||||||
|
|
||||||
import { kubernetesApi } from '@/services/api';
|
import { kubernetesApi } from '@/api';
|
||||||
import { useToast } from '@/hooks/use-toast';
|
import { useToast } from '@/hooks/use-toast';
|
||||||
import { DeploymentDetail } from './DeploymentDetail';
|
import { DeploymentDetail } from './DeploymentDetail';
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import {
|
|||||||
RefreshCw, Loader2, ChevronRight, Plus, Trash2, Boxes, Container, Network,
|
RefreshCw, Loader2, ChevronRight, Plus, Trash2, Boxes, Container, Network,
|
||||||
Shield, Activity, AlertTriangle, CheckCircle2,
|
Shield, Activity, AlertTriangle, CheckCircle2,
|
||||||
} from 'lucide-react';
|
} from 'lucide-react';
|
||||||
import { kubernetesApi } from '@/services/api';
|
import { kubernetesApi } from '@/api';
|
||||||
|
|
||||||
interface NamespaceDetail {
|
interface NamespaceDetail {
|
||||||
name: string;
|
name: string;
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import {
|
|||||||
Clock,
|
Clock,
|
||||||
} from 'lucide-react';
|
} from 'lucide-react';
|
||||||
|
|
||||||
import { kubernetesApi } from '@/services/api';
|
import { kubernetesApi } from '@/api';
|
||||||
|
|
||||||
const RESOURCE_LINKS = [
|
const RESOURCE_LINKS = [
|
||||||
{ type: 'deployments', label: 'Deployments', icon: Boxes, desc: '工作负载副本管理' },
|
{ type: 'deployments', label: 'Deployments', icon: Boxes, desc: '工作负载副本管理' },
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import { YamlViewer } from './YamlViewer';
|
|||||||
import { ResourceVisualEditor } from './ResourceVisualEditor';
|
import { ResourceVisualEditor } from './ResourceVisualEditor';
|
||||||
import { PodExecTerminal } from './PodExecTerminal';
|
import { PodExecTerminal } from './PodExecTerminal';
|
||||||
import { PodFileBrowser } from './PodFileBrowser';
|
import { PodFileBrowser } from './PodFileBrowser';
|
||||||
import { kubernetesApi } from '@/services/api';
|
import { kubernetesApi } from '@/api';
|
||||||
import { useToast } from '@/hooks/use-toast';
|
import { useToast } from '@/hooks/use-toast';
|
||||||
|
|
||||||
type ResourceType =
|
type ResourceType =
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import {
|
|||||||
CheckCircle2,
|
CheckCircle2,
|
||||||
} from 'lucide-react';
|
} from 'lucide-react';
|
||||||
|
|
||||||
import { kubernetesApi } from '@/services/api';
|
import { kubernetesApi } from '@/api';
|
||||||
|
|
||||||
export default function NodeDetailPage() {
|
export default function NodeDetailPage() {
|
||||||
const { clusterCode, nodeName } = useParams<{ clusterCode: string; nodeName: string }>();
|
const { clusterCode, nodeName } = useParams<{ clusterCode: string; nodeName: string }>();
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import {
|
|||||||
Terminal, Maximize2, Minimize2, X, Loader2, RotateCw, Box,
|
Terminal, Maximize2, Minimize2, X, Loader2, RotateCw, Box,
|
||||||
} from 'lucide-react';
|
} from 'lucide-react';
|
||||||
import { cn } from '@/lib/utils';
|
import { cn } from '@/lib/utils';
|
||||||
import { kubernetesApi } from '@/services/api';
|
import { kubernetesApi } from '@/api';
|
||||||
import { useToast } from '@/hooks/use-toast';
|
import { useToast } from '@/hooks/use-toast';
|
||||||
|
|
||||||
export interface PodExecTerminalProps {
|
export interface PodExecTerminalProps {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
// PodFileBrowser.tsx — Pod 容器文件浏览器组件
|
// PodFileBrowser.tsx — Pod 容器文件浏览器组件
|
||||||
// 作者: Logan <admin@attacker.club>
|
// 作者: Logan <admin@attacker.club>
|
||||||
import { useState, useEffect, useCallback, useRef } from 'react';
|
import { useState, useEffect, useCallback, useRef } from 'react';
|
||||||
import { kubernetesApi } from '@/services/api';
|
import { kubernetesApi } from '@/api';
|
||||||
import { Button } from '@/components/ui/button';
|
import { Button } from '@/components/ui/button';
|
||||||
import { Badge } from '@/components/ui/badge';
|
import { Badge } from '@/components/ui/badge';
|
||||||
import {
|
import {
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import {
|
|||||||
RefreshCw, Loader2, Box, History, Clock, Filter, AlertCircle,
|
RefreshCw, Loader2, Box, History, Clock, Filter, AlertCircle,
|
||||||
} from 'lucide-react';
|
} from 'lucide-react';
|
||||||
import { cn } from '@/lib/utils';
|
import { cn } from '@/lib/utils';
|
||||||
import { kubernetesApi } from '@/services/api';
|
import { kubernetesApi } from '@/api';
|
||||||
import { useToast } from '@/hooks/use-toast';
|
import { useToast } from '@/hooks/use-toast';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import {
|
|||||||
Table, TableBody, TableCell, TableHead, TableHeader, TableRow,
|
Table, TableBody, TableCell, TableHead, TableHeader, TableRow,
|
||||||
} from '@/components/ui/table';
|
} from '@/components/ui/table';
|
||||||
import { Cpu, HardDrive, RefreshCw, ChevronRight, Activity } from 'lucide-react';
|
import { Cpu, HardDrive, RefreshCw, ChevronRight, Activity } from 'lucide-react';
|
||||||
import { kubernetesApi } from '@/services/api';
|
import { kubernetesApi } from '@/api';
|
||||||
|
|
||||||
export default function PodMetricsPage() {
|
export default function PodMetricsPage() {
|
||||||
const { clusterCode } = useParams<{ clusterCode: string }>();
|
const { clusterCode } = useParams<{ clusterCode: string }>();
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import { Label } from '@/components/ui/label';
|
|||||||
import { Textarea } from '@/components/ui/textarea';
|
import { Textarea } from '@/components/ui/textarea';
|
||||||
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select';
|
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select';
|
||||||
import { useToast } from '@/hooks/use-toast';
|
import { useToast } from '@/hooks/use-toast';
|
||||||
import { kubernetesApi } from '@/services/api';
|
import { kubernetesApi } from '@/api';
|
||||||
import CodeMirror from '@uiw/react-codemirror';
|
import CodeMirror from '@uiw/react-codemirror';
|
||||||
import { yaml } from '@codemirror/lang-yaml';
|
import { yaml } from '@codemirror/lang-yaml';
|
||||||
import { oneDark } from '@codemirror/theme-one-dark';
|
import { oneDark } from '@codemirror/theme-one-dark';
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import { Textarea } from '@/components/ui/textarea';
|
|||||||
import {
|
import {
|
||||||
Search, RefreshCw, Loader2, Cloud, Save, Plus, Trash2, Link2, Pencil, RotateCcw,
|
Search, RefreshCw, Loader2, Cloud, Save, Plus, Trash2, Link2, Pencil, RotateCcw,
|
||||||
} from 'lucide-react';
|
} from 'lucide-react';
|
||||||
import { kubernetesApi } from '@/services/api';
|
import { kubernetesApi } from '@/api';
|
||||||
import { useConfirm } from '@/components/ui/confirm-dialog';
|
import { useConfirm } from '@/components/ui/confirm-dialog';
|
||||||
import { toast } from 'sonner';
|
import { toast } from 'sonner';
|
||||||
import type { TopologyNode, TopologyEdge } from '@/types';
|
import type { TopologyNode, TopologyEdge } from '@/types';
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import {
|
|||||||
ArrowLeft, RotateCcw, FileCode, Activity, Container, Terminal,
|
ArrowLeft, RotateCcw, FileCode, Activity, Container, Terminal,
|
||||||
HardDrive, Minus, Plus, Boxes, Tag, Settings, Database,
|
HardDrive, Minus, Plus, Boxes, Tag, Settings, Database,
|
||||||
} from 'lucide-react';
|
} from 'lucide-react';
|
||||||
import { kubernetesApi } from '@/services/api';
|
import { kubernetesApi } from '@/api';
|
||||||
import { useToast } from '@/hooks/use-toast';
|
import { useToast } from '@/hooks/use-toast';
|
||||||
import { YamlViewer } from './YamlViewer';
|
import { YamlViewer } from './YamlViewer';
|
||||||
import { PodExecTerminal } from './PodExecTerminal';
|
import { PodExecTerminal } from './PodExecTerminal';
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { useState, useEffect, useMemo} from 'react';
|
|||||||
import { X, Copy, Check, Save, Loader2, Sparkles} from 'lucide-react';
|
import { X, Copy, Check, Save, Loader2, Sparkles} from 'lucide-react';
|
||||||
import { Button } from '@/components/ui/button';
|
import { Button } from '@/components/ui/button';
|
||||||
import { useToast } from '@/hooks/use-toast';
|
import { useToast } from '@/hooks/use-toast';
|
||||||
import { kubernetesApi } from '@/services/api';
|
import { kubernetesApi } from '@/api';
|
||||||
import { cleanYAML } from './k8s-yaml-utils';
|
import { cleanYAML } from './k8s-yaml-utils';
|
||||||
import CodeMirror from '@uiw/react-codemirror';
|
import CodeMirror from '@uiw/react-codemirror';
|
||||||
import { yaml } from '@codemirror/lang-yaml';
|
import { yaml } from '@codemirror/lang-yaml';
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { useThemeStore, useUserStore } from '@/store';
|
|||||||
import { Sidebar } from './Sidebar';
|
import { Sidebar } from './Sidebar';
|
||||||
import { Header } from './Header';
|
import { Header } from './Header';
|
||||||
import { Breadcrumb } from './Breadcrumb';
|
import { Breadcrumb } from './Breadcrumb';
|
||||||
import { userApi } from '@/services/api';
|
import { userApi } from '@/api';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MainLayout - 优化后的主布局组件
|
* MainLayout - 优化后的主布局组件
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import {
|
|||||||
DialogTitle,
|
DialogTitle,
|
||||||
} from '@/components/ui/dialog';
|
} from '@/components/ui/dialog';
|
||||||
import { Plus, Trash2, Loader2 } from 'lucide-react';
|
import { Plus, Trash2, Loader2 } from 'lucide-react';
|
||||||
import { alertApi } from '@/services/api';
|
import { alertApi } from '@/api';
|
||||||
import { CHANNEL_TYPES, getChannelTypeLabel } from './alertShared';
|
import { CHANNEL_TYPES, getChannelTypeLabel } from './alertShared';
|
||||||
|
|
||||||
const defaultChannelForm = { name: '', type: 'dingtalk', config: '', enabled: true };
|
const defaultChannelForm = { name: '', type: 'dingtalk', config: '', enabled: true };
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import {
|
|||||||
TableRow,
|
TableRow,
|
||||||
} from '@/components/ui/table';
|
} from '@/components/ui/table';
|
||||||
import { Search, AlertTriangle, Bell, CheckCircle, Loader2 } from 'lucide-react';
|
import { Search, AlertTriangle, Bell, CheckCircle, Loader2 } from 'lucide-react';
|
||||||
import { alertApi } from '@/services/api';
|
import { alertApi } from '@/api';
|
||||||
|
|
||||||
export function AlertEventsTab({
|
export function AlertEventsTab({
|
||||||
alerts,
|
alerts,
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import {
|
|||||||
CartesianGrid,
|
CartesianGrid,
|
||||||
Tooltip,
|
Tooltip,
|
||||||
} from 'recharts';
|
} from 'recharts';
|
||||||
import { alertApi } from '@/services/api';
|
import { alertApi } from '@/api';
|
||||||
import { AlertEventsTab } from './AlertEventsTab';
|
import { AlertEventsTab } from './AlertEventsTab';
|
||||||
import { AlertRulesTab } from './AlertRulesTab';
|
import { AlertRulesTab } from './AlertRulesTab';
|
||||||
import { AlertRuleDialog } from './AlertRuleDialog';
|
import { AlertRuleDialog } from './AlertRuleDialog';
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import {
|
|||||||
DialogTitle,
|
DialogTitle,
|
||||||
} from '@/components/ui/dialog';
|
} from '@/components/ui/dialog';
|
||||||
import { Loader2 } from 'lucide-react';
|
import { Loader2 } from 'lucide-react';
|
||||||
import { alertApi } from '@/services/api';
|
import { alertApi } from '@/api';
|
||||||
import { parseChannels, getChannelIcon, getChannelTypeLabel } from './alertShared';
|
import { parseChannels, getChannelIcon, getChannelTypeLabel } from './alertShared';
|
||||||
|
|
||||||
const emptyRuleForm = {
|
const emptyRuleForm = {
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import {
|
|||||||
} from '@/components/ui/table';
|
} from '@/components/ui/table';
|
||||||
import { Settings, Trash2 } from 'lucide-react';
|
import { Settings, Trash2 } from 'lucide-react';
|
||||||
import { toast } from 'sonner';
|
import { toast } from 'sonner';
|
||||||
import { alertApi } from '@/services/api';
|
import { alertApi } from '@/api';
|
||||||
import { renderRuleChannels } from './alertShared';
|
import { renderRuleChannels } from './alertShared';
|
||||||
|
|
||||||
const COL_SPAN = 9; // 复选框 + 7 数据列 + 操作列 // Logan.Li
|
const COL_SPAN = 9; // 复选框 + 7 数据列 + 操作列 // Logan.Li
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs';
|
|||||||
import { Switch } from '@/components/ui/switch';
|
import { Switch } from '@/components/ui/switch';
|
||||||
import { toast } from 'sonner';
|
import { toast } from 'sonner';
|
||||||
import { useConfirm } from '@/components/ui/confirm-dialog';
|
import { useConfirm } from '@/components/ui/confirm-dialog';
|
||||||
import { alertCenterApi, agentApi, alertApi } from '@/services/api';
|
import { alertCenterApi, agentApi, alertApi } from '@/api';
|
||||||
import {
|
import {
|
||||||
type Alert, type AlertRule, mapAlert, getSeverityBadge, getStatusBadge,
|
type Alert, type AlertRule, mapAlert, getSeverityBadge, getStatusBadge,
|
||||||
getChannelTypeLabel,
|
getChannelTypeLabel,
|
||||||
|
|||||||
Loaded 100 of 145 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user