import{j as e,r as o}from"./vendor-codemirror-B1SGo4xl.js";import{G as Ge,B as v,D as Me,a as Ee,b as Be,c as Le,t as N,i as Qe,f as Oe}from"./index-Bp-M7P_8.js";import{I as f}from"./input-Bnlm--la.js";import{p as T}from"./pipeline-BGteNHr0.js";import{u as We,q as Ve,b as Je}from"./unwrap-D6sbt6TG.js";import{u as ce}from"./useMutation-DTWI9Q1n.js";import{C as Ke,a as Ie}from"./card-BHSBTtub.js";import{B as D}from"./badge-B00SZHvE.js";import{L as H,a as Y,y as ae,J as U,ad as He,k as ie,ar as Z,as as Te,a2 as de,F as _e,b as ee,ae as I,aQ as Ue,N as he,h as ye,G as ue,z as Xe,aq as Ye,Q as Ze,f as me,T as Fe,q as ea,P as xe,S as aa,aR as na,ac as sa,aS as ta}from"./vendor-icons-BWk-DH7F.js";import{T as oa}from"./textarea-BvOVhaCD.js";import{L as h}from"./label-NkONM5Mp.js";import{S as se,a as te,b as oe,c as re,d as L}from"./select-DbhcBWnH.js";import{d as ra}from"./config-CBy2SxR-.js";import{c as la}from"./credential-Df-OY-sx.js";import"./index-5FEebgvX.js";function ia(n={page:1,page_size:100}){return We({queryKey:Ve.pipelines(n),queryFn:async()=>{const p=await T.getPipelines(n);return Je(p)},staleTime:2e4})}function pa(){const n=Ge(),p=()=>n.invalidateQueries({queryKey:["pipelines"]}),P=ce({mutationFn:d=>T.triggerByCode(d),onSuccess:p}),b=ce({mutationFn:d=>T.deletePipeline(d),onSuccess:p}),j=ce({mutationFn:({code:d,runId:y})=>T.stopRunByCode(d,y)});return{triggerMutation:P,deleteMutation:b,stopRunMutation:j,invalidate:p}}function ca(n){return n.toLowerCase().replace(/[^a-z0-9]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")||`pipeline-${Date.now()}`}function da(n){switch(n){case"success":return e.jsxs(D,{"code-path":"src/components/deploy/pipeline-helpers.tsx:49:9",variant:"outline",className:"border-emerald-500/30 text-emerald-400 bg-emerald-500/10",children:[e.jsx(ae,{"code-path":"src/components/deploy/pipeline-helpers.tsx:50:11",className:"h-3 w-3 mr-1"}),"成功"]});case"failed":return e.jsxs(D,{"code-path":"src/components/deploy/pipeline-helpers.tsx:56:9",variant:"outline",className:"border-red-500/30 text-red-400 bg-red-500/10",children:[e.jsx(Y,{"code-path":"src/components/deploy/pipeline-helpers.tsx:57:11",className:"h-3 w-3 mr-1"}),"失败"]});case"running":return e.jsxs(D,{"code-path":"src/components/deploy/pipeline-helpers.tsx:63:9",variant:"outline",className:"border-blue-500/30 text-blue-400 bg-blue-500/10 animate-pulse",children:[e.jsx(H,{"code-path":"src/components/deploy/pipeline-helpers.tsx:64:11",className:"h-3 w-3 mr-1 animate-spin"}),"运行中"]});default:return e.jsx(D,{"code-path":"src/components/deploy/pipeline-helpers.tsx:70:9",variant:"outline",className:"border-[var(--dg-border)] text-[var(--dg-text-secondary)]",children:"从未运行"})}}const le=[{key:"checkout",label:"代码检出",icon:U,color:"#6366F1",order:1,needs:["repo"],desc:"从 Git 仓库拉取代码"},{key:"build",label:"构建",icon:He,color:"#F59E0B",order:2,needs:[],desc:"编译/打包项目"},{key:"test",label:"测试",icon:ae,color:"#10B981",order:3,needs:[],desc:"运行单元/集成测试"},{key:"image",label:"镜像打包",icon:ie,color:"#06B6D4",order:4,needs:["registry"],desc:"Docker 构建 & 推送"},{key:"deploy",label:"部署",icon:Z,color:"#EF4444",order:5,needs:[],desc:"部署到目标环境"},{key:"verify",label:"验证",icon:Te,color:"#3B82F6",order:6,needs:[],desc:"部署后健康检查"}].sort((n,p)=>n.order-p.order);function ge(n){if(!n)return"-";if(n<60)return`${n}s`;const p=Math.floor(n/60),P=n%60;return P>0?`${p}分${P}秒`:`${p}分`}function ma(n){if(!n)return[];try{const p=typeof n=="string"?JSON.parse(n):n;return Array.isArray(p)?p:[]}catch{return[]}}function xa({pipeline:n}){const[p,P]=o.useState(null),[b,j]=o.useState(!1),d=n.code||n.id,y=async()=>{if(d){j(!0);try{const i=await T.getQueue(d);P(i?.data||i)}catch{P(null)}finally{j(!1)}}};o.useEffect(()=>{y();const i=setInterval(y,1e4);return()=>clearInterval(i)},[d]);const M=async i=>{try{await T.removeFromQueue(d,i),N.success("已取消"),y()}catch{N.error("取消失败")}},w=p?.running||0,u=p?.queued||0,C=p?.queue_ids||[],R=n.max_executors||2,t=p?.pending_runs||[];return b&&!p||w===0&&u===0?null:e.jsxs("div",{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:69:5",className:"px-4 py-2 space-y-2",children:[e.jsxs("div",{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:70:7",className:"flex items-center gap-2 text-xs",children:[e.jsx("span",{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:71:9",className:"text-[var(--dg-text-secondary)]",children:"构建执行状态"}),e.jsxs("span",{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:72:9",className:"font-bold text-[var(--dg-text-primary)]",children:[w,"/",R]}),u>0&&e.jsxs("span",{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:74:11",className:"text-[var(--dg-text-secondary)] ml-2",children:["构建队列 ",e.jsxs("span",{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:75:18",className:"font-bold text-amber-400",children:["(",u,")"]})]})]}),u>0&&t.length>0&&e.jsx("div",{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:81:9",className:"space-y-1",children:t.map(i=>e.jsxs("div",{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:83:13",className:"flex items-center justify-between bg-[var(--dg-bg-tertiary)] rounded px-3 py-1.5",children:[e.jsxs("div",{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:84:15",className:"flex items-center gap-2 text-xs",children:[e.jsx(ee,{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:85:17",className:"h-3 w-3 text-amber-400"}),e.jsxs("span",{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:86:17",className:"text-[var(--dg-text-secondary)] font-mono",children:["#",String(i.build_number??i.id??"")]}),e.jsx("span",{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:87:17",className:"text-[var(--dg-text-secondary)]",children:String(i.branch||"-")}),e.jsx("span",{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:88:17",className:"text-[var(--dg-text-secondary)] opacity-50",children:String(i.triggered_by||"-")})]}),e.jsxs(v,{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:90:15",variant:"ghost",size:"sm",className:"h-6 text-xs text-red-400 hover:text-red-300",onClick:()=>M(i.id),children:[e.jsx(Y,{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:91:17",className:"h-3 w-3 mr-1"}),"取消"]})]},i.id))}),u>0&&t.length===0&&C.length>0&&e.jsx("div",{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:99:9",className:"space-y-1",children:C.map(i=>e.jsxs("div",{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:101:13",className:"flex items-center justify-between bg-[var(--dg-bg-tertiary)] rounded px-3 py-1.5",children:[e.jsxs("div",{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:102:15",className:"flex items-center gap-2 text-xs",children:[e.jsx(ee,{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:103:17",className:"h-3 w-3 text-amber-400"}),e.jsxs("span",{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:104:17",className:"text-[var(--dg-text-muted)] font-mono",children:["Run #",i]})]}),e.jsxs(v,{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:106:15",variant:"ghost",size:"sm",className:"h-6 text-xs text-red-400 hover:text-red-300",onClick:()=>M(i),children:[e.jsx(Y,{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:107:17",className:"h-3 w-3 mr-1"}),"取消"]})]},i))})]})}function ga({pipeline:n,pipelineRuns:p,isLoadingRuns:P,onStopRun:b}){const[j,d]=o.useState(!1),[y,M]=o.useState(null),[w,u]=o.useState([]),C=n.code||n.id,R=async t=>{M(t),d(!0);try{const i=await T.getRunLog(C,t.id);u(i?.logs||[])}catch{u([])}};return e.jsxs("div",{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:136:5",className:"border-t border-[var(--dg-border)]",children:[e.jsx(xa,{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:137:7",pipeline:n}),P?e.jsx("div",{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:140:9",className:"flex items-center justify-center py-6",children:e.jsx(H,{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:141:11",className:"h-5 w-5 animate-spin text-[var(--dg-text-secondary)]"})}):p.length===0?e.jsx("div",{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:144:9",className:"py-6 text-center text-[var(--dg-text-secondary)] text-sm",children:"暂无执行记录"}):e.jsxs("table",{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:146:9",className:"w-full text-sm",children:[e.jsx("thead",{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:147:11",className:"border-b border-[var(--dg-border)]",children:e.jsxs("tr",{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:148:13",className:"bg-[var(--dg-bg-tertiary)]",children:[e.jsx("th",{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:149:15",className:"px-4 py-2 text-left text-xs font-medium text-[var(--dg-text-secondary)]",children:"#"}),e.jsx("th",{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:150:15",className:"px-4 py-2 text-left text-xs font-medium text-[var(--dg-text-secondary)]",children:"状态"}),e.jsx("th",{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:151:15",className:"px-4 py-2 text-left text-xs font-medium text-[var(--dg-text-secondary)]",children:"触发人"}),e.jsx("th",{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:152:15",className:"px-4 py-2 text-left text-xs font-medium text-[var(--dg-text-secondary)]",children:"耗时"}),e.jsx("th",{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:153:15",className:"px-4 py-2 text-left text-xs font-medium text-[var(--dg-text-secondary)]",children:"时间"}),e.jsx("th",{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:154:15",className:"px-4 py-2 text-right text-xs font-medium text-[var(--dg-text-secondary)]",children:"操作"})]})}),e.jsx("tbody",{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:157:11",children:p.map(t=>e.jsxs("tr",{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:159:15",className:"border-b border-[var(--dg-border)] hover:bg-[var(--dg-bg-tertiary)]/50",children:[e.jsxs("td",{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:160:17",className:"px-4 py-2 font-medium text-[var(--dg-text-primary)]",children:["#",String(t.build_number??t.id??"")]}),e.jsx("td",{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:161:17",className:"px-4 py-2",children:t.status==="success"?e.jsxs(D,{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:163:21",className:"bg-emerald-500/20 text-emerald-400 border-emerald-500/30 text-[11px]",children:[e.jsx(ae,{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:164:23",className:"h-3 w-3 mr-0.5"}),"成功"]}):t.status==="failed"?e.jsxs(D,{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:167:21",className:"bg-red-500/20 text-red-400 border-red-500/30 text-[11px]",children:[e.jsx(Y,{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:168:23",className:"h-3 w-3 mr-0.5"}),"失败"]}):t.status==="running"?e.jsxs(D,{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:171:21",className:"bg-blue-500/20 text-blue-400 border-blue-500/30 text-[11px]",children:[e.jsx(H,{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:172:23",className:"h-3 w-3 animate-spin mr-0.5"}),"执行中"]}):t.status==="cancelled"?e.jsxs(D,{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:175:21",className:"bg-yellow-500/20 text-yellow-400 border-yellow-500/30 text-[11px]",children:[e.jsx(de,{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:176:23",className:"h-3 w-3 mr-0.5"}),"已停止"]}):e.jsx(D,{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:179:21",variant:"secondary",className:"text-[11px]",children:String(t.status)})}),e.jsx("td",{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:182:17",className:"px-4 py-2 text-[var(--dg-text-secondary)] text-xs",children:String(t.triggered_by||"admin")}),e.jsx("td",{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:183:17",className:"px-4 py-2 text-[var(--dg-text-secondary)] text-xs",children:ge(t.duration)}),e.jsx("td",{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:184:17",className:"px-4 py-2 text-[var(--dg-text-secondary)] text-xs",children:t.created_at?new Date(t.created_at).toLocaleString("zh-CN"):"-"}),e.jsx("td",{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:187:17",className:"px-4 py-2 text-right",children:e.jsxs("div",{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:188:19",className:"flex items-center justify-end gap-1",children:[e.jsxs(v,{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:189:21",variant:"ghost",size:"sm",className:"h-7 text-xs text-blue-400 hover:text-blue-300",onClick:()=>R(t),children:[e.jsx(_e,{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:190:23",className:"h-3.5 w-3.5 mr-1"}),"日志"]}),(t.status==="running"||t.status==="pending")&&e.jsxs(v,{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:193:23",variant:"ghost",size:"sm",className:"h-7 text-xs text-red-400 hover:text-red-300",onClick:()=>b(t.id),children:[e.jsx(de,{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:194:25",className:"h-3.5 w-3.5 mr-1"}),"停止"]})]})})]},t.id))})]}),e.jsx(Me,{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:205:7",open:j,onOpenChange:d,children:e.jsxs(Ee,{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:206:9",className:"max-w-3xl max-h-[85vh] overflow-y-auto bg-[var(--dg-bg-primary)] border-[var(--dg-border)] text-[var(--dg-text-primary)]",children:[e.jsx(Be,{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:207:11",children:e.jsxs(Le,{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:208:13",className:"flex items-center gap-2",children:[e.jsx(_e,{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:209:15",className:"h-5 w-5"}),"执行日志 #",String(y?.build_number??y?.id??"")]})}),e.jsxs("div",{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:212:11",className:"space-y-3",children:[e.jsxs("div",{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:213:13",className:"flex flex-wrap gap-3 text-sm text-[var(--dg-text-secondary)]",children:[e.jsxs("span",{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:214:15",children:["触发方式: ",String(y?.triggered_by||"manual")]}),e.jsxs("span",{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:215:15",children:["分支: ",String(y?.branch||"-")]}),e.jsxs("span",{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:216:15",children:["耗时: ",ge(y?.duration)]})]}),e.jsx("div",{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:218:13",className:"bg-slate-950 rounded-md p-3 max-h-[50vh] overflow-y-auto font-mono text-xs",children:w.length===0?e.jsx("div",{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:220:17",className:"text-slate-500 py-4 text-center",children:"暂无日志"}):w.map((t,i)=>e.jsxs("div",{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:223:19",className:"flex gap-2 py-0.5",children:[e.jsxs("span",{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:224:21",className:"text-slate-500 shrink-0",children:["[",t.time,"]"]}),e.jsxs("span",{"code-path":"src/components/deploy/pipeline-manager/PipelineRunPanel.tsx:225:21",className:t.level==="error"?"text-red-400":t.level==="warn"?"text-yellow-400":t.level==="success"?"text-green-400":"text-slate-300",children:[t.level==="success"?"✓":t.level==="error"?"✗":t.level==="warn"?"!":">"," ",t.message]})]},i))})]})]})})]})}function ha({pipeline:n,isExpanded:p,isLoadingRuns:P,pipelineRuns:b,onToggleExpand:j,onTrigger:d,onStopRunning:y,onDelete:M,onStopRun:w}){const u=Qe(),C=ma(n.stages),R=n.repo,t=n.registry,i=n.environment,A=n.code||n.id;return e.jsx(Ke,{"code-path":"src/components/deploy/pipeline-manager/PipelineCard.tsx:61:5",className:"bg-[var(--dg-bg-secondary)] border-[var(--dg-border)] overflow-hidden",children:e.jsxs(Ie,{"code-path":"src/components/deploy/pipeline-manager/PipelineCard.tsx:62:7",className:"p-0",children:[e.jsxs("div",{"code-path":"src/components/deploy/pipeline-manager/PipelineCard.tsx:63:9",className:"px-4 py-3",children:[e.jsxs("div",{"code-path":"src/components/deploy/pipeline-manager/PipelineCard.tsx:64:11",className:"flex items-start justify-between",children:[e.jsxs("div",{"code-path":"src/components/deploy/pipeline-manager/PipelineCard.tsx:65:13",className:"flex-1 min-w-0",children:[e.jsxs("div",{"code-path":"src/components/deploy/pipeline-manager/PipelineCard.tsx:66:15",className:"flex items-center gap-2 flex-wrap",children:[e.jsx("h3",{"code-path":"src/components/deploy/pipeline-manager/PipelineCard.tsx:67:17",className:"font-semibold text-[var(--dg-text-primary)]",children:String(n.name)}),n.run_count>0&&e.jsxs(D,{"code-path":"src/components/deploy/pipeline-manager/PipelineCard.tsx:69:19",variant:"outline",className:"text-[11px] text-[var(--dg-text-secondary)] border-[var(--dg-border)]",children:["#",String(n.run_count)]}),da(n.last_status),i&&e.jsx(D,{"code-path":"src/components/deploy/pipeline-manager/PipelineCard.tsx:75:19",style:{backgroundColor:`${i.color}20`,color:i.color},className:"text-xs",children:String(i.display_name)}),n.job_name&&e.jsx(D,{"code-path":"src/components/deploy/pipeline-manager/PipelineCard.tsx:83:19",variant:"secondary",className:"text-xs font-mono opacity-60",children:String(n.job_name)})]}),e.jsx("p",{"code-path":"src/components/deploy/pipeline-manager/PipelineCard.tsx:86:15",className:"text-xs text-[var(--dg-text-secondary)] mt-1 line-clamp-1",children:String(n.description||"暂无描述")}),(n.last_run_branch||n.last_commit_id||n.last_image_tag)&&e.jsxs("div",{"code-path":"src/components/deploy/pipeline-manager/PipelineCard.tsx:91:17",className:"flex items-center gap-1 mt-1.5 text-xs font-mono",children:[n.last_run_branch&&e.jsxs("span",{"code-path":"src/components/deploy/pipeline-manager/PipelineCard.tsx:93:21",className:"flex items-center gap-0.5 text-indigo-400",children:[e.jsx(U,{"code-path":"src/components/deploy/pipeline-manager/PipelineCard.tsx:94:23",className:"h-3 w-3"}),String(n.last_run_branch)]}),n.last_run_branch&&n.last_commit_id&&e.jsx("span",{"code-path":"src/components/deploy/pipeline-manager/PipelineCard.tsx:98:21",className:"text-[var(--dg-text-secondary)] opacity-50 text-[10px] mx-0.5",children:"+"}),n.last_commit_id&&e.jsx("code",{"code-path":"src/components/deploy/pipeline-manager/PipelineCard.tsx:101:21",className:"text-amber-400 bg-amber-400/10 px-1 py-0.5 rounded text-[11px]",children:String(n.last_commit_id).slice(0,8)}),(n.last_run_branch||n.last_commit_id)&&n.last_image_tag&&e.jsx(I,{"code-path":"src/components/deploy/pipeline-manager/PipelineCard.tsx:106:21",className:"h-3 w-3 text-[var(--dg-text-secondary)] opacity-40 mx-0.5"}),n.last_image_tag&&e.jsxs("span",{"code-path":"src/components/deploy/pipeline-manager/PipelineCard.tsx:109:21",className:"flex items-center gap-0.5 text-cyan-400",children:[e.jsx(Ue,{"code-path":"src/components/deploy/pipeline-manager/PipelineCard.tsx:110:23",className:"h-3 w-3"}),e.jsx("code",{"code-path":"src/components/deploy/pipeline-manager/PipelineCard.tsx:111:23",className:"bg-cyan-400/10 px-1 py-0.5 rounded text-[11px]",children:String(n.last_image_tag)})]}),n.last_duration>0&&e.jsxs("span",{"code-path":"src/components/deploy/pipeline-manager/PipelineCard.tsx:115:21",className:"flex items-center gap-0.5 ml-auto text-[var(--dg-text-secondary)] opacity-50",children:[e.jsx(ee,{"code-path":"src/components/deploy/pipeline-manager/PipelineCard.tsx:116:23",className:"h-3 w-3"}),ge(n.last_duration)]})]}),e.jsxs("div",{"code-path":"src/components/deploy/pipeline-manager/PipelineCard.tsx:121:15",className:"flex items-center gap-3 mt-1.5 text-xs text-[var(--dg-text-secondary)] opacity-60",children:[e.jsxs("span",{"code-path":"src/components/deploy/pipeline-manager/PipelineCard.tsx:122:17",className:"flex items-center gap-1",children:[e.jsx(U,{"code-path":"src/components/deploy/pipeline-manager/PipelineCard.tsx:123:19",className:"h-3 w-3"}),n.deploy_mode==="tag"?"Tag发版":String(n.branch||"main")]}),e.jsx("span",{"code-path":"src/components/deploy/pipeline-manager/PipelineCard.tsx:126:17",className:"flex items-center gap-1",children:(n.deploy_target||"ssh")==="k8s"?e.jsxs(e.Fragment,{children:[e.jsx(he,{"code-path":"src/components/deploy/pipeline-manager/PipelineCard.tsx:128:23",className:"h-3 w-3"}),"Kubernetes"]}):e.jsxs(e.Fragment,{children:[e.jsx(ye,{"code-path":"src/components/deploy/pipeline-manager/PipelineCard.tsx:130:23",className:"h-3 w-3"}),"SSH 主机"]})}),R&&e.jsxs("span",{"code-path":"src/components/deploy/pipeline-manager/PipelineCard.tsx:133:26",className:"flex items-center gap-1",children:[e.jsx(ue,{"code-path":"src/components/deploy/pipeline-manager/PipelineCard.tsx:133:68",className:"h-3 w-3"}),String(R.name)]}),t&&e.jsxs("span",{"code-path":"src/components/deploy/pipeline-manager/PipelineCard.tsx:134:30",className:"flex items-center gap-1",children:[e.jsx(ie,{"code-path":"src/components/deploy/pipeline-manager/PipelineCard.tsx:134:72",className:"h-3 w-3"}),String(t.name)]}),n.last_run_at&&e.jsxs("span",{"code-path":"src/components/deploy/pipeline-manager/PipelineCard.tsx:136:19",children:[e.jsx(ee,{"code-path":"src/components/deploy/pipeline-manager/PipelineCard.tsx:136:25",className:"h-3 w-3 inline mr-0.5"}),new Date(n.last_run_at).toLocaleString("zh-CN")]})]})]}),e.jsxs("div",{"code-path":"src/components/deploy/pipeline-manager/PipelineCard.tsx:140:13",className:"flex items-center gap-1 ml-4 shrink-0",children:[n.last_status==="running"?e.jsxs(v,{"code-path":"src/components/deploy/pipeline-manager/PipelineCard.tsx:142:17",variant:"destructive",size:"sm",className:"h-8",onClick:y,children:[e.jsx(de,{"code-path":"src/components/deploy/pipeline-manager/PipelineCard.tsx:143:19",className:"h-3.5 w-3.5 mr-1"}),"停止"]}):e.jsxs(v,{"code-path":"src/components/deploy/pipeline-manager/PipelineCard.tsx:146:17",variant:"default",size:"sm",className:"h-8",onClick:d,children:[e.jsx(Xe,{"code-path":"src/components/deploy/pipeline-manager/PipelineCard.tsx:147:19",className:"h-3.5 w-3.5 mr-1"}),"执行"]}),e.jsx(v,{"code-path":"src/components/deploy/pipeline-manager/PipelineCard.tsx:150:15",variant:"outline",size:"sm",className:"h-8",onClick:()=>u(`/pipelines/${A}`),children:"编辑"}),e.jsxs(v,{"code-path":"src/components/deploy/pipeline-manager/PipelineCard.tsx:151:15",variant:"outline",size:"sm",className:"h-8",onClick:()=>u(`/pipelines/${A}/runs`),children:[e.jsx(Ye,{"code-path":"src/components/deploy/pipeline-manager/PipelineCard.tsx:152:17",className:"h-3.5 w-3.5 mr-1"}),"记录"]}),e.jsx(v,{"code-path":"src/components/deploy/pipeline-manager/PipelineCard.tsx:154:15",variant:"ghost",size:"sm",className:"h-8",onClick:j,children:p?e.jsx(Ze,{"code-path":"src/components/deploy/pipeline-manager/PipelineCard.tsx:155:31",className:"h-4 w-4"}):e.jsx(me,{"code-path":"src/components/deploy/pipeline-manager/PipelineCard.tsx:155:69",className:"h-4 w-4"})}),e.jsx(v,{"code-path":"src/components/deploy/pipeline-manager/PipelineCard.tsx:157:15",variant:"ghost",size:"icon",className:"h-8 w-8 text-red-500",onClick:M,children:e.jsx(Fe,{"code-path":"src/components/deploy/pipeline-manager/PipelineCard.tsx:158:17",className:"h-4 w-4"})})]})]}),C.length>0&&e.jsx("div",{"code-path":"src/components/deploy/pipeline-manager/PipelineCard.tsx:164:13",className:"flex items-center mt-2.5",children:C.map((g,E)=>{const O=le.find(z=>z.label===g.name);let _="";if(n.last_run_stages)try{const z=typeof n.last_run_stages=="string"?JSON.parse(n.last_run_stages):n.last_run_stages,X=Array.isArray(z)?z.find(J=>J.name===g.name||J.type===O?.key):null;_=String(X?.status||"")}catch{}const F=_==="success"||_==="completed",q=_==="running"||_==="in_progress",G=_==="failed"||_==="error",$=G?"#EF4444":q?"#3B82F6":F?"#10B981":"#6B7280",W=G?"#EF444428":q?"#3B82F628":F?"#10B98128":"#6B728018",V=G?e.jsx(Y,{"code-path":"src/components/deploy/pipeline-manager/PipelineCard.tsx:186:19",className:"h-3 w-3"}):q?e.jsx(H,{"code-path":"src/components/deploy/pipeline-manager/PipelineCard.tsx:188:19",className:"h-3 w-3 animate-spin"}):F?e.jsx(ae,{"code-path":"src/components/deploy/pipeline-manager/PipelineCard.tsx:190:19",className:"h-3 w-3"}):e.jsx("span",{"code-path":"src/components/deploy/pipeline-manager/PipelineCard.tsx:192:19",className:"text-[10px] opacity-40",children:"○"});return e.jsxs("div",{"code-path":"src/components/deploy/pipeline-manager/PipelineCard.tsx:195:19",className:"flex items-center",children:[e.jsxs("div",{"code-path":"src/components/deploy/pipeline-manager/PipelineCard.tsx:196:21",className:"flex items-center gap-1.5 px-2.5 py-1.5 text-[11px] font-semibold border shadow-sm",style:{backgroundColor:W,borderColor:`${$}70`,color:$,borderRadius:E===0?"8px 0 0 8px":E===C.length-1?"0 8px 8px 0":"0"},children:[V,String(g.name)]}),E{try{const[a,c]=await Promise.all([ra.getEnvironments().catch(()=>({list:[]})),la.list({page_size:100}).catch(()=>({list:[]}))]);ze(Array.isArray(a?.list)?a.list:[]);const x=c?.list||[];X(x.filter(m=>m.secret_type==="api")),ne(x.filter(m=>m.secret_type==="docker"))}catch{}},[]);o.useEffect(()=>{n&&Re()},[n,Re]);const Ae=()=>{j(""),y(""),w(""),C(""),t("main"),A(""),E(["checkout","build","image","deploy"]),_("branch"),q("ssh"),$(""),r(""),B(""),S("manual"),ve(""),be(""),pe(""),fe(""),K([]),we(""),Se(2)},qe=async()=>{if(!b.trim()){N.error("请输入流水线名称");return}if(g.includes("checkout")&&!u.trim()){N.error("代码检出阶段需要填写 Git URL");return}if(g.includes("image")&&!l){N.error("镜像打包阶段需要关联 Docker 凭证");return}V(!0);try{const a=g.map(x=>le.find(m=>m.key===x)?.label||x),c=JSON.stringify(a.map((x,m)=>({id:`stage-${m+1}`,name:x,type:g[m]||"custom",tasks:[]})));await T.createPipeline({name:b,code:ca(b),job_name:d||void 0,description:M,source:u,branch:R,dockerfile:i,type:"deploy",stages:c,deploy_mode:O,deploy_target:F,environment_id:G?Number(G):null,repo_id:null,registry_id:null,git_credential_id:s?Number(s):null,registry_credential_id:l?Number(l):null,trigger_mode:k,watch_branches:Pe||void 0,exclude_branch:je||void 0,cron_expr:Ne||void 0,webhook_token:Ce||void 0,variables:Q.length>0?JSON.stringify(Q):void 0,cache_paths:De||void 0,max_executors:ke}),N.success("流水线已创建"),p(!1),Ae(),P()}catch{N.error("创建失败")}finally{V(!1)}};return e.jsx(Me,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:153:5",open:n,onOpenChange:p,children:e.jsxs(Ee,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:154:7",className:"max-w-2xl max-h-[85vh] overflow-y-auto bg-[var(--dg-bg-primary)] border-[var(--dg-border)] text-[var(--dg-text-primary)]",children:[e.jsx(Be,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:155:9",children:e.jsxs(Le,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:156:11",className:"flex items-center gap-2",children:[e.jsx(Z,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:156:60",className:"h-5 w-5"}),"新建流水线"]})}),e.jsxs("div",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:158:9",className:"space-y-4",children:[e.jsxs("div",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:159:11",className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:160:13",className:"space-y-1",children:[e.jsxs(h,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:161:15",children:["名称 ",e.jsx("span",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:161:25",className:"text-red-400",children:"*"})]}),e.jsx(f,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:162:15",value:b,onChange:a=>j(a.target.value),placeholder:"例如: demo-jar 后端部署",className:"bg-[var(--dg-bg-secondary)] border-[var(--dg-border)] h-9"})]}),e.jsxs("div",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:164:13",className:"space-y-1",children:[e.jsxs(h,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:165:15",children:["Job 名称 ",e.jsx("span",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:165:29",className:"text-xs text-[var(--dg-text-secondary)]",children:"(Webhook URL)"})]}),e.jsx(f,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:166:15",value:d,onChange:a=>y(a.target.value),placeholder:"cex-admin-server",className:"bg-[var(--dg-bg-secondary)] border-[var(--dg-border)] h-9 font-mono text-sm"}),d&&e.jsxs("p",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:167:30",className:"text-[10px] text-[var(--dg-text-secondary)] opacity-60",children:["Webhook: POST .../webhook/job/",e.jsx("b",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:167:130",children:d})]})]})]}),e.jsxs("div",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:170:11",className:"space-y-1",children:[e.jsx(h,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:171:13",children:"描述"}),e.jsx(oa,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:172:13",value:M,onChange:a=>w(a.target.value),placeholder:"流水线描述...",rows:2,className:"bg-[var(--dg-bg-secondary)] border-[var(--dg-border)]"})]}),e.jsxs("div",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:175:11",className:"grid grid-cols-3 gap-3",children:[e.jsxs("div",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:176:13",className:"space-y-1",children:[e.jsx(h,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:177:15",children:"部署模式"}),e.jsx("div",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:178:15",className:"flex gap-1 bg-[var(--dg-bg-secondary)] rounded-lg p-1 border border-[var(--dg-border)]",children:[{key:"branch",label:"分支",icon:U},{key:"tag",label:"Tag 发版",icon:ea}].map(a=>{const c=O===a.key;return e.jsxs("button",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:185:21",onClick:()=>_(a.key),className:`flex-1 flex items-center justify-center gap-1 px-2 py-1.5 rounded-md text-xs font-medium transition-all ${c?"bg-blue-500 text-white":"text-[var(--dg-text-secondary)] hover:text-[var(--dg-text-primary)]"}`,children:[e.jsx(a.icon,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:192:23",className:"h-3.5 w-3.5"}),a.label]},a.key)})})]}),e.jsxs("div",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:198:13",className:"space-y-1",children:[e.jsx(h,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:199:15",children:"部署目标"}),e.jsx("div",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:200:15",className:"flex gap-1 bg-[var(--dg-bg-secondary)] rounded-lg p-1 border border-[var(--dg-border)]",children:[{key:"ssh",label:"SSH 主机",icon:ye},{key:"k8s",label:"Kubernetes 集群",icon:he}].map(a=>{const c=F===a.key;return e.jsxs("button",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:207:21",onClick:()=>q(a.key),className:`flex-1 flex items-center justify-center gap-1 px-2 py-1.5 rounded-md text-xs font-medium transition-all ${c?"bg-green-500 text-white":"text-[var(--dg-text-secondary)] hover:text-[var(--dg-text-primary)]"}`,children:[e.jsx(a.icon,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:214:23",className:"h-3.5 w-3.5"}),a.label]},a.key)})})]}),e.jsxs("div",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:220:13",className:"space-y-1",children:[e.jsx(h,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:221:15",children:"环境分组"}),e.jsxs(se,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:222:15",value:String(G),onValueChange:a=>$(a==="__none"?"":a),children:[e.jsx(te,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:223:17",className:"bg-[var(--dg-bg-secondary)] border-[var(--dg-border)] h-9",children:e.jsx(oe,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:223:102",placeholder:"选择环境"})}),e.jsxs(re,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:224:17",children:[e.jsx(L,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:225:19",value:"__none",children:"不指定"}),$e.map(a=>e.jsx(L,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:227:21",value:String(a.id),children:e.jsxs("span",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:228:23",className:"flex items-center gap-1.5",children:[e.jsx("span",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:229:25",className:"w-2 h-2 rounded-full inline-block",style:{backgroundColor:a.color}}),String(a.display_name)]})},a.id))]})]})]})]}),e.jsxs("div",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:239:11",className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:240:13",className:"space-y-1",children:[e.jsxs(h,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:241:15",children:["Git URL ",g.includes("checkout")&&e.jsx("span",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:241:70",className:"text-red-400",children:"*"})]}),e.jsx(f,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:242:15",value:u,onChange:a=>C(a.target.value),placeholder:"https://gitee.com/user/repo.git",className:"bg-[var(--dg-bg-secondary)] border-[var(--dg-border)] h-9 font-mono text-xs"})]}),e.jsxs("div",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:244:13",className:"space-y-1",children:[e.jsx(h,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:245:15",children:"分支 / Tag"}),e.jsx(f,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:246:15",value:R,onChange:a=>t(a.target.value),placeholder:O==="tag"?"v1.0.0":"main",className:"bg-[var(--dg-bg-secondary)] border-[var(--dg-border)] h-9"})]}),e.jsxs("div",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:248:13",className:"space-y-1",children:[e.jsxs(h,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:249:15",children:["Git 凭证 ",e.jsx("span",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:249:29",className:"text-xs text-[var(--dg-text-secondary)] opacity-60",children:"(API Token)"})]}),e.jsxs(se,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:250:15",value:String(s),onValueChange:a=>r(a==="__none"?"":a),children:[e.jsx(te,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:251:17",className:"bg-[var(--dg-bg-secondary)] border-[var(--dg-border)] h-9",children:e.jsx(oe,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:251:102",placeholder:"选择凭证"})}),e.jsxs(re,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:252:17",children:[e.jsx(L,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:253:19",value:"__none",children:"不关联"}),z.map(a=>e.jsx(L,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:255:21",value:String(a.id),children:e.jsxs("span",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:256:23",className:"flex items-center gap-1.5",children:[e.jsx(ue,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:257:25",className:"h-3 w-3 opacity-60"}),String(a.name)," ",a.summary&&e.jsxs("span",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:257:96",className:"text-[10px] opacity-50",children:["(",String(a.summary),")"]})]})},a.id))]})]}),!s&&g.includes("checkout")&&e.jsx("p",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:263:78",className:"text-xs text-amber-400",children:"建议关联凭证"})]}),e.jsxs("div",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:265:13",className:"space-y-1",children:[e.jsxs(h,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:266:15",children:["镜像仓库凭证 ",g.includes("image")&&e.jsx("span",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:266:66",className:"text-red-400",children:"*"})]}),e.jsxs(se,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:267:15",value:String(l),onValueChange:a=>B(a==="__none"?"":a),children:[e.jsx(te,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:268:17",className:"bg-[var(--dg-bg-secondary)] border-[var(--dg-border)] h-9",children:e.jsx(oe,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:268:102",placeholder:"选择 Docker 凭证"})}),e.jsxs(re,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:269:17",children:[e.jsx(L,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:270:19",value:"__none",children:"不关联"}),J.map(a=>e.jsx(L,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:272:21",value:String(a.id),children:e.jsxs("span",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:273:23",className:"flex items-center gap-1.5",children:[e.jsx(ie,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:274:25",className:"h-3 w-3 opacity-60"}),String(a.name)," ",a.summary&&e.jsxs("span",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:274:100",className:"text-[10px] opacity-50",children:["(",String(a.summary),")"]})]})},a.id))]})]}),!l&&g.includes("image")&&e.jsx("p",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:280:80",className:"text-xs text-amber-400",children:"需要关联 Docker 凭证"})]})]}),l&&d&&e.jsxs("div",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:285:13",className:"p-2.5 rounded-md bg-blue-500/5 border border-blue-500/20 text-xs text-[var(--dg-text-secondary)]",children:[e.jsx("span",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:286:15",className:"text-blue-400",children:"镜像命名:"}),e.jsxs("code",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:287:15",className:"text-[var(--dg-text-primary)]",children:["{registry}","/","{namespace}","/","{","{JOB_BASE_NAME}","}",":","{","{tag}","}"]}),e.jsx("span",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:288:15",className:"ml-2 opacity-60",children:"例:"}),e.jsxs("code",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:289:15",className:"opacity-60",children:["harbor.ast1001.com/test/",d,":latest"]})]}),e.jsxs("div",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:292:11",className:"space-y-1",children:[e.jsx(h,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:293:13",children:"Dockerfile 路径"}),e.jsx(f,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:294:13",value:i,onChange:a=>A(a.target.value),placeholder:"jar/Dockerfile",className:"bg-[var(--dg-bg-secondary)] border-[var(--dg-border)] h-9 font-mono text-xs"})]}),e.jsxs("div",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:297:11",className:"space-y-2",children:[e.jsxs(h,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:298:13",children:["发布流程 ",e.jsx("span",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:298:25",className:"text-xs text-[var(--dg-text-secondary)] opacity-70 ml-1",children:"按顺序选择阶段"})]}),e.jsx("div",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:299:13",className:"flex flex-wrap gap-2",children:le.map(a=>{const c=g.includes(a.key);return e.jsxs(D,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:303:19",className:`cursor-pointer transition-all text-xs px-3 py-1.5 ${c?"border-current":"border-[var(--dg-border)] opacity-50 hover:opacity-80"}`,style:c?{backgroundColor:`${a.color}20`,color:a.color,borderColor:a.color}:{},onClick:()=>E(c?g.filter(x=>x!==a.key):[...g,a.key]),title:a.desc,children:[e.jsx(a.icon,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:310:21",className:"h-3 w-3 mr-1"}),a.label," ",a.needs.includes("repo")?"🔗":"",a.needs.includes("registry")?"📦":""]},a.key)})}),g.length>0&&e.jsx("div",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:316:15",className:"flex items-center mt-2",children:g.map((a,c)=>{const x=le.find(m=>m.key===a);return e.jsxs("div",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:320:21",className:"flex items-center",children:[e.jsxs("div",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:321:23",className:"flex items-center gap-1 px-2 py-1 text-[11px] font-medium border",style:{backgroundColor:`${x.color}20`,borderColor:`${x.color}40`,color:x.color,borderRadius:c===0?"6px 0 0 6px":c===g.length-1?"0 6px 6px 0":"0"},children:[e.jsx(x.icon,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:330:25",className:"h-3 w-3"}),x.label]}),c{const c=k===a.key;return e.jsx("button",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:355:19",onClick:()=>S(a.key),className:`flex-1 flex flex-col items-center gap-0.5 px-2 py-2 rounded-md text-xs font-medium transition-all ${c?"bg-blue-500 text-white":"text-[var(--dg-text-secondary)] hover:text-[var(--dg-text-primary)]"}`,title:a.desc,children:a.label},a.key)})}),k==="git_push"&&e.jsxs("div",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:370:15",className:"mt-3 space-y-2 p-3 rounded-md bg-[var(--dg-bg-secondary)] border border-[var(--dg-border)]",children:[e.jsxs("div",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:371:17",className:"space-y-1",children:[e.jsxs(h,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:372:19",className:"text-xs",children:["监听分支 ",e.jsx("span",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:372:51",className:"text-[var(--dg-text-secondary)] opacity-60",children:"(逗号分隔,支持 * 通配)"})]}),e.jsx(f,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:373:19",value:Pe,onChange:a=>ve(a.target.value),placeholder:"release/*, main",className:"bg-[var(--dg-bg-tertiary)] border-[var(--dg-border)] h-8 font-mono text-xs"})]}),e.jsxs("div",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:375:17",className:"space-y-1",children:[e.jsxs(h,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:376:19",className:"text-xs",children:["排除分支 ",e.jsx("span",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:376:51",className:"text-[var(--dg-text-secondary)] opacity-60",children:"(不触发构建)"})]}),e.jsx(f,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:377:19",value:je,onChange:a=>be(a.target.value),placeholder:"wip/*, draft/*",className:"bg-[var(--dg-bg-tertiary)] border-[var(--dg-border)] h-8 font-mono text-xs"})]})]}),k==="cron"&&e.jsxs("div",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:383:15",className:"mt-3 space-y-2 p-3 rounded-md bg-[var(--dg-bg-secondary)] border border-[var(--dg-border)]",children:[e.jsxs("div",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:384:17",className:"space-y-1",children:[e.jsxs(h,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:385:19",className:"text-xs",children:["Cron 表达式 ",e.jsx("span",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:385:55",className:"text-[var(--dg-text-secondary)] opacity-60",children:"(标准 5 位)"})]}),e.jsx(f,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:386:19",value:Ne,onChange:a=>pe(a.target.value),placeholder:"0 2 * * *",className:"bg-[var(--dg-bg-tertiary)] border-[var(--dg-border)] h-8 font-mono text-xs"})]}),e.jsx("div",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:388:17",className:"flex flex-wrap gap-1.5",children:[{expr:"*/5 * * * *",label:"每5分钟"},{expr:"0 * * * *",label:"每小时"},{expr:"0 2 * * *",label:"每天2点"},{expr:"0 0 * * 0",label:"每周日"}].map(a=>e.jsx(D,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:395:21",variant:"outline",className:"cursor-pointer text-[10px] hover:bg-blue-500/10",onClick:()=>pe(a.expr),children:a.label},a.expr))})]}),k==="webhook"&&e.jsxs("div",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:404:15",className:"mt-3 space-y-2 p-3 rounded-md bg-[var(--dg-bg-secondary)] border border-[var(--dg-border)]",children:[e.jsxs("div",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:405:17",className:"space-y-1",children:[e.jsxs(h,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:406:19",className:"text-xs",children:["Webhook Token ",e.jsx("span",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:406:60",className:"text-[var(--dg-text-secondary)] opacity-60",children:"(签名验证,可选)"})]}),e.jsx(f,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:407:19",value:Ce,onChange:a=>fe(a.target.value),placeholder:"随机字符串",className:"bg-[var(--dg-bg-tertiary)] border-[var(--dg-border)] h-8 font-mono text-xs"})]}),e.jsxs("p",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:409:17",className:"text-[10px] text-[var(--dg-text-secondary)] opacity-60",children:["Webhook URL: ",e.jsxs("code",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:410:32",className:"text-[var(--dg-blue)]",children:["POST /api/v1/webhook/pipeline/","{code}"]})]})]})]}),e.jsxs("div",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:416:11",className:"border-t border-[var(--dg-border)] pt-4",children:[e.jsxs("div",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:417:13",className:"flex items-center justify-between mb-2",children:[e.jsxs(h,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:418:15",children:["环境变量 ",e.jsxs("span",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:418:27",className:"text-xs text-[var(--dg-text-secondary)] opacity-60",children:["($","{VAR_NAME}"," 引用)"]})]}),e.jsxs(v,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:419:15",variant:"ghost",size:"sm",className:"h-7 text-xs",onClick:()=>K([...Q,{key:"",value:"",desc:""}]),children:[e.jsx(xe,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:420:17",className:"h-3 w-3 mr-1"}),"添加变量"]})]}),Q.length===0?e.jsx("p",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:424:15",className:"text-xs text-[var(--dg-text-muted)] py-2",children:'暂无变量,点击"添加变量"新增'}):e.jsx("div",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:426:15",className:"space-y-2",children:Q.map((a,c)=>e.jsxs("div",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:428:19",className:"grid grid-cols-12 gap-2 items-start p-2 rounded-md bg-[var(--dg-bg-secondary)] border border-[var(--dg-border)]",children:[e.jsx(f,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:429:21",value:a.key,onChange:x=>{const m=[...Q];m[c]={...m[c],key:x.target.value},K(m)},placeholder:"变量名",className:"col-span-3 h-8 text-xs font-mono bg-[var(--dg-bg-tertiary)] border-[var(--dg-border)]"}),e.jsx(f,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:439:21",value:a.value,onChange:x=>{const m=[...Q];m[c]={...m[c],value:x.target.value},K(m)},placeholder:"变量值",className:"col-span-4 h-8 text-xs font-mono bg-[var(--dg-bg-tertiary)] border-[var(--dg-border)]"}),e.jsx(f,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:449:21",value:a.desc,onChange:x=>{const m=[...Q];m[c]={...m[c],desc:x.target.value},K(m)},placeholder:"说明",className:"col-span-4 h-8 text-xs bg-[var(--dg-bg-tertiary)] border-[var(--dg-border)]"}),e.jsx(v,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:459:21",variant:"ghost",size:"icon",className:"col-span-1 h-8 w-8 text-red-400",onClick:()=>K(Q.filter((x,m)=>m!==c)),children:e.jsx(Fe,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:460:23",className:"h-3.5 w-3.5"})})]},c))})]}),e.jsxs("div",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:468:11",className:"border-t border-[var(--dg-border)] pt-4",children:[e.jsxs(h,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:469:13",className:"mb-2 block",children:["构建缓存 ",e.jsx("span",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:469:48",className:"text-xs text-[var(--dg-text-secondary)] opacity-60",children:"(加速后续构建)"})]}),e.jsx(f,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:470:13",value:De,onChange:a=>we(a.target.value),placeholder:"node_modules, .m2, target",className:"bg-[var(--dg-bg-secondary)] border-[var(--dg-border)] h-8 text-xs font-mono"}),e.jsx("p",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:471:13",className:"text-[10px] text-[var(--dg-text-secondary)] opacity-50 mt-1",children:"多个路径用逗号分隔,相同的 Key 会命中已有缓存"})]}),e.jsxs("div",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:474:11",className:"border-t border-[var(--dg-border)] pt-4",children:[e.jsxs(h,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:475:13",className:"mb-2 block",children:["并发执行数 ",e.jsx("span",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:475:49",className:"text-xs text-[var(--dg-text-secondary)] opacity-60",children:"(Number of executors)"})]}),e.jsx("div",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:476:13",className:"flex items-center gap-2",children:e.jsxs(se,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:477:15",value:String(ke),onValueChange:a=>Se(Number(a)),children:[e.jsx(te,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:478:17",className:"w-32 h-8 text-xs bg-[var(--dg-bg-secondary)] border-[var(--dg-border)]",children:e.jsx(oe,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:479:19"})}),e.jsxs(re,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:481:17",children:[e.jsx(L,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:482:19",value:"1",children:"1 — 串行"}),e.jsx(L,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:483:19",value:"2",children:"2"}),e.jsx(L,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:484:19",value:"3",children:"3"}),e.jsx(L,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:485:19",value:"4",children:"4"}),e.jsx(L,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:486:19",value:"5",children:"5"})]})]})}),e.jsx("p",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:490:13",className:"text-[10px] text-[var(--dg-text-secondary)] opacity-50 mt-1",children:"设为 1 则按顺序串行执行,默认 2 可并发构建"})]})]}),e.jsxs("div",{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:493:9",className:"flex justify-end gap-2 mt-4 pt-4 border-t border-[var(--dg-border)]",children:[e.jsx(v,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:494:11",variant:"outline",onClick:()=>p(!1),children:"取消"}),e.jsxs(v,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:495:11",onClick:qe,disabled:W,children:[W?e.jsx(H,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:496:23",className:"h-4 w-4 animate-spin mr-1"}):e.jsx(Z,{"code-path":"src/components/deploy/pipeline-manager/PipelineCreateDialog.tsx:496:75",className:"h-4 w-4 mr-1"}),W?"创建中...":"创建流水线"]})]})]})})}function Ea(){const[n,p]=o.useState(""),{data:P=[],isLoading:b,refetch:j}=ia(),{triggerMutation:d,deleteMutation:y,stopRunMutation:M}=pa(),[w,u]=o.useState({}),[C,R]=o.useState({}),[t,i]=o.useState({}),[A,g]=o.useState("all"),[E,O]=o.useState({}),[_,F]=o.useState(!1),q=Oe(),G=[{key:"all",label:"全部",icon:na,color:"#6B7280"},{key:"production",label:"生产",icon:Te,color:"#EF4444"},{key:"testing",label:"测试",icon:ae,color:"#F59E0B"},{key:"staging",label:"预发布",icon:ue,color:"#8B5CF6"},{key:"development",label:"开发",icon:sa,color:"#3B82F6"}];o.useEffect(()=>{P.forEach(s=>{const r=s.id;s.last_status==="running"&&!E[r]&&T.getRuns(s.code).then(l=>{const k=(l?.list||[]).find(S=>S.status==="running"||S.status==="pending");k&&O(S=>({...S,[r]:k}))}).catch(()=>{})})},[P,E]);const $=async(s,r)=>{i(l=>({...l,[s]:!0}));try{const l=await T.getRuns(r);R(B=>({...B,[s]:l?.list||[]}))}catch{R(l=>({...l,[s]:[]}))}finally{i(l=>({...l,[s]:!1}))}},W=(s,r)=>{w[s]?u(l=>({...l,[s]:!1})):($(s,r),u(l=>({...l,[s]:!0})))},V=async(s,r)=>{try{await d.mutateAsync(r),N.success("已触发"),$(s,r),j()}catch{N.error("触发失败")}},z=async(s,r,l)=>{if(await q({title:"停止运行",description:"确定要停止此运行吗?",variant:"destructive"}))try{await M.mutateAsync({code:r,runId:l}),N.success("已停止"),$(s,r),O(k=>{const S={...k};return delete S[s],S})}catch{N.error("停止失败")}},X=async(s,r)=>{const l=E[s];if(!l){try{const k=((await T.getRuns(r))?.list||[]).find(S=>S.status==="running"||S.status==="pending");k?await z(s,r,k.id):N.error("未找到运行中的任务")}catch{N.error("停止失败")}return}await z(s,r,l.id)},J=async s=>{if(await q({title:"删除流水线",description:`确定删除「${s.name}」?`,variant:"destructive"}))try{await y.mutateAsync(s.id),N.success("已删除"),j()}catch{N.error("删除失败")}},ne=P.filter(s=>{const r=String(s.name||"").toLowerCase().includes(n.toLowerCase())||String(s.description||"").toLowerCase().includes(n.toLowerCase()),l=s.environment,B=A==="all"||(l?.type||"")===A;return r&&B});return e.jsxs("div",{"code-path":"src/components/deploy/PipelineManager.tsx:157:5",className:"space-y-5",children:[e.jsxs("div",{"code-path":"src/components/deploy/PipelineManager.tsx:158:7",className:"flex items-center justify-between",children:[e.jsxs("div",{"code-path":"src/components/deploy/PipelineManager.tsx:159:9",children:[e.jsx("h1",{"code-path":"src/components/deploy/PipelineManager.tsx:160:11",className:"text-2xl font-bold text-[var(--dg-text-primary)]",children:"流水线"}),e.jsx("p",{"code-path":"src/components/deploy/PipelineManager.tsx:161:11",className:"text-sm text-[var(--dg-text-secondary)] mt-1",children:"CI/CD 构建 · 部署 · 发布一体化"})]}),e.jsxs("div",{"code-path":"src/components/deploy/PipelineManager.tsx:163:9",className:"flex items-center gap-2",children:[e.jsxs(v,{"code-path":"src/components/deploy/PipelineManager.tsx:164:11",variant:"outline",className:"border-[var(--dg-border)] text-[var(--dg-text-secondary)]",onClick:()=>j(),children:[e.jsx(ee,{"code-path":"src/components/deploy/PipelineManager.tsx:165:13",className:`h-4 w-4 mr-2 ${b?"animate-spin":""}`}),"刷新"]}),e.jsxs(v,{"code-path":"src/components/deploy/PipelineManager.tsx:167:11",onClick:()=>F(!0),children:[e.jsx(xe,{"code-path":"src/components/deploy/PipelineManager.tsx:167:52",className:"h-4 w-4 mr-2"}),"新建流水线"]})]})]}),e.jsxs("div",{"code-path":"src/components/deploy/PipelineManager.tsx:172:7",className:"flex items-stretch gap-3 px-4 py-3 rounded-lg bg-[var(--dg-bg-secondary)] border border-[var(--dg-border)]",children:[e.jsxs("div",{"code-path":"src/components/deploy/PipelineManager.tsx:173:9",className:"flex-1 space-y-1.5",children:[e.jsxs("div",{"code-path":"src/components/deploy/PipelineManager.tsx:174:11",className:"flex items-center gap-1.5",children:[e.jsx(U,{"code-path":"src/components/deploy/PipelineManager.tsx:175:13",className:"h-3 w-3 text-indigo-400"}),e.jsx("span",{"code-path":"src/components/deploy/PipelineManager.tsx:176:13",className:"text-[10px] font-semibold text-indigo-400",children:"构建"}),e.jsx(I,{"code-path":"src/components/deploy/PipelineManager.tsx:177:13",className:"h-2.5 w-2.5 text-[var(--dg-text-secondary)] opacity-30"}),e.jsx(Z,{"code-path":"src/components/deploy/PipelineManager.tsx:178:13",className:"h-3 w-3 text-red-400"}),e.jsx("span",{"code-path":"src/components/deploy/PipelineManager.tsx:179:13",className:"text-[10px] font-semibold text-red-400",children:"部署"}),e.jsx(I,{"code-path":"src/components/deploy/PipelineManager.tsx:180:13",className:"h-2.5 w-2.5 text-[var(--dg-text-secondary)] opacity-30"}),e.jsxs("div",{"code-path":"src/components/deploy/PipelineManager.tsx:181:13",className:"flex items-center gap-1 px-2 py-0.5 rounded bg-blue-400/10 border border-blue-400/20",children:[e.jsx(ye,{"code-path":"src/components/deploy/PipelineManager.tsx:182:15",className:"h-3 w-3 text-blue-400"}),e.jsx("span",{"code-path":"src/components/deploy/PipelineManager.tsx:183:15",className:"text-[10px] font-medium text-blue-400",children:"SSH 主机"})]})]}),e.jsx("p",{"code-path":"src/components/deploy/PipelineManager.tsx:186:11",className:"text-[9px] text-[var(--dg-text-secondary)] opacity-40 pl-1",children:"传统主机 SCP 部署 · 无需镜像仓库"})]}),e.jsx("div",{"code-path":"src/components/deploy/PipelineManager.tsx:188:9",className:"w-px bg-[var(--dg-border)]"}),e.jsxs("div",{"code-path":"src/components/deploy/PipelineManager.tsx:189:9",className:"flex-1 space-y-1.5",children:[e.jsxs("div",{"code-path":"src/components/deploy/PipelineManager.tsx:190:11",className:"flex items-center gap-1.5",children:[e.jsx(U,{"code-path":"src/components/deploy/PipelineManager.tsx:191:13",className:"h-3 w-3 text-indigo-400"}),e.jsx("span",{"code-path":"src/components/deploy/PipelineManager.tsx:192:13",className:"text-[10px] font-semibold text-indigo-400",children:"构建"}),e.jsx(I,{"code-path":"src/components/deploy/PipelineManager.tsx:193:13",className:"h-2.5 w-2.5 text-[var(--dg-text-secondary)] opacity-30"}),e.jsx(ie,{"code-path":"src/components/deploy/PipelineManager.tsx:194:13",className:"h-3 w-3 text-cyan-400"}),e.jsx("span",{"code-path":"src/components/deploy/PipelineManager.tsx:195:13",className:"text-[10px] font-semibold text-cyan-400",children:"镜像仓库"}),e.jsx(I,{"code-path":"src/components/deploy/PipelineManager.tsx:196:13",className:"h-2.5 w-2.5 text-[var(--dg-text-secondary)] opacity-30"}),e.jsx(Z,{"code-path":"src/components/deploy/PipelineManager.tsx:197:13",className:"h-3 w-3 text-red-400"}),e.jsx("span",{"code-path":"src/components/deploy/PipelineManager.tsx:198:13",className:"text-[10px] font-semibold text-red-400",children:"部署"}),e.jsx(I,{"code-path":"src/components/deploy/PipelineManager.tsx:199:13",className:"h-2.5 w-2.5 text-[var(--dg-text-secondary)] opacity-30"}),e.jsxs("div",{"code-path":"src/components/deploy/PipelineManager.tsx:200:13",className:"flex items-center gap-1 px-2 py-0.5 rounded bg-emerald-400/10 border border-emerald-400/20",children:[e.jsx(he,{"code-path":"src/components/deploy/PipelineManager.tsx:201:15",className:"h-3 w-3 text-emerald-400"}),e.jsx("span",{"code-path":"src/components/deploy/PipelineManager.tsx:202:15",className:"text-[10px] font-medium text-emerald-400",children:"Kubernetes"})]})]}),e.jsx("p",{"code-path":"src/components/deploy/PipelineManager.tsx:205:11",className:"text-[9px] text-[var(--dg-text-secondary)] opacity-40 pl-1",children:"容器化部署 · 需镜像仓库推送"})]}),e.jsx("span",{"code-path":"src/components/deploy/PipelineManager.tsx:207:9",className:"self-center ml-2 text-[10px] text-[var(--dg-text-secondary)] opacity-30 tracking-wide whitespace-nowrap",children:"全流程可视化"})]}),e.jsxs("div",{"code-path":"src/components/deploy/PipelineManager.tsx:210:7",className:"flex items-center gap-4",children:[e.jsxs("div",{"code-path":"src/components/deploy/PipelineManager.tsx:211:9",className:"relative max-w-md flex-1",children:[e.jsx(aa,{"code-path":"src/components/deploy/PipelineManager.tsx:212:11",className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-[var(--dg-text-secondary)]"}),e.jsx(f,{"code-path":"src/components/deploy/PipelineManager.tsx:213:11",placeholder:"搜索流水线...",value:n,onChange:s=>p(s.target.value),className:"pl-10 bg-[var(--dg-bg-secondary)] border-[var(--dg-border)] text-[var(--dg-text-primary)]"})]}),e.jsx("div",{"code-path":"src/components/deploy/PipelineManager.tsx:220:9",className:"flex items-center gap-1 bg-[var(--dg-bg-secondary)] rounded-lg p-1 border border-[var(--dg-border)]",children:G.map(s=>{const r=A===s.key,l=s.icon;return e.jsxs("button",{"code-path":"src/components/deploy/PipelineManager.tsx:225:15",onClick:()=>g(s.key),className:`flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-medium transition-all ${r?"text-white shadow-sm":"text-[var(--dg-text-secondary)] hover:text-[var(--dg-text-primary)]"}`,style:r?{backgroundColor:s.color}:{},children:[e.jsx(l,{"code-path":"src/components/deploy/PipelineManager.tsx:233:17",className:"h-3.5 w-3.5"}),s.label]},s.key)})})]}),b?e.jsx("div",{"code-path":"src/components/deploy/PipelineManager.tsx:241:9",className:"flex items-center justify-center py-12",children:e.jsx(H,{"code-path":"src/components/deploy/PipelineManager.tsx:242:11",className:"h-6 w-6 text-[var(--dg-text-secondary)] animate-spin"})}):ne.length===0?e.jsxs("div",{"code-path":"src/components/deploy/PipelineManager.tsx:245:9",className:"text-center py-16 text-[var(--dg-text-secondary)]",children:[e.jsx(ta,{"code-path":"src/components/deploy/PipelineManager.tsx:246:11",className:"h-10 w-10 mx-auto mb-3 opacity-30"}),e.jsx("p",{"code-path":"src/components/deploy/PipelineManager.tsx:247:11",className:"text-sm",children:"暂无流水线"}),e.jsxs(v,{"code-path":"src/components/deploy/PipelineManager.tsx:248:11",variant:"outline",className:"mt-4",onClick:()=>F(!0),children:[e.jsx(xe,{"code-path":"src/components/deploy/PipelineManager.tsx:249:13",className:"h-4 w-4 mr-1"}),"创建第一个流水线"]})]}):e.jsx("div",{"code-path":"src/components/deploy/PipelineManager.tsx:253:9",className:"space-y-3",children:ne.map(s=>{const r=s.id,l=s.code||s.id;return e.jsx(ha,{"code-path":"src/components/deploy/PipelineManager.tsx:258:15",pipeline:s,isExpanded:!!w[r],isLoadingRuns:!!t[r],pipelineRuns:C[r]||[],onToggleExpand:()=>W(r,l),onTrigger:()=>V(r,l),onStopRunning:()=>X(r,l),onDelete:()=>J(s),onStopRun:B=>z(r,l,B)},r)})}),e.jsx(ya,{"code-path":"src/components/deploy/PipelineManager.tsx:275:7",open:_,onOpenChange:F,onCreated:j})]})}export{Ea as PipelineManager};