chore: 同步 embed 静态资源(base=/ 修复深链白屏)
二进制 / K8s embed 模式 go:embed 使用 backend/static
This commit is contained in:
1 parent
992e9b2ecc
commit
921b44d6a4
155 files changed
+187
-184
No files matched your search
@@ -0,0 +1 @@
|
||||
import{f as ee,r as t,j as e,B as u,L as O,M as se,D as oe,a as ae,b as te,c as ce,d as ne,e as re,t as N}from"./index-BTQygws6.js";import{I as j}from"./input-C6mE-wO9.js";import{L as i}from"./label-8e-EC7mH.js";import{B as A}from"./badge-BsIZhz7S.js";import{C as V}from"./checkbox-D73wKf04.js";import{T as le,a as de,b as H,c as r,d as ie,e as l}from"./table-Dh5trM9F.js";import{S as y,a as C,b as w,c as S,d as R}from"./select-pPlmgAjn.js";import{r as M}from"./region-CWnyU1Ly.js";import{S as pe}from"./search-BDsFve6h.js";import{P as ge}from"./plus-DOS6OUrq.js";import{T as $}from"./trash-2-5oUve9eW.js";import{C as xe}from"./circle-check-DMxKs2Ba.js";import{C as he}from"./circle-x-CYoA2i-_.js";import{P as me}from"./pencil-BgEVXj0m.js";import"./index-WFeZT6kc.js";import"./chevron-up-Z8QjN8G2.js";const k={aws:"AWS",aliyun:"阿里云",tencent:"腾讯云",huawei:"华为云",azure:"Azure"},ue={aws:"text-orange-400",aliyun:"text-orange-400",tencent:"text-blue-400",huawei:"text-red-400",azure:"text-blue-400"};function Ie(){const D=ee(),[T,L]=t.useState([]),[F,P]=t.useState(!0),[f,Q]=t.useState(""),[b,W]=t.useState("all"),[c,d]=t.useState([]),[X,p]=t.useState(!1),[g,I]=t.useState(null),[B,z]=t.useState(!1),[o,n]=t.useState({name:"",code:"",provider:"aliyun",location:"",status:"active",endpoint:""}),x=t.useCallback(async()=>{P(!0);try{const a=(await M.list())?.list||[];L(a)}catch{L([])}finally{P(!1)}},[]);t.useEffect(()=>{x()},[x]);const h=T.filter(s=>{const a=s.name?.toLowerCase().includes(f.toLowerCase())||s.code?.toLowerCase().includes(f.toLowerCase()),v=b==="all"||s.provider===b;return a&&v}),E=h.length>0&&h.every(s=>c.includes(s.id)),q=()=>{d(E?[]:h.map(s=>s.id))},G=s=>{d(a=>a.includes(s)?a.filter(v=>v!==s):[...a,s])},J=()=>{I(null),n({name:"",code:"",provider:"aliyun",location:"",status:"active",endpoint:""}),p(!0)},K=s=>{I(s),n({name:s.name||"",code:s.code||"",provider:s.provider||"aliyun",location:s.location||"",status:s.status||"active",endpoint:s.endpoint||""}),p(!0)},U=async()=>{if(!(!o.name.trim()||!o.code.trim())){z(!0);try{g?await M.update(g.id,o):await M.create(o),p(!1),x()}catch{}finally{z(!1)}}},Y=async s=>{const a=T.find(m=>m.id===s);if(await D({title:"删除区域",description:`确定删除「${a?.name||s}」吗?此操作不可撤销。`,confirmText:"删除",variant:"destructive"}))try{await M.delete(s),N.success("区域已删除"),d(m=>m.filter(_=>_!==s)),x()}catch(m){console.error("删除区域失败:",m),N.error("删除失败")}},Z=async()=>{if(!(c.length===0||!await D({title:"批量删除区域",description:`确定删除选中的 ${c.length} 个区域吗?此操作不可撤销。`,confirmText:"批量删除",variant:"destructive"})))try{await M.batchDelete(c),N.success(`已删除 ${c.length} 个区域`),d([]),x()}catch(a){console.error("批量删除失败:",a),N.error("批量删除失败")}};return e.jsxs("div",{"code-path":"src/components/cloud/RegionManager.tsx:185:5",className:"p-6 space-y-4",children:[e.jsxs("div",{"code-path":"src/components/cloud/RegionManager.tsx:187:7",className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{"code-path":"src/components/cloud/RegionManager.tsx:188:9",className:"flex items-center gap-3 flex-1",children:[e.jsxs("div",{"code-path":"src/components/cloud/RegionManager.tsx:189:11",className:"relative w-72",children:[e.jsx(pe,{"code-path":"src/components/cloud/RegionManager.tsx:190:13",className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-slate-500"}),e.jsx(j,{"code-path":"src/components/cloud/RegionManager.tsx:191:13",placeholder:"搜索区域名称或编码...",value:f,onChange:s=>Q(s.target.value),className:"pl-9 h-9 bg-slate-800/50 border-slate-700"})]}),e.jsxs(y,{"code-path":"src/components/cloud/RegionManager.tsx:198:11",value:b,onValueChange:W,children:[e.jsx(C,{"code-path":"src/components/cloud/RegionManager.tsx:199:13",className:"w-32 h-9 bg-slate-800/50 border-slate-700",children:e.jsx(w,{"code-path":"src/components/cloud/RegionManager.tsx:200:15"})}),e.jsxs(S,{"code-path":"src/components/cloud/RegionManager.tsx:202:13",children:[e.jsx(R,{"code-path":"src/components/cloud/RegionManager.tsx:203:15",value:"all",children:"全部云商"}),Object.entries(k).map(([s,a])=>e.jsx(R,{"code-path":"src/components/cloud/RegionManager.tsx:205:17",value:s,children:a},s))]})]})]}),e.jsxs(u,{"code-path":"src/components/cloud/RegionManager.tsx:210:9",onClick:J,className:"gap-2",children:[e.jsx(ge,{"code-path":"src/components/cloud/RegionManager.tsx:211:11",className:"h-4 w-4"}),"添加区域"]})]}),c.length>0&&e.jsxs("div",{"code-path":"src/components/cloud/RegionManager.tsx:218:9",className:"flex items-center justify-between gap-4 px-4 py-2.5 rounded-lg bg-slate-800/50 border border-slate-700",children:[e.jsxs("span",{"code-path":"src/components/cloud/RegionManager.tsx:219:11",className:"text-sm text-slate-300",children:["已选择 ",e.jsx("span",{"code-path":"src/components/cloud/RegionManager.tsx:220:17",className:"font-semibold text-slLine truncated
|
||||
Reference in new issue
Block a user