prime-dev-cli 2.0.9 → 2.0.10

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 (41) hide show
  1. package/dist/server/.next/BUILD_ID +1 -1
  2. package/dist/server/.next/app-build-manifest.json +1 -1
  3. package/dist/server/.next/build-manifest.json +2 -2
  4. package/dist/server/.next/cache/.rscinfo +1 -1
  5. package/dist/server/.next/cache/.tsbuildinfo +1 -1
  6. package/dist/server/.next/cache/eslint/.cache_1qa5vxt +1 -1
  7. package/dist/server/.next/fallback-build-manifest.json +2 -2
  8. package/dist/server/.next/next-minimal-server.js.nft.json +1 -1
  9. package/dist/server/.next/next-server.js.nft.json +1 -1
  10. package/dist/server/.next/prerender-manifest.json +3 -3
  11. package/dist/server/.next/server/app/_not-found.html +1 -1
  12. package/dist/server/.next/server/app/_not-found.rsc +1 -1
  13. package/dist/server/.next/server/app/api/uat-git-flow/route.js +1 -1
  14. package/dist/server/.next/server/app/api/uat-git-flow/step/route.js +1 -1
  15. package/dist/server/.next/server/app/configuration.html +1 -1
  16. package/dist/server/.next/server/app/configuration.rsc +1 -1
  17. package/dist/server/.next/server/app/index.html +1 -1
  18. package/dist/server/.next/server/app/index.rsc +1 -1
  19. package/dist/server/.next/server/app/initialization/page/app-build-manifest.json +1 -1
  20. package/dist/server/.next/server/app/initialization/page_client-reference-manifest.js +1 -1
  21. package/dist/server/.next/server/app/initialization.html +1 -1
  22. package/dist/server/.next/server/app/initialization.rsc +2 -2
  23. package/dist/server/.next/server/chunks/packages_server_42b02aec._.js +1 -1
  24. package/dist/server/.next/server/chunks/packages_server_42b02aec._.js.map +1 -1
  25. package/dist/server/.next/server/chunks/packages_server_854cbe00._.js +1 -1
  26. package/dist/server/.next/server/chunks/packages_server_854cbe00._.js.map +1 -1
  27. package/dist/server/.next/server/chunks/ssr/packages_server_src_622c27d6._.js +1 -1
  28. package/dist/server/.next/server/chunks/ssr/packages_server_src_622c27d6._.js.map +1 -1
  29. package/dist/server/.next/server/pages/404.html +1 -1
  30. package/dist/server/.next/server/pages/500.html +1 -1
  31. package/dist/server/.next/server/server-reference-manifest.js +1 -1
  32. package/dist/server/.next/server/server-reference-manifest.json +1 -1
  33. package/dist/server/.next/static/chunks/2dfd52ecb63ce530.js.map +1 -0
  34. package/dist/server/.next/static/chunks/51016cbb3e241c61.js +3 -0
  35. package/dist/server/.next/trace +2 -2
  36. package/package.json +2 -2
  37. package/dist/server/.next/static/chunks/16b23f7570a551e1.js +0 -3
  38. package/dist/server/.next/static/chunks/b109f2fb91f36e31.js.map +0 -1
  39. /package/dist/server/.next/static/{zjt6jXsNQxDdU-RHF8TC7 → HajrbQiEu_dEojCWqcu4x}/_buildManifest.js +0 -0
  40. /package/dist/server/.next/static/{zjt6jXsNQxDdU-RHF8TC7 → HajrbQiEu_dEojCWqcu4x}/_clientMiddlewareManifest.json +0 -0
  41. /package/dist/server/.next/static/{zjt6jXsNQxDdU-RHF8TC7 → HajrbQiEu_dEojCWqcu4x}/_ssgManifest.js +0 -0
