prime-dev-cli 2.0.7 → 2.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. package/config/projects.json +80 -24
  2. package/dist/server/.next/BUILD_ID +1 -1
  3. package/dist/server/.next/app-build-manifest.json +3 -3
  4. package/dist/server/.next/build-manifest.json +2 -2
  5. package/dist/server/.next/cache/.rscinfo +1 -1
  6. package/dist/server/.next/cache/.tsbuildinfo +1 -1
  7. package/dist/server/.next/cache/eslint/.cache_1qa5vxt +1 -1
  8. package/dist/server/.next/fallback-build-manifest.json +2 -2
  9. package/dist/server/.next/next-minimal-server.js.nft.json +1 -1
  10. package/dist/server/.next/next-server.js.nft.json +1 -1
  11. package/dist/server/.next/prerender-manifest.json +3 -3
  12. package/dist/server/.next/server/app/_not-found.html +1 -1
  13. package/dist/server/.next/server/app/_not-found.rsc +1 -1
  14. package/dist/server/.next/server/app/api/admin-git-batch-create-branch/route.js.nft.json +1 -1
  15. package/dist/server/.next/server/app/api/admin-git-batch-delete-branch/route.js.nft.json +1 -1
  16. package/dist/server/.next/server/app/api/admin-git-batch-merge/route.js.nft.json +1 -1
  17. package/dist/server/.next/server/app/api/admin-git-batch-probe-remote-branch/route.js.nft.json +1 -1
  18. package/dist/server/.next/server/app/api/batch-list-branches/route.js +1 -1
  19. package/dist/server/.next/server/app/api/batch-list-branches/route.js.nft.json +1 -1
  20. package/dist/server/.next/server/app/api/batch-list-submodule-branches/route.js +1 -1
  21. package/dist/server/.next/server/app/api/batch-list-submodule-branches/route.js.nft.json +1 -1
  22. package/dist/server/.next/server/app/api/batch-switch-branch/route.js.nft.json +1 -1
  23. package/dist/server/.next/server/app/api/batch-switch-submodule-branch/route.js.nft.json +1 -1
  24. package/dist/server/.next/server/app/api/branch/switch/route.js.nft.json +1 -1
  25. package/dist/server/.next/server/app/api/branches/route.js.nft.json +1 -1
  26. package/dist/server/.next/server/app/api/check-workspace/route.js.nft.json +1 -1
  27. package/dist/server/.next/server/app/api/gwh-git-flow/route.js.nft.json +1 -1
  28. package/dist/server/.next/server/app/api/initialize-workspace/route.js.nft.json +1 -1
  29. package/dist/server/.next/server/app/api/microapp-proxy-config/route.js.nft.json +1 -1
  30. package/dist/server/.next/server/app/api/open-project/route.js.nft.json +1 -1
  31. package/dist/server/.next/server/app/api/project-config/route.js.nft.json +1 -1
  32. package/dist/server/.next/server/app/api/retry-project/route.js.nft.json +1 -1
  33. package/dist/server/.next/server/app/api/submodule-info/route.js.nft.json +1 -1
  34. package/dist/server/.next/server/app/api/uat-git-flow/route.js +2 -2
  35. package/dist/server/.next/server/app/api/uat-git-flow/route.js.nft.json +1 -1
  36. package/dist/server/.next/server/app/api/uat-git-flow/step/route.js +2 -2
  37. package/dist/server/.next/server/app/api/uat-git-flow/step/route.js.nft.json +1 -1
  38. package/dist/server/.next/server/app/configuration/page/app-build-manifest.json +1 -1
  39. package/dist/server/.next/server/app/configuration/page_client-reference-manifest.js +1 -1
  40. package/dist/server/.next/server/app/configuration.html +1 -1
  41. package/dist/server/.next/server/app/configuration.rsc +2 -2
  42. package/dist/server/.next/server/app/index.html +1 -1
  43. package/dist/server/.next/server/app/index.rsc +1 -1
  44. package/dist/server/.next/server/app/initialization/page/app-build-manifest.json +2 -2
  45. package/dist/server/.next/server/app/initialization/page.js.nft.json +1 -1
  46. package/dist/server/.next/server/app/initialization/page_client-reference-manifest.js +1 -1
  47. package/dist/server/.next/server/app/initialization.html +1 -1
  48. package/dist/server/.next/server/app/initialization.rsc +2 -2
  49. package/dist/server/.next/server/chunks/[root-of-the-server]__6c7b8215._.js +3 -0
  50. package/dist/server/.next/server/chunks/[root-of-the-server]__6c7b8215._.js.map +1 -0
  51. package/dist/server/.next/server/chunks/[root-of-the-server]__c52380bc._.js +3 -0
  52. package/dist/server/.next/server/chunks/[root-of-the-server]__c52380bc._.js.map +1 -0
  53. package/dist/server/.next/server/chunks/_24087f66._.js +1 -1
  54. package/dist/server/.next/server/chunks/_24087f66._.js.map +1 -1
  55. package/dist/server/.next/server/chunks/_61c263b3._.js +1 -1
  56. package/dist/server/.next/server/chunks/_61c263b3._.js.map +1 -1
  57. package/dist/server/.next/server/chunks/packages_server_42b02aec._.js +3 -0
  58. package/dist/server/.next/server/chunks/packages_server_42b02aec._.js.map +1 -0
  59. package/dist/server/.next/server/chunks/packages_server_854cbe00._.js +3 -0
  60. package/dist/server/.next/server/chunks/packages_server_854cbe00._.js.map +1 -0
  61. package/dist/server/.next/server/chunks/ssr/_283bdc73._.js +1 -1
  62. package/dist/server/.next/server/chunks/ssr/_283bdc73._.js.map +1 -1
  63. package/dist/server/.next/server/chunks/ssr/_c7905e3c._.js +1 -1
  64. package/dist/server/.next/server/chunks/ssr/_c7905e3c._.js.map +1 -1
  65. package/dist/server/.next/server/chunks/ssr/packages_server_src_622c27d6._.js +3 -0
  66. package/dist/server/.next/server/chunks/ssr/packages_server_src_622c27d6._.js.map +1 -0
  67. package/dist/server/.next/server/pages/404.html +1 -1
  68. package/dist/server/.next/server/pages/500.html +1 -1
  69. package/dist/server/.next/server/server-reference-manifest.js +1 -1
  70. package/dist/server/.next/server/server-reference-manifest.json +1 -1
  71. package/dist/server/.next/static/chunks/16b23f7570a551e1.js +3 -0
  72. package/dist/server/.next/static/chunks/{736431eeff70b2b7.js → 4e8de43e1f6c5336.js} +2 -2
  73. package/dist/server/.next/static/chunks/{51509164bafe1e57.js.map → 84a2f16086c26ab1.js.map} +1 -1
  74. package/dist/server/.next/static/chunks/b109f2fb91f36e31.js.map +1 -0
  75. package/dist/server/.next/static/chunks/{1ae3fa2333c12687.js → f3137530db91c282.js} +2 -2
  76. package/dist/server/.next/static/chunks/{227a962f4584edf8.js.map → fa09d2a29cc42906.js.map} +1 -1
  77. package/dist/server/.next/trace +2 -2
  78. package/package.json +1 -1
  79. package/plugin-marketplace/plugins/prime-dev-cli/skills/prime-workspace/SKILL.md +112 -22
  80. package/skills/prime-workspace/README.md +20 -2
  81. package/skills/prime-workspace/SKILL.md +510 -214
  82. package/skills/prime-workspace/references/api-contracts.md +125 -0
  83. package/skills/prime-workspace/references/microfrontend-proxy.md +155 -0
  84. package/dist/server/.next/server/chunks/[root-of-the-server]__131fe141._.js +0 -3
  85. package/dist/server/.next/server/chunks/[root-of-the-server]__131fe141._.js.map +0 -1
  86. package/dist/server/.next/server/chunks/[root-of-the-server]__36b87de0._.js +0 -3
  87. package/dist/server/.next/server/chunks/[root-of-the-server]__36b87de0._.js.map +0 -1
  88. package/dist/server/.next/server/chunks/packages_server_ccc16996._.js +0 -3
  89. package/dist/server/.next/server/chunks/packages_server_ccc16996._.js.map +0 -1
  90. package/dist/server/.next/server/chunks/packages_server_d1209331._.js +0 -3
  91. package/dist/server/.next/server/chunks/packages_server_d1209331._.js.map +0 -1
  92. package/dist/server/.next/server/chunks/ssr/packages_server_src_65e3de99._.js +0 -3
  93. package/dist/server/.next/server/chunks/ssr/packages_server_src_65e3de99._.js.map +0 -1
  94. package/dist/server/.next/static/chunks/6f824bb5811ceebd.js +0 -3
  95. package/dist/server/.next/static/chunks/f9854e63365b2956.js.map +0 -1
  96. /package/dist/server/.next/static/{Dz7Ultbv0aaqF3m4OrOHQ → zjt6jXsNQxDdU-RHF8TC7}/_buildManifest.js +0 -0
  97. /package/dist/server/.next/static/{Dz7Ultbv0aaqF3m4OrOHQ → zjt6jXsNQxDdU-RHF8TC7}/_clientMiddlewareManifest.json +0 -0
  98. /package/dist/server/.next/static/{Dz7Ultbv0aaqF3m4OrOHQ → zjt6jXsNQxDdU-RHF8TC7}/_ssgManifest.js +0 -0
