From 04861a48cb3860f4e6e7a52c64b8ebedefb6953c Mon Sep 17 00:00:00 2001 From: Xiaoxia AI Date: Mon, 22 Jun 2026 11:03:05 +0800 Subject: [PATCH] fix(web): stop workspace quota api calls --- .../src/pages/workspace/WorkspaceDetail.tsx | 54 +++---------------- 1 file changed, 8 insertions(+), 46 deletions(-) diff --git a/apps/web/src/pages/workspace/WorkspaceDetail.tsx b/apps/web/src/pages/workspace/WorkspaceDetail.tsx index 6266d9afd..373a5bd60 100644 --- a/apps/web/src/pages/workspace/WorkspaceDetail.tsx +++ b/apps/web/src/pages/workspace/WorkspaceDetail.tsx @@ -3,11 +3,10 @@ */ import React, { useState } from 'react'; import { useParams, useNavigate } from 'react-router-dom'; -import { Tabs, Button, Descriptions, Progress, Card, Row, Col, List, Modal, Form, Input, message, Alert } from 'antd'; -import { PlusOutlined, TeamOutlined, ProjectOutlined } from '@ant-design/icons'; +import { Tabs, Button, Descriptions, Card, List, Modal, Form, Input, message, Alert } from 'antd'; +import { PlusOutlined, TeamOutlined } from '@ant-design/icons'; import { useWorkspace } from '@/hooks/useWorkspace'; import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'; -import { getQuotaStatus } from '@/api/subscription'; import { createProject, getProjects } from '@/api/projects'; import MemberList from '@/components/business/MemberList'; import InviteMemberModal from '@/components/business/InviteMemberModal'; @@ -17,11 +16,6 @@ const WorkspaceDetail: React.FC = () => { const { id } = useParams<{ id: string }>(); const navigate = useNavigate(); const { data: workspace, isLoading } = useWorkspace(id!); - const { data: quota } = useQuery({ - queryKey: ['quota', id], - queryFn: () => getQuotaStatus(id!), - enabled: !!id, - }); const queryClient = useQueryClient(); const [inviteModalOpen, setInviteModalOpen] = useState(false); const [createProjectOpen, setCreateProjectOpen] = useState(false); @@ -59,16 +53,6 @@ const WorkspaceDetail: React.FC = () => { if (isLoading) return
加载中...
; if (!workspace) return
工作空间不存在
; - const getStatusColor = (status: string) => { - const colors: Record = { - normal: '#52c41a', - warning: '#faad14', - critical: '#ff4d4f', - exceeded: '#ff4d4f', - }; - return colors[status] || colors.normal; - }; - const items = [ { key: 'overview', @@ -124,34 +108,12 @@ const WorkspaceDetail: React.FC = () => { /> - {quota && ( - - - -
-
- 项目数量:{quota.projects.used} / {quota.projects.limit} -
- -
- - -
-
- 存储空间:{quota.storage.used_gb.toFixed(2)} GB / {quota.storage.limit_gb} GB -
- -
- -
-
- )} + ), },