From 448a7d5e73b08f95e8fa243fbbebe2fdafba36d7 Mon Sep 17 00:00:00 2001 From: LydiaCai1203 <1125862926@qq.com> Date: Wed, 10 Jun 2026 18:06:12 +0800 Subject: [PATCH] feat: support gitcode --- frontend/public/iconfont.js | 2 +- frontend/src/api/Api.ts | 1 + .../components/console/git-bot/create-git-bot-dialog.tsx | 3 +++ .../src/components/console/git-bot/edit-git-bot-dialog.tsx | 3 +++ frontend/src/components/console/settings/add-identity.tsx | 6 ++++++ frontend/src/components/console/settings/edit-identity.tsx | 3 +++ .../components/console/task/create-default-task-dialog.tsx | 1 + frontend/src/components/console/task/task-input.tsx | 1 + frontend/src/components/welcome/git-bot.tsx | 4 ++-- frontend/src/utils/common.tsx | 7 +++++++ 10 files changed, 28 insertions(+), 3 deletions(-) diff --git a/frontend/public/iconfont.js b/frontend/public/iconfont.js index d8b44b26..cc5a9e47 100644 --- a/frontend/public/iconfont.js +++ b/frontend/public/iconfont.js @@ -1 +1 @@ -window._iconfont_svg_string_5023051='',(a=>{var l=(c=(c=document.getElementsByTagName("script"))[c.length-1]).getAttribute("data-injectcss"),c=c.getAttribute("data-disable-injectsvg");if(!c){var h,t,i,p,o,d=function(l,c){c.parentNode.insertBefore(l,c)};if(l&&!a.__iconfont__svg__cssinject__){a.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(l){console&&console.log(l)}}h=function(){var l,c=document.createElement("div");c.innerHTML=a._iconfont_svg_string_5023051,(c=c.getElementsByTagName("svg")[0])&&(c.setAttribute("aria-hidden","true"),c.style.position="absolute",c.style.width=0,c.style.height=0,c.style.overflow="hidden",c=c,(l=document.body).firstChild?d(c,l.firstChild):l.appendChild(c))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(h,0):(t=function(){document.removeEventListener("DOMContentLoaded",t,!1),h()},document.addEventListener("DOMContentLoaded",t,!1)):document.attachEvent&&(i=h,p=a.document,o=!1,m(),p.onreadystatechange=function(){"complete"==p.readyState&&(p.onreadystatechange=null,z())})}function z(){o||(o=!0,i())}function m(){try{p.documentElement.doScroll("left")}catch(l){return void setTimeout(m,50)}z()}})(window); \ No newline at end of file +window._iconfont_svg_string_5023051='',(a=>{var l=(c=(c=document.getElementsByTagName("script"))[c.length-1]).getAttribute("data-injectcss"),c=c.getAttribute("data-disable-injectsvg");if(!c){var h,t,i,p,o,d=function(l,c){c.parentNode.insertBefore(l,c)};if(l&&!a.__iconfont__svg__cssinject__){a.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(l){console&&console.log(l)}}h=function(){var l,c=document.createElement("div");c.innerHTML=a._iconfont_svg_string_5023051,(c=c.getElementsByTagName("svg")[0])&&(c.setAttribute("aria-hidden","true"),c.style.position="absolute",c.style.width=0,c.style.height=0,c.style.overflow="hidden",c=c,(l=document.body).firstChild?d(c,l.firstChild):l.appendChild(c))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(h,0):(t=function(){document.removeEventListener("DOMContentLoaded",t,!1),h()},document.addEventListener("DOMContentLoaded",t,!1)):document.attachEvent&&(i=h,p=a.document,o=!1,m(),p.onreadystatechange=function(){"complete"==p.readyState&&(p.onreadystatechange=null,z())})}function z(){o||(o=!0,i())}function m(){try{p.documentElement.doScroll("left")}catch(l){return void setTimeout(m,50)}z()}})(window); \ No newline at end of file diff --git a/frontend/src/api/Api.ts b/frontend/src/api/Api.ts index e9fdd499..8603e7c8 100644 --- a/frontend/src/api/Api.ts +++ b/frontend/src/api/Api.ts @@ -22,6 +22,7 @@ export enum ConstsGitPlatform { GitPlatformGitee = "gitee", GitPlatformCodeup = "codeup", GitPlatformCnb = "cnb", + GitPlatformAtomGit = "atomgit", GitPlatformInternal = "internal", } diff --git a/frontend/src/components/console/git-bot/create-git-bot-dialog.tsx b/frontend/src/components/console/git-bot/create-git-bot-dialog.tsx index 8385d76f..e0d81e03 100644 --- a/frontend/src/components/console/git-bot/create-git-bot-dialog.tsx +++ b/frontend/src/components/console/git-bot/create-git-bot-dialog.tsx @@ -173,6 +173,9 @@ export function CreateGitBotDialog({ open, onOpenChange, onSuccess }: CreateGitB CNB + + GitCode + diff --git a/frontend/src/components/console/git-bot/edit-git-bot-dialog.tsx b/frontend/src/components/console/git-bot/edit-git-bot-dialog.tsx index 33949c7a..085a80f7 100644 --- a/frontend/src/components/console/git-bot/edit-git-bot-dialog.tsx +++ b/frontend/src/components/console/git-bot/edit-git-bot-dialog.tsx @@ -158,6 +158,9 @@ export function EditGitBotDialog({ open, onOpenChange, bot, onSuccess }: EditGit CNB + + GitCode + diff --git a/frontend/src/components/console/settings/add-identity.tsx b/frontend/src/components/console/settings/add-identity.tsx index 815bfaaf..08290cca 100644 --- a/frontend/src/components/console/settings/add-identity.tsx +++ b/frontend/src/components/console/settings/add-identity.tsx @@ -75,6 +75,9 @@ export default function AddIdentity({ case ConstsGitPlatform.GitPlatformCnb: setBaseUrl("https://api.cnb.cool") break + case ConstsGitPlatform.GitPlatformAtomGit: + setBaseUrl("https://api.atomgit.com") + break default: setBaseUrl("") } @@ -181,6 +184,9 @@ export default function AddIdentity({ CNB + + GitCode + diff --git a/frontend/src/components/console/settings/edit-identity.tsx b/frontend/src/components/console/settings/edit-identity.tsx index aa4d01b8..defae65a 100644 --- a/frontend/src/components/console/settings/edit-identity.tsx +++ b/frontend/src/components/console/settings/edit-identity.tsx @@ -193,6 +193,9 @@ export default function EditIdentity({ CNB + + GitCode + diff --git a/frontend/src/components/console/task/create-default-task-dialog.tsx b/frontend/src/components/console/task/create-default-task-dialog.tsx index 4857be91..325f5b66 100644 --- a/frontend/src/components/console/task/create-default-task-dialog.tsx +++ b/frontend/src/components/console/task/create-default-task-dialog.tsx @@ -96,6 +96,7 @@ function isIdentityWithRepos(identity: DomainGitIdentity): boolean { ConstsGitPlatform.GitPlatformGitLab, ConstsGitPlatform.GitPlatformCodeup, ConstsGitPlatform.GitPlatformCnb, + ConstsGitPlatform.GitPlatformAtomGit, ].includes(identity.platform as ConstsGitPlatform) } diff --git a/frontend/src/components/console/task/task-input.tsx b/frontend/src/components/console/task/task-input.tsx index efc1fa67..223c8aba 100644 --- a/frontend/src/components/console/task/task-input.tsx +++ b/frontend/src/components/console/task/task-input.tsx @@ -47,6 +47,7 @@ function isIdentityWithRepos(identity: DomainGitIdentity): boolean { ConstsGitPlatform.GitPlatformGitLab, ConstsGitPlatform.GitPlatformCodeup, ConstsGitPlatform.GitPlatformCnb, + ConstsGitPlatform.GitPlatformAtomGit, ].includes(identity.platform as ConstsGitPlatform); } diff --git a/frontend/src/components/welcome/git-bot.tsx b/frontend/src/components/welcome/git-bot.tsx index ce23a8c5..5d86ee84 100644 --- a/frontend/src/components/welcome/git-bot.tsx +++ b/frontend/src/components/welcome/git-bot.tsx @@ -18,7 +18,7 @@ const proofs = [ { icon: IconStack2, title: "支持主流 Git 平台", - description: "GitHub、GitLab、Gitea、Gitee、Codeup、CNB 等协作链路都可以接入,不让 AI 结果停留在平台内部。", + description: "GitHub、GitLab、Gitea、Gitee、Codeup、CNB、GitCode 等协作链路都可以接入,不让 AI 结果停留在平台内部。", }, { icon: IconShare2, @@ -32,7 +32,7 @@ const proofs = [ }, ]; -const platformTags = ["GitHub", "GitLab", "Gitea", "Gitee", "Codeup", "CNB", "远程协助", "离线部署"]; +const platformTags = ["GitHub", "GitLab", "Gitea", "Gitee", "Codeup", "CNB", "GitCode", "远程协助", "离线部署"]; const GitBot = () => { const typewriterText = "@monkeycode-ai 你好,请帮我 review 这个 PR"; diff --git a/frontend/src/utils/common.tsx b/frontend/src/utils/common.tsx index 20070f19..6d44f38c 100644 --- a/frontend/src/utils/common.tsx +++ b/frontend/src/utils/common.tsx @@ -353,6 +353,8 @@ export function getRepoIcon(url: string) { return case 'gitea.com': return + case 'atomgit.com': + return default: return } @@ -386,6 +388,9 @@ export function detectGitPlatformFromUrl(url: string): ConstsGitPlatform | undef if (hostname === "cnb.cool" || hostname.endsWith(".cnb.cool")) { return ConstsGitPlatform.GitPlatformCnb } + if (hostname === "atomgit.com" || hostname.endsWith(".atomgit.com")) { + return ConstsGitPlatform.GitPlatformAtomGit + } return undefined } @@ -430,6 +435,8 @@ export function getGitPlatformIcon(platform?: string) { return case 'cnb': return + case 'atomgit': + return default: return }