diff --git a/frontend/src/components/audit/components/BasicConfig.tsx b/frontend/src/components/audit/components/BasicConfig.tsx index c82968e..b613f85 100644 --- a/frontend/src/components/audit/components/BasicConfig.tsx +++ b/frontend/src/components/audit/components/BasicConfig.tsx @@ -9,7 +9,7 @@ import { } from "@/components/ui/select"; import { GitBranch, Zap, Info } from "lucide-react"; import type { Project, CreateAuditTaskForm } from "@/shared/types"; -import { isRepositoryProject, isZipProject } from "@/shared/utils/projectUtils"; +import { isRepositoryProject, isZipProject, getRepositoryPlatformLabel } from "@/shared/utils/projectUtils"; import ZipFileSection from "./ZipFileSection"; import type { ZipFileMeta } from "@/shared/utils/zipStorage"; @@ -138,7 +138,7 @@ function ProjectInfoCard({ project }: { project: Project }) { {isRepo && ( <>
- 仓库平台:{project.repository_type?.toUpperCase() || "OTHER"} + 仓库平台:{getRepositoryPlatformLabel(project.repository_type)}
默认分支:{project.default_branch}
> diff --git a/frontend/src/pages/ProjectDetail.tsx b/frontend/src/pages/ProjectDetail.tsx index 9d282c2..28ea711 100644 --- a/frontend/src/pages/ProjectDetail.tsx +++ b/frontend/src/pages/ProjectDetail.tsx @@ -34,13 +34,13 @@ import { api } from "@/shared/config/database"; import { runRepositoryAudit, scanStoredZipFile } from "@/features/projects/services"; import type { Project, AuditTask, CreateProjectForm } from "@/shared/types"; import { hasZipFile } from "@/shared/utils/zipStorage"; -import { isRepositoryProject, getSourceTypeLabel } from "@/shared/utils/projectUtils"; +import { isRepositoryProject, getSourceTypeLabel, getRepositoryPlatformLabel } from "@/shared/utils/projectUtils"; import { toast } from "sonner"; import CreateTaskDialog from "@/components/audit/CreateTaskDialog"; import FileSelectionDialog from "@/components/audit/FileSelectionDialog"; import TerminalProgressDialog from "@/components/audit/TerminalProgressDialog"; import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogFooter } from "@/components/ui/dialog"; -import { SUPPORTED_LANGUAGES } from "@/shared/constants"; +import { SUPPORTED_LANGUAGES, REPOSITORY_PLATFORMS } from "@/shared/constants"; export default function ProjectDetail() { const { id } = useParams<{ id: string }>(); @@ -475,8 +475,7 @@ export default function ProjectDetail() {
@@ -783,9 +779,11 @@ export default function ProjectDetail() {
仓库平台
-{task.project.repository_type?.toUpperCase() || 'OTHER'}
+{getRepositoryPlatformLabel(task.project.repository_type)}