mirror of
https://github.com/chaitin/MonkeyCode.git
synced 2026-11-29 16:18:40 +08:00
feat: support gitcode
This commit is contained in:
1 parent
e4722ef557
commit
448a7d5e73
10 files changed
+28
-3
No files matched your search
@@ -1 +1 @@
|
||||
window._iconfont_svg_string_5023051='<svg><symbol id="icon-Codeup" viewBox="0 0 1024 1024"><path d="M241.92 448c0 4.48 0.64 8.32 0.64 12.8C266.88 334.08 378.24 237.44 512 237.44a275.2 275.2 0 0 1 250.24 161.28L936.96 320A467.84 467.84 0 0 0 512 45.44c-2.56 0-5.12 0.64-7.68 0.64C350.08 114.56 241.92 268.16 241.92 448z" fill="#B8CFF4" ></path><path d="M739.84 665.6A275.2 275.2 0 0 1 512 786.56c-65.92 0-125.44-24.32-172.8-62.72-61.44-50.56-101.76-126.08-101.76-211.84 0-17.28 1.92-34.56 5.12-51.2 0-4.48-0.64-8.32-0.64-12.8 0-179.84 107.52-334.08 262.4-401.92C250.88 49.92 45.44 257.28 45.44 512c0 257.28 209.28 466.56 466.56 466.56a467.2 467.2 0 0 0 300.16-110.08c32.64-27.52 62.08-58.88 86.4-95.36l-158.72-107.52z" fill="#1E61C1" ></path><path d="M846.08 352m-96 0a96 96 0 1 0 192 0 96 96 0 1 0-192 0Z" fill="#2469D1" ></path></symbol><symbol id="icon-Cnb" viewBox="0 0 1024 1024"><path d="M723.44 144.29a22.335 22.335 0 0 0-6.2475-23.82C694.85 100.55 638.405 58.5875 553.64 52.385c-94.9275-6.96-153.6975 18.75-183.375 37.815-12.81 8.205-13.5225 26.85-1.545 36.255l241.815 189.9c21.315 16.725 52.575 7.275 61.275-18.555l51.63-153.51z m-596.1 563.6775a28.0275 28.0275 0 0 0-11.1525 30.6675c9.2025 33.39 36.6 102.87 114.375 166.0875 77.76 63.2175 169.77 70.035 209.1 69.06a27.525 27.525 0 0 0 25.5525-19.4475L620.225 458.63c11.175-35.79-28.5-65.8125-59.3175-44.8875L127.34 707.975z m113.295-523.0875a27.27 27.27 0 0 0-23.295 1.4175c-28.695 15.78-102.165 64.3875-140.0625 164.25-29.25 76.965-18.945 162.0825-10.905 203.715 2.6475 13.605 16.8525 21.45 29.6325 16.41L561.1025 387.2c33.21-13.11 33.3525-60.555 0.195-73.8225L240.635 184.88z m689.9325 355.215c13.4325 9.2175 31.83 1.0875 34.17-15.1575 6.1725-43.02 11.5125-117.9-13.1325-174.3825-32.8575-75.27-88.62-121.68-115.0875-140.55a21.87 21.87 0 0 0-27.345 1.53L691.805 316.715c-19.17 17.175-17.1825 47.97 4.02 62.5275l234.7425 160.9125v-0.06z m-327.945 401.535c-1.2075 13.995 10.5225 25.5675 24.345 24.0675 44.475-4.815 135.8475-22.65 204.3075-88.7325 66.645-64.305 88.32-140.6625 94.6275-171.045a28.0425 28.0425 0 0 0-5.565-23.265l-205.215-255.9c-22.2225-27.72-66.5325-14.025-69.6225 21.5025l-42.9 493.3725h0.0225z" fill="#F76945" ></path></symbol><symbol id="icon-model" viewBox="0 0 1024 1024"><path d="M745.38097778 241.20888889H796.44444445c94.25578667 0 170.66666667 76.41088 170.66666666 170.66666666v227.55555556c0 94.25578667-76.41088 170.66666667-170.66666666 170.66666667H227.55555555c-94.25578667 0-170.66666667-76.41088-170.66666666-170.66666667V411.87555555c0-94.25578667 76.41088-170.66666667 170.66666666-170.66666666h51.06346667l-20.78492444-124.70272c-4.64896-27.89148445 14.19491555-54.272 42.0864-58.92096 27.89148445-4.64896 54.272 14.19491555 58.92096 42.0864l22.75555555 136.53333333c0.27989333 1.67480889 0.47331555 3.34506667 0.58709334 5.00394667h259.63178666c0.11377778-1.66115555 0.3072-3.32913778 0.58709334-5.00394667l22.75555555-136.53333333c4.64896-27.89148445 31.02947555-46.73536 58.92096-42.0864 27.89148445 4.64896 46.73536 31.02947555 42.0864 58.92096L745.38097778 241.20888889zM227.55555555 343.60888889c-37.70368 0-68.26666667 30.56298667-68.26666666 68.26666666v227.55555556c0 37.70368 30.56298667 68.26666667 68.26666666 68.26666667h568.8888889c37.70368 0 68.26666667-30.56298667 68.26666666-68.26666667V411.87555555c0-37.70368-30.56298667-68.26666667-68.26666666-68.26666666H227.55555555z m56.8888889 623.50222222c-28.27605333 0-51.2-22.92394667-51.2-51.2S256.16839111 864.71111111 284.44444445 864.71111111h455.1111111c28.27605333 0 51.2 22.92394667 51.2 51.2S767.83160889 967.11111111 739.55555555 967.11111111H284.44444445z m-4.55111112-486.96888889c0-28.27605333 22.92394667-51.2 51.2-51.2S382.29333333 451.86616889 382.29333333 480.14222222v45.51111111c0 28.27605333-22.92394667 51.2-51.2 51.2S279.89333333 553.92938667 279.89333333 525.65333333v-45.51111111z m361.81333334 0c0-28.27605333 22.92394667-51.2 51.2-51.2S744.10666667 451.86616889 744.10666667 480.14222222v45.51111111c0 28.27605333-22.92394667 51.2-51.2 51.2S641.70666667 553.92938667 641.70666667 525.65333333v-45.51111111z" fill="#1296db" ></path></symbol><symbol id="icon-qiandaizi" viewBox="0 0 1024 1024"><path d="M652.839385 270.808615a45.449846 45.449846 0 0 0 45.449846-16.384 692.381538 692.381538 0 0 0 47.734154-67.741538A87.748923 87.748923 0 0 0 709.159385 64.433231a173.686154 173.686154 0 0 0-115.003077-23.236923c-40.96 6.380308-74.515692 54.114462-120.91077 59.076923-46.395077 5.041231-90.978462-32.295385-121.383384-29.932308-48.679385 3.150769-72.310154 66.796308-45.449846 116.342154 14.808615 23.630769 31.035077 46.158769 48.600615 67.741538 10.791385 13.784615 28.435692 20.086154 45.449846 16.384a584.231385 584.231385 0 0 1 250.958769 0h1.417847z m-125.479385 77.272616C258.678154 348.16 118.153846 536.418462 118.153846 721.841231c0 112.718769 42.299077 262.774154 409.206154 262.774154s409.127385-150.055385 409.127385-262.774154c0-185.501538-140.445538-373.76-409.127385-373.76z m8.192 285.144615c101.376 24Line truncated
|
||||
window._iconfont_svg_string_5023051='<svg><symbol id="icon-GitCode" viewBox="0 0 1056 1024"><path d="M481.68421063 958.65263187c-84.37894781-9.6-175.83157875-45.47368406-231.91578938-90.44210531-31.83157875-25.2631575-84.37894781-82.8631575-104.08421062-113.17894781-60.12631594-92.96842125-84.37894781-208.16842125-66.18947344-312.75789469 17.68421062-100.54736812 59.11578938-179.36842125 132.37894687-251.11578937 127.32631594-124.8 330.94736813-164.21052656 494.14736813-95.49473719 53.55789469 22.7368425 105.09473719 54.56842125 126.31579031 77.81052656 41.43157875 45.97894781 26.27368406 120.75789469-29.30526375 148.54736813-23.74736812 11.62105219-67.70526281 12.12631594-84.88421063 1.01052656s-32.84210531-41.43157875-36.88421062-72.25263094c-2.02105219-14.65263188-4.54736813-26.77894781-5.05263094-26.77894781-1.01052656 0-13.64210531 7.07368406-27.78947437 15.15789469-46.48421062 27.28421063-60.12631594 31.32631594-131.36842032 35.87368406-37.38947344 2.02105219-78.82105219 5.55789469-91.45263187 7.57894781-23.24210531 3.03157875-51.5368425-1.01052656-96.50526281-15.15789469l-23.74736907-7.57894781 1.01052657 49.01052656c0.50526281 47.49473719 0 50.02105219-20.21052657 91.95789469-26.27368406 54.56842125-35.87368406 87.41052656-39.91578937 135.91578938-9.6 116.71578937 54.0631575 203.62105219 174.82105312 237.97894781 78.31578937 22.23157875 207.6631575 17.68421062 277.89473625-10.10526375 67.2-26.77894781 126.31578937-88.92631594 126.31578938-133.38947344 0-18.18947344-23.24210531-41.43157875-48.50526281-47.49473718-10.61052656-3.03157875-51.03157875-6.56842125-89.43157875-8.08421063-81.34736813-3.5368425-137.9368425-11.11578938-153.6-21.22105219s-23.74736812-38.4-16.67368407-59.62105312c7.07368406-22.23157875 18.18947344-31.83157875 51.03157875-43.95789469 22.23157875-8.58947344 38.4-10.10526281 103.07368407-10.10526281 137.43157875 0 202.10526281 17.17894781 252.63157875 67.70526281 58.10526281 58.61052656 64.16842125 147.5368425 15.15789468 226.35789469-72.25263188 115.70526281-157.64210531 181.89473719-273.34736812 211.70526375-38.90526281 10.61052656-141.97894781 17.17894781-183.91578938 12.12631593z" fill="#D62240" ></path></symbol><symbol id="icon-Codeup" viewBox="0 0 1024 1024"><path d="M241.92 448c0 4.48 0.64 8.32 0.64 12.8C266.88 334.08 378.24 237.44 512 237.44a275.2 275.2 0 0 1 250.24 161.28L936.96 320A467.84 467.84 0 0 0 512 45.44c-2.56 0-5.12 0.64-7.68 0.64C350.08 114.56 241.92 268.16 241.92 448z" fill="#B8CFF4" ></path><path d="M739.84 665.6A275.2 275.2 0 0 1 512 786.56c-65.92 0-125.44-24.32-172.8-62.72-61.44-50.56-101.76-126.08-101.76-211.84 0-17.28 1.92-34.56 5.12-51.2 0-4.48-0.64-8.32-0.64-12.8 0-179.84 107.52-334.08 262.4-401.92C250.88 49.92 45.44 257.28 45.44 512c0 257.28 209.28 466.56 466.56 466.56a467.2 467.2 0 0 0 300.16-110.08c32.64-27.52 62.08-58.88 86.4-95.36l-158.72-107.52z" fill="#1E61C1" ></path><path d="M846.08 352m-96 0a96 96 0 1 0 192 0 96 96 0 1 0-192 0Z" fill="#2469D1" ></path></symbol><symbol id="icon-Cnb" viewBox="0 0 1024 1024"><path d="M723.44 144.29a22.335 22.335 0 0 0-6.2475-23.82C694.85 100.55 638.405 58.5875 553.64 52.385c-94.9275-6.96-153.6975 18.75-183.375 37.815-12.81 8.205-13.5225 26.85-1.545 36.255l241.815 189.9c21.315 16.725 52.575 7.275 61.275-18.555l51.63-153.51z m-596.1 563.6775a28.0275 28.0275 0 0 0-11.1525 30.6675c9.2025 33.39 36.6 102.87 114.375 166.0875 77.76 63.2175 169.77 70.035 209.1 69.06a27.525 27.525 0 0 0 25.5525-19.4475L620.225 458.63c11.175-35.79-28.5-65.8125-59.3175-44.8875L127.34 707.975z m113.295-523.0875a27.27 27.27 0 0 0-23.295 1.4175c-28.695 15.78-102.165 64.3875-140.0625 164.25-29.25 76.965-18.945 162.0825-10.905 203.715 2.6475 13.605 16.8525 21.45 29.6325 16.41L561.1025 387.2c33.21-13.11 33.3525-60.555 0.195-73.8225L240.635 184.88z m689.9325 355.215c13.4325 9.2175 31.83 1.0875 34.17-15.1575 6.1725-43.02 11.5125-117.9-13.1325-174.3825-32.8575-75.27-88.62-121.68-115.0875-140.55a21.87 21.87 0 0 0-27.345 1.53L691.805 316.715c-19.17 17.175-17.1825 47.97 4.02 62.5275l234.7425 160.9125v-0.06z m-327.945 401.535c-1.2075 13.995 10.5225 25.5675 24.345 24.0675 44.475-4.815 135.8475-22.65 204.3075-88.7325 66.645-64.305 88.32-140.6625 94.6275-171.045a28.0425 28.0425 0 0 0-5.565-23.265l-205.215-255.9c-22.2225-27.72-66.5325-14.025-69.6225 21.5025l-42.9 493.3725h0.0225z" fill="#F76945" ></path></symbol><symbol id="icon-model" viewBox="0 0 1024 1024"><path d="M745.38097778 241.20888889H796.44444445c94.25578667 0 170.66666667 76.41088 170.66666666 170.66666666v227.55555556c0 94.25578667-76.41088 170.66666667-170.66666666 170.66666667H227.55555555c-94.25578667 0-170.66666667-76.41088-170.66666666-170.66666667V411.87555555c0-94.25578667 76.41088-170.66666667 170.66666666-170.66666666h51.06346667l-20.78492444-124.70272c-4.64896-27.89148445 14.19491555-54.272 42.0864-58.92096 27.89148445-4.64896 54.272 14.19491555 58.92096 42.0864l22.75555555 136.53333333c0.27989333 1.67480889 0.47331555 3.34506667 0.58709334 5.00394667h259.63178666c0.11377778-1.66115555 Line truncated
|
||||
@@ -22,6 +22,7 @@ export enum ConstsGitPlatform {
|
||||
GitPlatformGitee = "gitee",
|
||||
GitPlatformCodeup = "codeup",
|
||||
GitPlatformCnb = "cnb",
|
||||
GitPlatformAtomGit = "atomgit",
|
||||
GitPlatformInternal = "internal",
|
||||
}
|
||||
|
||||
|
||||
@@ -173,6 +173,9 @@ export function CreateGitBotDialog({ open, onOpenChange, onSuccess }: CreateGitB
|
||||
<SelectItem value={ConstsGitPlatform.GitPlatformCnb}>
|
||||
<Icon name="Cnb" />CNB
|
||||
</SelectItem>
|
||||
<SelectItem value={ConstsGitPlatform.GitPlatformAtomGit}>
|
||||
<Icon name="GitCode" />GitCode
|
||||
</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</FieldContent>
|
||||
|
||||
@@ -158,6 +158,9 @@ export function EditGitBotDialog({ open, onOpenChange, bot, onSuccess }: EditGit
|
||||
<SelectItem value={ConstsGitPlatform.GitPlatformCnb}>
|
||||
<Icon name="Cnb" />CNB
|
||||
</SelectItem>
|
||||
<SelectItem value={ConstsGitPlatform.GitPlatformAtomGit}>
|
||||
<Icon name="GitCode" />GitCode
|
||||
</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</FieldContent>
|
||||
|
||||
@@ -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({
|
||||
<SelectItem value={ConstsGitPlatform.GitPlatformCnb}>
|
||||
<Icon name="Cnb" />CNB
|
||||
</SelectItem>
|
||||
<SelectItem value={ConstsGitPlatform.GitPlatformAtomGit}>
|
||||
<Icon name="GitCode" />GitCode
|
||||
</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</FieldContent>
|
||||
|
||||
@@ -193,6 +193,9 @@ export default function EditIdentity({
|
||||
<SelectItem value={ConstsGitPlatform.GitPlatformCnb}>
|
||||
<Icon name="Cnb" />CNB
|
||||
</SelectItem>
|
||||
<SelectItem value={ConstsGitPlatform.GitPlatformAtomGit}>
|
||||
<Icon name="GitCode" />GitCode
|
||||
</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</FieldContent>
|
||||
|
||||
@@ -96,6 +96,7 @@ function isIdentityWithRepos(identity: DomainGitIdentity): boolean {
|
||||
ConstsGitPlatform.GitPlatformGitLab,
|
||||
ConstsGitPlatform.GitPlatformCodeup,
|
||||
ConstsGitPlatform.GitPlatformCnb,
|
||||
ConstsGitPlatform.GitPlatformAtomGit,
|
||||
].includes(identity.platform as ConstsGitPlatform)
|
||||
}
|
||||
|
||||
|
||||
@@ -47,6 +47,7 @@ function isIdentityWithRepos(identity: DomainGitIdentity): boolean {
|
||||
ConstsGitPlatform.GitPlatformGitLab,
|
||||
ConstsGitPlatform.GitPlatformCodeup,
|
||||
ConstsGitPlatform.GitPlatformCnb,
|
||||
ConstsGitPlatform.GitPlatformAtomGit,
|
||||
].includes(identity.platform as ConstsGitPlatform);
|
||||
}
|
||||
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -353,6 +353,8 @@ export function getRepoIcon(url: string) {
|
||||
return <Icon name="Gitee" className="size-4" />
|
||||
case 'gitea.com':
|
||||
return <Icon name="Gitea" className="size-4" />
|
||||
case 'atomgit.com':
|
||||
return <Icon name="GitCode" className="size-4" />
|
||||
default:
|
||||
return <Icon name="GitHub-Uncolor" className="size-4" />
|
||||
}
|
||||
@@ -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 <Icon name="Codeup" className="size-4" />
|
||||
case 'cnb':
|
||||
return <Icon name="Cnb" className="size-4" />
|
||||
case 'atomgit':
|
||||
return <Icon name="GitCode" className="size-4" />
|
||||
default:
|
||||
return <IconHelpHexagon className="size-4" />
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user