feat: Integrate Gitea as the default repository type with corresponding UI updates and icon.
This commit is contained in:
parent
fcb40db556
commit
4e7a4c5d9c
|
|
@ -56,7 +56,7 @@ export default function ProjectDetail() {
|
|||
description: "",
|
||||
source_type: "repository",
|
||||
repository_url: "",
|
||||
repository_type: "github",
|
||||
repository_type: "gitea",
|
||||
default_branch: "main",
|
||||
programming_languages: []
|
||||
});
|
||||
|
|
@ -97,7 +97,7 @@ export default function ProjectDetail() {
|
|||
description: project.description || "",
|
||||
source_type: project.source_type || "repository",
|
||||
repository_url: project.repository_url || "",
|
||||
repository_type: project.repository_type || "github",
|
||||
repository_type: project.repository_type || "gitea",
|
||||
default_branch: project.default_branch || "main",
|
||||
programming_languages: project.programming_languages ? JSON.parse(project.programming_languages) : []
|
||||
});
|
||||
|
|
@ -763,7 +763,7 @@ export default function ProjectDetail() {
|
|||
id="edit-repo-url"
|
||||
value={editForm.repository_url}
|
||||
onChange={(e) => setEditForm({ ...editForm, repository_url: e.target.value })}
|
||||
placeholder="https://github.com/username/repo"
|
||||
placeholder="https://gitea.com/username/repo"
|
||||
className="cyber-input mt-1"
|
||||
/>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -298,7 +298,7 @@ export default function Projects() {
|
|||
description: project.description || "",
|
||||
source_type: project.source_type || "repository",
|
||||
repository_url: project.repository_url || "",
|
||||
repository_type: project.repository_type || "github",
|
||||
repository_type: project.repository_type || "gitea",
|
||||
default_branch: project.default_branch || "main",
|
||||
programming_languages: project.programming_languages ? JSON.parse(project.programming_languages) : []
|
||||
});
|
||||
|
|
@ -518,8 +518,8 @@ export default function Projects() {
|
|||
onChange={(e) => setCreateForm({ ...createForm, repository_url: e.target.value })}
|
||||
placeholder={
|
||||
createForm.repository_type === 'other'
|
||||
? "git@github.com:user/repo.git"
|
||||
: "https://github.com/user/repo"
|
||||
? "git@gitea.com:user/repo.git"
|
||||
: "https://gitea.com/user/repo"
|
||||
}
|
||||
className="cyber-input"
|
||||
/>
|
||||
|
|
@ -1019,8 +1019,8 @@ export default function Projects() {
|
|||
onChange={(e) => setEditForm({ ...editForm, repository_url: e.target.value })}
|
||||
placeholder={
|
||||
editForm.repository_type === 'other'
|
||||
? "git@github.com:user/repo.git"
|
||||
: "https://github.com/user/repo"
|
||||
? "git@gitea.com:user/repo.git"
|
||||
: "https://gitea.com/user/repo"
|
||||
}
|
||||
className="cyber-input mt-1"
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -99,6 +99,7 @@ export default function RecycleBin() {
|
|||
switch (type) {
|
||||
case 'github': return '🐙';
|
||||
case 'gitlab': return '🦊';
|
||||
case 'gitea': return '🍵';
|
||||
default: return '📁';
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -35,10 +35,12 @@ export const REPOSITORY_PLATFORMS: Array<{
|
|||
value: RepositoryPlatform;
|
||||
label: string;
|
||||
icon?: string;
|
||||
}> = Object.entries(REPOSITORY_PLATFORM_LABELS).map(([value, label]) => ({
|
||||
value: value as RepositoryPlatform,
|
||||
label
|
||||
}));
|
||||
}> = [
|
||||
{ value: 'gitea', label: 'Gitea' },
|
||||
{ value: 'github', label: 'GitHub' },
|
||||
{ value: 'gitlab', label: 'GitLab' },
|
||||
{ value: 'other', label: '其他' },
|
||||
];
|
||||
|
||||
// 项目来源类型的颜色配置
|
||||
export const SOURCE_TYPE_COLORS: Record<ProjectSourceType, {
|
||||
|
|
|
|||
Loading…
Reference in New Issue