+
+
updateConfig('giteaToken', e.target.value)}
+ placeholder="sha1_xxxxxxxxxxxx"
+ className="h-10 cyber-input"
+ />
+
+ 用于访问 Gitea 私有仓库。获取:{' '}
+
+ [your-gitea-instance]/user/settings/applications
+
+
+
diff --git a/frontend/src/pages/Projects.tsx b/frontend/src/pages/Projects.tsx
index 60177ca..f2c0a72 100644
--- a/frontend/src/pages/Projects.tsx
+++ b/frontend/src/pages/Projects.tsx
@@ -275,6 +275,7 @@ export default function Projects() {
switch (type) {
case 'github': return ;
case 'gitlab': return ;
+ case 'gitea': return ;
default: return ;
}
};
@@ -486,6 +487,7 @@ export default function Projects() {
GITHUB
GITLAB
+ GITEA
OTHER
@@ -1016,6 +1018,7 @@ export default function Projects() {
GITHUB
GITLAB
+ GITEA
OTHER
diff --git a/frontend/src/shared/constants/projectTypes.ts b/frontend/src/shared/constants/projectTypes.ts
index d230fb9..55e6d47 100644
--- a/frontend/src/shared/constants/projectTypes.ts
+++ b/frontend/src/shared/constants/projectTypes.ts
@@ -10,17 +10,17 @@ export const PROJECT_SOURCE_TYPES: Array<{
label: string;
description: string;
}> = [
- {
- value: 'repository',
- label: '远程仓库',
- description: '从 GitHub/GitLab 等远程仓库拉取代码'
- },
- {
- value: 'zip',
- label: 'ZIP上传',
- description: '上传本地ZIP压缩包进行扫描'
- }
-];
+ {
+ value: 'repository',
+ label: '远程仓库',
+ description: '从 GitHub/GitLab 等远程仓库拉取代码'
+ },
+ {
+ value: 'zip',
+ label: 'ZIP上传',
+ description: '上传本地ZIP压缩包进行扫描'
+ }
+ ];
// 仓库平台选项
export const REPOSITORY_PLATFORMS: Array<{
@@ -28,10 +28,11 @@ export const REPOSITORY_PLATFORMS: Array<{
label: string;
icon?: string;
}> = [
- { value: 'github', label: 'GitHub' },
- { value: 'gitlab', label: 'GitLab' },
- { value: 'other', label: '其他' }
-];
+ { value: 'github', label: 'GitHub' },
+ { value: 'gitlab', label: 'GitLab' },
+ { value: 'gitea', label: 'Gitea' },
+ { value: 'other', label: '其他' }
+ ];
// 项目来源类型的颜色配置
export const SOURCE_TYPE_COLORS: Record = {
github: { bg: 'bg-foreground', text: 'text-background' },
gitlab: { bg: 'bg-orange-500', text: 'text-white' },
+ gitea: { bg: 'bg-green-600', text: 'text-white' },
other: { bg: 'bg-muted-foreground', text: 'text-background' }
};
diff --git a/frontend/src/shared/types/index.ts b/frontend/src/shared/types/index.ts
index 666222e..db57b01 100644
--- a/frontend/src/shared/types/index.ts
+++ b/frontend/src/shared/types/index.ts
@@ -24,7 +24,7 @@ export interface Profile {
export type ProjectSourceType = 'repository' | 'zip';
// 仓库平台类型
-export type RepositoryPlatform = 'github' | 'gitlab' | 'other';
+export type RepositoryPlatform = 'github' | 'gitlab' | 'gitea' | 'other';
// 项目相关类型
export interface Project {
diff --git a/frontend/src/shared/utils/projectUtils.ts b/frontend/src/shared/utils/projectUtils.ts
index 1ade33d..07bc437 100644
--- a/frontend/src/shared/utils/projectUtils.ts
+++ b/frontend/src/shared/utils/projectUtils.ts
@@ -48,6 +48,7 @@ export function getRepositoryPlatformLabel(platform?: string): string {
const labels: Record = {
github: 'GitHub',
gitlab: 'GitLab',
+ gitea: 'Gitea',
other: '其他'
};
return labels[platform || 'other'] || '其他';