@@ -0,0 +1,3 @@
1
+ module.exports={94011:a=>{"use strict";var{g:b,__dirname:c}=a;{a.s({default:()=>l});var d=a.i(99559),e=a.i(57560),f=a.i(50923),g=a.i(94688),h=a.i(24640),i=a.i(72408),j=a.i(37897),k=a.i(56414);let b="submodules/common";function l({projectName:a,variant:c,onSwitched:l,refreshSignal:m}){let n="sub"===c,[o,p]=(0,e.useState)(null),[q,r]=(0,e.useState)(null),[s,t]=(0,e.useState)(!1),[u,v]=(0,e.useState)([]),[w,x]=(0,e.useState)(!1),[y,z]=(0,e.useState)(null),[A,B]=(0,e.useState)(""),[C,D]=(0,e.useState)(null),[E,F]=(0,e.useState)(null),G=(0,e.useRef)(null),H=a=>{F(a),G.current&&clearTimeout(G.current),G.current=setTimeout(()=>F(null),5e3)},I=(0,e.useCallback)(async()=>{if(n)try{let c=await fetch(`/api/submodule-info?project=${encodeURIComponent(a)}&subPath=${encodeURIComponent(b)}`),d=await c.json();d.success&&d.data&&(r(!!d.data.exists),p(d.data))}catch(b){console.error(`获取子仓库信息失败 (${a}):`,b)}else try{let b=await fetch(`/api/branches?project=${encodeURIComponent(a)}`),c=await b.json();c.success&&c.data?.exists&&p({exists:!0,currentBranch:c.data.currentBranch||null,detached:!1,commitHash:""})}catch(b){console.error(`获取项目分支信息失败 (${a}):`,b)}},[n,a]),J=(0,e.useCallback)(async()=>{x(!0),z(null);try{let c=n?`&subPath=${encodeURIComponent(b)}`:"",d=await fetch(`/api/branches?project=${encodeURIComponent(a)}${c}`),e=await d.json();e.success?v(e.data?.branches||[]):z(e.error||"获取远程分支失败")}catch(b){console.error(`获取远程分支失败 (${a}):`,b),z("网络请求失败")}finally{x(!1)}},[n,a]);(0,e.useEffect)(()=>{I()},[I,m]),(0,e.useEffect)(()=>()=>{G.current&&clearTimeout(G.current)},[]);let K=async c=>{if(!C&&c!==o?.currentBranch){D(c);try{let d=await fetch("/api/branch/switch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n?{projectName:a,branchName:c,subPath:b}:{projectName:a,branchName:c})}),e=await d.json();e.success?(t(!1),B(""),await I(),l?.()):(t(!1),B(""),H(e.error||"切换分支失败"))}catch(b){console.error(`切换分支失败 (${a}):`,b),t(!1),H("切换分支失败: 网络错误")}finally{D(null)}}};if(n&&!1===q)return null;let L=o?o.detached?o.commitHash?`(detached) ${o.commitHash}`:"(detached)":o.currentBranch||"未知分支":"",{visible:M,total:N}=(0,k.filterBranchOptions)(u,A),O=n?"flex items-center gap-1.5 px-2 py-1 bg-purple-50 border border-purple-200 rounded-md min-w-0":"flex items-center gap-1.5 px-2 py-1 bg-blue-50 border border-blue-200 rounded-md min-w-0",P=n?"text-xs font-medium text-purple-700 truncate shrink-0 max-w-[8rem]":"text-xs font-medium text-blue-700 truncate shrink-0 max-w-[8rem]",Q=n?"flex items-center gap-1 text-xs font-medium text-purple-800 hover:bg-purple-100 rounded px-1 transition-colors min-w-0":"flex items-center gap-1 text-xs font-medium text-blue-800 hover:bg-blue-100 rounded px-1 transition-colors min-w-0";return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:O,children:[n&&(0,d.jsx)("span",{className:P,title:`子仓库: ${a}/${b}`,children:"common"}),(0,d.jsxs)(h.DropdownMenu,{open:s,onOpenChange:a=>{t(a),a&&(B(""),J())},children:[(0,d.jsx)(h.DropdownMenuTrigger,{asChild:!0,children:(0,d.jsxs)("button",{type:"button",className:Q,title:n?`点击切换子仓库(${a}/submodules/common)分支`:`点击切换 ${a} 分支`,children:[(0,d.jsx)("span",{className:"truncate max-w-[10rem]",children:L}),(0,d.jsx)(j.ChevronDownIcon,{className:"size-3 opacity-60 shrink-0"})]})}),(0,d.jsxs)(h.DropdownMenuContent,{align:"start",className:"w-72",children:[(0,d.jsx)("div",{className:"p-1",children:(0,d.jsx)(g.Input,{value:A,onChange:a=>B(a.target.value),placeholder:"搜索分支...",className:"h-8"})}),(0,d.jsx)(h.DropdownMenuSeparator,{}),w&&(0,d.jsxs)("div",{className:"flex items-center justify-center gap-2 px-3 py-4 text-sm text-gray-500",children:[(0,d.jsx)("span",{className:"animate-spin w-3 h-3 border-2 border-blue-500 border-t-transparent rounded-full"}),"加载远程分支中..."]}),!w&&y&&(0,d.jsxs)("div",{className:"px-3 py-3 text-sm",children:[(0,d.jsx)("p",{className:"text-red-600",children:y}),(0,d.jsx)(f.Button,{variant:"outline",size:"sm",onClick:J,className:"mt-2 h-7 px-2 text-xs",children:"重试"})]}),!w&&!y&&0===u.length&&(0,d.jsx)("div",{className:"px-3 py-4 text-sm text-gray-500",children:"暂无远程分支"}),!w&&!y&&u.length>0&&0===N&&(0,d.jsx)("div",{className:"px-3 py-4 text-sm text-gray-500",children:"没有匹配的分支"}),!w&&!y&&N>0&&(0,d.jsxs)("div",{className:"max-h-64 overflow-y-auto",children:[M.map(a=>(0,d.jsxs)(h.DropdownMenuItem,{disabled:null!==C,className:"flex items-center justify-between",onSelect:b=>{b.preventDefault(),K(a)},children:[(0,d.jsx)("span",{className:"min-w-0 flex-1 truncate",children:a}),(0,d.jsxs)("span",{className:"flex items-center gap-2 shrink-0",children:[a===o?.currentBranch&&(0,d.jsx)(i.CheckIcon,{className:"size-4 text-blue-600"}),C===a&&(0,d.jsx)("span",{className:"animate-spin w-3 h-3 border-2 border-blue-500 border-t-transparent rounded-full"})]})]},a)),N>M.length&&(0,d.jsxs)("div",{className:"px-3 py-2 text-xs text-gray-400 border-t",children:["共 ",N," 个匹配分支,仅展示前 ",M.length," 项,更多请使用上方搜索"]})]})]})]})]}),E&&(0,d.jsx)("div",{className:"fixed top-16 right-4 z-50 max-w-sm px-4 py-3 bg-red-50 border border-red-200 rounded-md shadow-lg text-sm text-red-600",children:E})]})}}},67450:a=>{"use strict";var{g:b,__dirname:c}=a;{a.s({PROJECT_CONFIG_PATH:()=>c,ProjectStatus:()=>f,WORKSPACE_CONFIG:()=>b});var d=a.i(13442),e=a.i(30331);let b={WORKSPACE_ROOT:(0,e.join)((0,d.homedir)(),"Documents","prime-workspace"),GIT_TIMEOUT:3e5,MAX_CONCURRENT_CLONES:Math.max(2,Math.min((0,d.cpus)().length,8)),MAX_RETRY_ATTEMPTS:3},c=(0,e.join)((0,d.homedir)(),".prime-projects.json");var f=function(a){return a.PENDING="pending",a.EXISTING="existing",a.CLONING="cloning",a.SUCCESS="success",a.FAILED="failed",a.RETRYING="retrying",a.INCOMPLETE="incomplete",a}({})}},93121:a=>{"use strict";var{g:b,__dirname:c}=a;{a.s({DEFAULT_UAT_BASE_BRANCH:()=>c,UAT_BASE_BRANCH_OPTIONS:()=>b,UAT_FINAL_MERGE_TARGETS:()=>f,getUatFinalMergeTargets:()=>e,isAllowedUatBaseBranch:()=>d});let b=["main","main-new"],c="main";function d(a){return b.includes(a)}let f={main:["main","fix/main"],"main-new":["main-new"]};function e(a){return f[a]??[a]}}},90250:a=>{"use strict";var{g:b,__dirname:c}=a;{a.s({buildBatchProbeRemoteBranchPayload:()=>x,buildBatchSwitchBranchPayload:()=>u,buildBatchSwitchSubBranchPayload:()=>w,default:()=>b,mapProbeRemoteBranchResultText:()=>y,validateBatchProbeRemoteBranchForm:()=>s,validateBatchSwitchBranchForm:()=>t,validateBatchSwitchSubBranchForm:()=>v});var d=a.i(99559),e=a.i(57560),f=a.i(40490),g=a.i(50923),h=a.i(2031),i=a.i(94011),j=a.i(94688),k=a.i(58413),l=a.i(24640),m=a.i(72408),n=a.i(37897),o=a.i(22529),p=a.i(67450),q=a.i(56414),r=a.i(93121);function s(a,b){let c=[];return 0===a.length&&c.push("请先选择至少一个项目。"),b.trim()||c.push("请填写远端分支名称。"),c}function t(a,b){let c=[];return 0===a.length&&c.push("请先选择至少一个项目。"),b.trim()||c.push("请选择目标分支。"),c}function u(a,b,c){return{projects:[a],branchName:b.trim(),dryRun:c}}function v(a,b){let c=[];return 0===a.length&&c.push("请先选择至少一个项目。"),b.trim()||c.push("请选择子仓库目标分支。"),c}function w(a,b,c){return{projects:[a],branchName:b.trim(),dryRun:c}}function x(a,b,c){return{projects:[a],branchName:b.trim(),dryRun:c}}function y(a){return!0===a.exists?"存在":!1===a.exists?"不存在":a.success?"成功":"执行失败"}let b=()=>{let a=(0,f.useRouter)(),[b,c]=(0,e.useState)({isInitializing:!1,isCompleted:!1,isLoading:!0,hasCompleted:!1,globalProgress:0,globalMessage:"正在检查工作空间状态...",projects:{}}),[z,A]=(0,e.useState)({selectedProjects:[],createBranch:"release/",baseBranch:r.DEFAULT_UAT_BASE_BRANCH,mergeBranch:"feature/"}),[B,C]=(0,e.useState)({isRunning:!1,operationLogs:[],feedbacks:[],runId:""}),[D,E]=(0,e.useState)({selectedProjects:[],createBranch:"release/",baseBranch:"GWH",mergeBranch:"feature/"}),[F,G]=(0,e.useState)({isRunning:!1,operationLogs:[],feedbacks:[],runId:""}),[H,I]=(0,e.useState)({selectedProjects:[],targetBranch:"main",sourceBranch:""}),[J,K]=(0,e.useState)({isRunning:!1,operationLogs:[],feedbacks:[],progress:0,totalProjects:0,completedProjects:0,currentProject:""}),[L,M]=(0,e.useState)({selectedProjects:[],createBranch:"",baseBranch:"main"}),[N,O]=(0,e.useState)({isRunning:!1,operationLogs:[],feedbacks:[],progress:0,totalProjects:0,completedProjects:0,currentProject:""}),[P,Q]=(0,e.useState)({selectedProjects:[],branchName:""}),[R,S]=(0,e.useState)({isRunning:!1,operationLogs:[],feedbacks:[],progress:0,totalProjects:0,completedProjects:0,currentProject:""}),[T,U]=(0,e.useState)({selectedProjects:[],branchName:""}),[V,W]=(0,e.useState)({isRunning:!1,operationLogs:[],feedbacks:[],progress:0,totalProjects:0,completedProjects:0,currentProject:""}),[X,Y]=(0,e.useState)({selectedProjects:[],branchName:""}),[Z,$]=(0,e.useState)({isRunning:!1,operationLogs:[],feedbacks:[],progress:0,totalProjects:0,completedProjects:0,currentProject:""}),[_,aa]=(0,e.useState)([]),[ab,ac]=(0,e.useState)(!1),[ad,ae]=(0,e.useState)(null),[af,ag]=(0,e.useState)(!1),[ah,ai]=(0,e.useState)(""),[aj,ak]=(0,e.useState)([]),[al,am]=(0,e.useState)(!1),[an,ao]=(0,e.useState)({selectedProjects:[],branchName:""}),[ap,aq]=(0,e.useState)({isRunning:!1,operationLogs:[],feedbacks:[],progress:0,totalProjects:0,completedProjects:0,currentProject:""}),[ar,as]=(0,e.useState)([]),[at,au]=(0,e.useState)(!1),[av,aw]=(0,e.useState)(null),[ax,ay]=(0,e.useState)(!1),[az,aA]=(0,e.useState)(""),[aB,aC]=(0,e.useState)([]),[aD,aE]=(0,e.useState)(!1),[aF,aG]=(0,e.useState)(!1),[aH,aI]=(0,e.useState)(null),[aJ,aK]=(0,e.useState)(!1),[aL,aM]=(0,e.useState)(!1),[aN,aO]=(0,e.useState)([]),[aP,aQ]=(0,e.useState)({}),[aR,aS]=(0,e.useState)({});(0,e.useEffect)(()=>{aT()},[]),(0,e.useEffect)(()=>{(async()=>{try{let a=await fetch("/api/admin-status"),b=await a.json();aG(!!b?.isAdmin)}catch(a){console.error("获取管理员状态失败:",a),aG(!1)}})()},[]);let aT=async()=>{try{c(a=>({...a,isLoading:!0,globalMessage:"正在检查工作空间状态..."}));let a=await fetch("/api/check-workspace"),b=await a.json();if(b.success){let a={};b.projects.forEach(b=>{a[b.name]={name:b.name,status:b.status,progress:100*(b.status===p.ProjectStatus.EXISTING),message:b.message,canRetry:!1,needsCleanup:b.needsCleanup||!1}}),c(c=>({...c,isLoading:!1,projects:a,globalMessage:b.message||"检查完成"}))}else c(a=>({...a,isLoading:!1,globalMessage:b.error||"检查工作空间状态失败"}))}catch(a){c(a=>({...a,isLoading:!1,globalMessage:"无法连接到服务器,请刷新页面重试"})),console.error("检查工作空间状态失败:",a)}},aU=a=>{switch(a.type){case"initialization":case"workspace_created":case"projects_loaded":if(c(b=>({...b,globalProgress:a.progress||0,globalMessage:a.message||""})),a.projects&&Array.isArray(a.projects)){let b={};a.projects.forEach(a=>{b[a]={name:a,status:p.ProjectStatus.PENDING,progress:0,message:"等待开始...",canRetry:!1}}),c(a=>({...a,projects:b}))}break;case"project_existing":if(a.projectName){let b=a.projectName;c(c=>({...c,globalProgress:a.progress??c.globalProgress,globalMessage:a.message??"",projects:{...c.projects,[b]:{...c.projects[b],status:p.ProjectStatus.EXISTING,message:"项目已存在",progress:100,canRetry:!1}}}))}break;case"project_start":if(a.projectName){let b=a.projectName;c(c=>({...c,globalProgress:a.progress??c.globalProgress,globalMessage:a.message??"",projects:{...c.projects,[b]:{...c.projects[b],status:p.ProjectStatus.CLONING,message:"开始克隆...",progress:0}}}))}break;case"project_progress":if(a.projectName){let b=a.projectName;c(c=>({...c,globalProgress:a.progress??c.globalProgress,projects:{...c.projects,[b]:{...c.projects[b],message:a.message??"",progress:Math.min(a.progress??0,100)}}}))}break;case"project_success":if(a.projectName){let b=a.projectName;c(c=>({...c,globalProgress:a.progress??c.globalProgress,projects:{...c.projects,[b]:{...c.projects[b],status:p.ProjectStatus.SUCCESS,message:"克隆成功",progress:100,canRetry:!1}}}))}break;case"project_failed":if(a.projectName){let b=a.projectName;c(c=>({...c,globalProgress:a.progress??c.globalProgress,projects:{...c.projects,[b]:{...c.projects[b],status:p.ProjectStatus.FAILED,message:"克隆失败",error:a.error,canRetry:!0}}}))}break;case"command_log":if(a.projectName&&a.logType&&void 0!==a.content&&a.timestamp){let b=a.projectName,d=a.logType,e=a.content,f=a.timestamp;c(a=>({...a,projects:{...a.projects,[b]:{...a.projects[b],logs:[...a.projects[b]?.logs||[],{type:d,content:e,timestamp:f}].slice(-1e3)}}}))}break;case"completion":c(b=>({...b,isInitializing:!1,isCompleted:!0,hasCompleted:!0,globalProgress:100,globalMessage:a.message??"初始化完成",completionSummary:a.result?{success:a.result.success,totalProjects:a.result.totalProjects,successCount:a.result.successCount,failedCount:a.result.failedCount,duration:a.result.duration}:void 0}));break;case"error":c(b=>({...b,isInitializing:!1,hasCompleted:!0,globalMessage:a.message??"发生错误",globalProgress:a.progress??b.globalProgress}))}},aV=async(a,b="cursor")=>{c(b=>({...b,projects:{...b.projects,[a]:{...b.projects[a],isOpening:!0}}}));try{let d=await fetch("/api/open-project",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectName:a,editor:b})}),e=await d.json();if(e.success&&e.editorUrl){let a=document.createElement("a");a.href=e.editorUrl,a.style.display="none",document.body.appendChild(a),a.click(),document.body.removeChild(a)}else console.error("打开项目失败:",e.error);c(b=>({...b,projects:{...b.projects,[a]:{...b.projects[a],isOpening:!1}}}))}catch(b){c(b=>({...b,projects:{...b.projects,[a]:{...b.projects[a],isOpening:!1}}})),console.error("打开项目失败:",b)}},aW=async a=>{c(b=>({...b,projects:{...b.projects,[a]:{...b.projects[a],isCleaningUp:!0}}}));try{let b=await fetch("/api/cleanup-project",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectName:a})}),d=await b.json();d.success?c(b=>({...b,projects:{...b.projects,[a]:{...b.projects[a],status:p.ProjectStatus.PENDING,message:"已清理,待克隆",isCleaningUp:!1,needsCleanup:!1}}})):c(b=>({...b,projects:{...b.projects,[a]:{...b.projects[a],isCleaningUp:!1,error:d.error}}}))}catch(b){c(c=>({...c,projects:{...c.projects,[a]:{...c.projects[a],isCleaningUp:!1,error:b instanceof Error?b.message:String(b)}}}))}},aX=async a=>{c(b=>({...b,projects:{...b.projects,[a]:{...b.projects[a],status:p.ProjectStatus.RETRYING,message:"正在重试...",progress:0,canRetry:!1}}}));try{let b=await fetch("/api/retry-project",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectName:a})}),d=await b.json();c(b=>({...b,projects:{...b.projects,[a]:{...b.projects[a],status:d.success?p.ProjectStatus.SUCCESS:p.ProjectStatus.FAILED,message:d.message,error:d.error,progress:d.success?100:b.projects[a].progress,canRetry:!d.success}}}))}catch(b){c(c=>({...c,projects:{...c.projects,[a]:{...c.projects[a],status:p.ProjectStatus.FAILED,message:"重试失败",error:b instanceof Error?b.message:String(b),canRetry:!0}}}))}},aY=a=>{switch(a){case p.ProjectStatus.EXISTING:case p.ProjectStatus.SUCCESS:return"text-green-600 bg-green-50 border-green-200";case p.ProjectStatus.FAILED:return"text-red-600 bg-red-50 border-red-200";case p.ProjectStatus.INCOMPLETE:return"text-orange-600 bg-orange-50 border-orange-200";case p.ProjectStatus.CLONING:case p.ProjectStatus.RETRYING:return"text-blue-600 bg-blue-50 border-blue-200";case p.ProjectStatus.PENDING:default:return"text-gray-600 bg-gray-50 border-gray-200"}},aZ=a=>{switch(a){case p.ProjectStatus.PENDING:return"待克隆";case p.ProjectStatus.EXISTING:return"已存在";case p.ProjectStatus.CLONING:return"克隆中";case p.ProjectStatus.SUCCESS:return"成功";case p.ProjectStatus.FAILED:return"失败";case p.ProjectStatus.INCOMPLETE:return"不完整";case p.ProjectStatus.RETRYING:return"重试中";default:return"未知"}},a$=()=>{let a=Object.values(b.projects);return a.length>0&&a.every(a=>a.status===p.ProjectStatus.EXISTING)},a_=b=>{a.push(`/configuration?project=${encodeURIComponent(b)}`)},a0=(a,b)=>{A(c=>({...c,[a]:b}))},a1=(a,b)=>{E(c=>({...c,[a]:b}))},a2=(a,b)=>{I(c=>({...c,[a]:b}))},a3=(a,b)=>{M(c=>({...c,[a]:b}))},a4=a=>{Q(b=>({...b,branchName:a}))},a5=a=>{U(b=>({...b,branchName:a}))},a6=a=>{Y(b=>({...b,branchName:a})),ag(!1),ai("")},a7=async()=>{let a=X.selectedProjects.length>0?X.selectedProjects:Object.keys(b.projects);if(0===a.length){ae("暂无可用的项目"),aa([]);return}ac(!0),ae(null);try{let b=await fetch("/api/batch-list-branches",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projects:a})}),c=await b.json();c.success?(aa(c.branches||[]),Array.isArray(c.failedProjects)&&c.failedProjects.length>0&&ae(`${c.failedProjects.length} 个项目获取分支失败(已跳过): ${c.failedProjects.map(a=>a.projectName).join(", ")}`)):(ae(c.error||"获取分支列表失败"),aa([]))}catch(a){console.error("获取批量分支列表失败:",a),ae("网络请求失败"),aa([])}finally{ac(!1)}},a8=async a=>{let b=[];if(0===H.selectedProjects.length&&b.push("请先选择至少一个项目。"),H.targetBranch.trim()||b.push("请填写合入分支名称。"),H.sourceBranch.trim()||b.push("请填写被合入分支名称。"),b.length>0)return void K({isRunning:!1,operationLogs:[],feedbacks:b,progress:0,totalProjects:0,completedProjects:0,currentProject:""});let c=H.selectedProjects.length;K({isRunning:!0,operationLogs:[`开始批量分支合并,共 ${c} 个项目...`],feedbacks:[],progress:0,totalProjects:c,completedProjects:0,currentProject:""});let d=[],e=[];for(let b=0;b<H.selectedProjects.length;b++){let f=H.selectedProjects[b];K(a=>({...a,currentProject:f,completedProjects:b,progress:Math.round(b/c*100),operationLogs:[...a.operationLogs,`[进度] ${b+1}/${c} 开始处理项目 ${f}`]}));try{let b=await fetch("/api/admin-git-batch-merge",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projects:[f],targetBranch:H.targetBranch.trim(),sourceBranch:H.sourceBranch.trim(),dryRun:a})}),c=await b.json(),g=Array.isArray(c.operationLogs)?c.operationLogs:[],h=Array.isArray(c.feedbacks)?c.feedbacks:[c.error||"执行失败"];K(a=>({...a,operationLogs:[...a.operationLogs,...g],feedbacks:[...a.feedbacks,...h]})),e.push(...h),Array.isArray(c.projectResults)&&d.push(...c.projectResults)}catch(b){let a=b instanceof Error?b.message:"执行失败";K(b=>({...b,operationLogs:[...b.operationLogs,`[${f}] 请求失败: ${a}`],feedbacks:[...b.feedbacks,`[${f}] ${a}`]})),e.push(`[${f}] ${a}`),d.push({projectName:f,success:!1,reason:a})}}K(a=>({...a,isRunning:!1,progress:100,completedProjects:c,currentProject:"",operationLogs:[...a.operationLogs,"批量分支合并执行完成。"],feedbacks:e.length>0?e:a.feedbacks})),d.length>0?(aO(d),aM(!0)):(aO([]),aM(!1))},a9=async a=>{let b=[];if(0===L.selectedProjects.length&&b.push("请先选择至少一个项目。"),L.createBranch.trim()||b.push("请填写新分支名称。"),L.baseBranch.trim()||b.push("请填写来源分支名称。"),b.length>0)return void O({isRunning:!1,operationLogs:[],feedbacks:b,progress:0,totalProjects:0,completedProjects:0,currentProject:""});let c=L.selectedProjects.length;O({isRunning:!0,operationLogs:[`开始批量新建分支,共 ${c} 个项目...`],feedbacks:[],progress:0,totalProjects:c,completedProjects:0,currentProject:""});let d=[],e=[];for(let b=0;b<L.selectedProjects.length;b++){let f=L.selectedProjects[b];O(a=>({...a,currentProject:f,completedProjects:b,progress:Math.round(b/c*100),operationLogs:[...a.operationLogs,`[进度] ${b+1}/${c} 开始处理项目 ${f}`]}));try{let b=await fetch("/api/admin-git-batch-create-branch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projects:[f],createBranch:L.createBranch.trim(),baseBranch:L.baseBranch.trim(),dryRun:a})}),c=await b.json(),g=Array.isArray(c.operationLogs)?c.operationLogs:[],h=Array.isArray(c.feedbacks)?c.feedbacks:[c.error||"执行失败"];O(a=>({...a,operationLogs:[...a.operationLogs,...g],feedbacks:[...a.feedbacks,...h]})),e.push(...h),Array.isArray(c.projectResults)&&d.push(...c.projectResults)}catch(b){let a=b instanceof Error?b.message:"执行失败";O(b=>({...b,operationLogs:[...b.operationLogs,`[${f}] 请求失败: ${a}`],feedbacks:[...b.feedbacks,`[${f}] ${a}`]})),e.push(`[${f}] ${a}`),d.push({projectName:f,success:!1,reason:a})}}O(a=>({...a,isRunning:!1,progress:100,completedProjects:c,currentProject:"",operationLogs:[...a.operationLogs,"批量新建分支执行完成。"],feedbacks:e.length>0?e:a.feedbacks})),d.length>0?(aO(d),aM(!0)):(aO([]),aM(!1))},ba=async a=>{let b=[];if(0===P.selectedProjects.length&&b.push("请先选择至少一个项目。"),P.branchName.trim()||b.push("请填写远端分支名称。"),b.length>0)return void S({isRunning:!1,operationLogs:[],feedbacks:b,progress:0,totalProjects:0,completedProjects:0,currentProject:""});let c=P.selectedProjects.length;S({isRunning:!0,operationLogs:[`开始批量删除远端分支,共 ${c} 个项目...`],feedbacks:[],progress:0,totalProjects:c,completedProjects:0,currentProject:""});let d=[],e=[];for(let b=0;b<P.selectedProjects.length;b++){let f=P.selectedProjects[b];S(a=>({...a,currentProject:f,completedProjects:b,progress:Math.round(b/c*100),operationLogs:[...a.operationLogs,`[进度] ${b+1}/${c} 开始处理项目 ${f}`]}));try{let b=await fetch("/api/admin-git-batch-delete-branch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projects:[f],branchName:P.branchName.trim(),dryRun:a})}),c=await b.json(),g=Array.isArray(c.operationLogs)?c.operationLogs:[],h=Array.isArray(c.feedbacks)?c.feedbacks:[c.error||"执行失败"];S(a=>({...a,operationLogs:[...a.operationLogs,...g],feedbacks:[...a.feedbacks,...h]})),e.push(...h),Array.isArray(c.projectResults)&&d.push(...c.projectResults)}catch(b){let a=b instanceof Error?b.message:"执行失败";S(b=>({...b,operationLogs:[...b.operationLogs,`[${f}] 请求失败: ${a}`],feedbacks:[...b.feedbacks,`[${f}] ${a}`]})),e.push(`[${f}] ${a}`),d.push({projectName:f,success:!1,reason:a})}}S(a=>({...a,isRunning:!1,progress:100,completedProjects:c,currentProject:"",operationLogs:[...a.operationLogs,"批量删除远端分支执行完成。"],feedbacks:e.length>0?e:a.feedbacks})),d.length>0?(aO(d),aM(!0)):(aO([]),aM(!1))},bb=async a=>{let b=s(T.selectedProjects,T.branchName);if(b.length>0)return void W({isRunning:!1,operationLogs:[],feedbacks:b,progress:0,totalProjects:0,completedProjects:0,currentProject:""});let c=T.selectedProjects.length;W({isRunning:!0,operationLogs:[`开始批量探测远端分支,共 ${c} 个项目...`],feedbacks:[],progress:0,totalProjects:c,completedProjects:0,currentProject:""});let d=[],e=[];for(let b=0;b<T.selectedProjects.length;b++){let f=T.selectedProjects[b];W(a=>({...a,currentProject:f,completedProjects:b,progress:Math.round(b/c*100),operationLogs:[...a.operationLogs,`[进度] ${b+1}/${c} 开始处理项目 ${f}`]}));try{let b=await fetch("/api/admin-git-batch-probe-remote-branch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(x(f,T.branchName,a))}),c=await b.json(),g=Array.isArray(c.operationLogs)?c.operationLogs:[],h=Array.isArray(c.feedbacks)?c.feedbacks:[c.error||"执行失败"];W(a=>({...a,operationLogs:[...a.operationLogs,...g],feedbacks:[...a.feedbacks,...h]})),e.push(...h),Array.isArray(c.projectResults)&&d.push(...c.projectResults)}catch(b){let a=b instanceof Error?b.message:"执行失败";W(b=>({...b,operationLogs:[...b.operationLogs,`[${f}] 请求失败: ${a}`],feedbacks:[...b.feedbacks,`[${f}] ${a}`]})),e.push(`[${f}] ${a}`),d.push({projectName:f,success:!1,reason:a})}}W(a=>({...a,isRunning:!1,progress:100,completedProjects:c,currentProject:"",operationLogs:[...a.operationLogs,"批量探测远端分支执行完成。"],feedbacks:e.length>0?e:a.feedbacks})),d.length>0?(aO(d),aM(!0)):(aO([]),aM(!1))},bc=async a=>{let b=t(X.selectedProjects,X.branchName);if(b.length>0)return void $({isRunning:!1,operationLogs:[],feedbacks:b,progress:0,totalProjects:0,completedProjects:0,currentProject:""});let c=X.selectedProjects.length,d=X.branchName.trim();$({isRunning:!0,operationLogs:[`开始批量切换分支${a?"(DRY RUN)":""},目标分支: ${d},共 ${c} 个项目...`],feedbacks:[],progress:0,totalProjects:c,completedProjects:0,currentProject:""});let e=[],f=[];for(let b=0;b<X.selectedProjects.length;b++){let g=X.selectedProjects[b];$(a=>({...a,currentProject:g,completedProjects:b,progress:Math.round(b/c*100),operationLogs:[...a.operationLogs,`[进度] ${b+1}/${c} 开始处理项目 ${g}`]}));try{let b=await fetch("/api/batch-switch-branch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(u(g,d,a))}),c=await b.json(),h=Array.isArray(c.operationLogs)?c.operationLogs:[],i=Array.isArray(c.feedbacks)?c.feedbacks:[c.error||"执行失败"];$(a=>({...a,operationLogs:[...a.operationLogs,...h],feedbacks:[...a.feedbacks,...i]})),f.push(...i),Array.isArray(c.projectResults)&&e.push(...c.projectResults)}catch(b){let a=b instanceof Error?b.message:"执行失败";$(b=>({...b,operationLogs:[...b.operationLogs,`[${g}] 请求失败: ${a}`],feedbacks:[...b.feedbacks,`[${g}] ${a}`]})),f.push(`[${g}] ${a}`),e.push({projectName:g,success:!1,reason:a})}}let g=e.filter(a=>a.success).length,h=e.length-g;$(a=>({...a,isRunning:!1,progress:100,completedProjects:c,currentProject:"",operationLogs:[...a.operationLogs,`批量切换分支执行完成。总结: 共 ${e.length} 个项目,成功 ${g} 个,失败 ${h} 个。`],feedbacks:f.length>0?f:a.feedbacks})),e.length>0?(ak(e),am(!0)):(ak([]),am(!1)),bd(e.map(a=>a.projectName))},bd=a=>{aS(b=>{let c={...b};return a.forEach(a=>{c[a]=(c[a]||0)+1}),c})},be=a=>{ao(b=>({...b,branchName:a})),ay(!1),aA("")},bf=async()=>{let a=an.selectedProjects.length>0?an.selectedProjects:Object.keys(b.projects);if(0===a.length){aw("暂无可用的项目"),as([]);return}au(!0),aw(null);try{let b=await fetch("/api/batch-list-submodule-branches",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projects:a})}),c=await b.json();c.success?(as(c.branches||[]),Array.isArray(c.failedProjects)&&c.failedProjects.length>0&&aw(`${c.failedProjects.length} 个项目获取子仓库分支失败(已跳过): ${c.failedProjects.map(a=>a.projectName).join(", ")}`)):(aw(c.error||"获取子仓库分支列表失败"),as([]))}catch(a){console.error("获取批量子仓库分支列表失败:",a),aw("网络请求失败"),as([])}finally{au(!1)}},bg=async a=>{let b=v(an.selectedProjects,an.branchName);if(b.length>0)return void aq({isRunning:!1,operationLogs:[],feedbacks:b,progress:0,totalProjects:0,completedProjects:0,currentProject:""});let c=an.selectedProjects.length,d=an.branchName.trim();aq({isRunning:!0,operationLogs:[`开始批量切换子仓库(submodules/common)分支${a?"(DRY RUN)":""},目标分支: ${d},共 ${c} 个项目...`],feedbacks:[],progress:0,totalProjects:c,completedProjects:0,currentProject:""});let e=[],f=[];for(let b=0;b<an.selectedProjects.length;b++){let g=an.selectedProjects[b];aq(a=>({...a,currentProject:g,completedProjects:b,progress:Math.round(b/c*100),operationLogs:[...a.operationLogs,`[进度] ${b+1}/${c} 开始处理项目 ${g}`]}));try{let b=await fetch("/api/batch-switch-submodule-branch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(w(g,d,a))}),c=await b.json(),h=Array.isArray(c.operationLogs)?c.operationLogs:[],i=Array.isArray(c.feedbacks)?c.feedbacks:[c.error||"执行失败"];aq(a=>({...a,operationLogs:[...a.operationLogs,...h],feedbacks:[...a.feedbacks,...i]})),f.push(...i),Array.isArray(c.projectResults)&&e.push(...c.projectResults)}catch(b){let a=b instanceof Error?b.message:"执行失败";aq(b=>({...b,operationLogs:[...b.operationLogs,`[${g}] 请求失败: ${a}`],feedbacks:[...b.feedbacks,`[${g}] ${a}`]})),f.push(`[${g}] ${a}`),e.push({projectName:g,success:!1,reason:a})}}let g=e.filter(a=>a.success).length,h=e.length-g;aq(a=>({...a,isRunning:!1,progress:100,completedProjects:c,currentProject:"",operationLogs:[...a.operationLogs,`批量切换子仓库分支执行完成。总结: 共 ${e.length} 个项目,成功 ${g} 个,失败 ${h} 个。`],feedbacks:f.length>0?f:a.feedbacks})),e.length>0?(aC(e),aE(!0)):(aC([]),aE(!1)),bd(e.map(a=>a.projectName))},bh=async a=>{let b=[];if(0===z.selectedProjects.length&&b.push("请先选择至少一个项目。"),z.createBranch.trim()||b.push("请填写创建分支名。"),z.baseBranch.trim()||b.push("请填写从 origin 哪个分支创建。"),z.mergeBranch.trim()||b.push("请填写被合并分支名称。"),b.length>0)return void C({isRunning:!1,operationLogs:[],feedbacks:b,runId:""});let c=`uat-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;C({isRunning:!0,operationLogs:[],feedbacks:[],runId:c});try{let b=await fetch("/api/uat-git-flow",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projects:z.selectedProjects,createBranch:z.createBranch.trim(),baseBranch:z.baseBranch,mergeBranch:z.mergeBranch.trim(),dryRun:a,runId:c})}),d=await b.json();C({isRunning:!1,operationLogs:Array.isArray(d.operationLogs)?d.operationLogs:[],feedbacks:Array.isArray(d.feedbacks)?d.feedbacks:[d.error||"执行失败"],runId:""}),Array.isArray(d.projectResults)&&(aO(d.projectResults),aM(!0))}catch(a){C({isRunning:!1,operationLogs:[],feedbacks:[a instanceof Error?a.message:"执行失败"],runId:""}),aO([]),aM(!1)}},bi=async a=>{let b=[];if(0===D.selectedProjects.length&&b.push("请先选择至少一个项目。"),D.createBranch.trim()||b.push("请填写创建分支名。"),D.baseBranch.trim()||b.push("请填写从 origin 哪个分支创建。"),D.mergeBranch.trim()||b.push("请填写被合并分支名称。"),b.length>0)return void G({isRunning:!1,operationLogs:[],feedbacks:b,runId:""});let c=`gwh-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;G({isRunning:!0,operationLogs:[],feedbacks:[],runId:c});try{let b=await fetch("/api/gwh-git-flow",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projects:D.selectedProjects,createBranch:D.createBranch.trim(),baseBranch:"GWH",mergeBranch:D.mergeBranch.trim(),dryRun:a,runId:c})}),d=await b.json();G({isRunning:!1,operationLogs:Array.isArray(d.operationLogs)?d.operationLogs:[],feedbacks:Array.isArray(d.feedbacks)?d.feedbacks:[d.error||"执行失败"],runId:""}),Array.isArray(d.projectResults)&&(aO(d.projectResults),aM(!0))}catch(a){G({isRunning:!1,operationLogs:[],feedbacks:[a instanceof Error?a.message:"执行失败"],runId:""}),aO([]),aM(!1)}},bj=async()=>{if(aH&&B.runId)try{let a=await fetch("/api/uat-git-flow/step",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"execute",runId:B.runId,stepId:aH.stepId})}),b=await a.json(),c=Array.isArray(b.operationLogs)?b.operationLogs:[],d=Array.isArray(b.feedbacks)?b.feedbacks:[b.error||"执行失败"];if(!b.success){C(a=>({...a,isRunning:!1,operationLogs:c,feedbacks:d,runId:""})),aI(null),aK(!1);return}C(a=>({...a,operationLogs:c,feedbacks:d,isRunning:!b.isComplete,runId:b.isComplete?"":a.runId})),b.nextStep?(aI(b.nextStep),aK(!0)):(aI(null),aK(!1),Array.isArray(b.projectResults)&&(aO(b.projectResults),aM(!0)))}catch(a){C(b=>({...b,isRunning:!1,operationLogs:b.operationLogs,feedbacks:[...b.feedbacks,a instanceof Error?a.message:"执行失败"],runId:""})),aI(null),aK(!1)}},bk=async()=>{if(B.runId)try{let a=await fetch("/api/uat-git-flow/abort",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runId:B.runId})}),b=await a.json();b&&Array.isArray(b.operationLogs)?C(a=>({...a,isRunning:!1,operationLogs:b.operationLogs,feedbacks:Array.isArray(b.feedbacks)?b.feedbacks:a.feedbacks,runId:""})):C(a=>({...a,isRunning:!1,runId:""})),Array.isArray(b.projectResults)&&(aO(b.projectResults),aM(!0)),aI(null),aK(!1)}catch(a){C(b=>({...b,feedbacks:[...b.feedbacks,a instanceof Error?a.message:"中断失败"]}))}},bl=async()=>{if(F.runId)try{let a=await fetch("/api/gwh-git-flow/abort",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runId:F.runId})}),b=await a.json();b&&Array.isArray(b.operationLogs)?G(a=>({...a,isRunning:!1,operationLogs:b.operationLogs,feedbacks:Array.isArray(b.feedbacks)?b.feedbacks:a.feedbacks,runId:""})):G(a=>({...a,isRunning:!1,runId:""})),Array.isArray(b.projectResults)&&(aO(b.projectResults),aM(!0))}catch(a){G(b=>({...b,feedbacks:[...b.feedbacks,a instanceof Error?a.message:"中断失败"]}))}},bm=(0,q.filterBranchOptions)(_,ah),bn=(0,q.filterBranchOptions)(ar,az);return(0,d.jsxs)("div",{className:"container mx-auto p-4 sm:p-6 md:p-8",children:[(0,d.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,d.jsx)("h1",{className:"text-2xl font-bold",children:"项目初始化"}),b.isLoading?(0,d.jsx)(g.Button,{disabled:!0,children:"检查中..."}):(0,d.jsx)(g.Button,{onClick:()=>{c(a=>({...a,isInitializing:!0,isCompleted:!1,hasCompleted:!1,globalProgress:0,globalMessage:"正在连接服务器...",projects:{},completionSummary:void 0}));let a=new EventSource("/api/initialize-workspace");a.onmessage=a=>{try{let b=JSON.parse(a.data);aU(b)}catch(a){console.error("解析 SSE 消息失败:",a)}},a.onerror=()=>{c(a=>a.hasCompleted?a:{...a,isInitializing:!1,globalMessage:"连接服务器失败,请重试"}),a.close()},a.addEventListener("error",()=>{a.close()})},disabled:b.isInitializing,children:b.isInitializing?"初始化中...":"创建项目空间"})]}),(b.isInitializing||b.isCompleted)&&!a$()&&(0,d.jsxs)("div",{className:"mb-6 p-4 bg-gray-50 rounded-lg",children:[(0,d.jsxs)("div",{className:"flex justify-between items-center mb-2",children:[(0,d.jsx)("span",{className:"text-sm font-medium",children:b.globalMessage}),(0,d.jsxs)("span",{className:"text-sm text-gray-600",children:[b.globalProgress,"%"]})]}),(0,d.jsx)("div",{className:"w-full bg-gray-200 rounded-full h-2",children:(0,d.jsx)("div",{className:"bg-blue-600 h-2 rounded-full transition-all duration-300",style:{width:`${b.globalProgress}%`}})})]}),b.completionSummary&&!a$()&&(0,d.jsxs)("div",{className:`mb-6 p-4 rounded-lg border ${b.completionSummary.success?"bg-green-50 border-green-200":"bg-yellow-50 border-yellow-200"}`,children:[(0,d.jsx)("h3",{className:"font-semibold mb-2",children:"初始化完成"}),(0,d.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 text-sm",children:[(0,d.jsxs)("div",{children:["总项目数: ",b.completionSummary.totalProjects]}),(0,d.jsxs)("div",{className:"text-green-600",children:["成功: ",b.completionSummary.successCount]}),(0,d.jsxs)("div",{className:"text-red-600",children:["失败: ",b.completionSummary.failedCount]}),(0,d.jsxs)("div",{children:["耗时: ",Math.round(b.completionSummary.duration/1e3),"s"]})]})]}),(0,d.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4",children:Object.keys(b.projects).length>0?Object.values(b.projects).map(a=>(0,d.jsxs)("div",{className:`border rounded-lg p-4 ${aY(a.status)}`,children:[(0,d.jsxs)("div",{className:"flex justify-between items-start mb-2",children:[(0,d.jsx)("h2",{className:"font-semibold cursor-pointer hover:text-blue-600 transition-colors",onClick:()=>a_(a.name),title:"点击进入项目配置",children:a.name}),(0,d.jsx)("span",{className:"text-xs px-2 py-1 rounded-full bg-white",children:aZ(a.status)})]}),(0,d.jsx)("p",{className:"text-sm mb-2",children:a.message}),a.status===p.ProjectStatus.CLONING||a.status===p.ProjectStatus.RETRYING?(0,d.jsxs)("div",{className:"mb-2",children:[(0,d.jsx)("div",{className:"w-full bg-white rounded-full h-1",children:(0,d.jsx)("div",{className:"bg-current h-1 rounded-full transition-all duration-300",style:{width:`${a.progress}%`}})}),(0,d.jsxs)("span",{className:"text-xs",children:[a.progress,"%"]})]}):null,a.error&&(0,d.jsx)("p",{className:"text-xs text-red-600 mb-2",children:a.error}),(a.status===p.ProjectStatus.EXISTING||a.status===p.ProjectStatus.SUCCESS)&&(0,d.jsx)("div",{className:"mb-2",children:(0,d.jsx)(i.default,{projectName:a.name,variant:"main",refreshSignal:aR[a.name]||0,onSwitched:()=>aS(b=>({...b,[a.name]:(b[a.name]||0)+1}))})}),(a.status===p.ProjectStatus.EXISTING||a.status===p.ProjectStatus.SUCCESS)&&(0,d.jsx)("div",{className:"mb-2",children:(0,d.jsx)(i.default,{projectName:a.name,variant:"sub",refreshSignal:aR[a.name]||0})}),(0,d.jsxs)("div",{className:"space-y-2",children:[a.canRetry&&(0,d.jsx)(g.Button,{size:"sm",variant:"outline",onClick:()=>aX(a.name),className:"w-full",children:"重试"}),a.needsCleanup&&a.status===p.ProjectStatus.INCOMPLETE&&(0,d.jsx)(g.Button,{size:"sm",variant:"destructive",onClick:()=>aW(a.name),disabled:a.isCleaningUp,className:"w-full",children:a.isCleaningUp?"清理中...":"清理项目"}),(a.status===p.ProjectStatus.EXISTING||a.status===p.ProjectStatus.SUCCESS)&&(0,d.jsx)(h.EditorSplitButton,{onOpen:b=>aV(a.name,b),loading:a.isOpening,loadingText:"打开中...",size:"sm",variant:"default",className:"w-full"}),a.logs&&a.logs.length>0&&(0,d.jsx)(g.Button,{size:"sm",variant:"outline",onClick:()=>aQ(b=>({...b,[a.name]:!b[a.name]})),className:"w-full",children:aP[a.name]?"隐藏日志":`查看日志 (${a.logs.length})`})]}),aP[a.name]&&a.logs&&a.logs.length>0&&(0,d.jsx)("div",{className:"mt-3 border-t pt-3",children:(0,d.jsx)("div",{className:"bg-black text-white rounded text-xs font-mono p-2 max-h-48 overflow-y-auto",children:a.logs.map((a,b)=>(0,d.jsxs)("div",{className:`mb-1 ${"stderr"===a.type?"text-red-400":"progress"===a.type?"text-yellow-400":"text-green-400"}`,children:[(0,d.jsx)("span",{className:"text-gray-500 mr-2",children:new Date(a.timestamp).toLocaleTimeString()}),(0,d.jsxs)("span",{className:"text-blue-400 mr-2",children:["[",a.type,"]"]}),(0,d.jsx)("span",{className:"whitespace-pre-wrap",children:a.content})]},b))})})]},a.name)):(0,d.jsx)("div",{className:"col-span-full text-center text-gray-500 py-8",children:b.isLoading?"正在检查项目状态...":b.isInitializing?"正在加载项目...":'点击"创建项目空间"开始初始化'})}),aF&&(0,d.jsxs)("div",{className:"mt-8 rounded-lg border bg-white p-4 shadow-sm",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between mb-4",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold",children:"UAT上线前 Git 操作流"}),(0,d.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,d.jsx)(g.Button,{onClick:()=>bh(!1),disabled:B.isRunning,children:B.isRunning?"执行中...":"执行"}),(0,d.jsx)(g.Button,{variant:"outline",onClick:()=>bh(!0),disabled:B.isRunning,children:"DRY RUN"}),(0,d.jsx)(g.Button,{variant:"destructive",onClick:bk,disabled:!B.isRunning,children:"中断"})]})]}),(0,d.jsxs)("div",{className:"grid gap-4 md:grid-cols-2",children:[(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)(k.Label,{htmlFor:"uat-projects",children:"选择项目"}),(0,d.jsx)("select",{id:"uat-projects",multiple:!0,value:z.selectedProjects,onChange:a=>{let b=Array.from(a.target.selectedOptions).map(a=>a.value);A(a=>({...a,selectedProjects:b}))},className:"w-full min-h-[140px] rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-xs focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",children:0===Object.keys(b.projects).length?(0,d.jsx)("option",{value:"",disabled:!0,children:"暂无可用项目"}):Object.keys(b.projects).map(a=>(0,d.jsx)("option",{value:a,children:a},a))}),(0,d.jsx)("p",{className:"text-xs text-gray-500",children:"按住 Command / Ctrl 可多选"})]}),(0,d.jsxs)("div",{className:"grid gap-4",children:[(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)(k.Label,{htmlFor:"uat-create-branch",children:"创建分支名"}),(0,d.jsx)(j.Input,{id:"uat-create-branch",value:z.createBranch,onChange:a=>a0("createBranch",a.target.value),placeholder:"例如: release/uat-2026-01"})]}),(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)(k.Label,{htmlFor:"uat-base-branch",children:"从 origin 哪个分支创建"}),(0,d.jsx)("select",{id:"uat-base-branch",value:z.baseBranch,onChange:a=>a0("baseBranch",a.target.value),className:"w-full h-9 rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-xs focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",children:r.UAT_BASE_BRANCH_OPTIONS.map(a=>(0,d.jsx)("option",{value:a,children:a},a))})]}),(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)(k.Label,{htmlFor:"uat-merge-branch",children:"被合并分支名称"}),(0,d.jsx)(j.Input,{id:"uat-merge-branch",value:z.mergeBranch,onChange:a=>a0("mergeBranch",a.target.value),placeholder:"例如: feature/xxx"})]})]})]}),(0,d.jsxs)("div",{className:"mt-6 grid gap-4 md:grid-cols-2",children:[(0,d.jsxs)("div",{className:"rounded-lg border p-3",children:[(0,d.jsx)("h3",{className:"text-sm font-semibold mb-2",children:"操作记录"}),0===B.operationLogs.length?(0,d.jsx)("p",{className:"text-xs text-gray-500",children:"暂无记录"}):(0,d.jsx)("div",{className:"bg-black text-white rounded text-xs font-mono p-2 max-h-48 overflow-y-auto",children:B.operationLogs.map((a,b)=>(0,d.jsx)("div",{className:"mb-1 whitespace-pre-wrap",children:a},b))})]}),(0,d.jsxs)("div",{className:"rounded-lg border p-3",children:[(0,d.jsx)("h3",{className:"text-sm font-semibold mb-2",children:"反馈信息"}),0===B.feedbacks.length?(0,d.jsx)("p",{className:"text-xs text-gray-500",children:"暂无反馈"}):(0,d.jsx)("div",{className:"space-y-1 text-sm",children:B.feedbacks.map((a,b)=>(0,d.jsx)("div",{className:"rounded bg-gray-50 px-2 py-1 text-gray-700",children:a},b))})]})]})]}),aF&&(0,d.jsxs)("div",{className:"mt-8 rounded-lg border bg-white p-4 shadow-sm",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between mb-4",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold",children:"武汉协和版本上线前 Git 操作流"}),(0,d.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,d.jsx)(g.Button,{onClick:()=>bi(!1),disabled:F.isRunning,children:F.isRunning?"执行中...":"执行"}),(0,d.jsx)(g.Button,{variant:"outline",onClick:()=>bi(!0),disabled:F.isRunning,children:"DRY RUN"}),(0,d.jsx)(g.Button,{variant:"destructive",onClick:bl,disabled:!F.isRunning,children:"中断"})]})]}),(0,d.jsxs)("div",{className:"grid gap-4 md:grid-cols-2",children:[(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)(k.Label,{htmlFor:"gwh-projects",children:"选择项目"}),(0,d.jsx)("select",{id:"gwh-projects",multiple:!0,value:D.selectedProjects,onChange:a=>{let b=Array.from(a.target.selectedOptions).map(a=>a.value);E(a=>({...a,selectedProjects:b}))},className:"w-full min-h-[140px] rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-xs focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",children:0===Object.keys(b.projects).length?(0,d.jsx)("option",{value:"",disabled:!0,children:"暂无可用项目"}):Object.keys(b.projects).map(a=>(0,d.jsx)("option",{value:a,children:a},a))}),(0,d.jsx)("p",{className:"text-xs text-gray-500",children:"按住 Command / Ctrl 可多选"})]}),(0,d.jsxs)("div",{className:"grid gap-4",children:[(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)(k.Label,{htmlFor:"gwh-create-branch",children:"创建分支名"}),(0,d.jsx)(j.Input,{id:"gwh-create-branch",value:D.createBranch,onChange:a=>a1("createBranch",a.target.value),placeholder:"例如: release/whxh-2026-03"})]}),(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)(k.Label,{htmlFor:"gwh-base-branch",children:"从 origin 哪个分支创建(固定)"}),(0,d.jsx)(j.Input,{id:"gwh-base-branch",value:D.baseBranch,disabled:!0,placeholder:"GWH"})]}),(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)(k.Label,{htmlFor:"gwh-merge-branch",children:"被合并分支名称"}),(0,d.jsx)(j.Input,{id:"gwh-merge-branch",value:D.mergeBranch,onChange:a=>a1("mergeBranch",a.target.value),placeholder:"例如: feature/xxx"})]})]})]}),(0,d.jsxs)("div",{className:"mt-6 grid gap-4 md:grid-cols-2",children:[(0,d.jsxs)("div",{className:"rounded-lg border p-3",children:[(0,d.jsx)("h3",{className:"text-sm font-semibold mb-2",children:"操作记录"}),0===F.operationLogs.length?(0,d.jsx)("p",{className:"text-xs text-gray-500",children:"暂无记录"}):(0,d.jsx)("div",{className:"bg-black text-white rounded text-xs font-mono p-2 max-h-48 overflow-y-auto",children:F.operationLogs.map((a,b)=>(0,d.jsx)("div",{className:"mb-1 whitespace-pre-wrap",children:a},b))})]}),(0,d.jsxs)("div",{className:"rounded-lg border p-3",children:[(0,d.jsx)("h3",{className:"text-sm font-semibold mb-2",children:"反馈信息"}),0===F.feedbacks.length?(0,d.jsx)("p",{className:"text-xs text-gray-500",children:"暂无反馈"}):(0,d.jsx)("div",{className:"space-y-1 text-sm",children:F.feedbacks.map((a,b)=>(0,d.jsx)("div",{className:"rounded bg-gray-50 px-2 py-1 text-gray-700",children:a},b))})]})]})]}),aF&&(0,d.jsxs)("div",{className:"mt-8 rounded-lg border bg-white p-4 shadow-sm",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between mb-4",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold",children:"常用 Git 分支操作 · 批量分支合并"}),(0,d.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,d.jsx)(g.Button,{onClick:()=>a8(!1),disabled:J.isRunning,children:J.isRunning?"执行中...":"执行"}),(0,d.jsx)(g.Button,{variant:"outline",onClick:()=>a8(!0),disabled:J.isRunning,children:"DRY RUN"})]})]}),(0,d.jsxs)("div",{className:"grid gap-4 md:grid-cols-2",children:[(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)(k.Label,{htmlFor:"batch-merge-projects",children:"选择项目"}),(0,d.jsx)("select",{id:"batch-merge-projects",multiple:!0,value:H.selectedProjects,onChange:a=>{let b=Array.from(a.target.selectedOptions).map(a=>a.value);I(a=>({...a,selectedProjects:b}))},className:"w-full min-h-[140px] rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-xs focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",children:0===Object.keys(b.projects).length?(0,d.jsx)("option",{value:"",disabled:!0,children:"暂无可用项目"}):Object.keys(b.projects).map(a=>(0,d.jsx)("option",{value:a,children:a},a))}),(0,d.jsx)("p",{className:"text-xs text-gray-500",children:"按住 Command / Ctrl 可多选"})]}),(0,d.jsxs)("div",{className:"grid gap-4",children:[(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)(k.Label,{htmlFor:"batch-merge-target-branch",children:"合入分支名称"}),(0,d.jsx)(j.Input,{id:"batch-merge-target-branch",value:H.targetBranch,onChange:a=>a2("targetBranch",a.target.value),placeholder:"例如: main"})]}),(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)(k.Label,{htmlFor:"batch-merge-source-branch",children:"被合入分支名称"}),(0,d.jsx)(j.Input,{id:"batch-merge-source-branch",value:H.sourceBranch,onChange:a=>a2("sourceBranch",a.target.value),placeholder:"例如: release/candidate"})]})]})]}),(J.isRunning||J.progress>0)&&(0,d.jsxs)("div",{className:"mt-4 rounded-lg border p-3",children:[(0,d.jsxs)("div",{className:"flex justify-between items-center mb-2 text-sm",children:[(0,d.jsxs)("span",{children:["进度: ",J.completedProjects,"/",J.totalProjects,J.currentProject?` \xb7 当前项目: ${J.currentProject}`:""]}),(0,d.jsxs)("span",{children:[J.progress,"%"]})]}),(0,d.jsx)("div",{className:"w-full bg-gray-200 rounded-full h-2",children:(0,d.jsx)("div",{className:"bg-blue-600 h-2 rounded-full transition-all duration-300",style:{width:`${J.progress}%`}})})]}),(0,d.jsxs)("div",{className:"mt-6 grid gap-4 md:grid-cols-2",children:[(0,d.jsxs)("div",{className:"rounded-lg border p-3",children:[(0,d.jsx)("h3",{className:"text-sm font-semibold mb-2",children:"操作记录"}),0===J.operationLogs.length?(0,d.jsx)("p",{className:"text-xs text-gray-500",children:"暂无记录"}):(0,d.jsx)("div",{className:"bg-black text-white rounded text-xs font-mono p-2 max-h-48 overflow-y-auto",children:J.operationLogs.map((a,b)=>(0,d.jsx)("div",{className:"mb-1 whitespace-pre-wrap",children:a},b))})]}),(0,d.jsxs)("div",{className:"rounded-lg border p-3",children:[(0,d.jsx)("h3",{className:"text-sm font-semibold mb-2",children:"反馈信息"}),0===J.feedbacks.length?(0,d.jsx)("p",{className:"text-xs text-gray-500",children:"暂无反馈"}):(0,d.jsx)("div",{className:"space-y-1 text-sm",children:J.feedbacks.map((a,b)=>(0,d.jsx)("div",{className:"rounded bg-gray-50 px-2 py-1 text-gray-700",children:a},b))})]})]})]}),aF&&(0,d.jsxs)("div",{className:"mt-8 rounded-lg border bg-white p-4 shadow-sm",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between mb-4",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold",children:"常用 Git 分支操作 · 批量新建分支"}),(0,d.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,d.jsx)(g.Button,{onClick:()=>a9(!1),disabled:N.isRunning,children:N.isRunning?"执行中...":"执行"}),(0,d.jsx)(g.Button,{variant:"outline",onClick:()=>a9(!0),disabled:N.isRunning,children:"DRY RUN"})]})]}),(0,d.jsxs)("div",{className:"grid gap-4 md:grid-cols-2",children:[(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)(k.Label,{htmlFor:"batch-create-branch-projects",children:"选择项目"}),(0,d.jsx)("select",{id:"batch-create-branch-projects",multiple:!0,value:L.selectedProjects,onChange:a=>{let b=Array.from(a.target.selectedOptions).map(a=>a.value);M(a=>({...a,selectedProjects:b}))},className:"w-full min-h-[140px] rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-xs focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",children:0===Object.keys(b.projects).length?(0,d.jsx)("option",{value:"",disabled:!0,children:"暂无可用项目"}):Object.keys(b.projects).map(a=>(0,d.jsx)("option",{value:a,children:a},a))}),(0,d.jsx)("p",{className:"text-xs text-gray-500",children:"按住 Command / Ctrl 可多选"})]}),(0,d.jsxs)("div",{className:"grid gap-4",children:[(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)(k.Label,{htmlFor:"batch-create-branch-name",children:"新分支名称"}),(0,d.jsx)(j.Input,{id:"batch-create-branch-name",value:L.createBranch,onChange:a=>a3("createBranch",a.target.value),placeholder:"例如: release/2026-03"})]}),(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)(k.Label,{htmlFor:"batch-create-branch-base",children:"来源分支名称"}),(0,d.jsx)(j.Input,{id:"batch-create-branch-base",value:L.baseBranch,onChange:a=>a3("baseBranch",a.target.value),placeholder:"例如: main"})]})]})]}),(N.isRunning||N.progress>0)&&(0,d.jsxs)("div",{className:"mt-4 rounded-lg border p-3",children:[(0,d.jsxs)("div",{className:"flex justify-between items-center mb-2 text-sm",children:[(0,d.jsxs)("span",{children:["进度: ",N.completedProjects,"/",N.totalProjects,N.currentProject?` \xb7 当前项目: ${N.currentProject}`:""]}),(0,d.jsxs)("span",{children:[N.progress,"%"]})]}),(0,d.jsx)("div",{className:"w-full bg-gray-200 rounded-full h-2",children:(0,d.jsx)("div",{className:"bg-blue-600 h-2 rounded-full transition-all duration-300",style:{width:`${N.progress}%`}})})]}),(0,d.jsxs)("div",{className:"mt-6 grid gap-4 md:grid-cols-2",children:[(0,d.jsxs)("div",{className:"rounded-lg border p-3",children:[(0,d.jsx)("h3",{className:"text-sm font-semibold mb-2",children:"操作记录"}),0===N.operationLogs.length?(0,d.jsx)("p",{className:"text-xs text-gray-500",children:"暂无记录"}):(0,d.jsx)("div",{className:"bg-black text-white rounded text-xs font-mono p-2 max-h-48 overflow-y-auto",children:N.operationLogs.map((a,b)=>(0,d.jsx)("div",{className:"mb-1 whitespace-pre-wrap",children:a},b))})]}),(0,d.jsxs)("div",{className:"rounded-lg border p-3",children:[(0,d.jsx)("h3",{className:"text-sm font-semibold mb-2",children:"反馈信息"}),0===N.feedbacks.length?(0,d.jsx)("p",{className:"text-xs text-gray-500",children:"暂无反馈"}):(0,d.jsx)("div",{className:"space-y-1 text-sm",children:N.feedbacks.map((a,b)=>(0,d.jsx)("div",{className:"rounded bg-gray-50 px-2 py-1 text-gray-700",children:a},b))})]})]})]}),aF&&(0,d.jsxs)("div",{className:"mt-8 rounded-lg border bg-white p-4 shadow-sm",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between mb-4",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold",children:"常用 Git 分支操作 · 批量删除远端分支"}),(0,d.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,d.jsx)(g.Button,{onClick:()=>ba(!1),disabled:R.isRunning,children:R.isRunning?"执行中...":"执行"}),(0,d.jsx)(g.Button,{variant:"outline",onClick:()=>ba(!0),disabled:R.isRunning,children:"DRY RUN"})]})]}),(0,d.jsxs)("div",{className:"grid gap-4 md:grid-cols-2",children:[(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)(k.Label,{htmlFor:"batch-delete-branch-projects",children:"选择项目"}),(0,d.jsx)("select",{id:"batch-delete-branch-projects",multiple:!0,value:P.selectedProjects,onChange:a=>{let b=Array.from(a.target.selectedOptions).map(a=>a.value);Q(a=>({...a,selectedProjects:b}))},className:"w-full min-h-[140px] rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-xs focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",children:0===Object.keys(b.projects).length?(0,d.jsx)("option",{value:"",disabled:!0,children:"暂无可用项目"}):Object.keys(b.projects).map(a=>(0,d.jsx)("option",{value:a,children:a},a))}),(0,d.jsx)("p",{className:"text-xs text-gray-500",children:"按住 Command / Ctrl 可多选"})]}),(0,d.jsx)("div",{className:"grid gap-4",children:(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)(k.Label,{htmlFor:"batch-delete-branch-name",children:"远端分支名称"}),(0,d.jsx)(j.Input,{id:"batch-delete-branch-name",value:P.branchName,onChange:a=>a4(a.target.value),placeholder:"例如: release/2026-03"})]})})]}),(R.isRunning||R.progress>0)&&(0,d.jsxs)("div",{className:"mt-4 rounded-lg border p-3",children:[(0,d.jsxs)("div",{className:"flex justify-between items-center mb-2 text-sm",children:[(0,d.jsxs)("span",{children:["进度: ",R.completedProjects,"/",R.totalProjects,R.currentProject?` \xb7 当前项目: ${R.currentProject}`:""]}),(0,d.jsxs)("span",{children:[R.progress,"%"]})]}),(0,d.jsx)("div",{className:"w-full bg-gray-200 rounded-full h-2",children:(0,d.jsx)("div",{className:"bg-blue-600 h-2 rounded-full transition-all duration-300",style:{width:`${R.progress}%`}})})]}),(0,d.jsxs)("div",{className:"mt-6 grid gap-4 md:grid-cols-2",children:[(0,d.jsxs)("div",{className:"rounded-lg border p-3",children:[(0,d.jsx)("h3",{className:"text-sm font-semibold mb-2",children:"操作记录"}),0===R.operationLogs.length?(0,d.jsx)("p",{className:"text-xs text-gray-500",children:"暂无记录"}):(0,d.jsx)("div",{className:"bg-black text-white rounded text-xs font-mono p-2 max-h-48 overflow-y-auto",children:R.operationLogs.map((a,b)=>(0,d.jsx)("div",{className:"mb-1 whitespace-pre-wrap",children:a},b))})]}),(0,d.jsxs)("div",{className:"rounded-lg border p-3",children:[(0,d.jsx)("h3",{className:"text-sm font-semibold mb-2",children:"反馈信息"}),0===R.feedbacks.length?(0,d.jsx)("p",{className:"text-xs text-gray-500",children:"暂无反馈"}):(0,d.jsx)("div",{className:"space-y-1 text-sm",children:R.feedbacks.map((a,b)=>(0,d.jsx)("div",{className:"rounded bg-gray-50 px-2 py-1 text-gray-700",children:a},b))})]})]})]}),aF&&(0,d.jsxs)("div",{className:"mt-8 rounded-lg border bg-white p-4 shadow-sm",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between mb-4",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold",children:"常用 Git 分支操作 · 批量探测远端分支"}),(0,d.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,d.jsx)(g.Button,{onClick:()=>bb(!1),disabled:V.isRunning,children:V.isRunning?"执行中...":"执行"}),(0,d.jsx)(g.Button,{variant:"outline",onClick:()=>bb(!0),disabled:V.isRunning,children:"DRY RUN"})]})]}),(0,d.jsxs)("div",{className:"grid gap-4 md:grid-cols-2",children:[(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)(k.Label,{htmlFor:"batch-probe-branch-projects",children:"选择项目"}),(0,d.jsx)("select",{id:"batch-probe-branch-projects",multiple:!0,value:T.selectedProjects,onChange:a=>{let b=Array.from(a.target.selectedOptions).map(a=>a.value);U(a=>({...a,selectedProjects:b}))},className:"w-full min-h-[140px] rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-xs focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",children:0===Object.keys(b.projects).length?(0,d.jsx)("option",{value:"",disabled:!0,children:"暂无可用项目"}):Object.keys(b.projects).map(a=>(0,d.jsx)("option",{value:a,children:a},a))}),(0,d.jsx)("p",{className:"text-xs text-gray-500",children:"按住 Command / Ctrl 可多选"})]}),(0,d.jsx)("div",{className:"grid gap-4",children:(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)(k.Label,{htmlFor:"batch-probe-branch-name",children:"远端分支名称"}),(0,d.jsx)(j.Input,{id:"batch-probe-branch-name",value:T.branchName,onChange:a=>a5(a.target.value),placeholder:"例如: release/2026-03"})]})})]}),(V.isRunning||V.progress>0)&&(0,d.jsxs)("div",{className:"mt-4 rounded-lg border p-3",children:[(0,d.jsxs)("div",{className:"flex justify-between items-center mb-2 text-sm",children:[(0,d.jsxs)("span",{children:["进度: ",V.completedProjects,"/",V.totalProjects,V.currentProject?` \xb7 当前项目: ${V.currentProject}`:""]}),(0,d.jsxs)("span",{children:[V.progress,"%"]})]}),(0,d.jsx)("div",{className:"w-full bg-gray-200 rounded-full h-2",children:(0,d.jsx)("div",{className:"bg-blue-600 h-2 rounded-full transition-all duration-300",style:{width:`${V.progress}%`}})})]}),(0,d.jsxs)("div",{className:"mt-6 grid gap-4 md:grid-cols-2",children:[(0,d.jsxs)("div",{className:"rounded-lg border p-3",children:[(0,d.jsx)("h3",{className:"text-sm font-semibold mb-2",children:"操作记录"}),0===V.operationLogs.length?(0,d.jsx)("p",{className:"text-xs text-gray-500",children:"暂无记录"}):(0,d.jsx)("div",{className:"bg-black text-white rounded text-xs font-mono p-2 max-h-48 overflow-y-auto",children:V.operationLogs.map((a,b)=>(0,d.jsx)("div",{className:"mb-1 whitespace-pre-wrap",children:a},b))})]}),(0,d.jsxs)("div",{className:"rounded-lg border p-3",children:[(0,d.jsx)("h3",{className:"text-sm font-semibold mb-2",children:"反馈信息"}),0===V.feedbacks.length?(0,d.jsx)("p",{className:"text-xs text-gray-500",children:"暂无反馈"}):(0,d.jsx)("div",{className:"space-y-1 text-sm",children:V.feedbacks.map((a,b)=>(0,d.jsx)("div",{className:"rounded bg-gray-50 px-2 py-1 text-gray-700",children:a},b))})]})]})]}),(0,d.jsxs)("div",{className:"mt-8 rounded-lg border bg-white p-4 shadow-sm",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between mb-4",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold",children:"常用 Git 分支操作 · 批量切换分支"}),(0,d.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,d.jsx)(g.Button,{onClick:()=>bc(!1),disabled:Z.isRunning,children:Z.isRunning?"执行中...":"执行"}),(0,d.jsx)(g.Button,{variant:"outline",onClick:()=>bc(!0),disabled:Z.isRunning,children:"DRY RUN"})]})]}),(0,d.jsxs)("div",{className:"grid gap-4 md:grid-cols-2",children:[(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)(k.Label,{htmlFor:"batch-switch-branch-projects",children:"选择项目"}),(0,d.jsx)("select",{id:"batch-switch-branch-projects",multiple:!0,value:X.selectedProjects,onChange:a=>{let b=Array.from(a.target.selectedOptions).map(a=>a.value);Y(a=>({...a,selectedProjects:b}))},className:"w-full min-h-[140px] rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-xs focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",children:0===Object.keys(b.projects).length?(0,d.jsx)("option",{value:"",disabled:!0,children:"暂无可用项目"}):Object.keys(b.projects).map(a=>(0,d.jsx)("option",{value:a,children:a},a))}),(0,d.jsx)("p",{className:"text-xs text-gray-500",children:"按住 Command / Ctrl 可多选;未选择时下拉聚合所有项目分支"})]}),(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)(k.Label,{htmlFor:"batch-switch-branch-name",children:"目标分支"}),(0,d.jsxs)(l.DropdownMenu,{open:af,onOpenChange:a=>{ag(a),a&&(ai(""),a7())},children:[(0,d.jsx)(l.DropdownMenuTrigger,{asChild:!0,children:(0,d.jsxs)(g.Button,{variant:"outline",className:"w-full justify-between font-normal",children:[(0,d.jsx)("span",{className:"truncate",children:X.branchName||(ab?"加载中...":"点击选择目标分支")}),(0,d.jsx)(n.ChevronDownIcon,{className:"size-4 opacity-50 shrink-0"})]})}),(0,d.jsxs)(l.DropdownMenuContent,{align:"start",className:"w-72",children:[(0,d.jsx)("div",{className:"p-1",children:(0,d.jsx)(j.Input,{value:ah,onChange:a=>ai(a.target.value),placeholder:"搜索分支...",className:"h-8"})}),(0,d.jsx)(l.DropdownMenuSeparator,{}),ab&&(0,d.jsxs)("div",{className:"flex items-center justify-center gap-2 px-3 py-4 text-sm text-gray-500",children:[(0,d.jsx)("span",{className:"animate-spin w-3 h-3 border-2 border-blue-500 border-t-transparent rounded-full"}),"聚合获取各项目远程分支中..."]}),!ab&&ad&&(0,d.jsxs)("div",{className:"px-3 py-3 text-sm",children:[(0,d.jsx)("p",{className:"text-red-600",children:ad}),(0,d.jsx)(g.Button,{variant:"outline",size:"sm",onClick:a7,className:"mt-2 h-7 px-2 text-xs",children:"重试"})]}),!ab&&!ad&&(0,d.jsx)(d.Fragment,{children:0===_.length?(0,d.jsx)("div",{className:"px-3 py-4 text-sm text-gray-500",children:"暂无可用的远程分支"}):0===bm.total?(0,d.jsx)("div",{className:"px-3 py-4 text-sm text-gray-500",children:"没有匹配的分支"}):(0,d.jsxs)(d.Fragment,{children:[bm.visible.map(a=>(0,d.jsxs)(l.DropdownMenuItem,{className:"flex items-center justify-between",onSelect:b=>{b.preventDefault(),a6(a)},children:[(0,d.jsx)("span",{className:"min-w-0 flex-1 truncate",children:a}),a===X.branchName&&(0,d.jsx)(m.CheckIcon,{className:"size-4 text-blue-600 shrink-0"})]},a)),bm.total>bm.visible.length&&(0,d.jsxs)("div",{className:"px-3 py-2 text-xs text-gray-400 border-t",children:["共 ",bm.total," 个匹配分支,仅展示前 ",bm.visible.length," 项,更多请使用上方搜索"]})]})})]})]}),X.branchName&&(0,d.jsxs)("p",{className:"text-xs text-gray-500",children:["目标分支: ",(0,d.jsx)("span",{className:"text-blue-600 font-medium",children:X.branchName})]})]})]}),(Z.isRunning||Z.progress>0)&&(0,d.jsxs)("div",{className:"mt-4 rounded-lg border p-3",children:[(0,d.jsxs)("div",{className:"flex justify-between items-center mb-2 text-sm",children:[(0,d.jsxs)("span",{children:["进度: ",Z.completedProjects,"/",Z.totalProjects,Z.currentProject?` \xb7 当前项目: ${Z.currentProject}`:""]}),(0,d.jsxs)("span",{children:[Z.progress,"%"]})]}),(0,d.jsx)("div",{className:"w-full bg-gray-200 rounded-full h-2",children:(0,d.jsx)("div",{className:"bg-blue-600 h-2 rounded-full transition-all duration-300",style:{width:`${Z.progress}%`}})})]}),(0,d.jsxs)("div",{className:"mt-6 grid gap-4 md:grid-cols-2",children:[(0,d.jsxs)("div",{className:"rounded-lg border p-3",children:[(0,d.jsx)("h3",{className:"text-sm font-semibold mb-2",children:"操作记录"}),0===Z.operationLogs.length?(0,d.jsx)("p",{className:"text-xs text-gray-500",children:"暂无记录"}):(0,d.jsx)("div",{className:"bg-black text-white rounded text-xs font-mono p-2 max-h-48 overflow-y-auto",children:Z.operationLogs.map((a,b)=>(0,d.jsx)("div",{className:"mb-1 whitespace-pre-wrap",children:a},b))})]}),(0,d.jsxs)("div",{className:"rounded-lg border p-3",children:[(0,d.jsx)("h3",{className:"text-sm font-semibold mb-2",children:"反馈信息"}),0===Z.feedbacks.length?(0,d.jsx)("p",{className:"text-xs text-gray-500",children:"暂无反馈"}):(0,d.jsx)("div",{className:"space-y-1 text-sm",children:Z.feedbacks.map((a,b)=>(0,d.jsx)("div",{className:"rounded bg-gray-50 px-2 py-1 text-gray-700",children:a},b))})]})]})]}),(0,d.jsxs)("div",{className:"mt-8 rounded-lg border bg-white p-4 shadow-sm",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between mb-4",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold",children:"常用 Git 分支操作 · 批量切换子仓库(submodules/common)分支"}),(0,d.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,d.jsx)(g.Button,{onClick:()=>bg(!1),disabled:ap.isRunning,children:ap.isRunning?"执行中...":"执行"}),(0,d.jsx)(g.Button,{variant:"outline",onClick:()=>bg(!0),disabled:ap.isRunning,children:"DRY RUN"})]})]}),(0,d.jsxs)("div",{className:"grid gap-4 md:grid-cols-2",children:[(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)(k.Label,{htmlFor:"batch-switch-sub-projects",children:"选择项目"}),(0,d.jsx)("select",{id:"batch-switch-sub-projects",multiple:!0,value:an.selectedProjects,onChange:a=>{let b=Array.from(a.target.selectedOptions).map(a=>a.value);ao(a=>({...a,selectedProjects:b}))},className:"w-full min-h-[140px] rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-xs focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",children:0===Object.keys(b.projects).length?(0,d.jsx)("option",{value:"",disabled:!0,children:"暂无可用项目"}):Object.keys(b.projects).map(a=>(0,d.jsx)("option",{value:a,children:a},a))}),(0,d.jsx)("p",{className:"text-xs text-gray-500",children:"按住 Command / Ctrl 可多选;未选择时下拉聚合所有项目子仓库分支"})]}),(0,d.jsxs)("div",{className:"space-y-2",children:[(0,d.jsx)(k.Label,{htmlFor:"batch-switch-sub-name",children:"目标分支"}),(0,d.jsxs)(l.DropdownMenu,{open:ax,onOpenChange:a=>{ay(a),a&&(aA(""),bf())},children:[(0,d.jsx)(l.DropdownMenuTrigger,{asChild:!0,children:(0,d.jsxs)(g.Button,{variant:"outline",className:"w-full justify-between font-normal",children:[(0,d.jsx)("span",{className:"truncate",children:an.branchName||(at?"加载中...":"点击选择目标分支")}),(0,d.jsx)(n.ChevronDownIcon,{className:"size-4 opacity-50 shrink-0"})]})}),(0,d.jsxs)(l.DropdownMenuContent,{align:"start",className:"w-72",children:[(0,d.jsx)("div",{className:"p-1",children:(0,d.jsx)(j.Input,{value:az,onChange:a=>aA(a.target.value),placeholder:"搜索分支...",className:"h-8"})}),(0,d.jsx)(l.DropdownMenuSeparator,{}),at&&(0,d.jsxs)("div",{className:"flex items-center justify-center gap-2 px-3 py-4 text-sm text-gray-500",children:[(0,d.jsx)("span",{className:"animate-spin w-3 h-3 border-2 border-blue-500 border-t-transparent rounded-full"}),"聚合获取各项目子仓库远程分支中..."]}),!at&&av&&(0,d.jsxs)("div",{className:"px-3 py-3 text-sm",children:[(0,d.jsx)("p",{className:"text-red-600",children:av}),(0,d.jsx)(g.Button,{variant:"outline",size:"sm",onClick:bf,className:"mt-2 h-7 px-2 text-xs",children:"重试"})]}),!at&&!av&&(0,d.jsx)(d.Fragment,{children:0===ar.length?(0,d.jsx)("div",{className:"px-3 py-4 text-sm text-gray-500",children:"暂无可用的子仓库远程分支"}):0===bn.total?(0,d.jsx)("div",{className:"px-3 py-4 text-sm text-gray-500",children:"没有匹配的分支"}):(0,d.jsxs)(d.Fragment,{children:[bn.visible.map(a=>(0,d.jsxs)(l.DropdownMenuItem,{className:"flex items-center justify-between",onSelect:b=>{b.preventDefault(),be(a)},children:[(0,d.jsx)("span",{className:"min-w-0 flex-1 truncate",children:a}),a===an.branchName&&(0,d.jsx)(m.CheckIcon,{className:"size-4 text-blue-600 shrink-0"})]},a)),bn.total>bn.visible.length&&(0,d.jsxs)("div",{className:"px-3 py-2 text-xs text-gray-400 border-t",children:["共 ",bn.total," 个匹配分支,仅展示前 ",bn.visible.length," 项,更多请使用上方搜索"]})]})})]})]}),an.branchName&&(0,d.jsxs)("p",{className:"text-xs text-gray-500",children:["目标分支: ",(0,d.jsx)("span",{className:"text-blue-600 font-medium",children:an.branchName})]})]})]}),(ap.isRunning||ap.progress>0)&&(0,d.jsxs)("div",{className:"mt-4 rounded-lg border p-3",children:[(0,d.jsxs)("div",{className:"flex justify-between items-center mb-2 text-sm",children:[(0,d.jsxs)("span",{children:["进度: ",ap.completedProjects,"/",ap.totalProjects,ap.currentProject?` \xb7 当前项目: ${ap.currentProject}`:""]}),(0,d.jsxs)("span",{children:[ap.progress,"%"]})]}),(0,d.jsx)("div",{className:"w-full bg-gray-200 rounded-full h-2",children:(0,d.jsx)("div",{className:"bg-blue-600 h-2 rounded-full transition-all duration-300",style:{width:`${ap.progress}%`}})})]}),(0,d.jsxs)("div",{className:"mt-6 grid gap-4 md:grid-cols-2",children:[(0,d.jsxs)("div",{className:"rounded-lg border p-3",children:[(0,d.jsx)("h3",{className:"text-sm font-semibold mb-2",children:"操作记录"}),0===ap.operationLogs.length?(0,d.jsx)("p",{className:"text-xs text-gray-500",children:"暂无记录"}):(0,d.jsx)("div",{className:"bg-black text-white rounded text-xs font-mono p-2 max-h-48 overflow-y-auto",children:ap.operationLogs.map((a,b)=>(0,d.jsx)("div",{className:"mb-1 whitespace-pre-wrap",children:a},b))})]}),(0,d.jsxs)("div",{className:"rounded-lg border p-3",children:[(0,d.jsx)("h3",{className:"text-sm font-semibold mb-2",children:"反馈信息"}),0===ap.feedbacks.length?(0,d.jsx)("p",{className:"text-xs text-gray-500",children:"暂无反馈"}):(0,d.jsx)("div",{className:"space-y-1 text-sm",children:ap.feedbacks.map((a,b)=>(0,d.jsx)("div",{className:"rounded bg-gray-50 px-2 py-1 text-gray-700",children:a},b))})]})]})]}),(0,d.jsx)(o.Dialog,{open:!1,onOpenChange:a=>{!a&&aH&&B.isRunning||aK(a)},children:(0,d.jsxs)(o.DialogContent,{showCloseButton:!1,children:[(0,d.jsxs)(o.DialogHeader,{children:[(0,d.jsx)(o.DialogTitle,{children:"确认执行下一步"}),(0,d.jsx)(o.DialogDescription,{children:aH?`${aH.projectName} \xb7 ${aH.description}`:"准备下一步执行"})]}),(0,d.jsx)("div",{className:"rounded-md border bg-gray-50 p-3 text-sm font-mono text-gray-700",children:aH?aH.command:""}),(0,d.jsxs)(o.DialogFooter,{children:[(0,d.jsx)(g.Button,{variant:"outline",onClick:bk,children:"取消执行"}),(0,d.jsx)(g.Button,{onClick:bj,disabled:!aH,children:"确认并执行"})]})]})}),(0,d.jsx)(o.Dialog,{open:aF&&aL,onOpenChange:aM,children:(0,d.jsxs)(o.DialogContent,{children:[(0,d.jsxs)(o.DialogHeader,{children:[(0,d.jsx)(o.DialogTitle,{children:"操作结果"}),(0,d.jsx)(o.DialogDescription,{children:"查看所有项目执行结果"})]}),(0,d.jsx)("div",{className:"space-y-2",children:0===aN.length?(0,d.jsx)("p",{className:"text-sm text-gray-500",children:"暂无结果"}):aN.map(a=>(0,d.jsxs)("div",{className:`rounded-md border px-3 py-2 text-sm ${a.success?"bg-green-50 text-green-700":"bg-red-50 text-red-700"}`,children:[(0,d.jsxs)("div",{className:"flex items-start justify-between",children:[(0,d.jsx)("span",{className:"font-medium",children:a.projectName}),(0,d.jsx)("span",{className:"ml-4 text-right",children:!0===a.exists||!1===a.exists?y(a):a.success?"成功":a.reason||"失败"})]}),!a.success&&a.rollbackActions&&a.rollbackActions.length>0&&(0,d.jsxs)("div",{className:"mt-2 text-xs text-gray-600",children:[(0,d.jsx)("div",{className:"font-semibold text-gray-700",children:"已回滚操作:"}),(0,d.jsx)("ul",{className:"mt-1 list-disc pl-4",children:a.rollbackActions.map((b,c)=>(0,d.jsx)("li",{children:b},`${a.projectName}-rollback-${c}`))})]})]},a.projectName))}),(0,d.jsx)(o.DialogFooter,{children:(0,d.jsx)(g.Button,{onClick:()=>aM(!1),children:"关闭"})})]})}),(0,d.jsx)(o.Dialog,{open:al,onOpenChange:am,children:(0,d.jsxs)(o.DialogContent,{children:[(0,d.jsxs)(o.DialogHeader,{children:[(0,d.jsx)(o.DialogTitle,{children:"批量切换分支结果"}),(0,d.jsx)(o.DialogDescription,{children:(()=>{let a=aj.filter(a=>a.success).length,b=aj.length-a;return`共 ${aj.length} 个项目,成功 ${a} 个,失败 ${b} 个`})()})]}),(0,d.jsx)("div",{className:"space-y-2",children:0===aj.length?(0,d.jsx)("p",{className:"text-sm text-gray-500",children:"暂无结果"}):aj.map(a=>(0,d.jsx)("div",{className:`rounded-md border px-3 py-2 text-sm ${a.success?"bg-green-50 text-green-700":"bg-red-50 text-red-700"}`,children:(0,d.jsxs)("div",{className:"flex items-start justify-between",children:[(0,d.jsx)("span",{className:"font-medium",children:a.projectName}),(0,d.jsx)("span",{className:"ml-4 text-right",children:a.success?"成功":a.reason||"失败"})]})},a.projectName))}),(0,d.jsx)(o.DialogFooter,{children:(0,d.jsx)(g.Button,{onClick:()=>am(!1),children:"关闭"})})]})}),(0,d.jsx)(o.Dialog,{open:aD,onOpenChange:aE,children:(0,d.jsxs)(o.DialogContent,{children:[(0,d.jsxs)(o.DialogHeader,{children:[(0,d.jsx)(o.DialogTitle,{children:"批量切换子仓库分支结果"}),(0,d.jsx)(o.DialogDescription,{children:(()=>{let a=aB.filter(a=>a.success).length,b=aB.length-a;return`共 ${aB.length} 个项目,成功 ${a} 个,失败 ${b} 个`})()})]}),(0,d.jsx)("div",{className:"space-y-2",children:0===aB.length?(0,d.jsx)("p",{className:"text-sm text-gray-500",children:"暂无结果"}):aB.map(a=>(0,d.jsx)("div",{className:`rounded-md border px-3 py-2 text-sm ${a.success?"bg-green-50 text-green-700":"bg-red-50 text-red-700"}`,children:(0,d.jsxs)("div",{className:"flex items-start justify-between",children:[(0,d.jsx)("span",{className:"font-medium",children:a.projectName}),(0,d.jsx)("span",{className:"ml-4 text-right",children:a.success?"成功":a.reason||"失败"})]})},a.projectName))}),(0,d.jsx)(o.DialogFooter,{children:(0,d.jsx)(g.Button,{onClick:()=>aE(!1),children:"关闭"})})]})})]})}}}};
2
+
3
+ //# sourceMappingURL=packages_server_src_622c27d6._.js.map