@@ -1,3 +0,0 @@
1
- (globalThis.TURBOPACK=globalThis.TURBOPACK||[]).push(["object"==typeof document?document.currentScript:void 0,{31814:e=>{"use strict";var{g:s,__dirname:t}=e;{e.s({default:()=>h});var r=e.i(20393),a=e.i(19886),n=e.i(86871),c=e.i(70599),o=e.i(29255),i=e.i(31110),l=e.i(20546),d=e.i(58644);let s="submodules/common";function h({projectName:e,variant:t,onSwitched:h,refreshSignal:p}){let m="sub"===t,[u,g]=(0,a.useState)(null),[x,j]=(0,a.useState)(null),[b,f]=(0,a.useState)(!1),[N,y]=(0,a.useState)([]),[v,w]=(0,a.useState)(!1),[P,k]=(0,a.useState)(null),[C,S]=(0,a.useState)(""),[L,R]=(0,a.useState)(null),[A,B]=(0,a.useState)(null),$=(0,a.useRef)(null),I=e=>{B(e),$.current&&clearTimeout($.current),$.current=setTimeout(()=>B(null),5e3)},O=(0,a.useCallback)(async()=>{if(m)try{let t=await fetch(`/api/submodule-info?project=${encodeURIComponent(e)}&subPath=${encodeURIComponent(s)}`),r=await t.json();r.success&&r.data&&(j(!!r.data.exists),g(r.data))}catch(s){console.error(`获取子仓库信息失败 (${e}):`,s)}else try{let s=await fetch(`/api/branches?project=${encodeURIComponent(e)}`),t=await s.json();t.success&&t.data?.exists&&g({exists:!0,currentBranch:t.data.currentBranch||null,detached:!1,commitHash:""})}catch(s){console.error(`获取项目分支信息失败 (${e}):`,s)}},[m,e]),T=(0,a.useCallback)(async()=>{w(!0),k(null);try{let t=m?`&subPath=${encodeURIComponent(s)}`:"",r=await fetch(`/api/branches?project=${encodeURIComponent(e)}${t}`),a=await r.json();a.success?y(a.data?.branches||[]):k(a.error||"获取远程分支失败")}catch(s){console.error(`获取远程分支失败 (${e}):`,s),k("网络请求失败")}finally{w(!1)}},[m,e]);(0,a.useEffect)(()=>{O()},[O,p]),(0,a.useEffect)(()=>()=>{$.current&&clearTimeout($.current)},[]);let E=async t=>{if(!L&&t!==u?.currentBranch){R(t);try{let r=await fetch("/api/branch/switch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(m?{projectName:e,branchName:t,subPath:s}:{projectName:e,branchName:t})}),a=await r.json();a.success?(f(!1),S(""),await O(),h?.()):(f(!1),S(""),I(a.error||"切换分支失败"))}catch(s){console.error(`切换分支失败 (${e}):`,s),f(!1),I("切换分支失败: 网络错误")}finally{R(null)}}};if(m&&!1===x)return null;let D=u?u.detached?u.commitHash?`(detached) ${u.commitHash}`:"(detached)":u.currentBranch||"未知分支":"",{visible:M,total:U}=(0,d.filterBranchOptions)(N,C),F=m?"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",_=m?"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]",G=m?"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,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:F,children:[m&&(0,r.jsx)("span",{className:_,title:`子仓库: ${e}/${s}`,children:"common"}),(0,r.jsxs)(o.DropdownMenu,{open:b,onOpenChange:e=>{f(e),e&&(S(""),T())},children:[(0,r.jsx)(o.DropdownMenuTrigger,{asChild:!0,children:(0,r.jsxs)("button",{type:"button",className:G,title:m?`点击切换子仓库(${e}/submodules/common)分支`:`点击切换 ${e} 分支`,children:[(0,r.jsx)("span",{className:"truncate max-w-[10rem]",children:D}),(0,r.jsx)(l.ChevronDownIcon,{className:"size-3 opacity-60 shrink-0"})]})}),(0,r.jsxs)(o.DropdownMenuContent,{align:"start",className:"w-72",children:[(0,r.jsx)("div",{className:"p-1",children:(0,r.jsx)(c.Input,{value:C,onChange:e=>S(e.target.value),placeholder:"搜索分支...",className:"h-8"})}),(0,r.jsx)(o.DropdownMenuSeparator,{}),v&&(0,r.jsxs)("div",{className:"flex items-center justify-center gap-2 px-3 py-4 text-sm text-gray-500",children:[(0,r.jsx)("span",{className:"animate-spin w-3 h-3 border-2 border-blue-500 border-t-transparent rounded-full"}),"加载远程分支中..."]}),!v&&P&&(0,r.jsxs)("div",{className:"px-3 py-3 text-sm",children:[(0,r.jsx)("p",{className:"text-red-600",children:P}),(0,r.jsx)(n.Button,{variant:"outline",size:"sm",onClick:T,className:"mt-2 h-7 px-2 text-xs",children:"重试"})]}),!v&&!P&&0===N.length&&(0,r.jsx)("div",{className:"px-3 py-4 text-sm text-gray-500",children:"暂无远程分支"}),!v&&!P&&N.length>0&&0===U&&(0,r.jsx)("div",{className:"px-3 py-4 text-sm text-gray-500",children:"没有匹配的分支"}),!v&&!P&&U>0&&(0,r.jsxs)("div",{className:"max-h-64 overflow-y-auto",children:[M.map(e=>(0,r.jsxs)(o.DropdownMenuItem,{disabled:null!==L,className:"flex items-center justify-between",onSelect:s=>{s.preventDefault(),E(e)},children:[(0,r.jsx)("span",{className:"min-w-0 flex-1 truncate",children:e}),(0,r.jsxs)("span",{className:"flex items-center gap-2 shrink-0",children:[e===u?.currentBranch&&(0,r.jsx)(i.CheckIcon,{className:"size-4 text-blue-600"}),L===e&&(0,r.jsx)("span",{className:"animate-spin w-3 h-3 border-2 border-blue-500 border-t-transparent rounded-full"})]})]},e)),U>M.length&&(0,r.jsxs)("div",{className:"px-3 py-2 text-xs text-gray-400 border-t",children:["共 ",U," 个匹配分支,仅展示前 ",M.length," 项,更多请使用上方搜索"]})]})]})]})]}),A&&(0,r.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:A})]})}}},86442:function(e){var s,{g:t,__dirname:r,m:a,e:n}=e;"undefined"!=typeof __nccwpck_require__&&(__nccwpck_require__.ab=r+"/"),(s={}).endianness=function(){return"LE"},s.hostname=function(){return"undefined"!=typeof location?location.hostname:""},s.loadavg=function(){return[]},s.uptime=function(){return 0},s.freemem=function(){return Number.MAX_VALUE},s.totalmem=function(){return Number.MAX_VALUE},s.cpus=function(){return[]},s.type=function(){return"Browser"},s.release=function(){return"undefined"!=typeof navigator?navigator.appVersion:""},s.networkInterfaces=s.getNetworkInterfaces=function(){return{}},s.arch=function(){return"javascript"},s.platform=function(){return"browser"},s.tmpdir=s.tmpDir=function(){return"/tmp"},s.EOL="\n",s.homedir=function(){return"/"},a.exports=s},87733:function(e){var{g:s,__dirname:t,m:r,e:a}=e;!function(){"use strict";var e={114:function(e){function s(e){if("string"!=typeof e)throw TypeError("Path must be a string. Received "+JSON.stringify(e))}function t(e,s){for(var t,r="",a=0,n=-1,c=0,o=0;o<=e.length;++o){if(o<e.length)t=e.charCodeAt(o);else if(47===t)break;else t=47;if(47===t){if(n===o-1||1===c);else if(n!==o-1&&2===c){if(r.length<2||2!==a||46!==r.charCodeAt(r.length-1)||46!==r.charCodeAt(r.length-2)){if(r.length>2){var i=r.lastIndexOf("/");if(i!==r.length-1){-1===i?(r="",a=0):a=(r=r.slice(0,i)).length-1-r.lastIndexOf("/"),n=o,c=0;continue}}else if(2===r.length||1===r.length){r="",a=0,n=o,c=0;continue}}s&&(r.length>0?r+="/..":r="..",a=2)}else r.length>0?r+="/"+e.slice(n+1,o):r=e.slice(n+1,o),a=o-n-1;n=o,c=0}else 46===t&&-1!==c?++c:c=-1}return r}var r={resolve:function(){for(var e,r,a="",n=!1,c=arguments.length-1;c>=-1&&!n;c--)c>=0?r=arguments[c]:(void 0===e&&(e=""),r=e),s(r),0!==r.length&&(a=r+"/"+a,n=47===r.charCodeAt(0));if(a=t(a,!n),n)if(a.length>0)return"/"+a;else return"/";return a.length>0?a:"."},normalize:function(e){if(s(e),0===e.length)return".";var r=47===e.charCodeAt(0),a=47===e.charCodeAt(e.length-1);return(0!==(e=t(e,!r)).length||r||(e="."),e.length>0&&a&&(e+="/"),r)?"/"+e:e},isAbsolute:function(e){return s(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0==arguments.length)return".";for(var e,t=0;t<arguments.length;++t){var a=arguments[t];s(a),a.length>0&&(void 0===e?e=a:e+="/"+a)}return void 0===e?".":r.normalize(e)},relative:function(e,t){if(s(e),s(t),e===t||(e=r.resolve(e))===(t=r.resolve(t)))return"";for(var a=1;a<e.length&&47===e.charCodeAt(a);++a);for(var n=e.length,c=n-a,o=1;o<t.length&&47===t.charCodeAt(o);++o);for(var i=t.length-o,l=c<i?c:i,d=-1,h=0;h<=l;++h){if(h===l){if(i>l){if(47===t.charCodeAt(o+h))return t.slice(o+h+1);else if(0===h)return t.slice(o+h)}else c>l&&(47===e.charCodeAt(a+h)?d=h:0===h&&(d=0));break}var p=e.charCodeAt(a+h);if(p!==t.charCodeAt(o+h))break;47===p&&(d=h)}var m="";for(h=a+d+1;h<=n;++h)(h===n||47===e.charCodeAt(h))&&(0===m.length?m+="..":m+="/..");return m.length>0?m+t.slice(o+d):(o+=d,47===t.charCodeAt(o)&&++o,t.slice(o))},_makeLong:function(e){return e},dirname:function(e){if(s(e),0===e.length)return".";for(var t=e.charCodeAt(0),r=47===t,a=-1,n=!0,c=e.length-1;c>=1;--c)if(47===(t=e.charCodeAt(c))){if(!n){a=c;break}}else n=!1;return -1===a?r?"/":".":r&&1===a?"//":e.slice(0,a)},basename:function(e,t){if(void 0!==t&&"string"!=typeof t)throw TypeError('"ext" argument must be a string');s(e);var r,a=0,n=-1,c=!0;if(void 0!==t&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return"";var o=t.length-1,i=-1;for(r=e.length-1;r>=0;--r){var l=e.charCodeAt(r);if(47===l){if(!c){a=r+1;break}}else -1===i&&(c=!1,i=r+1),o>=0&&(l===t.charCodeAt(o)?-1==--o&&(n=r):(o=-1,n=i))}return a===n?n=i:-1===n&&(n=e.length),e.slice(a,n)}for(r=e.length-1;r>=0;--r)if(47===e.charCodeAt(r)){if(!c){a=r+1;break}}else -1===n&&(c=!1,n=r+1);return -1===n?"":e.slice(a,n)},extname:function(e){s(e);for(var t=-1,r=0,a=-1,n=!0,c=0,o=e.length-1;o>=0;--o){var i=e.charCodeAt(o);if(47===i){if(!n){r=o+1;break}continue}-1===a&&(n=!1,a=o+1),46===i?-1===t?t=o:1!==c&&(c=1):-1!==t&&(c=-1)}return -1===t||-1===a||0===c||1===c&&t===a-1&&t===r+1?"":e.slice(t,a)},format:function(e){var s,t;if(null===e||"object"!=typeof e)throw TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return s=e.dir||e.root,t=e.base||(e.name||"")+(e.ext||""),s?s===e.root?s+t:s+"/"+t:t},parse:function(e){s(e);var t,r={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return r;var a=e.charCodeAt(0),n=47===a;n?(r.root="/",t=1):t=0;for(var c=-1,o=0,i=-1,l=!0,d=e.length-1,h=0;d>=t;--d){if(47===(a=e.charCodeAt(d))){if(!l){o=d+1;break}continue}-1===i&&(l=!1,i=d+1),46===a?-1===c?c=d:1!==h&&(h=1):-1!==c&&(h=-1)}return -1===c||-1===i||0===h||1===h&&c===i-1&&c===o+1?-1!==i&&(0===o&&n?r.base=r.name=e.slice(1,i):r.base=r.name=e.slice(o,i)):(0===o&&n?(r.name=e.slice(1,c),r.base=e.slice(1,i)):(r.name=e.slice(o,c),r.base=e.slice(o,i)),r.ext=e.slice(c,i)),o>0?r.dir=e.slice(0,o-1):n&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};r.posix=r,e.exports=r}},s={};function a(t){var r=s[t];if(void 0!==r)return r.exports;var n=s[t]={exports:{}},c=!0;try{e[t](n,n.exports,a),c=!1}finally{c&&delete s[t]}return n.exports}a.ab=t+"/",r.exports=a(114)}()},7647:e=>{"use strict";var{g:s,__dirname:t}=e;{e.s({PROJECT_CONFIG_PATH:()=>t,ProjectStatus:()=>n,WORKSPACE_CONFIG:()=>s});var r=e.i(86442),a=e.i(87733);let s={WORKSPACE_ROOT:(0,a.join)((0,r.homedir)(),"Documents","prime-workspace"),GIT_TIMEOUT:3e5,MAX_CONCURRENT_CLONES:Math.max(2,Math.min((0,r.cpus)().length,8)),MAX_RETRY_ATTEMPTS:3},t=(0,a.join)((0,r.homedir)(),".prime-projects.json");var n=function(e){return e.PENDING="pending",e.EXISTING="existing",e.CLONING="cloning",e.SUCCESS="success",e.FAILED="failed",e.RETRYING="retrying",e.INCOMPLETE="incomplete",e}({})}},85548:e=>{"use strict";var{g:s,__dirname:t}=e;{e.s({DEFAULT_UAT_BASE_BRANCH:()=>t,UAT_BASE_BRANCH_OPTIONS:()=>s,UAT_FINAL_MERGE_TARGETS:()=>n,getUatFinalMergeTargets:()=>a,isAllowedUatBaseBranch:()=>r});let s=["main","main-new"],t="main";function r(e){return s.includes(e)}let n={main:["main","fix/main"],"main-new":["main-new"]};function a(e){return n[e]??[e]}}},9993:e=>{"use strict";var{g:s,__dirname:t}=e;{e.s({buildBatchProbeRemoteBranchPayload:()=>w,buildBatchSwitchBranchPayload:()=>N,buildBatchSwitchSubBranchPayload:()=>v,default:()=>s,mapProbeRemoteBranchResultText:()=>P,validateBatchProbeRemoteBranchForm:()=>b,validateBatchSwitchBranchForm:()=>f,validateBatchSwitchSubBranchForm:()=>y});var r=e.i(20393),a=e.i(19886),n=e.i(42152),c=e.i(86871),o=e.i(75777),i=e.i(31814),l=e.i(70599),d=e.i(80226),h=e.i(29255),p=e.i(31110),m=e.i(20546),u=e.i(19579),g=e.i(7647),x=e.i(58644),j=e.i(85548);function b(e,s){let t=[];return 0===e.length&&t.push("请先选择至少一个项目。"),s.trim()||t.push("请填写远端分支名称。"),t}function f(e,s){let t=[];return 0===e.length&&t.push("请先选择至少一个项目。"),s.trim()||t.push("请选择目标分支。"),t}function N(e,s,t){return{projects:[e],branchName:s.trim(),dryRun:t}}function y(e,s){let t=[];return 0===e.length&&t.push("请先选择至少一个项目。"),s.trim()||t.push("请选择子仓库目标分支。"),t}function v(e,s,t){return{projects:[e],branchName:s.trim(),dryRun:t}}function w(e,s,t){return{projects:[e],branchName:s.trim(),dryRun:t}}function P(e){return!0===e.exists?"存在":!1===e.exists?"不存在":e.success?"成功":"执行失败"}let s=()=>{let e=(0,n.useRouter)(),[s,t]=(0,a.useState)({isInitializing:!1,isCompleted:!1,isLoading:!0,hasCompleted:!1,globalProgress:0,globalMessage:"正在检查工作空间状态...",projects:{}}),[k,C]=(0,a.useState)({selectedProjects:[],createBranch:"release/",baseBranch:j.DEFAULT_UAT_BASE_BRANCH,mergeBranch:"feature/"}),[S,L]=(0,a.useState)({isRunning:!1,operationLogs:[],feedbacks:[],runId:""}),[R,A]=(0,a.useState)({selectedProjects:[],createBranch:"release/",baseBranch:"GWH",mergeBranch:"feature/"}),[B,$]=(0,a.useState)({isRunning:!1,operationLogs:[],feedbacks:[],runId:""}),[I,O]=(0,a.useState)({selectedProjects:[],targetBranch:"main",sourceBranch:""}),[T,E]=(0,a.useState)({isRunning:!1,operationLogs:[],feedbacks:[],progress:0,totalProjects:0,completedProjects:0,currentProject:""}),[D,M]=(0,a.useState)({selectedProjects:[],createBranch:"",baseBranch:"main"}),[U,F]=(0,a.useState)({isRunning:!1,operationLogs:[],feedbacks:[],progress:0,totalProjects:0,completedProjects:0,currentProject:""}),[_,G]=(0,a.useState)({selectedProjects:[],branchName:""}),[z,J]=(0,a.useState)({isRunning:!1,operationLogs:[],feedbacks:[],progress:0,totalProjects:0,completedProjects:0,currentProject:""}),[Y,H]=(0,a.useState)({selectedProjects:[],branchName:""}),[X,W]=(0,a.useState)({isRunning:!1,operationLogs:[],feedbacks:[],progress:0,totalProjects:0,completedProjects:0,currentProject:""}),[K,V]=(0,a.useState)({selectedProjects:[],branchName:""}),[q,Q]=(0,a.useState)({isRunning:!1,operationLogs:[],feedbacks:[],progress:0,totalProjects:0,completedProjects:0,currentProject:""}),[Z,ee]=(0,a.useState)([]),[es,et]=(0,a.useState)(!1),[er,ea]=(0,a.useState)(null),[en,ec]=(0,a.useState)(!1),[eo,ei]=(0,a.useState)(""),[el,ed]=(0,a.useState)([]),[eh,ep]=(0,a.useState)(!1),[em,eu]=(0,a.useState)({selectedProjects:[],branchName:""}),[eg,ex]=(0,a.useState)({isRunning:!1,operationLogs:[],feedbacks:[],progress:0,totalProjects:0,completedProjects:0,currentProject:""}),[ej,eb]=(0,a.useState)([]),[ef,eN]=(0,a.useState)(!1),[ey,ev]=(0,a.useState)(null),[ew,eP]=(0,a.useState)(!1),[ek,eC]=(0,a.useState)(""),[eS,eL]=(0,a.useState)([]),[eR,eA]=(0,a.useState)(!1),[eB,e$]=(0,a.useState)(!1),[eI,eO]=(0,a.useState)(null),[eT,eE]=(0,a.useState)(!1),[eD,eM]=(0,a.useState)(!1),[eU,eF]=(0,a.useState)([]),[e_,eG]=(0,a.useState)({}),[ez,eJ]=(0,a.useState)({});(0,a.useEffect)(()=>{eY()},[]),(0,a.useEffect)(()=>{(async()=>{try{let e=await fetch("/api/admin-status"),s=await e.json();e$(!!s?.isAdmin)}catch(e){console.error("获取管理员状态失败:",e),e$(!1)}})()},[]);let eY=async()=>{try{t(e=>({...e,isLoading:!0,globalMessage:"正在检查工作空间状态..."}));let e=await fetch("/api/check-workspace"),s=await e.json();if(s.success){let e={};s.projects.forEach(s=>{e[s.name]={name:s.name,status:s.status,progress:100*(s.status===g.ProjectStatus.EXISTING),message:s.message,canRetry:!1,needsCleanup:s.needsCleanup||!1}}),t(t=>({...t,isLoading:!1,projects:e,globalMessage:s.message||"检查完成"}))}else t(e=>({...e,isLoading:!1,globalMessage:s.error||"检查工作空间状态失败"}))}catch(e){t(e=>({...e,isLoading:!1,globalMessage:"无法连接到服务器,请刷新页面重试"})),console.error("检查工作空间状态失败:",e)}},eH=e=>{switch(e.type){case"initialization":case"workspace_created":case"projects_loaded":if(t(s=>({...s,globalProgress:e.progress||0,globalMessage:e.message||""})),e.projects&&Array.isArray(e.projects)){let s={};e.projects.forEach(e=>{s[e]={name:e,status:g.ProjectStatus.PENDING,progress:0,message:"等待开始...",canRetry:!1}}),t(e=>({...e,projects:s}))}break;case"project_existing":if(e.projectName){let s=e.projectName;t(t=>({...t,globalProgress:e.progress??t.globalProgress,globalMessage:e.message??"",projects:{...t.projects,[s]:{...t.projects[s],status:g.ProjectStatus.EXISTING,message:"项目已存在",progress:100,canRetry:!1}}}))}break;case"project_start":if(e.projectName){let s=e.projectName;t(t=>({...t,globalProgress:e.progress??t.globalProgress,globalMessage:e.message??"",projects:{...t.projects,[s]:{...t.projects[s],status:g.ProjectStatus.CLONING,message:"开始克隆...",progress:0}}}))}break;case"project_progress":if(e.projectName){let s=e.projectName;t(t=>({...t,globalProgress:e.progress??t.globalProgress,projects:{...t.projects,[s]:{...t.projects[s],message:e.message??"",progress:Math.min(e.progress??0,100)}}}))}break;case"project_success":if(e.projectName){let s=e.projectName;t(t=>({...t,globalProgress:e.progress??t.globalProgress,projects:{...t.projects,[s]:{...t.projects[s],status:g.ProjectStatus.SUCCESS,message:"克隆成功",progress:100,canRetry:!1}}}))}break;case"project_failed":if(e.projectName){let s=e.projectName;t(t=>({...t,globalProgress:e.progress??t.globalProgress,projects:{...t.projects,[s]:{...t.projects[s],status:g.ProjectStatus.FAILED,message:"克隆失败",error:e.error,canRetry:!0}}}))}break;case"command_log":if(e.projectName&&e.logType&&void 0!==e.content&&e.timestamp){let s=e.projectName,r=e.logType,a=e.content,n=e.timestamp;t(e=>({...e,projects:{...e.projects,[s]:{...e.projects[s],logs:[...e.projects[s]?.logs||[],{type:r,content:a,timestamp:n}].slice(-1e3)}}}))}break;case"completion":t(s=>({...s,isInitializing:!1,isCompleted:!0,hasCompleted:!0,globalProgress:100,globalMessage:e.message??"初始化完成",completionSummary:e.result?{success:e.result.success,totalProjects:e.result.totalProjects,successCount:e.result.successCount,failedCount:e.result.failedCount,duration:e.result.duration}:void 0}));break;case"error":t(s=>({...s,isInitializing:!1,hasCompleted:!0,globalMessage:e.message??"发生错误",globalProgress:e.progress??s.globalProgress}))}},eX=async(e,s="cursor")=>{t(s=>({...s,projects:{...s.projects,[e]:{...s.projects[e],isOpening:!0}}}));try{let r=await fetch("/api/open-project",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectName:e,editor:s})}),a=await r.json();if(a.success&&a.editorUrl){let e=document.createElement("a");e.href=a.editorUrl,e.style.display="none",document.body.appendChild(e),e.click(),document.body.removeChild(e)}else console.error("打开项目失败:",a.error);t(s=>({...s,projects:{...s.projects,[e]:{...s.projects[e],isOpening:!1}}}))}catch(s){t(s=>({...s,projects:{...s.projects,[e]:{...s.projects[e],isOpening:!1}}})),console.error("打开项目失败:",s)}},eW=async e=>{t(s=>({...s,projects:{...s.projects,[e]:{...s.projects[e],isCleaningUp:!0}}}));try{let s=await fetch("/api/cleanup-project",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectName:e})}),r=await s.json();r.success?t(s=>({...s,projects:{...s.projects,[e]:{...s.projects[e],status:g.ProjectStatus.PENDING,message:"已清理,待克隆",isCleaningUp:!1,needsCleanup:!1}}})):t(s=>({...s,projects:{...s.projects,[e]:{...s.projects[e],isCleaningUp:!1,error:r.error}}}))}catch(s){t(t=>({...t,projects:{...t.projects,[e]:{...t.projects[e],isCleaningUp:!1,error:s instanceof Error?s.message:String(s)}}}))}},eK=async e=>{t(s=>({...s,projects:{...s.projects,[e]:{...s.projects[e],status:g.ProjectStatus.RETRYING,message:"正在重试...",progress:0,canRetry:!1}}}));try{let s=await fetch("/api/retry-project",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectName:e})}),r=await s.json();t(s=>({...s,projects:{...s.projects,[e]:{...s.projects[e],status:r.success?g.ProjectStatus.SUCCESS:g.ProjectStatus.FAILED,message:r.message,error:r.error,progress:r.success?100:s.projects[e].progress,canRetry:!r.success}}}))}catch(s){t(t=>({...t,projects:{...t.projects,[e]:{...t.projects[e],status:g.ProjectStatus.FAILED,message:"重试失败",error:s instanceof Error?s.message:String(s),canRetry:!0}}}))}},eV=e=>{switch(e){case g.ProjectStatus.EXISTING:case g.ProjectStatus.SUCCESS:return"text-green-600 bg-green-50 border-green-200";case g.ProjectStatus.FAILED:return"text-red-600 bg-red-50 border-red-200";case g.ProjectStatus.INCOMPLETE:return"text-orange-600 bg-orange-50 border-orange-200";case g.ProjectStatus.CLONING:case g.ProjectStatus.RETRYING:return"text-blue-600 bg-blue-50 border-blue-200";case g.ProjectStatus.PENDING:default:return"text-gray-600 bg-gray-50 border-gray-200"}},eq=e=>{switch(e){case g.ProjectStatus.PENDING:return"待克隆";case g.ProjectStatus.EXISTING:return"已存在";case g.ProjectStatus.CLONING:return"克隆中";case g.ProjectStatus.SUCCESS:return"成功";case g.ProjectStatus.FAILED:return"失败";case g.ProjectStatus.INCOMPLETE:return"不完整";case g.ProjectStatus.RETRYING:return"重试中";default:return"未知"}},eQ=()=>{let e=Object.values(s.projects);return e.length>0&&e.every(e=>e.status===g.ProjectStatus.EXISTING)},eZ=s=>{e.push(`/configuration?project=${encodeURIComponent(s)}`)},e0=(e,s)=>{C(t=>({...t,[e]:s}))},e1=(e,s)=>{A(t=>({...t,[e]:s}))},e2=(e,s)=>{O(t=>({...t,[e]:s}))},e4=(e,s)=>{M(t=>({...t,[e]:s}))},e3=e=>{G(s=>({...s,branchName:e}))},e5=e=>{H(s=>({...s,branchName:e}))},e7=e=>{V(s=>({...s,branchName:e})),ec(!1),ei("")},e6=async()=>{let e=K.selectedProjects.length>0?K.selectedProjects:Object.keys(s.projects);if(0===e.length){ea("暂无可用的项目"),ee([]);return}et(!0),ea(null);try{let s=await fetch("/api/batch-list-branches",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projects:e})}),t=await s.json();t.success?(ee(t.branches||[]),Array.isArray(t.failedProjects)&&t.failedProjects.length>0&&ea(`${t.failedProjects.length} 个项目获取分支失败(已跳过): ${t.failedProjects.map(e=>e.projectName).join(", ")}`)):(ea(t.error||"获取分支列表失败"),ee([]))}catch(e){console.error("获取批量分支列表失败:",e),ea("网络请求失败"),ee([])}finally{et(!1)}},e8=async e=>{let s=[];if(0===I.selectedProjects.length&&s.push("请先选择至少一个项目。"),I.targetBranch.trim()||s.push("请填写合入分支名称。"),I.sourceBranch.trim()||s.push("请填写被合入分支名称。"),s.length>0)return void E({isRunning:!1,operationLogs:[],feedbacks:s,progress:0,totalProjects:0,completedProjects:0,currentProject:""});let t=I.selectedProjects.length;E({isRunning:!0,operationLogs:[`开始批量分支合并,共 ${t} 个项目...`],feedbacks:[],progress:0,totalProjects:t,completedProjects:0,currentProject:""});let r=[],a=[];for(let s=0;s<I.selectedProjects.length;s++){let n=I.selectedProjects[s];E(e=>({...e,currentProject:n,completedProjects:s,progress:Math.round(s/t*100),operationLogs:[...e.operationLogs,`[进度] ${s+1}/${t} 开始处理项目 ${n}`]}));try{let s=await fetch("/api/admin-git-batch-merge",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projects:[n],targetBranch:I.targetBranch.trim(),sourceBranch:I.sourceBranch.trim(),dryRun:e})}),t=await s.json(),c=Array.isArray(t.operationLogs)?t.operationLogs:[],o=Array.isArray(t.feedbacks)?t.feedbacks:[t.error||"执行失败"];E(e=>({...e,operationLogs:[...e.operationLogs,...c],feedbacks:[...e.feedbacks,...o]})),a.push(...o),Array.isArray(t.projectResults)&&r.push(...t.projectResults)}catch(s){let e=s instanceof Error?s.message:"执行失败";E(s=>({...s,operationLogs:[...s.operationLogs,`[${n}] 请求失败: ${e}`],feedbacks:[...s.feedbacks,`[${n}] ${e}`]})),a.push(`[${n}] ${e}`),r.push({projectName:n,success:!1,reason:e})}}E(e=>({...e,isRunning:!1,progress:100,completedProjects:t,currentProject:"",operationLogs:[...e.operationLogs,"批量分支合并执行完成。"],feedbacks:a.length>0?a:e.feedbacks})),r.length>0?(eF(r),eM(!0)):(eF([]),eM(!1))},e9=async e=>{let s=[];if(0===D.selectedProjects.length&&s.push("请先选择至少一个项目。"),D.createBranch.trim()||s.push("请填写新分支名称。"),D.baseBranch.trim()||s.push("请填写来源分支名称。"),s.length>0)return void F({isRunning:!1,operationLogs:[],feedbacks:s,progress:0,totalProjects:0,completedProjects:0,currentProject:""});let t=D.selectedProjects.length;F({isRunning:!0,operationLogs:[`开始批量新建分支,共 ${t} 个项目...`],feedbacks:[],progress:0,totalProjects:t,completedProjects:0,currentProject:""});let r=[],a=[];for(let s=0;s<D.selectedProjects.length;s++){let n=D.selectedProjects[s];F(e=>({...e,currentProject:n,completedProjects:s,progress:Math.round(s/t*100),operationLogs:[...e.operationLogs,`[进度] ${s+1}/${t} 开始处理项目 ${n}`]}));try{let s=await fetch("/api/admin-git-batch-create-branch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projects:[n],createBranch:D.createBranch.trim(),baseBranch:D.baseBranch.trim(),dryRun:e})}),t=await s.json(),c=Array.isArray(t.operationLogs)?t.operationLogs:[],o=Array.isArray(t.feedbacks)?t.feedbacks:[t.error||"执行失败"];F(e=>({...e,operationLogs:[...e.operationLogs,...c],feedbacks:[...e.feedbacks,...o]})),a.push(...o),Array.isArray(t.projectResults)&&r.push(...t.projectResults)}catch(s){let e=s instanceof Error?s.message:"执行失败";F(s=>({...s,operationLogs:[...s.operationLogs,`[${n}] 请求失败: ${e}`],feedbacks:[...s.feedbacks,`[${n}] ${e}`]})),a.push(`[${n}] ${e}`),r.push({projectName:n,success:!1,reason:e})}}F(e=>({...e,isRunning:!1,progress:100,completedProjects:t,currentProject:"",operationLogs:[...e.operationLogs,"批量新建分支执行完成。"],feedbacks:a.length>0?a:e.feedbacks})),r.length>0?(eF(r),eM(!0)):(eF([]),eM(!1))},se=async e=>{let s=[];if(0===_.selectedProjects.length&&s.push("请先选择至少一个项目。"),_.branchName.trim()||s.push("请填写远端分支名称。"),s.length>0)return void J({isRunning:!1,operationLogs:[],feedbacks:s,progress:0,totalProjects:0,completedProjects:0,currentProject:""});let t=_.selectedProjects.length;J({isRunning:!0,operationLogs:[`开始批量删除远端分支,共 ${t} 个项目...`],feedbacks:[],progress:0,totalProjects:t,completedProjects:0,currentProject:""});let r=[],a=[];for(let s=0;s<_.selectedProjects.length;s++){let n=_.selectedProjects[s];J(e=>({...e,currentProject:n,completedProjects:s,progress:Math.round(s/t*100),operationLogs:[...e.operationLogs,`[进度] ${s+1}/${t} 开始处理项目 ${n}`]}));try{let s=await fetch("/api/admin-git-batch-delete-branch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projects:[n],branchName:_.branchName.trim(),dryRun:e})}),t=await s.json(),c=Array.isArray(t.operationLogs)?t.operationLogs:[],o=Array.isArray(t.feedbacks)?t.feedbacks:[t.error||"执行失败"];J(e=>({...e,operationLogs:[...e.operationLogs,...c],feedbacks:[...e.feedbacks,...o]})),a.push(...o),Array.isArray(t.projectResults)&&r.push(...t.projectResults)}catch(s){let e=s instanceof Error?s.message:"执行失败";J(s=>({...s,operationLogs:[...s.operationLogs,`[${n}] 请求失败: ${e}`],feedbacks:[...s.feedbacks,`[${n}] ${e}`]})),a.push(`[${n}] ${e}`),r.push({projectName:n,success:!1,reason:e})}}J(e=>({...e,isRunning:!1,progress:100,completedProjects:t,currentProject:"",operationLogs:[...e.operationLogs,"批量删除远端分支执行完成。"],feedbacks:a.length>0?a:e.feedbacks})),r.length>0?(eF(r),eM(!0)):(eF([]),eM(!1))},ss=async e=>{let s=b(Y.selectedProjects,Y.branchName);if(s.length>0)return void W({isRunning:!1,operationLogs:[],feedbacks:s,progress:0,totalProjects:0,completedProjects:0,currentProject:""});let t=Y.selectedProjects.length;W({isRunning:!0,operationLogs:[`开始批量探测远端分支,共 ${t} 个项目...`],feedbacks:[],progress:0,totalProjects:t,completedProjects:0,currentProject:""});let r=[],a=[];for(let s=0;s<Y.selectedProjects.length;s++){let n=Y.selectedProjects[s];W(e=>({...e,currentProject:n,completedProjects:s,progress:Math.round(s/t*100),operationLogs:[...e.operationLogs,`[进度] ${s+1}/${t} 开始处理项目 ${n}`]}));try{let s=await fetch("/api/admin-git-batch-probe-remote-branch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(w(n,Y.branchName,e))}),t=await s.json(),c=Array.isArray(t.operationLogs)?t.operationLogs:[],o=Array.isArray(t.feedbacks)?t.feedbacks:[t.error||"执行失败"];W(e=>({...e,operationLogs:[...e.operationLogs,...c],feedbacks:[...e.feedbacks,...o]})),a.push(...o),Array.isArray(t.projectResults)&&r.push(...t.projectResults)}catch(s){let e=s instanceof Error?s.message:"执行失败";W(s=>({...s,operationLogs:[...s.operationLogs,`[${n}] 请求失败: ${e}`],feedbacks:[...s.feedbacks,`[${n}] ${e}`]})),a.push(`[${n}] ${e}`),r.push({projectName:n,success:!1,reason:e})}}W(e=>({...e,isRunning:!1,progress:100,completedProjects:t,currentProject:"",operationLogs:[...e.operationLogs,"批量探测远端分支执行完成。"],feedbacks:a.length>0?a:e.feedbacks})),r.length>0?(eF(r),eM(!0)):(eF([]),eM(!1))},st=async e=>{let s=f(K.selectedProjects,K.branchName);if(s.length>0)return void Q({isRunning:!1,operationLogs:[],feedbacks:s,progress:0,totalProjects:0,completedProjects:0,currentProject:""});let t=K.selectedProjects.length,r=K.branchName.trim();Q({isRunning:!0,operationLogs:[`开始批量切换分支${e?"(DRY RUN)":""},目标分支: ${r},共 ${t} 个项目...`],feedbacks:[],progress:0,totalProjects:t,completedProjects:0,currentProject:""});let a=[],n=[];for(let s=0;s<K.selectedProjects.length;s++){let c=K.selectedProjects[s];Q(e=>({...e,currentProject:c,completedProjects:s,progress:Math.round(s/t*100),operationLogs:[...e.operationLogs,`[进度] ${s+1}/${t} 开始处理项目 ${c}`]}));try{let s=await fetch("/api/batch-switch-branch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(N(c,r,e))}),t=await s.json(),o=Array.isArray(t.operationLogs)?t.operationLogs:[],i=Array.isArray(t.feedbacks)?t.feedbacks:[t.error||"执行失败"];Q(e=>({...e,operationLogs:[...e.operationLogs,...o],feedbacks:[...e.feedbacks,...i]})),n.push(...i),Array.isArray(t.projectResults)&&a.push(...t.projectResults)}catch(s){let e=s instanceof Error?s.message:"执行失败";Q(s=>({...s,operationLogs:[...s.operationLogs,`[${c}] 请求失败: ${e}`],feedbacks:[...s.feedbacks,`[${c}] ${e}`]})),n.push(`[${c}] ${e}`),a.push({projectName:c,success:!1,reason:e})}}let c=a.filter(e=>e.success).length,o=a.length-c;Q(e=>({...e,isRunning:!1,progress:100,completedProjects:t,currentProject:"",operationLogs:[...e.operationLogs,`批量切换分支执行完成。总结: 共 ${a.length} 个项目,成功 ${c} 个,失败 ${o} 个。`],feedbacks:n.length>0?n:e.feedbacks})),a.length>0?(ed(a),ep(!0)):(ed([]),ep(!1)),sr(a.map(e=>e.projectName))},sr=e=>{eJ(s=>{let t={...s};return e.forEach(e=>{t[e]=(t[e]||0)+1}),t})},sa=e=>{eu(s=>({...s,branchName:e})),eP(!1),eC("")},sn=async()=>{let e=em.selectedProjects.length>0?em.selectedProjects:Object.keys(s.projects);if(0===e.length){ev("暂无可用的项目"),eb([]);return}eN(!0),ev(null);try{let s=await fetch("/api/batch-list-submodule-branches",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projects:e})}),t=await s.json();t.success?(eb(t.branches||[]),Array.isArray(t.failedProjects)&&t.failedProjects.length>0&&ev(`${t.failedProjects.length} 个项目获取子仓库分支失败(已跳过): ${t.failedProjects.map(e=>e.projectName).join(", ")}`)):(ev(t.error||"获取子仓库分支列表失败"),eb([]))}catch(e){console.error("获取批量子仓库分支列表失败:",e),ev("网络请求失败"),eb([])}finally{eN(!1)}},sc=async e=>{let s=y(em.selectedProjects,em.branchName);if(s.length>0)return void ex({isRunning:!1,operationLogs:[],feedbacks:s,progress:0,totalProjects:0,completedProjects:0,currentProject:""});let t=em.selectedProjects.length,r=em.branchName.trim();ex({isRunning:!0,operationLogs:[`开始批量切换子仓库(submodules/common)分支${e?"(DRY RUN)":""},目标分支: ${r},共 ${t} 个项目...`],feedbacks:[],progress:0,totalProjects:t,completedProjects:0,currentProject:""});let a=[],n=[];for(let s=0;s<em.selectedProjects.length;s++){let c=em.selectedProjects[s];ex(e=>({...e,currentProject:c,completedProjects:s,progress:Math.round(s/t*100),operationLogs:[...e.operationLogs,`[进度] ${s+1}/${t} 开始处理项目 ${c}`]}));try{let s=await fetch("/api/batch-switch-submodule-branch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(v(c,r,e))}),t=await s.json(),o=Array.isArray(t.operationLogs)?t.operationLogs:[],i=Array.isArray(t.feedbacks)?t.feedbacks:[t.error||"执行失败"];ex(e=>({...e,operationLogs:[...e.operationLogs,...o],feedbacks:[...e.feedbacks,...i]})),n.push(...i),Array.isArray(t.projectResults)&&a.push(...t.projectResults)}catch(s){let e=s instanceof Error?s.message:"执行失败";ex(s=>({...s,operationLogs:[...s.operationLogs,`[${c}] 请求失败: ${e}`],feedbacks:[...s.feedbacks,`[${c}] ${e}`]})),n.push(`[${c}] ${e}`),a.push({projectName:c,success:!1,reason:e})}}let c=a.filter(e=>e.success).length,o=a.length-c;ex(e=>({...e,isRunning:!1,progress:100,completedProjects:t,currentProject:"",operationLogs:[...e.operationLogs,`批量切换子仓库分支执行完成。总结: 共 ${a.length} 个项目,成功 ${c} 个,失败 ${o} 个。`],feedbacks:n.length>0?n:e.feedbacks})),a.length>0?(eL(a),eA(!0)):(eL([]),eA(!1)),sr(a.map(e=>e.projectName))},so=async e=>{let s=[];if(0===k.selectedProjects.length&&s.push("请先选择至少一个项目。"),k.createBranch.trim()||s.push("请填写创建分支名。"),k.baseBranch.trim()||s.push("请填写从 origin 哪个分支创建。"),k.mergeBranch.trim()||s.push("请填写被合并分支名称。"),s.length>0)return void L({isRunning:!1,operationLogs:[],feedbacks:s,runId:""});let t=`uat-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;L({isRunning:!0,operationLogs:[],feedbacks:[],runId:t});try{let s=await fetch("/api/uat-git-flow",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projects:k.selectedProjects,createBranch:k.createBranch.trim(),baseBranch:k.baseBranch,mergeBranch:k.mergeBranch.trim(),dryRun:e,runId:t})}),r=await s.json();L({isRunning:!1,operationLogs:Array.isArray(r.operationLogs)?r.operationLogs:[],feedbacks:Array.isArray(r.feedbacks)?r.feedbacks:[r.error||"执行失败"],runId:""}),Array.isArray(r.projectResults)&&(eF(r.projectResults),eM(!0))}catch(e){L({isRunning:!1,operationLogs:[],feedbacks:[e instanceof Error?e.message:"执行失败"],runId:""}),eF([]),eM(!1)}},si=async e=>{let s=[];if(0===R.selectedProjects.length&&s.push("请先选择至少一个项目。"),R.createBranch.trim()||s.push("请填写创建分支名。"),R.baseBranch.trim()||s.push("请填写从 origin 哪个分支创建。"),R.mergeBranch.trim()||s.push("请填写被合并分支名称。"),s.length>0)return void $({isRunning:!1,operationLogs:[],feedbacks:s,runId:""});let t=`gwh-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;$({isRunning:!0,operationLogs:[],feedbacks:[],runId:t});try{let s=await fetch("/api/gwh-git-flow",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projects:R.selectedProjects,createBranch:R.createBranch.trim(),baseBranch:"GWH",mergeBranch:R.mergeBranch.trim(),dryRun:e,runId:t})}),r=await s.json();$({isRunning:!1,operationLogs:Array.isArray(r.operationLogs)?r.operationLogs:[],feedbacks:Array.isArray(r.feedbacks)?r.feedbacks:[r.error||"执行失败"],runId:""}),Array.isArray(r.projectResults)&&(eF(r.projectResults),eM(!0))}catch(e){$({isRunning:!1,operationLogs:[],feedbacks:[e instanceof Error?e.message:"执行失败"],runId:""}),eF([]),eM(!1)}},sl=async()=>{if(eI&&S.runId)try{let e=await fetch("/api/uat-git-flow/step",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"execute",runId:S.runId,stepId:eI.stepId})}),s=await e.json(),t=Array.isArray(s.operationLogs)?s.operationLogs:[],r=Array.isArray(s.feedbacks)?s.feedbacks:[s.error||"执行失败"];if(!s.success){L(e=>({...e,isRunning:!1,operationLogs:t,feedbacks:r,runId:""})),eO(null),eE(!1);return}L(e=>({...e,operationLogs:t,feedbacks:r,isRunning:!s.isComplete,runId:s.isComplete?"":e.runId})),s.nextStep?(eO(s.nextStep),eE(!0)):(eO(null),eE(!1),Array.isArray(s.projectResults)&&(eF(s.projectResults),eM(!0)))}catch(e){L(s=>({...s,isRunning:!1,operationLogs:s.operationLogs,feedbacks:[...s.feedbacks,e instanceof Error?e.message:"执行失败"],runId:""})),eO(null),eE(!1)}},sd=async()=>{if(S.runId)try{let e=await fetch("/api/uat-git-flow/abort",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runId:S.runId})}),s=await e.json();s&&Array.isArray(s.operationLogs)?L(e=>({...e,isRunning:!1,operationLogs:s.operationLogs,feedbacks:Array.isArray(s.feedbacks)?s.feedbacks:e.feedbacks,runId:""})):L(e=>({...e,isRunning:!1,runId:""})),Array.isArray(s.projectResults)&&(eF(s.projectResults),eM(!0)),eO(null),eE(!1)}catch(e){L(s=>({...s,feedbacks:[...s.feedbacks,e instanceof Error?e.message:"中断失败"]}))}},sh=async()=>{if(B.runId)try{let e=await fetch("/api/gwh-git-flow/abort",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runId:B.runId})}),s=await e.json();s&&Array.isArray(s.operationLogs)?$(e=>({...e,isRunning:!1,operationLogs:s.operationLogs,feedbacks:Array.isArray(s.feedbacks)?s.feedbacks:e.feedbacks,runId:""})):$(e=>({...e,isRunning:!1,runId:""})),Array.isArray(s.projectResults)&&(eF(s.projectResults),eM(!0))}catch(e){$(s=>({...s,feedbacks:[...s.feedbacks,e instanceof Error?e.message:"中断失败"]}))}},sp=(0,x.filterBranchOptions)(Z,eo),sm=(0,x.filterBranchOptions)(ej,ek);return(0,r.jsxs)("div",{className:"container mx-auto p-4 sm:p-6 md:p-8",children:[(0,r.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,r.jsx)("h1",{className:"text-2xl font-bold",children:"项目初始化"}),s.isLoading?(0,r.jsx)(c.Button,{disabled:!0,children:"检查中..."}):(0,r.jsx)(c.Button,{onClick:()=>{t(e=>({...e,isInitializing:!0,isCompleted:!1,hasCompleted:!1,globalProgress:0,globalMessage:"正在连接服务器...",projects:{},completionSummary:void 0}));let e=new EventSource("/api/initialize-workspace");e.onmessage=e=>{try{let s=JSON.parse(e.data);eH(s)}catch(e){console.error("解析 SSE 消息失败:",e)}},e.onerror=()=>{t(e=>e.hasCompleted?e:{...e,isInitializing:!1,globalMessage:"连接服务器失败,请重试"}),e.close()},e.addEventListener("error",()=>{e.close()})},disabled:s.isInitializing,children:s.isInitializing?"初始化中...":"创建项目空间"})]}),(s.isInitializing||s.isCompleted)&&!eQ()&&(0,r.jsxs)("div",{className:"mb-6 p-4 bg-gray-50 rounded-lg",children:[(0,r.jsxs)("div",{className:"flex justify-between items-center mb-2",children:[(0,r.jsx)("span",{className:"text-sm font-medium",children:s.globalMessage}),(0,r.jsxs)("span",{className:"text-sm text-gray-600",children:[s.globalProgress,"%"]})]}),(0,r.jsx)("div",{className:"w-full bg-gray-200 rounded-full h-2",children:(0,r.jsx)("div",{className:"bg-blue-600 h-2 rounded-full transition-all duration-300",style:{width:`${s.globalProgress}%`}})})]}),s.completionSummary&&!eQ()&&(0,r.jsxs)("div",{className:`mb-6 p-4 rounded-lg border ${s.completionSummary.success?"bg-green-50 border-green-200":"bg-yellow-50 border-yellow-200"}`,children:[(0,r.jsx)("h3",{className:"font-semibold mb-2",children:"初始化完成"}),(0,r.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 text-sm",children:[(0,r.jsxs)("div",{children:["总项目数: ",s.completionSummary.totalProjects]}),(0,r.jsxs)("div",{className:"text-green-600",children:["成功: ",s.completionSummary.successCount]}),(0,r.jsxs)("div",{className:"text-red-600",children:["失败: ",s.completionSummary.failedCount]}),(0,r.jsxs)("div",{children:["耗时: ",Math.round(s.completionSummary.duration/1e3),"s"]})]})]}),(0,r.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4",children:Object.keys(s.projects).length>0?Object.values(s.projects).map(e=>(0,r.jsxs)("div",{className:`border rounded-lg p-4 ${eV(e.status)}`,children:[(0,r.jsxs)("div",{className:"flex justify-between items-start mb-2",children:[(0,r.jsx)("h2",{className:"font-semibold cursor-pointer hover:text-blue-600 transition-colors",onClick:()=>eZ(e.name),title:"点击进入项目配置",children:e.name}),(0,r.jsx)("span",{className:"text-xs px-2 py-1 rounded-full bg-white",children:eq(e.status)})]}),(0,r.jsx)("p",{className:"text-sm mb-2",children:e.message}),e.status===g.ProjectStatus.CLONING||e.status===g.ProjectStatus.RETRYING?(0,r.jsxs)("div",{className:"mb-2",children:[(0,r.jsx)("div",{className:"w-full bg-white rounded-full h-1",children:(0,r.jsx)("div",{className:"bg-current h-1 rounded-full transition-all duration-300",style:{width:`${e.progress}%`}})}),(0,r.jsxs)("span",{className:"text-xs",children:[e.progress,"%"]})]}):null,e.error&&(0,r.jsx)("p",{className:"text-xs text-red-600 mb-2",children:e.error}),(e.status===g.ProjectStatus.EXISTING||e.status===g.ProjectStatus.SUCCESS)&&(0,r.jsx)("div",{className:"mb-2",children:(0,r.jsx)(i.default,{projectName:e.name,variant:"main",refreshSignal:ez[e.name]||0,onSwitched:()=>eJ(s=>({...s,[e.name]:(s[e.name]||0)+1}))})}),(e.status===g.ProjectStatus.EXISTING||e.status===g.ProjectStatus.SUCCESS)&&(0,r.jsx)("div",{className:"mb-2",children:(0,r.jsx)(i.default,{projectName:e.name,variant:"sub",refreshSignal:ez[e.name]||0})}),(0,r.jsxs)("div",{className:"space-y-2",children:[e.canRetry&&(0,r.jsx)(c.Button,{size:"sm",variant:"outline",onClick:()=>eK(e.name),className:"w-full",children:"重试"}),e.needsCleanup&&e.status===g.ProjectStatus.INCOMPLETE&&(0,r.jsx)(c.Button,{size:"sm",variant:"destructive",onClick:()=>eW(e.name),disabled:e.isCleaningUp,className:"w-full",children:e.isCleaningUp?"清理中...":"清理项目"}),(e.status===g.ProjectStatus.EXISTING||e.status===g.ProjectStatus.SUCCESS)&&(0,r.jsx)(o.EditorSplitButton,{onOpen:s=>eX(e.name,s),loading:e.isOpening,loadingText:"打开中...",size:"sm",variant:"default",className:"w-full"}),e.logs&&e.logs.length>0&&(0,r.jsx)(c.Button,{size:"sm",variant:"outline",onClick:()=>eG(s=>({...s,[e.name]:!s[e.name]})),className:"w-full",children:e_[e.name]?"隐藏日志":`查看日志 (${e.logs.length})`})]}),e_[e.name]&&e.logs&&e.logs.length>0&&(0,r.jsx)("div",{className:"mt-3 border-t pt-3",children:(0,r.jsx)("div",{className:"bg-black text-white rounded text-xs font-mono p-2 max-h-48 overflow-y-auto",children:e.logs.map((e,s)=>(0,r.jsxs)("div",{className:`mb-1 ${"stderr"===e.type?"text-red-400":"progress"===e.type?"text-yellow-400":"text-green-400"}`,children:[(0,r.jsx)("span",{className:"text-gray-500 mr-2",children:new Date(e.timestamp).toLocaleTimeString()}),(0,r.jsxs)("span",{className:"text-blue-400 mr-2",children:["[",e.type,"]"]}),(0,r.jsx)("span",{className:"whitespace-pre-wrap",children:e.content})]},s))})})]},e.name)):(0,r.jsx)("div",{className:"col-span-full text-center text-gray-500 py-8",children:s.isLoading?"正在检查项目状态...":s.isInitializing?"正在加载项目...":'点击"创建项目空间"开始初始化'})}),eB&&(0,r.jsxs)("div",{className:"mt-8 rounded-lg border bg-white p-4 shadow-sm",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between mb-4",children:[(0,r.jsx)("h2",{className:"text-lg font-semibold",children:"UAT上线前 Git 操作流"}),(0,r.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,r.jsx)(c.Button,{onClick:()=>so(!1),disabled:S.isRunning,children:S.isRunning?"执行中...":"执行"}),(0,r.jsx)(c.Button,{variant:"outline",onClick:()=>so(!0),disabled:S.isRunning,children:"DRY RUN"}),(0,r.jsx)(c.Button,{variant:"destructive",onClick:sd,disabled:!S.isRunning,children:"中断"})]})]}),(0,r.jsxs)("div",{className:"grid gap-4 md:grid-cols-2",children:[(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(d.Label,{htmlFor:"uat-projects",children:"选择项目"}),(0,r.jsx)("select",{id:"uat-projects",multiple:!0,value:k.selectedProjects,onChange:e=>{let s=Array.from(e.target.selectedOptions).map(e=>e.value);C(e=>({...e,selectedProjects:s}))},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(s.projects).length?(0,r.jsx)("option",{value:"",disabled:!0,children:"暂无可用项目"}):Object.keys(s.projects).map(e=>(0,r.jsx)("option",{value:e,children:e},e))}),(0,r.jsx)("p",{className:"text-xs text-gray-500",children:"按住 Command / Ctrl 可多选"})]}),(0,r.jsxs)("div",{className:"grid gap-4",children:[(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(d.Label,{htmlFor:"uat-create-branch",children:"创建分支名"}),(0,r.jsx)(l.Input,{id:"uat-create-branch",value:k.createBranch,onChange:e=>e0("createBranch",e.target.value),placeholder:"例如: release/uat-2026-01"})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(d.Label,{htmlFor:"uat-base-branch",children:"从 origin 哪个分支创建"}),(0,r.jsx)("select",{id:"uat-base-branch",value:k.baseBranch,onChange:e=>e0("baseBranch",e.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:j.UAT_BASE_BRANCH_OPTIONS.map(e=>(0,r.jsx)("option",{value:e,children:e},e))})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(d.Label,{htmlFor:"uat-merge-branch",children:"被合并分支名称"}),(0,r.jsx)(l.Input,{id:"uat-merge-branch",value:k.mergeBranch,onChange:e=>e0("mergeBranch",e.target.value),placeholder:"例如: feature/xxx"})]})]})]}),(0,r.jsxs)("div",{className:"mt-6 grid gap-4 md:grid-cols-2",children:[(0,r.jsxs)("div",{className:"rounded-lg border p-3",children:[(0,r.jsx)("h3",{className:"text-sm font-semibold mb-2",children:"操作记录"}),0===S.operationLogs.length?(0,r.jsx)("p",{className:"text-xs text-gray-500",children:"暂无记录"}):(0,r.jsx)("div",{className:"bg-black text-white rounded text-xs font-mono p-2 max-h-48 overflow-y-auto",children:S.operationLogs.map((e,s)=>(0,r.jsx)("div",{className:"mb-1 whitespace-pre-wrap",children:e},s))})]}),(0,r.jsxs)("div",{className:"rounded-lg border p-3",children:[(0,r.jsx)("h3",{className:"text-sm font-semibold mb-2",children:"反馈信息"}),0===S.feedbacks.length?(0,r.jsx)("p",{className:"text-xs text-gray-500",children:"暂无反馈"}):(0,r.jsx)("div",{className:"space-y-1 text-sm",children:S.feedbacks.map((e,s)=>(0,r.jsx)("div",{className:"rounded bg-gray-50 px-2 py-1 text-gray-700",children:e},s))})]})]})]}),eB&&(0,r.jsxs)("div",{className:"mt-8 rounded-lg border bg-white p-4 shadow-sm",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between mb-4",children:[(0,r.jsx)("h2",{className:"text-lg font-semibold",children:"武汉协和版本上线前 Git 操作流"}),(0,r.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,r.jsx)(c.Button,{onClick:()=>si(!1),disabled:B.isRunning,children:B.isRunning?"执行中...":"执行"}),(0,r.jsx)(c.Button,{variant:"outline",onClick:()=>si(!0),disabled:B.isRunning,children:"DRY RUN"}),(0,r.jsx)(c.Button,{variant:"destructive",onClick:sh,disabled:!B.isRunning,children:"中断"})]})]}),(0,r.jsxs)("div",{className:"grid gap-4 md:grid-cols-2",children:[(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(d.Label,{htmlFor:"gwh-projects",children:"选择项目"}),(0,r.jsx)("select",{id:"gwh-projects",multiple:!0,value:R.selectedProjects,onChange:e=>{let s=Array.from(e.target.selectedOptions).map(e=>e.value);A(e=>({...e,selectedProjects:s}))},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(s.projects).length?(0,r.jsx)("option",{value:"",disabled:!0,children:"暂无可用项目"}):Object.keys(s.projects).map(e=>(0,r.jsx)("option",{value:e,children:e},e))}),(0,r.jsx)("p",{className:"text-xs text-gray-500",children:"按住 Command / Ctrl 可多选"})]}),(0,r.jsxs)("div",{className:"grid gap-4",children:[(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(d.Label,{htmlFor:"gwh-create-branch",children:"创建分支名"}),(0,r.jsx)(l.Input,{id:"gwh-create-branch",value:R.createBranch,onChange:e=>e1("createBranch",e.target.value),placeholder:"例如: release/whxh-2026-03"})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(d.Label,{htmlFor:"gwh-base-branch",children:"从 origin 哪个分支创建(固定)"}),(0,r.jsx)(l.Input,{id:"gwh-base-branch",value:R.baseBranch,disabled:!0,placeholder:"GWH"})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(d.Label,{htmlFor:"gwh-merge-branch",children:"被合并分支名称"}),(0,r.jsx)(l.Input,{id:"gwh-merge-branch",value:R.mergeBranch,onChange:e=>e1("mergeBranch",e.target.value),placeholder:"例如: feature/xxx"})]})]})]}),(0,r.jsxs)("div",{className:"mt-6 grid gap-4 md:grid-cols-2",children:[(0,r.jsxs)("div",{className:"rounded-lg border p-3",children:[(0,r.jsx)("h3",{className:"text-sm font-semibold mb-2",children:"操作记录"}),0===B.operationLogs.length?(0,r.jsx)("p",{className:"text-xs text-gray-500",children:"暂无记录"}):(0,r.jsx)("div",{className:"bg-black text-white rounded text-xs font-mono p-2 max-h-48 overflow-y-auto",children:B.operationLogs.map((e,s)=>(0,r.jsx)("div",{className:"mb-1 whitespace-pre-wrap",children:e},s))})]}),(0,r.jsxs)("div",{className:"rounded-lg border p-3",children:[(0,r.jsx)("h3",{className:"text-sm font-semibold mb-2",children:"反馈信息"}),0===B.feedbacks.length?(0,r.jsx)("p",{className:"text-xs text-gray-500",children:"暂无反馈"}):(0,r.jsx)("div",{className:"space-y-1 text-sm",children:B.feedbacks.map((e,s)=>(0,r.jsx)("div",{className:"rounded bg-gray-50 px-2 py-1 text-gray-700",children:e},s))})]})]})]}),eB&&(0,r.jsxs)("div",{className:"mt-8 rounded-lg border bg-white p-4 shadow-sm",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between mb-4",children:[(0,r.jsx)("h2",{className:"text-lg font-semibold",children:"常用 Git 分支操作 · 批量分支合并"}),(0,r.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,r.jsx)(c.Button,{onClick:()=>e8(!1),disabled:T.isRunning,children:T.isRunning?"执行中...":"执行"}),(0,r.jsx)(c.Button,{variant:"outline",onClick:()=>e8(!0),disabled:T.isRunning,children:"DRY RUN"})]})]}),(0,r.jsxs)("div",{className:"grid gap-4 md:grid-cols-2",children:[(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(d.Label,{htmlFor:"batch-merge-projects",children:"选择项目"}),(0,r.jsx)("select",{id:"batch-merge-projects",multiple:!0,value:I.selectedProjects,onChange:e=>{let s=Array.from(e.target.selectedOptions).map(e=>e.value);O(e=>({...e,selectedProjects:s}))},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(s.projects).length?(0,r.jsx)("option",{value:"",disabled:!0,children:"暂无可用项目"}):Object.keys(s.projects).map(e=>(0,r.jsx)("option",{value:e,children:e},e))}),(0,r.jsx)("p",{className:"text-xs text-gray-500",children:"按住 Command / Ctrl 可多选"})]}),(0,r.jsxs)("div",{className:"grid gap-4",children:[(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(d.Label,{htmlFor:"batch-merge-target-branch",children:"合入分支名称"}),(0,r.jsx)(l.Input,{id:"batch-merge-target-branch",value:I.targetBranch,onChange:e=>e2("targetBranch",e.target.value),placeholder:"例如: main"})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(d.Label,{htmlFor:"batch-merge-source-branch",children:"被合入分支名称"}),(0,r.jsx)(l.Input,{id:"batch-merge-source-branch",value:I.sourceBranch,onChange:e=>e2("sourceBranch",e.target.value),placeholder:"例如: release/candidate"})]})]})]}),(T.isRunning||T.progress>0)&&(0,r.jsxs)("div",{className:"mt-4 rounded-lg border p-3",children:[(0,r.jsxs)("div",{className:"flex justify-between items-center mb-2 text-sm",children:[(0,r.jsxs)("span",{children:["进度: ",T.completedProjects,"/",T.totalProjects,T.currentProject?` \xb7 当前项目: ${T.currentProject}`:""]}),(0,r.jsxs)("span",{children:[T.progress,"%"]})]}),(0,r.jsx)("div",{className:"w-full bg-gray-200 rounded-full h-2",children:(0,r.jsx)("div",{className:"bg-blue-600 h-2 rounded-full transition-all duration-300",style:{width:`${T.progress}%`}})})]}),(0,r.jsxs)("div",{className:"mt-6 grid gap-4 md:grid-cols-2",children:[(0,r.jsxs)("div",{className:"rounded-lg border p-3",children:[(0,r.jsx)("h3",{className:"text-sm font-semibold mb-2",children:"操作记录"}),0===T.operationLogs.length?(0,r.jsx)("p",{className:"text-xs text-gray-500",children:"暂无记录"}):(0,r.jsx)("div",{className:"bg-black text-white rounded text-xs font-mono p-2 max-h-48 overflow-y-auto",children:T.operationLogs.map((e,s)=>(0,r.jsx)("div",{className:"mb-1 whitespace-pre-wrap",children:e},s))})]}),(0,r.jsxs)("div",{className:"rounded-lg border p-3",children:[(0,r.jsx)("h3",{className:"text-sm font-semibold mb-2",children:"反馈信息"}),0===T.feedbacks.length?(0,r.jsx)("p",{className:"text-xs text-gray-500",children:"暂无反馈"}):(0,r.jsx)("div",{className:"space-y-1 text-sm",children:T.feedbacks.map((e,s)=>(0,r.jsx)("div",{className:"rounded bg-gray-50 px-2 py-1 text-gray-700",children:e},s))})]})]})]}),eB&&(0,r.jsxs)("div",{className:"mt-8 rounded-lg border bg-white p-4 shadow-sm",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between mb-4",children:[(0,r.jsx)("h2",{className:"text-lg font-semibold",children:"常用 Git 分支操作 · 批量新建分支"}),(0,r.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,r.jsx)(c.Button,{onClick:()=>e9(!1),disabled:U.isRunning,children:U.isRunning?"执行中...":"执行"}),(0,r.jsx)(c.Button,{variant:"outline",onClick:()=>e9(!0),disabled:U.isRunning,children:"DRY RUN"})]})]}),(0,r.jsxs)("div",{className:"grid gap-4 md:grid-cols-2",children:[(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(d.Label,{htmlFor:"batch-create-branch-projects",children:"选择项目"}),(0,r.jsx)("select",{id:"batch-create-branch-projects",multiple:!0,value:D.selectedProjects,onChange:e=>{let s=Array.from(e.target.selectedOptions).map(e=>e.value);M(e=>({...e,selectedProjects:s}))},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(s.projects).length?(0,r.jsx)("option",{value:"",disabled:!0,children:"暂无可用项目"}):Object.keys(s.projects).map(e=>(0,r.jsx)("option",{value:e,children:e},e))}),(0,r.jsx)("p",{className:"text-xs text-gray-500",children:"按住 Command / Ctrl 可多选"})]}),(0,r.jsxs)("div",{className:"grid gap-4",children:[(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(d.Label,{htmlFor:"batch-create-branch-name",children:"新分支名称"}),(0,r.jsx)(l.Input,{id:"batch-create-branch-name",value:D.createBranch,onChange:e=>e4("createBranch",e.target.value),placeholder:"例如: release/2026-03"})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(d.Label,{htmlFor:"batch-create-branch-base",children:"来源分支名称"}),(0,r.jsx)(l.Input,{id:"batch-create-branch-base",value:D.baseBranch,onChange:e=>e4("baseBranch",e.target.value),placeholder:"例如: main"})]})]})]}),(U.isRunning||U.progress>0)&&(0,r.jsxs)("div",{className:"mt-4 rounded-lg border p-3",children:[(0,r.jsxs)("div",{className:"flex justify-between items-center mb-2 text-sm",children:[(0,r.jsxs)("span",{children:["进度: ",U.completedProjects,"/",U.totalProjects,U.currentProject?` \xb7 当前项目: ${U.currentProject}`:""]}),(0,r.jsxs)("span",{children:[U.progress,"%"]})]}),(0,r.jsx)("div",{className:"w-full bg-gray-200 rounded-full h-2",children:(0,r.jsx)("div",{className:"bg-blue-600 h-2 rounded-full transition-all duration-300",style:{width:`${U.progress}%`}})})]}),(0,r.jsxs)("div",{className:"mt-6 grid gap-4 md:grid-cols-2",children:[(0,r.jsxs)("div",{className:"rounded-lg border p-3",children:[(0,r.jsx)("h3",{className:"text-sm font-semibold mb-2",children:"操作记录"}),0===U.operationLogs.length?(0,r.jsx)("p",{className:"text-xs text-gray-500",children:"暂无记录"}):(0,r.jsx)("div",{className:"bg-black text-white rounded text-xs font-mono p-2 max-h-48 overflow-y-auto",children:U.operationLogs.map((e,s)=>(0,r.jsx)("div",{className:"mb-1 whitespace-pre-wrap",children:e},s))})]}),(0,r.jsxs)("div",{className:"rounded-lg border p-3",children:[(0,r.jsx)("h3",{className:"text-sm font-semibold mb-2",children:"反馈信息"}),0===U.feedbacks.length?(0,r.jsx)("p",{className:"text-xs text-gray-500",children:"暂无反馈"}):(0,r.jsx)("div",{className:"space-y-1 text-sm",children:U.feedbacks.map((e,s)=>(0,r.jsx)("div",{className:"rounded bg-gray-50 px-2 py-1 text-gray-700",children:e},s))})]})]})]}),eB&&(0,r.jsxs)("div",{className:"mt-8 rounded-lg border bg-white p-4 shadow-sm",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between mb-4",children:[(0,r.jsx)("h2",{className:"text-lg font-semibold",children:"常用 Git 分支操作 · 批量删除远端分支"}),(0,r.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,r.jsx)(c.Button,{onClick:()=>se(!1),disabled:z.isRunning,children:z.isRunning?"执行中...":"执行"}),(0,r.jsx)(c.Button,{variant:"outline",onClick:()=>se(!0),disabled:z.isRunning,children:"DRY RUN"})]})]}),(0,r.jsxs)("div",{className:"grid gap-4 md:grid-cols-2",children:[(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(d.Label,{htmlFor:"batch-delete-branch-projects",children:"选择项目"}),(0,r.jsx)("select",{id:"batch-delete-branch-projects",multiple:!0,value:_.selectedProjects,onChange:e=>{let s=Array.from(e.target.selectedOptions).map(e=>e.value);G(e=>({...e,selectedProjects:s}))},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(s.projects).length?(0,r.jsx)("option",{value:"",disabled:!0,children:"暂无可用项目"}):Object.keys(s.projects).map(e=>(0,r.jsx)("option",{value:e,children:e},e))}),(0,r.jsx)("p",{className:"text-xs text-gray-500",children:"按住 Command / Ctrl 可多选"})]}),(0,r.jsx)("div",{className:"grid gap-4",children:(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(d.Label,{htmlFor:"batch-delete-branch-name",children:"远端分支名称"}),(0,r.jsx)(l.Input,{id:"batch-delete-branch-name",value:_.branchName,onChange:e=>e3(e.target.value),placeholder:"例如: release/2026-03"})]})})]}),(z.isRunning||z.progress>0)&&(0,r.jsxs)("div",{className:"mt-4 rounded-lg border p-3",children:[(0,r.jsxs)("div",{className:"flex justify-between items-center mb-2 text-sm",children:[(0,r.jsxs)("span",{children:["进度: ",z.completedProjects,"/",z.totalProjects,z.currentProject?` \xb7 当前项目: ${z.currentProject}`:""]}),(0,r.jsxs)("span",{children:[z.progress,"%"]})]}),(0,r.jsx)("div",{className:"w-full bg-gray-200 rounded-full h-2",children:(0,r.jsx)("div",{className:"bg-blue-600 h-2 rounded-full transition-all duration-300",style:{width:`${z.progress}%`}})})]}),(0,r.jsxs)("div",{className:"mt-6 grid gap-4 md:grid-cols-2",children:[(0,r.jsxs)("div",{className:"rounded-lg border p-3",children:[(0,r.jsx)("h3",{className:"text-sm font-semibold mb-2",children:"操作记录"}),0===z.operationLogs.length?(0,r.jsx)("p",{className:"text-xs text-gray-500",children:"暂无记录"}):(0,r.jsx)("div",{className:"bg-black text-white rounded text-xs font-mono p-2 max-h-48 overflow-y-auto",children:z.operationLogs.map((e,s)=>(0,r.jsx)("div",{className:"mb-1 whitespace-pre-wrap",children:e},s))})]}),(0,r.jsxs)("div",{className:"rounded-lg border p-3",children:[(0,r.jsx)("h3",{className:"text-sm font-semibold mb-2",children:"反馈信息"}),0===z.feedbacks.length?(0,r.jsx)("p",{className:"text-xs text-gray-500",children:"暂无反馈"}):(0,r.jsx)("div",{className:"space-y-1 text-sm",children:z.feedbacks.map((e,s)=>(0,r.jsx)("div",{className:"rounded bg-gray-50 px-2 py-1 text-gray-700",children:e},s))})]})]})]}),eB&&(0,r.jsxs)("div",{className:"mt-8 rounded-lg border bg-white p-4 shadow-sm",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between mb-4",children:[(0,r.jsx)("h2",{className:"text-lg font-semibold",children:"常用 Git 分支操作 · 批量探测远端分支"}),(0,r.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,r.jsx)(c.Button,{onClick:()=>ss(!1),disabled:X.isRunning,children:X.isRunning?"执行中...":"执行"}),(0,r.jsx)(c.Button,{variant:"outline",onClick:()=>ss(!0),disabled:X.isRunning,children:"DRY RUN"})]})]}),(0,r.jsxs)("div",{className:"grid gap-4 md:grid-cols-2",children:[(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(d.Label,{htmlFor:"batch-probe-branch-projects",children:"选择项目"}),(0,r.jsx)("select",{id:"batch-probe-branch-projects",multiple:!0,value:Y.selectedProjects,onChange:e=>{let s=Array.from(e.target.selectedOptions).map(e=>e.value);H(e=>({...e,selectedProjects:s}))},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(s.projects).length?(0,r.jsx)("option",{value:"",disabled:!0,children:"暂无可用项目"}):Object.keys(s.projects).map(e=>(0,r.jsx)("option",{value:e,children:e},e))}),(0,r.jsx)("p",{className:"text-xs text-gray-500",children:"按住 Command / Ctrl 可多选"})]}),(0,r.jsx)("div",{className:"grid gap-4",children:(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(d.Label,{htmlFor:"batch-probe-branch-name",children:"远端分支名称"}),(0,r.jsx)(l.Input,{id:"batch-probe-branch-name",value:Y.branchName,onChange:e=>e5(e.target.value),placeholder:"例如: release/2026-03"})]})})]}),(X.isRunning||X.progress>0)&&(0,r.jsxs)("div",{className:"mt-4 rounded-lg border p-3",children:[(0,r.jsxs)("div",{className:"flex justify-between items-center mb-2 text-sm",children:[(0,r.jsxs)("span",{children:["进度: ",X.completedProjects,"/",X.totalProjects,X.currentProject?` \xb7 当前项目: ${X.currentProject}`:""]}),(0,r.jsxs)("span",{children:[X.progress,"%"]})]}),(0,r.jsx)("div",{className:"w-full bg-gray-200 rounded-full h-2",children:(0,r.jsx)("div",{className:"bg-blue-600 h-2 rounded-full transition-all duration-300",style:{width:`${X.progress}%`}})})]}),(0,r.jsxs)("div",{className:"mt-6 grid gap-4 md:grid-cols-2",children:[(0,r.jsxs)("div",{className:"rounded-lg border p-3",children:[(0,r.jsx)("h3",{className:"text-sm font-semibold mb-2",children:"操作记录"}),0===X.operationLogs.length?(0,r.jsx)("p",{className:"text-xs text-gray-500",children:"暂无记录"}):(0,r.jsx)("div",{className:"bg-black text-white rounded text-xs font-mono p-2 max-h-48 overflow-y-auto",children:X.operationLogs.map((e,s)=>(0,r.jsx)("div",{className:"mb-1 whitespace-pre-wrap",children:e},s))})]}),(0,r.jsxs)("div",{className:"rounded-lg border p-3",children:[(0,r.jsx)("h3",{className:"text-sm font-semibold mb-2",children:"反馈信息"}),0===X.feedbacks.length?(0,r.jsx)("p",{className:"text-xs text-gray-500",children:"暂无反馈"}):(0,r.jsx)("div",{className:"space-y-1 text-sm",children:X.feedbacks.map((e,s)=>(0,r.jsx)("div",{className:"rounded bg-gray-50 px-2 py-1 text-gray-700",children:e},s))})]})]})]}),(0,r.jsxs)("div",{className:"mt-8 rounded-lg border bg-white p-4 shadow-sm",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between mb-4",children:[(0,r.jsx)("h2",{className:"text-lg font-semibold",children:"常用 Git 分支操作 · 批量切换分支"}),(0,r.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,r.jsx)(c.Button,{onClick:()=>st(!1),disabled:q.isRunning,children:q.isRunning?"执行中...":"执行"}),(0,r.jsx)(c.Button,{variant:"outline",onClick:()=>st(!0),disabled:q.isRunning,children:"DRY RUN"})]})]}),(0,r.jsxs)("div",{className:"grid gap-4 md:grid-cols-2",children:[(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(d.Label,{htmlFor:"batch-switch-branch-projects",children:"选择项目"}),(0,r.jsx)("select",{id:"batch-switch-branch-projects",multiple:!0,value:K.selectedProjects,onChange:e=>{let s=Array.from(e.target.selectedOptions).map(e=>e.value);V(e=>({...e,selectedProjects:s}))},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(s.projects).length?(0,r.jsx)("option",{value:"",disabled:!0,children:"暂无可用项目"}):Object.keys(s.projects).map(e=>(0,r.jsx)("option",{value:e,children:e},e))}),(0,r.jsx)("p",{className:"text-xs text-gray-500",children:"按住 Command / Ctrl 可多选;未选择时下拉聚合所有项目分支"})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(d.Label,{htmlFor:"batch-switch-branch-name",children:"目标分支"}),(0,r.jsxs)(h.DropdownMenu,{open:en,onOpenChange:e=>{ec(e),e&&(ei(""),e6())},children:[(0,r.jsx)(h.DropdownMenuTrigger,{asChild:!0,children:(0,r.jsxs)(c.Button,{variant:"outline",className:"w-full justify-between font-normal",children:[(0,r.jsx)("span",{className:"truncate",children:K.branchName||(es?"加载中...":"点击选择目标分支")}),(0,r.jsx)(m.ChevronDownIcon,{className:"size-4 opacity-50 shrink-0"})]})}),(0,r.jsxs)(h.DropdownMenuContent,{align:"start",className:"w-72",children:[(0,r.jsx)("div",{className:"p-1",children:(0,r.jsx)(l.Input,{value:eo,onChange:e=>ei(e.target.value),placeholder:"搜索分支...",className:"h-8"})}),(0,r.jsx)(h.DropdownMenuSeparator,{}),es&&(0,r.jsxs)("div",{className:"flex items-center justify-center gap-2 px-3 py-4 text-sm text-gray-500",children:[(0,r.jsx)("span",{className:"animate-spin w-3 h-3 border-2 border-blue-500 border-t-transparent rounded-full"}),"聚合获取各项目远程分支中..."]}),!es&&er&&(0,r.jsxs)("div",{className:"px-3 py-3 text-sm",children:[(0,r.jsx)("p",{className:"text-red-600",children:er}),(0,r.jsx)(c.Button,{variant:"outline",size:"sm",onClick:e6,className:"mt-2 h-7 px-2 text-xs",children:"重试"})]}),!es&&!er&&(0,r.jsx)(r.Fragment,{children:0===Z.length?(0,r.jsx)("div",{className:"px-3 py-4 text-sm text-gray-500",children:"暂无可用的远程分支"}):0===sp.total?(0,r.jsx)("div",{className:"px-3 py-4 text-sm text-gray-500",children:"没有匹配的分支"}):(0,r.jsxs)(r.Fragment,{children:[sp.visible.map(e=>(0,r.jsxs)(h.DropdownMenuItem,{className:"flex items-center justify-between",onSelect:s=>{s.preventDefault(),e7(e)},children:[(0,r.jsx)("span",{className:"min-w-0 flex-1 truncate",children:e}),e===K.branchName&&(0,r.jsx)(p.CheckIcon,{className:"size-4 text-blue-600 shrink-0"})]},e)),sp.total>sp.visible.length&&(0,r.jsxs)("div",{className:"px-3 py-2 text-xs text-gray-400 border-t",children:["共 ",sp.total," 个匹配分支,仅展示前 ",sp.visible.length," 项,更多请使用上方搜索"]})]})})]})]}),K.branchName&&(0,r.jsxs)("p",{className:"text-xs text-gray-500",children:["目标分支: ",(0,r.jsx)("span",{className:"text-blue-600 font-medium",children:K.branchName})]})]})]}),(q.isRunning||q.progress>0)&&(0,r.jsxs)("div",{className:"mt-4 rounded-lg border p-3",children:[(0,r.jsxs)("div",{className:"flex justify-between items-center mb-2 text-sm",children:[(0,r.jsxs)("span",{children:["进度: ",q.completedProjects,"/",q.totalProjects,q.currentProject?` \xb7 当前项目: ${q.currentProject}`:""]}),(0,r.jsxs)("span",{children:[q.progress,"%"]})]}),(0,r.jsx)("div",{className:"w-full bg-gray-200 rounded-full h-2",children:(0,r.jsx)("div",{className:"bg-blue-600 h-2 rounded-full transition-all duration-300",style:{width:`${q.progress}%`}})})]}),(0,r.jsxs)("div",{className:"mt-6 grid gap-4 md:grid-cols-2",children:[(0,r.jsxs)("div",{className:"rounded-lg border p-3",children:[(0,r.jsx)("h3",{className:"text-sm font-semibold mb-2",children:"操作记录"}),0===q.operationLogs.length?(0,r.jsx)("p",{className:"text-xs text-gray-500",children:"暂无记录"}):(0,r.jsx)("div",{className:"bg-black text-white rounded text-xs font-mono p-2 max-h-48 overflow-y-auto",children:q.operationLogs.map((e,s)=>(0,r.jsx)("div",{className:"mb-1 whitespace-pre-wrap",children:e},s))})]}),(0,r.jsxs)("div",{className:"rounded-lg border p-3",children:[(0,r.jsx)("h3",{className:"text-sm font-semibold mb-2",children:"反馈信息"}),0===q.feedbacks.length?(0,r.jsx)("p",{className:"text-xs text-gray-500",children:"暂无反馈"}):(0,r.jsx)("div",{className:"space-y-1 text-sm",children:q.feedbacks.map((e,s)=>(0,r.jsx)("div",{className:"rounded bg-gray-50 px-2 py-1 text-gray-700",children:e},s))})]})]})]}),(0,r.jsxs)("div",{className:"mt-8 rounded-lg border bg-white p-4 shadow-sm",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between mb-4",children:[(0,r.jsx)("h2",{className:"text-lg font-semibold",children:"常用 Git 分支操作 · 批量切换子仓库(submodules/common)分支"}),(0,r.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,r.jsx)(c.Button,{onClick:()=>sc(!1),disabled:eg.isRunning,children:eg.isRunning?"执行中...":"执行"}),(0,r.jsx)(c.Button,{variant:"outline",onClick:()=>sc(!0),disabled:eg.isRunning,children:"DRY RUN"})]})]}),(0,r.jsxs)("div",{className:"grid gap-4 md:grid-cols-2",children:[(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(d.Label,{htmlFor:"batch-switch-sub-projects",children:"选择项目"}),(0,r.jsx)("select",{id:"batch-switch-sub-projects",multiple:!0,value:em.selectedProjects,onChange:e=>{let s=Array.from(e.target.selectedOptions).map(e=>e.value);eu(e=>({...e,selectedProjects:s}))},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(s.projects).length?(0,r.jsx)("option",{value:"",disabled:!0,children:"暂无可用项目"}):Object.keys(s.projects).map(e=>(0,r.jsx)("option",{value:e,children:e},e))}),(0,r.jsx)("p",{className:"text-xs text-gray-500",children:"按住 Command / Ctrl 可多选;未选择时下拉聚合所有项目子仓库分支"})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(d.Label,{htmlFor:"batch-switch-sub-name",children:"目标分支"}),(0,r.jsxs)(h.DropdownMenu,{open:ew,onOpenChange:e=>{eP(e),e&&(eC(""),sn())},children:[(0,r.jsx)(h.DropdownMenuTrigger,{asChild:!0,children:(0,r.jsxs)(c.Button,{variant:"outline",className:"w-full justify-between font-normal",children:[(0,r.jsx)("span",{className:"truncate",children:em.branchName||(ef?"加载中...":"点击选择目标分支")}),(0,r.jsx)(m.ChevronDownIcon,{className:"size-4 opacity-50 shrink-0"})]})}),(0,r.jsxs)(h.DropdownMenuContent,{align:"start",className:"w-72",children:[(0,r.jsx)("div",{className:"p-1",children:(0,r.jsx)(l.Input,{value:ek,onChange:e=>eC(e.target.value),placeholder:"搜索分支...",className:"h-8"})}),(0,r.jsx)(h.DropdownMenuSeparator,{}),ef&&(0,r.jsxs)("div",{className:"flex items-center justify-center gap-2 px-3 py-4 text-sm text-gray-500",children:[(0,r.jsx)("span",{className:"animate-spin w-3 h-3 border-2 border-blue-500 border-t-transparent rounded-full"}),"聚合获取各项目子仓库远程分支中..."]}),!ef&&ey&&(0,r.jsxs)("div",{className:"px-3 py-3 text-sm",children:[(0,r.jsx)("p",{className:"text-red-600",children:ey}),(0,r.jsx)(c.Button,{variant:"outline",size:"sm",onClick:sn,className:"mt-2 h-7 px-2 text-xs",children:"重试"})]}),!ef&&!ey&&(0,r.jsx)(r.Fragment,{children:0===ej.length?(0,r.jsx)("div",{className:"px-3 py-4 text-sm text-gray-500",children:"暂无可用的子仓库远程分支"}):0===sm.total?(0,r.jsx)("div",{className:"px-3 py-4 text-sm text-gray-500",children:"没有匹配的分支"}):(0,r.jsxs)(r.Fragment,{children:[sm.visible.map(e=>(0,r.jsxs)(h.DropdownMenuItem,{className:"flex items-center justify-between",onSelect:s=>{s.preventDefault(),sa(e)},children:[(0,r.jsx)("span",{className:"min-w-0 flex-1 truncate",children:e}),e===em.branchName&&(0,r.jsx)(p.CheckIcon,{className:"size-4 text-blue-600 shrink-0"})]},e)),sm.total>sm.visible.length&&(0,r.jsxs)("div",{className:"px-3 py-2 text-xs text-gray-400 border-t",children:["共 ",sm.total," 个匹配分支,仅展示前 ",sm.visible.length," 项,更多请使用上方搜索"]})]})})]})]}),em.branchName&&(0,r.jsxs)("p",{className:"text-xs text-gray-500",children:["目标分支: ",(0,r.jsx)("span",{className:"text-blue-600 font-medium",children:em.branchName})]})]})]}),(eg.isRunning||eg.progress>0)&&(0,r.jsxs)("div",{className:"mt-4 rounded-lg border p-3",children:[(0,r.jsxs)("div",{className:"flex justify-between items-center mb-2 text-sm",children:[(0,r.jsxs)("span",{children:["进度: ",eg.completedProjects,"/",eg.totalProjects,eg.currentProject?` \xb7 当前项目: ${eg.currentProject}`:""]}),(0,r.jsxs)("span",{children:[eg.progress,"%"]})]}),(0,r.jsx)("div",{className:"w-full bg-gray-200 rounded-full h-2",children:(0,r.jsx)("div",{className:"bg-blue-600 h-2 rounded-full transition-all duration-300",style:{width:`${eg.progress}%`}})})]}),(0,r.jsxs)("div",{className:"mt-6 grid gap-4 md:grid-cols-2",children:[(0,r.jsxs)("div",{className:"rounded-lg border p-3",children:[(0,r.jsx)("h3",{className:"text-sm font-semibold mb-2",children:"操作记录"}),0===eg.operationLogs.length?(0,r.jsx)("p",{className:"text-xs text-gray-500",children:"暂无记录"}):(0,r.jsx)("div",{className:"bg-black text-white rounded text-xs font-mono p-2 max-h-48 overflow-y-auto",children:eg.operationLogs.map((e,s)=>(0,r.jsx)("div",{className:"mb-1 whitespace-pre-wrap",children:e},s))})]}),(0,r.jsxs)("div",{className:"rounded-lg border p-3",children:[(0,r.jsx)("h3",{className:"text-sm font-semibold mb-2",children:"反馈信息"}),0===eg.feedbacks.length?(0,r.jsx)("p",{className:"text-xs text-gray-500",children:"暂无反馈"}):(0,r.jsx)("div",{className:"space-y-1 text-sm",children:eg.feedbacks.map((e,s)=>(0,r.jsx)("div",{className:"rounded bg-gray-50 px-2 py-1 text-gray-700",children:e},s))})]})]})]}),(0,r.jsx)(u.Dialog,{open:!1,onOpenChange:e=>{!e&&eI&&S.isRunning||eE(e)},children:(0,r.jsxs)(u.DialogContent,{showCloseButton:!1,children:[(0,r.jsxs)(u.DialogHeader,{children:[(0,r.jsx)(u.DialogTitle,{children:"确认执行下一步"}),(0,r.jsx)(u.DialogDescription,{children:eI?`${eI.projectName} \xb7 ${eI.description}`:"准备下一步执行"})]}),(0,r.jsx)("div",{className:"rounded-md border bg-gray-50 p-3 text-sm font-mono text-gray-700",children:eI?eI.command:""}),(0,r.jsxs)(u.DialogFooter,{children:[(0,r.jsx)(c.Button,{variant:"outline",onClick:sd,children:"取消执行"}),(0,r.jsx)(c.Button,{onClick:sl,disabled:!eI,children:"确认并执行"})]})]})}),(0,r.jsx)(u.Dialog,{open:eB&&eD,onOpenChange:eM,children:(0,r.jsxs)(u.DialogContent,{children:[(0,r.jsxs)(u.DialogHeader,{children:[(0,r.jsx)(u.DialogTitle,{children:"操作结果"}),(0,r.jsx)(u.DialogDescription,{children:"查看所有项目执行结果"})]}),(0,r.jsx)("div",{className:"space-y-2",children:0===eU.length?(0,r.jsx)("p",{className:"text-sm text-gray-500",children:"暂无结果"}):eU.map(e=>(0,r.jsxs)("div",{className:`rounded-md border px-3 py-2 text-sm ${e.success?"bg-green-50 text-green-700":"bg-red-50 text-red-700"}`,children:[(0,r.jsxs)("div",{className:"flex items-start justify-between",children:[(0,r.jsx)("span",{className:"font-medium",children:e.projectName}),(0,r.jsx)("span",{className:"ml-4 text-right",children:!0===e.exists||!1===e.exists?P(e):e.success?"成功":e.reason||"失败"})]}),!e.success&&e.rollbackActions&&e.rollbackActions.length>0&&(0,r.jsxs)("div",{className:"mt-2 text-xs text-gray-600",children:[(0,r.jsx)("div",{className:"font-semibold text-gray-700",children:"已回滚操作:"}),(0,r.jsx)("ul",{className:"mt-1 list-disc pl-4",children:e.rollbackActions.map((s,t)=>(0,r.jsx)("li",{children:s},`${e.projectName}-rollback-${t}`))})]})]},e.projectName))}),(0,r.jsx)(u.DialogFooter,{children:(0,r.jsx)(c.Button,{onClick:()=>eM(!1),children:"关闭"})})]})}),(0,r.jsx)(u.Dialog,{open:eh,onOpenChange:ep,children:(0,r.jsxs)(u.DialogContent,{children:[(0,r.jsxs)(u.DialogHeader,{children:[(0,r.jsx)(u.DialogTitle,{children:"批量切换分支结果"}),(0,r.jsx)(u.DialogDescription,{children:(()=>{let e=el.filter(e=>e.success).length,s=el.length-e;return`共 ${el.length} 个项目,成功 ${e} 个,失败 ${s} 个`})()})]}),(0,r.jsx)("div",{className:"space-y-2",children:0===el.length?(0,r.jsx)("p",{className:"text-sm text-gray-500",children:"暂无结果"}):el.map(e=>(0,r.jsx)("div",{className:`rounded-md border px-3 py-2 text-sm ${e.success?"bg-green-50 text-green-700":"bg-red-50 text-red-700"}`,children:(0,r.jsxs)("div",{className:"flex items-start justify-between",children:[(0,r.jsx)("span",{className:"font-medium",children:e.projectName}),(0,r.jsx)("span",{className:"ml-4 text-right",children:e.success?"成功":e.reason||"失败"})]})},e.projectName))}),(0,r.jsx)(u.DialogFooter,{children:(0,r.jsx)(c.Button,{onClick:()=>ep(!1),children:"关闭"})})]})}),(0,r.jsx)(u.Dialog,{open:eR,onOpenChange:eA,children:(0,r.jsxs)(u.DialogContent,{children:[(0,r.jsxs)(u.DialogHeader,{children:[(0,r.jsx)(u.DialogTitle,{children:"批量切换子仓库分支结果"}),(0,r.jsx)(u.DialogDescription,{children:(()=>{let e=eS.filter(e=>e.success).length,s=eS.length-e;return`共 ${eS.length} 个项目,成功 ${e} 个,失败 ${s} 个`})()})]}),(0,r.jsx)("div",{className:"space-y-2",children:0===eS.length?(0,r.jsx)("p",{className:"text-sm text-gray-500",children:"暂无结果"}):eS.map(e=>(0,r.jsx)("div",{className:`rounded-md border px-3 py-2 text-sm ${e.success?"bg-green-50 text-green-700":"bg-red-50 text-red-700"}`,children:(0,r.jsxs)("div",{className:"flex items-start justify-between",children:[(0,r.jsx)("span",{className:"font-medium",children:e.projectName}),(0,r.jsx)("span",{className:"ml-4 text-right",children:e.success?"成功":e.reason||"失败"})]})},e.projectName))}),(0,r.jsx)(u.DialogFooter,{children:(0,r.jsx)(c.Button,{onClick:()=>eA(!1),children:"关闭"})})]})})]})}}}}]);
2
-
3
- //# sourceMappingURL=b109f2fb91f36e31.js.map