chore(build): 更新 embed 前端静态资源
同步 ./run.sh build 产出的 backend/static 哈希资源与 index.html。
This commit is contained in:
1 parent
8df0acb338
commit
1fd9a631e5
108 files changed
+142
-139
No files matched your search
@@ -0,0 +1 @@
|
||||
import{r as h,j as e}from"./vendor-codemirror-B1SGo4xl.js";import{B as j}from"./index-Bp-M7P_8.js";import{p as B,c as Z,g as ie,M as le,d as ue,b as xe,e as pe,f as me,y as he}from"./PodFileBrowser-CVjj8HxI.js";import{I as E}from"./input-Bnlm--la.js";import{L as S}from"./label-NkONM5Mp.js";import{T as be}from"./textarea-BvOVhaCD.js";import{S as F,a as G,b as W,c as q,d as Y}from"./select-DbhcBWnH.js";import{u as ve}from"./use-toast-DNZLibQY.js";import{k as _,d as ge}from"./index-BkulU9RM.js";import{D as ke,f as Re,N as Ee,j as ye,F as je,X as Ve,L as I,P as z,T as O,$}from"./vendor-icons-BWk-DH7F.js";function ee(i,b,c){switch(i){case"services":return{apiVersion:"v1",kind:"Service",metadata:{name:c,namespace:b},spec:{type:"ClusterIP",selector:{},ports:[{name:"http",port:80,targetPort:80,protocol:"TCP"}]}};case"ingresses":return{apiVersion:"networking.k8s.io/v1",kind:"Ingress",metadata:{name:c,namespace:b},spec:{ingressClassName:"nginx",rules:[{host:"",http:{paths:[{path:"/",pathType:"Prefix",backend:{service:{name:"",port:{number:80}}}}]}}]}};case"configmaps":return{apiVersion:"v1",kind:"ConfigMap",metadata:{name:c,namespace:b},data:{}};case"secrets":return{apiVersion:"v1",kind:"Secret",metadata:{name:c,namespace:b},type:"Opaque",data:{}};case"pvcs":return{apiVersion:"v1",kind:"PersistentVolumeClaim",metadata:{name:c,namespace:b},spec:{accessModes:["ReadWriteOnce"],resources:{requests:{storage:"1Gi"}}}};default:return{apiVersion:"v1",kind:"Unknown",metadata:{name:c,namespace:b}}}}function Ae({clusterCode:i,namespace:b,resource:c,name:y,onClose:k,onSaved:f,isCreate:v=!1}){const{toast:d}=ve(),[w,m]=h.useState(!0),[g,V]=h.useState(!1),[N,r]=h.useState(""),[t,x]=h.useState(null),[R,P]=h.useState("visual"),[l,n]=h.useState(""),[p,s]=h.useState(""),[o,a]=h.useState(!1),[C,A]=h.useState(!1),[se,U]=h.useState(!1),H=h.useCallback(async()=>{m(!0);try{if(v){const K=ee(c,b,y||""),Q=await B(K);x(K),n(Q),s(Q),r(""),a(!0);return}const u=await _.getResourceYaml(i,b,c,y);r(u);const{manifest:T,yaml:M}=await Z(u);n(M),s(M),a(!1),A(!1),x(T),T||(P("yaml"),d({title:"可视化编辑不可用",description:"无法解析资源结构,已切换到 YAML 编辑模式"}))}catch(u){d({title:"加载失败",description:u.message,variant:"destructive"})}finally{m(!1)}},[i,b,c,y,v]);h.useEffect(()=>{H()},[H]);const L=async u=>{V(!0);try{const T=await B(u),M=u?.metadata?.name||y;if(v){if(!M?.trim()){d({title:"请填写名称",variant:"destructive"});return}await _.applyYAML(i,T),d({title:"创建成功",description:`${c}/${M}`})}else await _.updateResourceYaml(i,b,c,y,T),d({title:"保存成功",description:`${c}/${y} 已更新`});f?.(),k()}catch(T){d({title:v?"创建失败":"保存失败",description:T.message,variant:"destructive"})}finally{V(!1)}},te=async()=>{V(!0);try{const u=await me(p);v?(await _.applyYAML(i,u),d({title:"创建成功",description:"YAML 已应用"})):(await _.updateResourceYaml(i,b,c,y,u),d({title:"保存成功",description:`${c}/${y} 已更新`})),a(!1),n(u),s(u),v||r(u),f?.(),k()}catch(u){d({title:"保存失败",description:u.message,variant:"destructive"})}finally{V(!1)}},re=async()=>{const u=await pe(p);if(!u){d({title:"无法解析 YAML",description:"请检查语法后继续用 YAML 模式",variant:"destructive"});return}x(u),P("visual")},oe=async()=>{if(t){const u=await B(t);n(u),s(u)}a(!1),A(!1),P("yaml")},X=()=>o?p:C?N:l,ae=async()=>{await navigator.clipboard.writeText(X()),U(!0),setTimeout(()=>U(!1),2e3)},ce=()=>{const u=he(c,b,y||t?.metadata?.name||"resource");ge(u,X()),d({title:"已下载",description:u})},ne=ie(c),J={configmaps:{title:"ConfigMap",icon:je,color:"text-blue-400"},secrets:{title:"Secret",icon:ye,color:"text-amber-400"},services:{title:"Service",icon:Ee,color:"text-cyan-400"},ingresses:{title:"Ingress",icon:Re,color:"text-purple-400"},pvcs:{title:"PersistentVolumeClaim",icon:ke,color:"text-emerald-400"}},D=J[c]||J.configmaps,de=D.icon;return e.jsx(le,{"code-path":"src/components/kubernetes/ResourceVisualEditor.tsx:169:5",onClose:k,children:e.jsxs("div",{"code-path":"src/components/kubernetes/ResourceVisualEditor.tsx:170:7",className:"bg-[var(--dg-bg-primary)] border border-[var(--dg-border)] rounded-xl w-[90vw] max-w-3xl h-[85vh] flex flex-col shadow-2xl",onClick:u=>u.stopPropagation(),children:[e.jsxs("div",{"code-path":"src/components/kubernetes/ResourceVisualEditor.tsx:175:9",className:"flex items-center justify-between p-4 border-b border-[var(--dg-border)]",children:[e.jsxs("div",{"code-path":"src/components/kubernetes/ResourceVisualEditor.tsx:176:11",className:"flex items-center gap-2",children:[e.jsx(de,{"code-path":"src/components/kubernetes/ResourceVisualEditor.tsx:177:13",className:`h-5 w-5 ${D.color}`}),e.jsxs("div",{"code-path":"src/components/kubernetes/ResourceVisualEditor.tsx:178:13",children:[e.jsx("h2",{"code-path":"src/components/kubernetes/ResourceVisualEditor.tsx:179:15",className:"text-lg font-bold text-[var(--dg-text-primary)]",children:v?`新建 ${D.title}`:`${D.title} 编
Line truncated
|
||||
Reference in new issue
Block a user