chore: 重新编译前端产物(补装CodeMirror依赖)
This commit is contained in:
1 parent
23e9e3da62
commit
4e384ca401
115 files changed
+147
-147
No files matched your search
@@ -0,0 +1 @@
|
||||
import{r as d,j as e}from"./vendor-codemirror-B1SGo4xl.js";import{C as V,a as W,b as y,c as S}from"./card-BIfzBCEy.js";import{g as Te,i as Re,k as Le,f as $e,B as p}from"./index-Dungj95X.js";import{B as j}from"./badge-CGJlVD3L.js";import{T as re,a as ce,b as C,c as h,d as le,e as i}from"./table-B2F10oba.js";import{k as U}from"./index-drGq01ok.js";import{u as Ae}from"./use-toast-DNZLibQY.js";import{Y as de,P as Me,a as Be}from"./PodFileBrowser-B-U8iHmY.js";import{S as w,f as ie,s as q}from"./k8s-yaml-utils-4KZB_Bq_.js";import{m as ze,B as xe,n as Oe,o as Fe,p as _e,q as De,D as He,k as he,A as Ye,r as Ee,H as qe,s as Ie,P as Je}from"./vendor-icons-DmqcWdzX.js";import"./select-CiTqGGhE.js";import"./index-5FEebgvX.js";import"./vendor-xterm-20M9KZE1.js";function c({label:t,value:x,sub:P,color:u}){return e.jsx(V,{"code-path":"src/components/kubernetes/WorkloadViewPage.tsx:30:5",className:"bg-slate-900 border-slate-800",children:e.jsxs(W,{"code-path":"src/components/kubernetes/WorkloadViewPage.tsx:31:7",className:"p-3",children:[e.jsx("p",{"code-path":"src/components/kubernetes/WorkloadViewPage.tsx:32:9",className:"text-xs text-slate-500",children:t}),e.jsx("p",{"code-path":"src/components/kubernetes/WorkloadViewPage.tsx:33:9",className:"text-base font-bold mt-0.5",style:{color:u||"#e2e8f0"},children:x}),P&&e.jsx("p",{"code-path":"src/components/kubernetes/WorkloadViewPage.tsx:34:17",className:"text-[10px] text-slate-600 mt-0.5",children:P})]})})}function me({labels:t}){const x=Object.entries(t||{});return x.length===0?e.jsx("span",{"code-path":"src/components/kubernetes/WorkloadViewPage.tsx:43:36",className:"text-xs text-slate-600",children:"无"}):e.jsx("div",{"code-path":"src/components/kubernetes/WorkloadViewPage.tsx:45:5",className:"flex flex-wrap gap-1.5",children:x.map(([P,u])=>e.jsxs(j,{"code-path":"src/components/kubernetes/WorkloadViewPage.tsx:47:9",variant:"outline",className:"border-slate-700 text-slate-400 text-[10px] font-mono",children:[P,"=",u]},P))})}function ls(){const t=Te(),x=Re(),P=Le(),{toast:u}=Ae(),ke=$e(),n=t.clusterCode||"",r=t.namespace||"",l=t.name||"",m=P.pathname.includes("/DaemonSet/")?"DaemonSet":"StatefulSet",T=t.mode==="yaml"?"yaml":"view",[N,ue]=d.useState(null),[R,be]=d.useState([]),[ge,I]=d.useState(!0),[we,L]=d.useState(!1),[v,F]=d.useState(1),[$,A]=d.useState(!1),[_,J]=d.useState(null),[D,K]=d.useState(null),[je,G]=d.useState(!1),M=d.useCallback(async()=>{I(!0);try{const[s,o]=await Promise.all([U.getResourceYaml(n,r,m.toLowerCase()+"s",l).catch(()=>""),U.getPods(n).catch(()=>[])]);let f=null;if(s&&typeof s=="string")try{f=JSON.parse(s)}catch{f={_raw:s}}else s&&typeof s=="object"&&(f=s);ue(f);const E=(Array.isArray(o)?o:o?.list||o?.data||[]).filter(O=>{const Ue=O.name||O.metadata?.name||"",ne=O.namespace||O.namespace_name||"";return Ue.startsWith(l)&&(!ne||ne===r)});be(E)}catch(s){console.error("load error",s)}finally{I(!1)}},[n,r,l,m]);d.useEffect(()=>{M()},[M]);const Q=s=>{s!==T&&x(`/kubernetes/${n}/namespace/${r}/workload/${s}/${m}/${l}`,{replace:!0})},Pe=async()=>{if(await ke({title:"滚动重启",description:`确认重启 ${m} ${l}?将触发滚动重启。`,confirmText:"重启"})){A(!0);try{m==="StatefulSet"?await U.restartStatefulSet(n,r,l):await U.restartDaemonSet(n,r,l),u({title:"重启指令已下发",description:`${m} 滚动重启已触发`}),setTimeout(M,1e3)}catch(o){u({title:"重启失败",description:o?.message||String(o),variant:"destructive"})}finally{A(!1)}}},Ve=async()=>{A(!0);try{await U.scaleStatefulSet(n,r,l,v),u({title:"扩缩容成功",description:`StatefulSet 副本数已更新为 ${v}`}),L(!1),setTimeout(M,1e3)}catch(s){u({title:"扩缩容失败",description:s?.message||String(s),variant:"destructive"})}finally{A(!1)}},k=N?.spec||{},b=N?.status||{},X=k?.template?.spec?.containers||[],Z=k?.template?.spec?.initContainers||[],B=k.replicas??1,ee=b.readyReplicas??0,We=b.currentReplicas??0,Ne=b.updatedReplicas??0,H=b.desiredNumberScheduled??0,fe=b.currentNumberScheduled??0,se=b.numberReady??0,ve=b.numberAvailable??0,ye=b.updatedNumberScheduled??0,g=m==="StatefulSet",z=g?ee===B&&B>0:se===H&&H>0,a=k.updateStrategy||{},Y=a.type||"RollingUpdate",te=k.volumeClaimTemplates||[],Se=k.selector?.matchLabels||{},Ce=N?.metadata?.labels||{},ae=N?.metadata?.annotations||{};return e.jsxs("div",{"code-path":"src/components/kubernetes/WorkloadViewPage.tsx:191:5",className:"p-4 space-y-4",children:[e.jsxs("div",{"code-path":"src/components/kubernetes/WorkloadViewPage.tsx:193:7",className:"flex items-center justify-between",children:[e.jsxs("div",{"code-path":"src/components/kubernetes/WorkloadViewPage.tsx:194:9",className:"flex items-center gap-3",children:[e.jsx(p,{"code-path":"src/components/kubernetes/WorkloadViewPage.tsx:195:11",variant:"ghost",size:"icon",className:"h-8 w-8 text-slate-400 hover:text-slate-200",onClick:()=>x(-1),children:e.jsx(ze,{"code-path":"src/components/kubernetes/WorkloadViewPage.tsx:196:13",className:"h-4 w-4"})}),e.jsx(xe,{"code-path":"src/comLine truncated
|
||||
Reference in new issue
Block a user