chore: 同步最新前端构建产物到 backend/static

This commit is contained in:
Logan.Li committed 2026-06-26 00:02:36 +08:00
1 parent 0b404b4611
commit 9bf35b369c
134 files changed
+480 -2

No files matched your search

@@ -0,0 +1,20 @@
import{i as Ge,r as m,v as tt,N as Ee,A as Ut,j as e,B as h,L as pe,V as Kt,o as Xt,E as Zt,C as Qt,R as bs,p as ys,t as es,_ as ts,z as Ze,S as yt,G as ks,M as gs,y as ht,P as ut,Q as lt,m as ss,aW as vs,T as Bt,al as js,X as ns,a3 as kt,k as Ns}from"./index-CwVkcMR-.js";import{C as G,a as L,b as le,c as de}from"./card-C5qBu7CR.js";import{I as k}from"./input-B5ad6Rfz.js";import{L as A}from"./label-mg-tHjNc.js";import{B as ee}from"./badge-DgJ0w7jf.js";import{k as Q}from"./index-DK2BjZ0M.js";import{u as we}from"./use-toast-C8N6561m.js";import{S as fe,f as Le,e as Ds,b as fs,s as dt,Y as Ot,P as Ss,a as Es}from"./PodFileBrowser-Dsv7UfKm.js";import{T as Re,a as Be,b as ge,c as K,d as Oe,e as X}from"./table-X8m9Cp5H.js";import{P as oe}from"./plus-CaJ-dB4A.js";import{H as ws}from"./history-DUPeIzQi.js";import{M as gt}from"./minus-BWHRIRGV.js";import{F as vt}from"./file-text-DGoBtmAr.js";import{H as os}from"./hard-drive-CGq_SnM5.js";import{E as bt}from"./external-link-BhKmTUrK.js";import{T as Qe}from"./textarea-BZOXMpxW.js";import{S as Me,a as _e,b as et,c as $e,d as be}from"./select-CGtvCG8I.js";import{S as jt}from"./switch-DYr_nGop.js";import{T as xe}from"./trash-2-BPpnm3Sz.js";import{Z as as}from"./zap-Dr77-_Z_.js";import{F as Cs}from"./folder-open-BPEM3um6.js";import{R as cs}from"./rotate-cw-BWMnGC9F.js";import{P as rs}from"./play-_cqG4jyc.js";import{S as st}from"./save-CdpyeGoy.js";import{D as Ps}from"./disc-nz-uNCoJ.js";import{a as As,F as it}from"./folder-Jx79bRH4.js";import{R as nt}from"./refresh-cw-DM6JPbZg.js";import{C as Vs}from"./circle-x-DBoylLde.js";import{A as Ws}from"./arrow-left-B1MijWEO.js";import{P as It}from"./pause-CoEPLyJU.js";import"./copy-CKzeWvtb.js";import"./sparkles-BA2sXk5-.js";import"./xterm-DSqgeKvr.js";import"./box-D54sw_gB.js";import"./minimize-2-Dk2LAAKi.js";import"./upload-CSuL4aK-.js";import"./download-BgEJ-n5L.js";import"./index-CBIZnJrN.js";import"./chevron-up-DM77dvsL.js";const Ts=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],Rs=Ge("hash",Ts);const Bs=[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]],Os=Ge("heart",Bs);const Is=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],Hs=Ge("image",Is);const zs=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],Ms=Ge("key-round",zs);const _s=[["path",{d:"M13.172 2a2 2 0 0 1 1.414.586l6.71 6.71a2.4 2.4 0 0 1 0 3.408l-4.592 4.592a2.4 2.4 0 0 1-3.408 0l-6.71-6.71A2 2 0 0 1 6 9.172V3a1 1 0 0 1 1-1z",key:"16rjxf"}],["path",{d:"M2 7v6.172a2 2 0 0 0 .586 1.414l6.71 6.71a2.4 2.4 0 0 0 3.191.193",key:"178nd4"}],["circle",{cx:"10.5",cy:"6.5",r:".5",fill:"currentColor",key:"12ikhr"}]],Ht=Ge("tags",_s);function ls(t){const s=t.conditions||t.pod_conditions||[],o=n=>s.find(l=>(l.type||l.Type)===n),a=n=>n?.lastTransitionTime||n?.LastTransitionTime||n?.last_transition_time;return{scheduled:a(o("PodScheduled")||{}),initialized:a(o("Initialized")||{}),containersReady:a(o("ContainersReady")||{}),ready:a(o("Ready")||{}),startTime:t.start_time||t.startTime}}function $s(t){const{clusterCode:s,namespace:o,deployment:a,pods:n,revisions:l,onRefresh:d}=t,{toast:p}=we(),[g,x]=m.useState("pods"),[N,D]=m.useState(null),[O,v]=m.useState(null),[f,C]=m.useState(a?.replicas||0),[E,M]=m.useState(!1),[I,q]=m.useState([]),[Y,V]=m.useState([]),[Z,_]=m.useState([]),[F,ne]=m.useState(""),[te,r]=m.useState([]),[u,S]=m.useState([]),T=a?.ready_replicas??a?.readyReplicas??0,i=a?.replicas??0,P=T===i&&i>0;m.useEffect(()=>{g==="services"&&(ne("services"),Promise.all([Q.getNamespaceServices(s,o).catch(()=>[]),Q.getNamespaceIngresses(s,o).catch(()=>[])]).then(([b,J])=>{const z=R=>Array.isArray(R)?R:R?.list||R?.items||R?.data||[],$=z(b),he=z(J),U=a?.spec?.selector?.matchLabels||a?.spec?.template?.metadata?.labels||{},me=$.filter(R=>{const ae=R.spec?.selector||R.selector||{};return Object.keys(ae).length===0?!1:Object.entries(ae).every(([ke,Ne])=>U[ke]===Ne)}).map(R=>({name:R.name||R.metadata?.name,type:R.spec?.type||R.type||"ClusterIP",clusterIP:R.spec?.clusterIP||R.cluster_ip||"<none>",ports:(R.spec?.ports||R.ports||[]).map(ae=>`${ae.port}${ae.targetPort?":"+ae.targetPort:""}/${ae.protocol||"TCP"}`),selector:R.spec?.selector||R.selector||{},age:R.age||""})),je=new Set(me.map(R=>R.name)),re=he.filter(R=>(R.spec?.rules||R.rules||[]).some(ke=>(ke.http?.paths||ke.paths||[]).some(Ne=>{const j=Ne.backend?.service?.name||Ne.backendSerLine truncated
`):n.exec?.command||"",initialDelaySeconds:n.initialDelaySeconds,periodSeconds:n.periodSeconds,timeoutSeconds:n.timeoutSeconds,successThreshold:n.successThreshold,failureThreshold:n.failureThreshold}},o=n=>{if(!n)return{type:"none"};let l="none";return n.exec?l="exec":n.httpGet?l="httpGet":n.tcpSocket&&(l="tcpSocket"),{type:l,execCommand:Array.isArray(n.exec?.command)?n.exec.command.join(`
`):"",httpPath:n.httpGet?.path||"",httpPort:n.httpGet?.port??"",tcpPort:n.tcpSocket?.port??""}},a=t.securityContext;return{name:t.name||"",image:t.image||"",imagePullPolicy:t.imagePullPolicy||"",command:Array.isArray(t.command)?t.command:[],args:Array.isArray(t.args)?t.args:[],workingDir:t.workingDir||"",env:(Array.isArray(t.env)?t.env:[]).map(n=>({name:n.name||"",value:n.value??""})),ports:(Array.isArray(t.ports)?t.ports:[]).map(n=>({name:n.name||"",containerPort:n.containerPort??"",protocol:n.protocol||"TCP"})),resources:{requests:t.resources?.requests||{},limits:t.resources?.limits||{}},livenessProbe:s(t.livenessProbe),readinessProbe:s(t.readinessProbe),startupProbe:s(t.startupProbe),lifecycle:t.lifecycle?{postStart:t.lifecycle.postStart?o(t.lifecycle.postStart):void 0,preStop:t.lifecycle.preStop?o(t.lifecycle.preStop):void 0}:null,securityContext:a?{runAsUser:a.runAsUser,runAsGroup:a.runAsGroup,runAsNonRoot:a.runAsNonRoot,privileged:a.privileged,readOnlyRootFilesystem:a.readOnlyRootFilesystem,allowPrivilegeEscalation:a.allowPrivilegeEscalation,capabilitiesAdd:a.capabilities?.add||[],capabilitiesDrop:a.capabilities?.drop||[]}:null,volumeMounts:(Array.isArray(t.volumeMounts)?t.volumeMounts:[]).map(n=>({name:n.name||"",mountPath:n.mountPath||"",subPath:n.subPath||"",readOnly:n.readOnly||!1}))}}function Mt(t=""){return{name:t,image:"",imagePullPolicy:"IfNotPresent",command:[],args:[],workingDir:"",env:[],ports:[],resources:{},livenessProbe:null,readinessProbe:null,startupProbe:null,lifecycle:null,securityContext:null,volumeMounts:[]}}function pt(t){if(!t||t.type==="none"||!t.type)return;const s={};if(t.type==="httpGet")s.httpGet={},t.httpPath&&(s.httpGet.path=t.httpPath),t.httpPort!==""&&t.httpPort!=null&&(s.httpGet.port=typeof t.httpPort=="number"?t.httpPort:Number(t.httpPort)),t.httpHost&&(s.httpGet.host=t.httpHost);else if(t.type==="tcpSocket")s.tcpSocket={},t.tcpPort!==""&&t.tcpPort!=null&&(s.tcpSocket.port=typeof t.tcpPort=="number"?t.tcpPort:Number(t.tcpPort));else if(t.type==="exec"){const o=(t.execCommand||"").split(`
`).map(a=>a.trim()).filter(Boolean);o.length&&(s.exec={command:o})}return t.initialDelaySeconds!=null&&(s.initialDelaySeconds=t.initialDelaySeconds),t.periodSeconds!=null&&(s.periodSeconds=t.periodSeconds),t.timeoutSeconds!=null&&(s.timeoutSeconds=t.timeoutSeconds),t.successThreshold!=null&&(s.successThreshold=t.successThreshold),t.failureThreshold!=null&&(s.failureThreshold=t.failureThreshold),Object.keys(s).length>0?s:void 0}function _t(t){if(!(!t||t.type==="none"||!t.type)){if(t.type==="exec"){const s=(t.execCommand||"").split(`
`).map(o=>o.trim()).filter(Boolean);return s.length?{exec:{command:s}}:void 0}if(t.type==="httpGet"){const s={httpGet:{}};return t.httpPath&&(s.httpGet.path=t.httpPath),t.httpPort!==""&&t.httpPort!=null&&(s.httpGet.port=Number(t.httpPort)),s}if(t.type==="tcpSocket"){const s={tcpSocket:{}};return t.tcpPort!==""&&t.tcpPort!=null&&(s.tcpSocket.port=Number(t.tcpPort)),s}}}function $t(t){const s={name:t.name};t.image&&(s.image=t.image),t.imagePullPolicy&&(s.imagePullPolicy=t.imagePullPolicy),t.workingDir&&(s.workingDir=t.workingDir),t.command.length>0&&(s.command=t.command),t.args.length>0&&(s.args=t.args),t.env.length>0&&(s.env=t.env.filter(x=>x.name.trim()).map(x=>{const N={name:x.name};return x.value!=null&&(N.value=x.value),N})),t.ports.length>0&&(s.ports=t.ports.filter(x=>x.containerPort!=="").map(x=>{const N={containerPort:typeof x.containerPort=="number"?x.containerPort:Number(x.containerPort)};return x.name&&(N.name=x.name),x.protocol&&(N.protocol=x.protocol),N}));const o=t.resources.requests,a=t.resources.limits,n=o&&Object.values(o).some(x=>x&&x.trim()),l=a&&Object.values(a).some(x=>x&&x.trim());(n||l)&&(s.resources={},n&&(s.resources.requests={},o.cpu?.trim()&&(s.resources.requests.cpu=o.cpu),o.memory?.trim()&&(s.resources.requests.memory=o.memory)),l&&(s.resources.limits={},a.cpu?.trim()&&(s.resources.limits.cpu=a.cpu),a.memory?.trim()&&(s.resources.limits.memory=a.memory)));const d=pt(t.livenessProbe);d&&(s.livenessProbe=d);const p=pt(t.readinessProbe);p&&(s.readinessProbe=p);const g=pt(t.startupProbe);if(g&&(s.startupProbe=g),t.lifecycle){const x={},N=_t(t.lifecycle.postStart);N&&(x.postStart=N);const D=_t(t.lifecycle.preStop);D&&(x.preStop=D),Object.keys(x).length>0&&(s.lifecycle=x)}if(t.securityContext){const x=t.securityContext,N={};x.runAsUser!==""&&x.runAsUser!=null&&(N.runAsUser=Number(x.runAsUser)),x.runAsGroup!==""&&x.runAsGroup!=null&&(N.runAsGroup=Number(x.runAsGroup)),x.runAsNonRoot!=null&&(N.runAsNonRoot=x.runAsNonRoot),x.privileged!=null&&(N.privileged=x.privileged),x.readOnlyRootFilesystem!=null&&(N.readOnlyRootFilesystem=x.readOnlyRootFilesystem),x.allowPrivilegeEscalation!=null&&(N.allowPrivilegeEscalation=x.allowPrivilegeEscalation);const D=(x.capabilitiesAdd||[]).filter(Boolean),O=(x.capabilitiesDrop||[]).filter(Boolean);(D.length||O.length)&&(N.capabilities={},D.length&&(N.capabilities.add=D),O.length&&(N.capabilities.drop=O)),Object.keys(N).length>0&&(s.securityContext=N)}return t.volumeMounts.length>0&&(s.volumeMounts=t.volumeMounts.filter(x=>x.name.trim()&&x.mountPath.trim()).map(x=>{const N={name:x.name,mountPath:x.mountPath};return x.subPath&&(N.subPath=x.subPath),x.readOnly&&(N.readOnly=!0),N})),s}function Gt(t){return t.join(`
`)}function Lt(t){return t.split(`
`).map(s=>s.trim()).filter(Boolean)}function qs({container:t,onUpdate:s}){const o=t,a="flex items-center gap-1.5 text-xs font-semibold text-slate-300 mb-2";return e.jsxs(e.Fragment,{children:[e.jsxs("div",{"code-path":"src/components/kubernetes/deployment-edit/ContainerEditor.tsx:36:7",className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[e.jsxs("div",{"code-path":"src/components/kubernetes/deployment-edit/ContainerEditor.tsx:37:9",children:[e.jsx(A,{"code-path":"src/components/kubernetes/deployment-edit/ContainerEditor.tsx:38:11",className:"text-slate-400 text-xs",children:"容器名称"}),e.jsx(k,{"code-path":"src/components/kubernetes/deployment-edit/ContainerEditor.tsx:39:11",value:o.name,onChange:n=>s({name:n.target.value}),placeholder:"my-app",className:"mt-1 bg-slate-800 border-slate-700 text-slate-200 font-mono text-xs h-8"})]}),e.jsxs("div",{"code-path":"src/components/kubernetes/deployment-edit/ContainerEditor.tsx:43:9",children:[e.jsx(A,{"code-path":"src/components/kubernetes/deployment-edit/ContainerEditor.tsx:44:11",className:"text-slate-400 text-xs",children:"容器镜像"}),e.jsx(k,{"code-path":"src/components/kubernetes/deployment-edit/ContainerEditor.tsx:45:11",value:o.image,onChange:n=>s({image:n.target.value}),placeholder:"nginx:1.25",className:"mt-1 bg-slate-800 border-slate-700 text-slate-200 font-mono text-xs h-8"})]}),e.jsxs("div",{"code-path":"src/components/kubernetes/deployment-edit/ContainerEditor.tsx:49:9",children:[e.jsx(A,{"code-path":"src/components/kubernetes/deployment-edit/ContainerEditor.tsx:50:11",className:"text-slate-400 text-xs",children:"镜像拉取策略"}),e.jsxs(Me,{"code-path":"src/components/kubernetes/deployment-edit/ContainerEditor.tsx:51:11",value:o.imagePullPolicy||"__none",onValueChange:n=>s({imagePullPolicy:n==="__none"?"":n}),children:[e.jsx(_e,{"code-path":"src/components/kubernetes/deployment-edit/ContainerEditor.tsx:52:13",className:"mt-1 bg-slate-800 border-slate-700 text-slate-200 text-xs h-8",children:e.jsx(et,{"code-path":"src/components/kubernetes/deployment-edit/ContainerEditor.tsx:53:15"})}),e.jsxs($e,{"code-path":"src/components/kubernetes/deployment-edit/ContainerEditor.tsx:55:13",className:"bg-slate-900 border-slate-700",children:[e.jsx(be,{"code-path":"src/components/kubernetes/deployment-edit/ContainerEditor.tsx:56:15",value:"__none",className:"text-slate-400",children:"不设置(默认 IfNotPresent)"}),e.jsx(be,{"code-path":"src/components/kubernetes/deployment-edit/ContainerEditor.tsx:57:15",value:"Always",className:"text-slate-200",children:"Always"}),e.jsx(be,{"code-path":"src/components/kubernetes/deployment-edit/ContainerEditor.tsx:58:15",value:"IfNotPresent",className:"text-slate-200",children:"IfNotPresent"}),e.jsx(be,{"code-path":"src/components/kubernetes/deployment-edit/ContainerEditor.tsx:59:15",value:"Never",className:"text-slate-200",children:"Never"})]})]})]}),e.jsxs("div",{"code-path":"src/components/kubernetes/deployment-edit/ContainerEditor.tsx:63:9",children:[e.jsx(A,{"code-path":"src/components/kubernetes/deployment-edit/ContainerEditor.tsx:64:11",className:"text-slate-400 text-xs",children:"工作目录 (workingDir)"}),e.jsx(k,{"code-path":"src/components/kubernetes/deployment-edit/ContainerEditor.tsx:65:11",value:o.workingDir||"",onChange:n=>s({workingDir:n.target.value}),placeholder:"/app",className:"mt-1 bg-slate-800 border-slate-700 text-slate-200 font-mono text-xs h-8"})]})]}),e.jsxs("div",{"code-path":"src/components/kubernetes/deployment-edit/ContainerEditor.tsx:72:7",className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[e.jsxs("div",{"code-path":"src/components/kubernetes/deployment-edit/ContainerEditor.tsx:73:9",children:[e.jsx(A,{"code-path":"src/components/kubernetes/deployment-edit/ContainerEditor.tsx:74:11",className:"text-slate-400 text-xs",children:"启动命令 (command) — 每行一个"}),e.jsx(Qe,{"code-path":"src/components/kubernetes/deployment-edit/ContainerEditor.tsx:75:11",value:Gt(o.command),placeholder:`/bin/sh
-c`,onChange:n=>s({command:Lt(n.target.value)}),className:"mt-1 bg-slate-800 border-slate-700 text-slate-200 font-mono text-xs min-h-[60px]"})]}),e.jsxs("div",{"code-path":"src/components/kubernetes/deployment-edit/ContainerEditor.tsx:79:9",children:[e.jsx(A,{"code-path":"src/components/kubernetes/deployment-edit/ContainerEditor.tsx:80:11",className:"text-slate-400 text-xs",children:"启动参数 (args) — 每行一个"}),e.jsx(Qe,{"code-path":"src/components/kubernetes/deployment-edit/ContainerEditor.tsx:81:11",value:Gt(o.args),placeholder:`--config=/etc/app.yaml
--debug`,onChange:n=>s({args:Lt(n.target.value)}),className:"mt-1 bg-slate-800 border-slate-700 text-slate-200 font-mono text-xs min-h-[60px]"})]})]}),e.jsxs("div",{"code-path":"src/components/kubernetes/deployment-edit/ContainerEditor.tsx:88:7",children:[e.jsxs("div",{"code-path":"src/components/kubernetes/deployment-edit/ContainerEditor.tsx:89:9",className:"flex items-center justify-between mb-2",children:[e.jsxs("div",{"code-path":"src/components/kubernetes/deployment-edit/ContainerEditor.tsx:90:11",className:a,children:[e.jsx(Zt,{"code-path":"src/components/kubernetes/deployment-edit/ContainerEditor.tsx:90:39",className:"h-3.5 w-3.5 text-cyan-400"})," 环境变量"]}),e.jsxs(h,{"code-path":"src/components/kubernetes/deployment-edit/ContainerEditor.tsx:91:11",size:"sm",variant:"outline",className:"h-6 border-slate-700 text-slate-300 text-[11px]",onClick:()=>s({env:[...o.env,{name:"",value:""}]}),children:[e.jsx(oe,{"code-path":"src/components/kubernetes/deployment-edit/ContainerEditor.tsx:93:13",className:"h-3 w-3 mr-1"}),"新增"]})]}),e.jsxs("div",{"code-path":"src/components/kubernetes/deployment-edit/ContainerEditor.tsx:96:9",className:"space-y-1.5",children:[o.env.map((n,l)=>e.jsxs("div",{"code-path":"src/components/kubernetes/deployment-edit/ContainerEditor.tsx:98:13",className:"grid grid-cols-[1fr_1.4fr_auto] gap-2",children:[e.jsx(k,{"code-path":"src/components/kubernetes/deployment-edit/ContainerEditor.tsx:99:15",value:n.name,placeholder:"KEY",onChange:d=>{const p=[...o.env];p[l]={...n,name:d.target.value},s({env:p})},className:"bg-slate-800 border-slate-700 text-slate-200 font-mono text-xs h-8"}),e.jsx(k,{"code-path":"src/components/kubernetes/deployment-edit/ContainerEditor.tsx:102:15",value:n.value||"",placeholder:"value",onChange:d=>{const p=[...o.env];p[l]={...n,value:d.target.value},s({env:p})},className:"bg-slate-800 border-slate-700 text-slate-200 font-mono text-xs h-8"}),e.jsx(h,{"code-path":"src/components/kubernetes/deployment-edit/ContainerEditor.tsx:105:15",variant:"ghost",size:"icon",className:"h-8 w-8 text-red-400",onClick:()=>s({env:o.env.filter((d,p)=>p!==l)}),children:e.jsx(xe,{"code-path":"src/components/kubernetes/deployment-edit/ContainerEditor.tsx:107:17",className:"h-3.5 w-3.5"})})]},l)),o.env.length===0&&e.jsx("p",{"code-path":"src/components/kubernetes/deployment-edit/ContainerEditor.tsx:111:34",className:"text-[11px] text-slate-600",children:"无环境变量"})]})]}),e.jsxs("div",{"code-path":"src/components/kubernetes/deployment-edit/ContainerEditor.tsx:116:7",children:[e.jsxs("div",{"code-path":"src/components/kubernetes/deployment-edit/ContainerEditor.tsx:117:9",className:"flex items-center justify-between mb-2",children:[e.jsxs("div",{"code-path":"src/components/kubernetes/deployment-edit/ContainerEditor.tsx:118:11",className:a,children:[e.jsx(Ee,{"code-path":"src/components/kubernetes/deployment-edit/ContainerEditor.tsx:118:39",className:"h-3.5 w-3.5 text-indigo-400"})," 端口"]}),e.jsxs(h,{"code-path":"src/components/kubernetes/deployment-edit/ContainerEditor.tsx:119:11",size:"sm",variant:"outline",className:"h-6 border-slate-700 text-slate-300 text-[11px]",onClick:()=>s({ports:[...o.ports,{name:"",containerPort:"",protocol:"TCP"}]}),children:[e.jsx(oe,{"code-path":"src/components/kubernetes/deployment-edit/ContainerEditor.tsx:121:13",className:"h-3 w-3 mr-1"}),"新增"]})]}),e.jsxs("div",{"code-path":"src/components/kubernetes/deployment-edit/ContainerEditor.tsx:124:9",className:"space-y-1.5",children:[o.ports.map((n,l)=>e.jsxs("div",{"code-path":"src/components/kubernetes/deployment-edit/ContainerEditor.tsx:126:13",className:"grid grid-cols-[1fr_1fr_100px_auto] gap-2",children:[e.jsx(k,{"code-path":"src/components/kubernetes/deployment-edit/ContainerEditor.tsx:127:15",value:n.name||"",placeholder:"http",onChange:d=>{const p=[...o.ports];p[l]={...n,name:d.target.value},s({ports:p})},className:"bg-slate-800 border-slate-700 text-slate-200 font-mono text-xs h-8"}),e.jsx(k,{"code-path":"src/components/kubernetes/deployment-edit/ContainerEditor.tsx:130:15",type:"number",value:n.containerPort,placeholder:"8080",onChange:d=>{const p=[...o.ports];p[l]={...n,containerPort:d.target.value},s({ports:p})},className:"bg-slate-800 border-slate-700 text-slate-200 font-mono text-xs h-8"}),e.jsxs(Me,{"code-path":"src/components/kubernetes/deployment-edit/ContainerEditor.tsx:133:15",value:n.protocol||"TCP",onValueChange:d=>{const p=[...o.ports];p[l]={...n,protocol:d},s({ports:p})},children:[e.jsx(_e,{"code-path":"src/components/kubernetes/deployment-edit/ContainerEditor.tsx:134:17",className:"bg-slate-800 border-slate-700 text-slate-200 text-xs h-8",children:e.jsx(et,{"code-path":"src/components/kubernetes/deployment-edit/ContainerEditor.tsx:135:19"})}),e.jsxs($e,{"code-path":"src/components/kubernetes/deployment-edit/ContainerEditor.tsx:137:17",className:"bg-slate-900 border-slate-700",children:[e.jsx(be,{"code-path":"src/components/kubernetes/deployment-edit/ContainerEditor.ts Line truncated
114.114.114.114`,rows:3,className:"w-full mt-1 bg-slate-800 border border-slate-700 rounded text-xs text-slate-300 font-mono p-2 resize-y"})]}),e.jsxs("div",{"code-path":"src/components/kubernetes/deployment-edit-advanced/DnsHostSection.tsx:74:13",children:[e.jsx(A,{"code-path":"src/components/kubernetes/deployment-edit-advanced/DnsHostSection.tsx:75:15",className:"text-slate-500 text-xs",children:"searches(搜索域,每行一个)"}),e.jsx("textarea",{"code-path":"src/components/kubernetes/deployment-edit-advanced/DnsHostSection.tsx:76:15",value:o,onChange:f=>a(f.target.value),placeholder:`svc.cluster.local
cluster.local`,rows:3,className:"w-full mt-1 bg-slate-800 border border-slate-700 rounded text-xs text-slate-300 font-mono p-2 resize-y"})]})]}),e.jsxs("div",{"code-path":"src/components/kubernetes/deployment-edit-advanced/DnsHostSection.tsx:85:11",children:[e.jsxs("div",{"code-path":"src/components/kubernetes/deployment-edit-advanced/DnsHostSection.tsx:86:13",className:"flex items-center justify-between mb-1",children:[e.jsx(A,{"code-path":"src/components/kubernetes/deployment-edit-advanced/DnsHostSection.tsx:87:15",className:"text-slate-400 text-xs",children:"options(DNS 选项)"}),e.jsxs(h,{"code-path":"src/components/kubernetes/deployment-edit-advanced/DnsHostSection.tsx:88:15",size:"sm",variant:"ghost",className:"h-6 text-xs text-slate-400",onClick:g,children:[e.jsx(oe,{"code-path":"src/components/kubernetes/deployment-edit-advanced/DnsHostSection.tsx:89:17",className:"h-3 w-3 mr-1"}),"添加"]})]}),n.length===0?e.jsx("p",{"code-path":"src/components/kubernetes/deployment-edit-advanced/DnsHostSection.tsx:93:15",className:"text-xs text-slate-600 italic",children:"未配置"}):n.map((f,C)=>e.jsxs("div",{"code-path":"src/components/kubernetes/deployment-edit-advanced/DnsHostSection.tsx:96:17",className:"flex items-center gap-2 mb-1.5",children:[e.jsx(k,{"code-path":"src/components/kubernetes/deployment-edit-advanced/DnsHostSection.tsx:97:19",value:f.name,onChange:E=>x(C,{name:E.target.value}),placeholder:"ndots",className:"flex-1 h-7 bg-slate-800 border-slate-700 text-slate-300 text-xs font-mono"}),e.jsx("span",{"code-path":"src/components/kubernetes/deployment-edit-advanced/DnsHostSection.tsx:103:19",className:"text-slate-600",children:":"}),e.jsx(k,{"code-path":"src/components/kubernetes/deployment-edit-advanced/DnsHostSection.tsx:104:19",value:f.value,onChange:E=>x(C,{value:E.target.value}),placeholder:"5(可留空)",className:"flex-1 h-7 bg-slate-800 border-slate-700 text-slate-300 text-xs font-mono"}),e.jsx(h,{"code-path":"src/components/kubernetes/deployment-edit-advanced/DnsHostSection.tsx:110:19",size:"icon",variant:"ghost",className:"h-6 w-6 text-red-400",onClick:()=>N(C),children:e.jsx(xe,{"code-path":"src/components/kubernetes/deployment-edit-advanced/DnsHostSection.tsx:111:21",className:"h-3 w-3"})})]},C))]})]})]}),e.jsxs(G,{"code-path":"src/components/kubernetes/deployment-edit-advanced/DnsHostSection.tsx:120:7",className:"bg-slate-900 border-slate-800",children:[e.jsx(le,{"code-path":"src/components/kubernetes/deployment-edit-advanced/DnsHostSection.tsx:121:9",className:"pb-3",children:e.jsxs(de,{"code-path":"src/components/kubernetes/deployment-edit-advanced/DnsHostSection.tsx:122:11",className:"text-sm text-slate-200 flex items-center gap-2",children:[e.jsx(gs,{"code-path":"src/components/kubernetes/deployment-edit-advanced/DnsHostSection.tsx:123:13",className:"h-4 w-4 text-amber-400"}),"主机别名 (hostAliases)"]})}),e.jsxs(L,{"code-path":"src/components/kubernetes/deployment-edit-advanced/DnsHostSection.tsx:126:9",className:"pt-0 space-y-2",children:[e.jsxs("div",{"code-path":"src/components/kubernetes/deployment-edit-advanced/DnsHostSection.tsx:127:11",className:"flex items-center justify-between mb-1",children:[e.jsx(A,{"code-path":"src/components/kubernetes/deployment-edit-advanced/DnsHostSection.tsx:128:13",className:"text-slate-400 text-xs",children:"IP → 主机名映射(注入 Pod 的 /etc/hosts)"}),e.jsxs(h,{"code-path":"src/components/kubernetes/deployment-edit-advanced/DnsHostSection.tsx:129:13",size:"sm",variant:"ghost",className:"h-6 text-xs text-slate-400",onClick:D,children:[e.jsx(oe,{"code-path":"src/components/kubernetes/deployment-edit-advanced/DnsHostSection.tsx:130:15",className:"h-3 w-3 mr-1"}),"添加"]})]}),d.length===0?e.jsx("p",{"code-path":"src/components/kubernetes/deployment-edit-advanced/DnsHostSection.tsx:134:13",className:"text-xs text-slate-600 italic",children:"未配置"}):d.map((f,C)=>e.jsxs("div",{"code-path":"src/components/kubernetes/deployment-edit-advanced/DnsHostSection.tsx:137:15",className:"flex items-center gap-2",children:[e.jsx(k,{"code-path":"src/components/kubernetes/deployment-edit-advanced/DnsHostSection.tsx:138:17",value:f.ip,onChange:E=>O(C,{ip:E.target.value}),placeholder:"10.10.10.72",className:"w-40 h-7 bg-slate-800 border-slate-700 text-slate-300 text-xs font-mono"}),e.jsx("span",{"code-path":"src/components/kubernetes/deployment-edit-advanced/DnsHostSection.tsx:144:17",className:"text-slate-600",children:"→"}),e.jsx(k,{"code-path":"src/components/kubernetes/deployment-edit-advanced/DnsHostSection.tsx:145:17",value:f.hostnames,onChange:E=>O(C,{hostnames:E.target.value}),placeholder:"gitlab.local, registry.local",className:"flex-1 h-7 bg-slate-800 border-slate-700 text-slate-300 text-xs font-mono"}),e.jsx(h,{"code-path":"src/components/kubernetes/deployment-edit-advanced/DnsHostSection.tsx:151:17",size:"icon",variant:"ghost",className:"h-6 w-6 text-red-400",onClick:()=>v(C),children:e.jsx(xe,{"code-path":"src/compone Line truncated
`):""),Vt(Array.isArray(B.searches)?B.searches.join(`
`):"");const ie=Array.isArray(B.options)?B.options:[];Tt(ie.map(ce=>({name:ce.name||"",value:ce.value||""}))),N(!1)},[a]);const is=()=>P(w=>[...w,{key:"",value:""}]),ps=w=>P(W=>W.filter((se,ye)=>ye!==w)),ms=(w,W)=>P(se=>se.map((ye,Pe)=>Pe===w?{...ye,...W}:ye)),xs=async()=>{g(!0);try{const w=JSON.parse(JSON.stringify(D));w.spec=w.spec||{},w.spec.template=w.spec.template||{},w.spec.template.spec=w.spec.template.spec||{};const W=w.spec.template.spec;if(w.spec.strategy={type:v},v==="RollingUpdate"&&(w.spec.strategy.rollingUpdate={maxSurge:C,maxUnavailable:M}),q&&(w.spec.revisionHistoryLimit=Number(q)),V&&(w.spec.progressDeadlineSeconds=Number(V)),_==="nodeName"&&ne.trim())W.nodeName=ne.trim(),delete W.nodeSelector,W.affinity&&delete W.affinity.nodeAffinity;else if(_==="nodeSelector"){const B={};for(const{key:ie,value:ce}of i){const He=ie.trim();He&&(B[He]=ce)}Object.keys(B).length>0?W.nodeSelector=B:delete W.nodeSelector,W.nodeName&&delete W.nodeName,W.affinity&&delete W.affinity.nodeAffinity}else if(_==="nodeAffinity"){const B=i.filter(ie=>ie.key.trim()).map(ie=>({key:ie.key.trim(),operator:"In",values:[ie.value]}));B.length>0?(W.affinity=W.affinity||{},W.affinity.nodeAffinity={requiredDuringSchedulingIgnoredDuringExecution:{nodeSelectorTerms:[{matchExpressions:B}]}}):W.affinity&&delete W.affinity.nodeAffinity,delete W.nodeSelector,W.nodeName&&delete W.nodeName}const se=y.filter(B=>B.key||B.operator==="Exists").map(B=>{const ie={};return B.key&&(ie.key=B.key),B.operator&&(ie.operator=B.operator),B.value&&B.operator!=="Exists"&&(ie.value=B.value),B.effect&&(ie.effect=B.effect),B.tolerationSeconds&&B.effect==="NoExecute"&&(ie.tolerationSeconds=Number(B.tolerationSeconds)),ie});se.length>0?W.tolerations=se:delete W.tolerations,J&&(W.dnsPolicy=J),$&&(W.restartPolicy=$),U&&(W.schedulerName=U),je&&(W.terminationGracePeriodSeconds=Number(je)),R&&(W.serviceAccountName=R);const ye={};ke&&(ye.fsGroup=Number(ke)),j&&(ye.runAsUser=Number(j)),ve&&(ye.runAsGroup=Number(ve)),We&&(ye.runAsNonRoot=!0),Object.keys(ye).length>0?W.securityContext=ye:delete W.securityContext,Fe?W.hostNetwork=!0:delete W.hostNetwork,Ye?W.hostIPC=!0:delete W.hostIPC,Nt?W.hostPID=!0:delete W.hostPID,ft?W.shareProcessNamespace=!0:delete W.shareProcessNamespace;const Pe=Et.filter(B=>B.ip.trim()).map(B=>({ip:B.ip.trim(),hostnames:B.hostnames.split(/[,\s]+/).map(ie=>ie.trim()).filter(Boolean)})).filter(B=>B.hostnames.length>0);Pe.length>0?W.hostAliases=Pe:delete W.hostAliases;const Ae={},Ie=Ct.split(`
`).map(B=>B.trim()).filter(Boolean);Ie.length>0&&(Ae.nameservers=Ie);const Je=At.split(`
`).map(B=>B.trim()).filter(Boolean);Je.length>0&&(Ae.searches=Je);const De=Wt.filter(B=>B.name.trim()).map(B=>{const ie={name:B.name.trim()};return B.value.trim()&&(ie.value=B.value.trim()),ie});De.length>0&&(Ae.options=De),Object.keys(Ae).length>0?W.dnsConfig=Ae:delete W.dnsConfig;const ct=JSON.stringify(w,null,2);await Q.updateResourceYaml(t,s,"deployments",o,ct),d({title:"高级设置已保存",description:`${o} 更新已提交`}),n()}catch(w){d({title:"保存失败",description:w?.message||String(w),variant:"destructive"})}finally{g(!1)}};return x?e.jsx(G,{"code-path":"src/components/kubernetes/DeploymentEditAdvanced.tsx:322:7",className:"bg-slate-900 border-slate-800",children:e.jsxs(L,{"code-path":"src/components/kubernetes/DeploymentEditAdvanced.tsx:323:9",className:"p-12 text-center",children:[e.jsx(pe,{"code-path":"src/components/kubernetes/DeploymentEditAdvanced.tsx:324:11",className:"h-6 w-6 animate-spin mx-auto text-slate-500"}),e.jsx("p",{"code-path":"src/components/kubernetes/DeploymentEditAdvanced.tsx:325:11",className:"text-slate-500 mt-3 text-sm",children:"加载中..."})]})}):a?e.jsxs("div",{"code-path":"src/components/kubernetes/DeploymentEditAdvanced.tsx:342:5",className:"space-y-4",children:[e.jsxs(G,{"code-path":"src/components/kubernetes/DeploymentEditAdvanced.tsx:344:7",className:"bg-slate-900 border-slate-800",children:[e.jsx(le,{"code-path":"src/components/kubernetes/DeploymentEditAdvanced.tsx:345:9",className:"pb-3",children:e.jsxs(de,{"code-path":"src/components/kubernetes/DeploymentEditAdvanced.tsx:346:11",className:"text-sm text-slate-200 flex items-center gap-2",children:[e.jsx(nt,{"code-path":"src/components/kubernetes/DeploymentEditAdvanced.tsx:347:13",className:"h-4 w-4 text-blue-400"}),"更新策略 (Strategy)"]})}),e.jsxs(L,{"code-path":"src/components/kubernetes/DeploymentEditAdvanced.tsx:350:9",className:"pt-0 space-y-3",children:[e.jsxs("div",{"code-path":"src/components/kubernetes/DeploymentEditAdvanced.tsx:351:11",className:"flex items-center gap-4",children:[e.jsxs("label",{"code-path":"src/components/kubernetes/DeploymentEditAdvanced.tsx:352:13",className:"flex items-center gap-1.5 text-xs text-slate-300 cursor-pointer",children:[e.jsx("input",{"code-path":"src/components/kubernetes/DeploymentEditAdvanced.tsx:353:15",type:"radio",checked:v==="RollingUpdate",onChange:()=>f("RollingUpdate"),className:"accent-blue-500"}),"RollingUpdate(滚动更新)"]}),e.jsxs("label",{"code-path":"src/components/kubernetes/DeploymentEditAdvanced.tsx:357:13",className:"flex items-center gap-1.5 text-xs text-slate-300 cursor-pointer",children:[e.jsx("input",{"code-path":"src/components/kubernetes/DeploymentEditAdvanced.tsx:358:15",type:"radio",checked:v==="Recreate",onChange:()=>f("Recreate"),className:"accent-blue-500"}),"Recreate(重建)"]})]}),v==="RollingUpdate"&&e.jsxs("div",{"code-path":"src/components/kubernetes/DeploymentEditAdvanced.tsx:364:13",className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{"code-path":"src/components/kubernetes/DeploymentEditAdvanced.tsx:365:15",children:[e.jsx(A,{"code-path":"src/components/kubernetes/DeploymentEditAdvanced.tsx:366:17",className:"text-slate-500 text-xs",children:"maxSurge(整数或百分比,超出期望副本数)"}),e.jsx(k,{"code-path":"src/components/kubernetes/DeploymentEditAdvanced.tsx:367:17",value:C,onChange:w=>E(w.target.value),placeholder:"25%",className:"h-8 mt-1 bg-slate-800 border-slate-700 text-slate-200 text-sm font-mono"})]}),e.jsxs("div",{"code-path":"src/components/kubernetes/DeploymentEditAdvanced.tsx:370:15",children:[e.jsx(A,{"code-path":"src/components/kubernetes/DeploymentEditAdvanced.tsx:371:17",className:"text-slate-500 text-xs",children:"maxUnavailable(整数或百分比,不可用上限)"}),e.jsx(k,{"code-path":"src/components/kubernetes/DeploymentEditAdvanced.tsx:372:17",value:M,onChange:w=>I(w.target.value),placeholder:"25%",className:"h-8 mt-1 bg-slate-800 border-slate-700 text-slate-200 text-sm font-mono"})]})]})]})]}),e.jsxs(G,{"code-path":"src/components/kubernetes/DeploymentEditAdvanced.tsx:381:7",className:"bg-slate-900 border-slate-800",children:[e.jsx(le,{"code-path":"src/components/kubernetes/DeploymentEditAdvanced.tsx:382:9",className:"pb-3",children:e.jsxs(de,{"code-path":"src/components/kubernetes/DeploymentEditAdvanced.tsx:383:11",className:"text-sm text-slate-200 flex items-center gap-2",children:[e.jsx(Qt,{"code-path":"src/components/kubernetes/DeploymentEditAdvanced.tsx:384:13",className:"h-4 w-4 text-amber-400"}),"历史版本 & 进度"]})}),e.jsxs(L,{"code-path":"src/components/kubernetes/DeploymentEditAdvanced.tsx:387:9",className:"pt-0 grid grid-cols-2 gap-3",children:[e.jsxs("div",{"code-path":"src/components/kubernetes/DeploymentEditAdvanced.tsx:388:11",children:[e.jsx(A,{"code-path":"src/components/kubernetes/DeploymentEditAdvanced.tsx:389:13",className:"text-slate-500 text-xs",children:"revisionHistoryLimit(保留 RS 历史)"}),e.jsx(k,{"code-path":"src/co Line truncated
bg-slate-800 border border-slate-700 text-slate-300 hover:border-blue-500/50 hover:text-blue-300 transition-colors`,children:[e.jsx(as,{"code-path":"src/components/kubernetes/DeploymentEditService.tsx:414:23",className:"h-2.5 w-2.5"}),c.label,e.jsxs("span",{"code-path":"src/components/kubernetes/DeploymentEditService.tsx:416:23",className:"text-slate-500 text-[9px]",children:[c.protocol," ",c.port,":",c.targetPort]})]},c.name))})]}),e.jsxs("div",{"code-path":"src/components/kubernetes/DeploymentEditService.tsx:423:15",className:"space-y-2",children:[e.jsxs(A,{"code-path":"src/components/kubernetes/DeploymentEditService.tsx:424:17",className:"text-slate-500 text-[11px]",children:["端口配置 ",e.jsxs("span",{"code-path":"src/components/kubernetes/DeploymentEditService.tsx:425:24",className:"text-slate-600",children:["(",q.ports.length," 个端口)"]})]}),q.ports.map((c,y)=>e.jsxs("div",{"code-path":"src/components/kubernetes/DeploymentEditService.tsx:428:19",className:"flex items-center gap-1.5 p-2 rounded bg-slate-800/50 border border-slate-700/50",children:[e.jsx(k,{"code-path":"src/components/kubernetes/DeploymentEditService.tsx:430:21",value:c.name,onChange:b=>F(y,"name",b.target.value),placeholder:"http",className:"h-7 w-[72px] bg-slate-800 border-slate-700 text-slate-300 text-xs font-mono"}),e.jsxs("select",{"code-path":"src/components/kubernetes/DeploymentEditService.tsx:434:21",value:c.protocol,onChange:b=>F(y,"protocol",b.target.value),className:"h-7 bg-slate-800 border border-slate-700 rounded text-xs text-slate-300 px-1.5 w-16",children:[e.jsx("option",{"code-path":"src/components/kubernetes/DeploymentEditService.tsx:436:23",value:"TCP",children:"TCP"}),e.jsx("option",{"code-path":"src/components/kubernetes/DeploymentEditService.tsx:437:23",value:"UDP",children:"UDP"})]}),e.jsx(k,{"code-path":"src/components/kubernetes/DeploymentEditService.tsx:440:21",value:c.port,onChange:b=>F(y,"port",b.target.value),type:"number",placeholder:"port",className:"h-7 w-[72px] bg-slate-800 border-slate-700 text-slate-300 text-xs font-mono"}),e.jsx("span",{"code-path":"src/components/kubernetes/DeploymentEditService.tsx:443:21",className:"text-slate-600 text-[10px]",children:"→"}),e.jsx(k,{"code-path":"src/components/kubernetes/DeploymentEditService.tsx:444:21",value:c.targetPort,onChange:b=>F(y,"targetPort",b.target.value),type:"number",placeholder:"targetPort",className:"h-7 w-[72px] bg-slate-800 border-slate-700 text-slate-300 text-xs font-mono"}),q.type==="NodePort"&&e.jsx(k,{"code-path":"src/components/kubernetes/DeploymentEditService.tsx:449:23",value:c.nodePort,onChange:b=>F(y,"nodePort",b.target.value),type:"number",placeholder:"30000-32767",className:"h-7 w-[80px] bg-slate-800 border-slate-700 text-slate-300 text-xs font-mono"}),e.jsx(h,{"code-path":"src/components/kubernetes/DeploymentEditService.tsx:454:21",size:"icon",variant:"ghost",className:"h-6 w-6 text-slate-500 hover:text-red-400",onClick:()=>ne(y),disabled:q.ports.length<=1,children:e.jsx(gt,{"code-path":"src/components/kubernetes/DeploymentEditService.tsx:456:23",className:"h-3 w-3"})})]},y)),e.jsxs(h,{"code-path":"src/components/kubernetes/DeploymentEditService.tsx:461:17",size:"sm",variant:"outline",className:"h-7 w-full border-dashed border-slate-700 text-slate-400 text-xs",onClick:()=>_(),children:[e.jsx(oe,{"code-path":"src/components/kubernetes/DeploymentEditService.tsx:463:19",className:"h-3 w-3 mr-1"}),"添加自定义端口"]})]}),e.jsxs("div",{"code-path":"src/components/kubernetes/DeploymentEditService.tsx:468:15",className:"text-[10px] text-slate-500 border-t border-slate-700/50 pt-2",children:[e.jsx("span",{"code-path":"src/components/kubernetes/DeploymentEditService.tsx:469:17",className:"text-slate-600",children:"selector (自动检测): "}),Object.keys(v).length>0?Object.entries(v).map(([c,y])=>e.jsxs("code",{"code-path":"src/components/kubernetes/DeploymentEditService.tsx:472:21",className:"bg-slate-800 px-1 py-0.5 rounded text-slate-400 ml-1",children:[c,"=",y]},c)):e.jsx("span",{"code-path":"src/components/kubernetes/DeploymentEditService.tsx:475:19",className:"text-slate-600 italic",children:"未检测到"})]}),e.jsxs("div",{"code-path":"src/components/kubernetes/DeploymentEditService.tsx:479:15",className:"flex justify-end gap-2 pt-1",children:[e.jsx(h,{"code-path":"src/components/kubernetes/DeploymentEditService.tsx:480:17",size:"sm",variant:"ghost",className:"h-7 text-xs text-slate-400",onClick:()=>I(null),children:"取消"}),e.jsx(h,{"code-path":"src/components/kubernetes/DeploymentEditService.tsx:481:17",size:"sm",className:"h-7 bg-blue-600 hover:bg-blue-700 text-xs",onClick:i,children:"创建"})]})]})]})]}),e.jsxs(G,{"code-path":"src/components/kubernetes/DeploymentEditService.tsx:489:7",className:"bg-slate-900 border-slate-800",children:[e.jsxs(le,{"code-path":"src/components/kubernetes/DeploymentEditService.tsx:490:9",className:"pb-3",children:[e.jsxs("div",{"code-path":"src/components/kube Line truncated
${N?"border-blue-500 text-blue-400":x.available?"border-transparent text-slate-400 hover:text-slate-200":"border-transparent text-slate-600 cursor-not-allowed"}`,children:[e.jsx(D,{"code-path":"src/components/kubernetes/DeploymentWorkload.tsx:584:15",className:"h-3.5 w-3.5"}),x.label,x.badge&&e.jsx("span",{"code-path":"src/components/kubernetes/DeploymentWorkload.tsx:587:17",className:`text-[9px] px-1 py-0.5 rounded ${N?"bg-blue-500/20 text-blue-300":"bg-slate-800 text-slate-600"}`,children:x.badge})]},x.key)})}),d==="basic"?e.jsx(Xs,{"code-path":"src/components/kubernetes/DeploymentWorkload.tsx:598:9",clusterCode:t,namespace:s,deploymentName:o,manifest:a,onSaved:n,onCancel:l}):d==="containers"?e.jsx(Ks,{"code-path":"src/components/kubernetes/DeploymentWorkload.tsx:608:9",clusterCode:t,namespace:s,deploymentName:o,manifest:a,onSaved:n,onCancel:l}):d==="storage"?e.jsx(en,{"code-path":"src/components/kubernetes/DeploymentWorkload.tsx:618:9",clusterCode:t,namespace:s,deploymentName:o,manifest:a,onSaved:n,onCancel:l}):d==="advanced"?e.jsx(on,{"code-path":"src/components/kubernetes/DeploymentWorkload.tsx:628:9",clusterCode:t,namespace:s,deploymentName:o,manifest:a,onSaved:n,onCancel:l}):d==="service"?e.jsx(cn,{"code-path":"src/components/kubernetes/DeploymentWorkload.tsx:638:9",clusterCode:t,namespace:s,deploymentName:o,manifest:a,onSaved:n,onCancel:l}):null]})}function dn({clusterCode:t,namespace:s,deploymentName:o}){const{toast:a}=we(),n=kt(g=>g.token)||localStorage.getItem("token")||"",l=`${window.location.origin}/api/v1/clusters/${t}/namespaces/${s}/deployments/${o}/update-image`,d=`curl -X POST '${l}' \\
-H 'Authorization: Bearer ${n?n.substring(0,16)+"...":"YOUR_TOKEN"}' \\
-H 'Content-Type: application/json' \\
-d '{"image": "harbor.example.com/app:v1.0", "container": "your-container-name"}'`,p=g=>{navigator.clipboard.writeText(g).then(()=>a({title:"已复制"})).catch(()=>{})};return e.jsxs("div",{"code-path":"src/components/kubernetes/DeploymentWorkload.tsx:666:5",className:"space-y-4",children:[e.jsxs("div",{"code-path":"src/components/kubernetes/DeploymentWorkload.tsx:667:7",children:[e.jsx(A,{"code-path":"src/components/kubernetes/DeploymentWorkload.tsx:668:9",className:"text-slate-400 text-sm",children:"Webhook URL"}),e.jsxs("div",{"code-path":"src/components/kubernetes/DeploymentWorkload.tsx:669:9",className:"flex items-center gap-2 mt-1",children:[e.jsx("code",{"code-path":"src/components/kubernetes/DeploymentWorkload.tsx:670:11",className:"flex-1 text-xs text-slate-300 bg-slate-800 rounded px-3 py-2 break-all font-mono",children:l}),e.jsx(h,{"code-path":"src/components/kubernetes/DeploymentWorkload.tsx:671:11",variant:"outline",size:"sm",className:"border-slate-700 text-slate-400 shrink-0",onClick:()=>p(l),children:"复制"})]})]}),e.jsxs("div",{"code-path":"src/components/kubernetes/DeploymentWorkload.tsx:674:7",children:[e.jsx(A,{"code-path":"src/components/kubernetes/DeploymentWorkload.tsx:675:9",className:"text-slate-400 text-sm",children:"curl 示例"}),e.jsxs("div",{"code-path":"src/components/kubernetes/DeploymentWorkload.tsx:676:9",className:"relative mt-1",children:[e.jsx("pre",{"code-path":"src/components/kubernetes/DeploymentWorkload.tsx:677:11",className:"text-xs text-slate-300 bg-slate-800 rounded p-3 overflow-x-auto font-mono whitespace-pre-wrap",children:d}),e.jsx(h,{"code-path":"src/components/kubernetes/DeploymentWorkload.tsx:678:11",variant:"outline",size:"sm",className:"absolute top-2 right-2 border-slate-700 text-slate-400",onClick:()=>p(d),children:"复制"})]})]}),e.jsxs("div",{"code-path":"src/components/kubernetes/DeploymentWorkload.tsx:681:7",className:"text-xs text-slate-500 space-y-1",children:[e.jsx("p",{"code-path":"src/components/kubernetes/DeploymentWorkload.tsx:682:9",children:"• 使用 Bearer Token 认证(JWT 登录令牌)"}),e.jsxs("p",{"code-path":"src/components/kubernetes/DeploymentWorkload.tsx:683:9",children:["• ",e.jsx("code",{"code-path":"src/components/kubernetes/DeploymentWorkload.tsx:683:14",className:"text-slate-400",children:"image"})," 必填,指定新镜像地址"]}),e.jsxs("p",{"code-path":"src/components/kubernetes/DeploymentWorkload.tsx:684:9",children:["• ",e.jsx("code",{"code-path":"src/components/kubernetes/DeploymentWorkload.tsx:684:14",className:"text-slate-400",children:"container"})," 可选,不填则更新第一个容器"]})]})]})}function Xe({title:t,children:s,onClose:o}){return e.jsx("div",{"code-path":"src/components/kubernetes/DeploymentWorkload.tsx:693:5",className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",onClick:o,children:e.jsxs("div",{"code-path":"src/components/kubernetes/DeploymentWorkload.tsx:694:7",className:"bg-slate-900 border border-slate-700 rounded-xl p-6 w-[460px] max-w-[90vw] shadow-2xl",onClick:a=>a.stopPropagation(),children:[e.jsxs("div",{"code-path":"src/components/kubernetes/DeploymentWorkload.tsx:695:9",className:"flex items-center justify-between mb-4",children:[e.jsx("h2",{"code-path":"src/components/kubernetes/DeploymentWorkload.tsx:696:11",className:"text-base font-bold text-slate-100",children:t}),e.jsx(h,{"code-path":"src/components/kubernetes/DeploymentWorkload.tsx:697:11",variant:"ghost",size:"icon",className:"h-7 w-7 text-slate-400",onClick:o,children:e.jsx(ns,{"code-path":"src/components/kubernetes/DeploymentWorkload.tsx:697:100",className:"h-4 w-4"})})]}),s]})})}function pn({clusterCode:t,namespace:s,podName:o,containers:a,onClose:n}){const{toast:l}=we(),[d,p]=m.useState(""),[g,x]=m.useState(200),[N,D]=m.useState(a[0]||""),[O,v]=m.useState(!1),[f,C]=m.useState(!1),E=async()=>{v(!0);try{const I=await Q.getPodLogs(t,s,o,g,N||void 0);p(I?.data?.logs||I?.logs||I||"无日志")}catch{p("获取日志失败")}finally{v(!1)}};m.useEffect(()=>{E()},[N,g]);const M=async()=>{C(!0);const I=kt.getState().token||"",q="",Y=N?`&container=${encodeURIComponent(N)}`:"",V=`${q}/api/v1/kubernetes/${t}/namespace/${s}/pods/${o}/logs?tail=${g}&stream=true${Y}`;try{const _=(await fetch(V,{headers:{Authorization:`Bearer ${I}`}})).body?.getReader();if(!_)return;const F=new TextDecoder;let ne="";for(;;){const{done:te,value:r}=await _.read();if(te)break;ne+=F.decode(r,{stream:!0}),p(ne)}}catch{l({title:"流式日志连接中断",variant:"destructive"})}finally{C(!1)}};return e.jsx("div",{"code-path":"src/components/kubernetes/DeploymentWorkload.tsx:752:5",className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",onClick:n,children:e.jsxs("div",{"code-path":"src/components/kubernetes/DeploymentWorkload.tsx:753:7",className:"bg-slate-900 border border-slate-700 rounded-xl w-[90vw] max-w-4xl max-h-[80vh] flex flex-col",onClick:I=>I.stopPropagation(),children:[e.jsxs("div",{"code-path" Line truncated