refactor(frontend): API 子模块化、大组件拆分与 TanStack Query hooks
P1: kubernetes/system API 拆为子目录模块,导出工具下沉到 lib/export-utils,
http 统一 buildApiUrl/getWsBase;HostMonitor、DeploymentEdit* 拆至子组件。
P2: 新增 hooks/api(queryKeys、useTerminalSessions、useHostMonitor),
TerminalSessionsTab 与 HostMonitor 接入 TanStack Query。
P3: 保留 services/api 路径,未迁移至 api/ 目录。
This commit is contained in:
1 parent
7fb2236b4d
commit
0b404b4611
226 files changed
+3040
-2596
No files matched your search
@@ -0,0 +1,11 @@
|
||||
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-l6TwDTR3.js","./index-Dmami9WE.js","./index-C8L7RhXS.css","./dashboard-BHNKEvkq.js","./server-3HmnhxQB.js","./kubernetes-D2-GnE0t.js","./deploy-CD5bEXt-.js","./automation-WG-s4QEv.js","./monitor-CicbJUrQ.js","./agent-B3ElXCx8.js","./cloud-Dq4kl-JO.js","./system-C3cYTuQH.js","./ai-2t1T1OeI.js"])))=>i.map(i=>d[i]);
|
||||
import{i as Ke,j as e,r as t,aU as Tr,D as _e,a as Te,b as Je,c as Re,d as Me,s as xr,Y as Ae,M as Ve,P as cr,K as ve,o as Fe,B as N,a6 as $e,S as ze,e as qe,$ as ir,a0 as xe,X as ue,t as vr,L as Le,ak as Rr,ab as Mr,a8 as Br,ag as Pr,aa as Qe,ad as Ar,a9 as $r,ac as Or,as as zr,h as Lr,V as Hr,aQ as hr,N as Ur,E as ar,aJ as gr,aK as ur,aL as br,aM as Sr,aN as We,aO as he,f as Dr}from"./index-Dmami9WE.js";import{C as ke,a as Ee}from"./card-CIfC-8Rh.js";import{I as V}from"./input-NsU9nXZF.js";import{C as ge}from"./checkbox-DoAtRzQj.js";import{b as Oe,e as se,T as Vr,a as Wr,c as de,d as Gr}from"./table-CG4mjNfb.js";import{S as fe,a as we,b as Ce,c as Ie,d as H}from"./select-DUbxjT0z.js";import{s as te,r as Kr}from"./server-3HmnhxQB.js";import{S as Jr}from"./stat-strip-BteRU1Iu.js";import{t as J}from"./index-BuEnLCjT.js";import{B as $}from"./badge-3UzCvU7L.js";import{c as ye}from"./cloud-Dq4kl-JO.js";import{R as le}from"./refresh-cw-CTBERyFc.js";import{S as jr}from"./search-Dd-PeBfg.js";import{x as qr,a as Qr}from"./xterm-DSqgeKvr.js";import{c as Nr,s as Xr}from"./deploy-CD5bEXt-.js";import{M as yr,a as fr}from"./minimize-2-BHcbNmdK.js";import{F as wr}from"./folder-open-CjMh_m_2.js";import{U as Xe}from"./upload-CRLg7Pbj.js";import{a as nr,F as Yr}from"./folder-B5RGB3GG.js";import{A as Zr}from"./arrow-left-BIbk9wFC.js";import{D as Ye}from"./download-Vuij9wGr.js";import{T as Ze}from"./trash-2-DWVnIU6o.js";import{L as D}from"./label-Ap_-SPYI.js";import{T as dr}from"./textarea-DHUZ6N85.js";import{S as es}from"./save-YtnrpTd8.js";import{H as rs}from"./hard-drive-DmC04Y5r.js";import{E as ss}from"./ellipsis-BcWfelgl.js";import{S as ts}from"./square-pen-B3dPIBrm.js";import{P as os}from"./plus-O65gX7Qz.js";import"./index-CtCQcvyh.js";import"./chevron-up-Cq4GPopa.js";const cs=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],er=Ke("chevron-left",cs);const as=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]],Ge=Ke("file-spreadsheet",as);const ns=[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],ds=Ke("folder-plus",ns);function ls({servers:s}){const x=s.filter(c=>c.status==="running").length,o=s.filter(c=>c.status==="maintenance").length,a=s.filter(c=>c.status==="stopped").length;return e.jsx(Jr,{"code-path":"src/components/server/ServerStatsStrip.tsx:14:5",items:[{label:"服务器",value:s.length,color:"blue"},{label:"运行中",value:x,color:"emerald"},{label:"维护中",value:o,color:"amber"},{label:"已停止",value:a,color:"muted"}]})}const ps=[{id:"aws",name:"AWS",color:"bg-orange-500",icon:"AWS"},{id:"aliyun",name:"阿里云",color:"bg-orange-600",icon:"AL"},{id:"tencent",name:"腾讯云",color:"bg-blue-500",icon:"TX"},{id:"huawei",name:"华为云",color:"bg-red-500",icon:"HW"},{id:"azure",name:"Azure",color:"bg-blue-600",icon:"AZ"}];function ms({open:s,onClose:x}){const[o,a]=t.useState([]),[c,u]=t.useState(1),[h,g]=t.useState(""),[m,F]=t.useState(null),[S,k]=t.useState([]),[n,y]=t.useState([]),[E,R]=t.useState(""),[w,f]=t.useState(!1),[v,C]=t.useState([]),[i,O]=t.useState([]),[W,j]=t.useState(!1),[z,p]=t.useState([]),[b,B]=t.useState(!1),[T,G]=t.useState(null),[ee,re]=t.useState("22"),[pe,l]=t.useState([]),[M,K]=t.useState(""),U=async()=>{try{const r=await ye.getAccounts();a(r?.list||[])}catch(r){console.error("加载云账号失败:",r)}};t.useEffect(()=>{s&&(U(),Tr(async()=>{const{credentialApi:r}=await import("./index-l6TwDTR3.js");return{credentialApi:r}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12]),import.meta.url).then(({credentialApi:r})=>{r.list().then(_=>l(_?.list||[])).catch(()=>l([]))}))},[s]);const P=o.filter(r=>r.provider===h&&r.status==="active"),X=t.useCallback(async r=>{try{return(await ye.getAccountRegions(r))?.list||[]}catch{return[]}},[]),q=t.useCallback(async r=>{f(!0);try{await ye.syncRegions(r);const _=await X(r);k(_)}catch(_){throw console.error("同步区域失败:",_),_}finally{f(!1)}},[X]),A=t.useCallback(async()=>{if(!m)return;const r=await X(m.id);if(k(r),r.length===0)try{await q(m.id)}catch{}},[m,X,q]),me=t.useCallback(async()=>{if(!(!m||n.length===0)){j(!0),p([]),C([]),O([]);try{const r=await ye.discoverInstances(m.id,n);C(r?.list||[]),p(r?.errors||[])}catch(r){console.error("发现主机失败:",r),p([r?.message||"发现主机失败"])}finally{j(!1)}}},[m,n]),L=async()=>{if(!(!m||i.length===0)){B(!0);try{const r=v.filter(ae=>i.includes(ae.instance_id)),_=await ye.importInstances(m.id,r,{default_port:Number(ee)||22,credential_id:M?Number(M):void 0});G(_||{imported:0,skipped:0})}catch(r){console.error("导入失败:",r)}finally{B(!1)Line truncated
|
||||
\x1B[31m[连接已关闭]\x1B[0m\r
|
||||
`)},T.onerror=()=>{j.write(`\r
|
||||
\x1B[31m[连接发生错误]\x1B[0m\r
|
||||
`)},()=>{try{T.close(),j.dispose()}catch{}g.current=null,m.current=null,k(!1)}},[s,o,i]),t.useEffect(()=>{if(!s)return;const j=h.current;if(!j)return;let z;const p=new ResizeObserver(()=>{clearTimeout(z),z=setTimeout(()=>{if(F.current&&g.current&&m.current)try{F.current.fit(),g.current.focus();const{cols:b,rows:B}=g.current;m.current.readyState===WebSocket.OPEN&&m.current.send(JSON.stringify({status:1,cols:b,rows:B}))}catch{}},60)});return p.observe(j),()=>{clearTimeout(z),p.disconnect()}},[s]),e.jsx(_e,{"code-path":"src/components/server/TerminalDialog.tsx:196:5",open:s,onOpenChange:x,children:e.jsxs(Te,{"code-path":"src/components/server/TerminalDialog.tsx:197:7",showCloseButton:!1,className:xe("bg-[var(--dg-bg-secondary)] border-[var(--dg-border)] p-0 gap-0","!duration-0 !transition-none",n?"!max-w-none !w-screen !h-screen !rounded-none !translate-x-0 !translate-y-0 !left-0 !top-0":""),style:n?{maxWidth:"100vw",width:"100vw",height:"100vh"}:{maxWidth:"900px",width:"90vw"},children:[e.jsxs(Re,{"code-path":"src/components/server/TerminalDialog.tsx:209:9",className:"sr-only",children:["终端 - ",a]}),e.jsx(Me,{"code-path":"src/components/server/TerminalDialog.tsx:210:9",className:"sr-only",children:"SSH 终端连接"}),e.jsxs("div",{"code-path":"src/components/server/TerminalDialog.tsx:212:9",className:"flex items-center justify-between px-4 py-2 border-b border-[var(--dg-border)]",children:[e.jsxs("div",{"code-path":"src/components/server/TerminalDialog.tsx:213:11",className:"flex items-center gap-2 text-sm",children:[e.jsx("div",{"code-path":"src/components/server/TerminalDialog.tsx:214:13",className:xe("w-2 h-2 rounded-full",S?"bg-emerald-400":"bg-red-400")}),e.jsx("span",{"code-path":"src/components/server/TerminalDialog.tsx:215:13",className:"text-[var(--dg-text-primary)] font-medium",children:a}),e.jsxs("span",{"code-path":"src/components/server/TerminalDialog.tsx:216:13",className:"text-[var(--dg-text-muted)]",children:["(",c,")"]})]}),e.jsxs("div",{"code-path":"src/components/server/TerminalDialog.tsx:218:11",className:"flex items-center gap-1",children:[e.jsx("button",{"code-path":"src/components/server/TerminalDialog.tsx:219:13",onClick:()=>y(!n),className:"p-1.5 rounded hover:bg-[var(--dg-bg-hover)] text-[var(--dg-text-secondary)]",children:n?e.jsx(yr,{"code-path":"src/components/server/TerminalDialog.tsx:223:29",className:"h-4 w-4"}):e.jsx(fr,{"code-path":"src/components/server/TerminalDialog.tsx:223:65",className:"h-4 w-4"})}),e.jsx("button",{"code-path":"src/components/server/TerminalDialog.tsx:225:13",onClick:()=>x(!1),className:"p-1.5 rounded hover:bg-[var(--dg-bg-hover)] text-[var(--dg-text-secondary)]",children:e.jsx(ue,{"code-path":"src/components/server/TerminalDialog.tsx:229:15",className:"h-4 w-4"})})]})]}),!i&&e.jsxs("div",{"code-path":"src/components/server/TerminalDialog.tsx:235:11",className:"p-6 flex flex-col items-center justify-center gap-4",style:{height:"480px"},children:[e.jsx(vr,{"code-path":"src/components/server/TerminalDialog.tsx:236:13",className:"h-12 w-12 text-amber-400"}),e.jsxs("div",{"code-path":"src/components/server/TerminalDialog.tsx:237:13",className:"text-center",children:[e.jsx("p",{"code-path":"src/components/server/TerminalDialog.tsx:238:15",className:"text-[var(--dg-text-primary)] font-medium mb-1",children:"服务器未配置认证凭据"}),e.jsx("p",{"code-path":"src/components/server/TerminalDialog.tsx:239:15",className:"text-sm text-[var(--dg-text-muted)]",children:"请选择一个凭据用于 SSH 连接"})]}),E.length===0?e.jsx("p",{"code-path":"src/components/server/TerminalDialog.tsx:242:15",className:"text-xs text-[var(--dg-text-muted)]",children:"暂无可用凭据,请先去「凭证配置」添加"}):e.jsxs("select",{"code-path":"src/components/server/TerminalDialog.tsx:244:15",value:w,onChange:j=>f(j.target.value),className:"w-64 px-3 py-2 bg-[var(--dg-bg-tertiary)] border border-[var(--dg-border)] rounded-md text-[var(--dg-text-primary)] text-sm",children:[e.jsx("option",{"code-path":"src/components/server/TerminalDialog.tsx:249:17",value:"",children:"-- 选择凭据 --"}),E.map(j=>e.jsxs("option",{"code-path":"src/components/server/TerminalDialog.tsx:251:19",value:String(j.id),children:[j.type==="ssh_key"?"🔑":"🔒"," ",j.name]},j.id))]}),e.jsx(N,{"code-path":"src/components/server/TerminalDialog.tsx:257:13",onClick:W,disabled:!w||v,className:"bg-[var(--dg-blue)] hover:opacity-90 text-white",children:v?"关联中...":"确认连接"})]}),i&&e.jsx("div",{"code-path":"src/components/server/TerminalDialog.tsx:268:11",ref:h,className:"bg-[#0a0e14]",style:{height:n?"calc(100vh - 49px)":"480px"}})]})})}const is=s=>s<1024?`${s} B`:s<1048576?`${(s/1024).toFixed(1)} KB`:`${(s/1048576).toFixed(2)} MB`;function vs({open:s,onOpenChange:x,serverId:o,serverName:a}){const[c,u]=t.useState([]),[h,g]=t.useState([]),[m,F]=t.useState("/"),[S,k]=t.useState(!1),[n,y]=t.useState(""),[E,R]=t.useState(!1),[w,f]=t.useState(!1),v=t.useRef(null),C=t.useCallback(asyn
Line truncated
|
||||
`).replace(/\r/g,`
|
||||
`).split(`
|
||||
`).filter(c=>c.trim());if(x.length<2)return[];const o=lr(x[0]).map(c=>c.toLowerCase()),a=[];for(let c=1;c<x.length;c++){const u=lr(x[c]),h={};o.forEach((g,m)=>{h[g]=u[m]??""}),a.push(h)}return a}function gs(s){return/^(\d{1,3}\.){3}\d{1,3}$/.test(s)&&s.split(".").every(x=>Number(x)>=0&&Number(x)<=255)}function us(){const s=["hostname,ip,port","web-01,192.168.1.10,22","db-01,192.168.1.20,22","cache-01,192.168.1.30,2222"].join(`
|
||||
`),x=new Blob(["\uFEFF"+s],{type:"text/csv;charset=utf-8;"}),o=URL.createObjectURL(x),a=document.createElement("a");a.href=o,a.download="servers-template.csv",a.click(),URL.revokeObjectURL(o)}function bs({open:s,onClose:x}){const[o,a]=t.useState(1),[c,u]=t.useState(""),[,h]=t.useState("password"),[g,m]=t.useState(null),[F,S]=t.useState(!1),[k,n]=t.useState([]),[y,E]=t.useState([]),[R,w]=t.useState(!1),[f,v]=t.useState([]),[C,i]=t.useState(""),[O,W]=t.useState("22");t.useEffect(()=>{if(!s)return;let l=!1;return(async()=>{try{const[M,K]=await Promise.all([Kr.list(),Nr.list()]);if(l)return;const U=M?.list??[];E(U.map(P=>({id:String(P.id??""),name:P.name??"",code:P.code??""}))),v(K?.list??[])}catch{l||(E([]),v([]))}})(),()=>{l=!0}},[s]);const j=async()=>{if(o===2&&g){S(!0);try{const l=await g.text(),M=hs(l);if(M.length===0){J.error("文件无有效数据,请使用模板格式(首行为表头)"),S(!1);return}const K=new Set,U=M.map((P,X)=>{const q=(P.hostname??"").trim(),A=(P.ip??"").trim(),me={row:X+2,hostname:q,ip:A,port:Number(P.port)||22,username:(P.username??"").trim()||"root",os:P.os??"",cpu:Number(P.cpu)||0,memory:Number(P.memory)||0,disk:Number(P.disk)||0,tags:P.tags??"",status:"valid",message:"有效"},L=[];q||L.push("主机名缺失"),A?gs(A)||L.push("IP格式错误"):L.push("IP缺失");const ie=`${q}|${A}`;return q&&A&&K.has(ie)?L.push("重复行"):K.add(ie),L.length>0&&(me.status="error",me.message=L.join("、")),me});n(U),a(o+1)}catch{J.error("文件解析失败,请确认是 CSV 格式")}finally{S(!1)}}else a(o+1)},z=()=>{o>1&&a(o-1)},p=l=>{l.target.files&&l.target.files[0]&&m(l.target.files[0])},b=()=>{a(1),u(""),W("22"),i(""),m(null),n([])},B=async()=>{const l=k.filter(M=>M.status==="valid");if(l.length!==0){w(!0);try{const M=l.map(A=>({hostname:A.hostname,ip:A.ip,port:A.port,username:A.username,os:A.os,cpu:A.cpu,memory:A.memory,disk:A.disk,tags:A.tags})),U=await te.batchCreate({servers:M,region_id:c||void 0,credential_id:C?Number(C):void 0,default_port:Number(O)||22})??{},P=U.success??0,X=U.skipped??0,q=U.failed??0;J.success(`导入完成:成功 ${P},跳过 ${X},失败 ${q}`),b(),x()}catch(M){J.error(M?.message||"导入失败,请重试")}finally{w(!1)}}},T=()=>{x(),b()},G=k.filter(l=>l.status==="valid").length,ee=k.filter(l=>l.status==="warning").length,re=k.filter(l=>l.status==="error").length,pe=[{id:1,title:"配置"},{id:2,title:"上传"},{id:3,title:"确认"}];return e.jsx(_e,{"code-path":"src/components/server/ExcelServerImport.tsx:278:5",open:s,onOpenChange:T,children:e.jsxs(Te,{"code-path":"src/components/server/ExcelServerImport.tsx:279:7",className:"max-w-3xl bg-[var(--dg-bg-primary)] border-[var(--dg-border)] text-[var(--dg-text-primary)]",children:[e.jsxs(Je,{"code-path":"src/components/server/ExcelServerImport.tsx:280:9",children:[e.jsx(Re,{"code-path":"src/components/server/ExcelServerImport.tsx:281:11",className:"text-xl",children:"CSV 批量导入服务器"}),e.jsx(Me,{"code-path":"src/components/server/ExcelServerImport.tsx:282:11",className:"sr-only",children:"通过 CSV 文件批量导入服务器资产"})]}),e.jsx("div",{"code-path":"src/components/server/ExcelServerImport.tsx:286:9",className:"flex items-center justify-center mb-6",children:pe.map((l,M)=>e.jsxs("div",{"code-path":"src/components/server/ExcelServerImport.tsx:288:13",className:"flex items-center",children:[e.jsx("div",{"code-path":"src/components/server/ExcelServerImport.tsx:289:15",className:`flex items-center justify-center w-8 h-8 rounded-full ${o===l.id?"bg-blue-600 text-white":o>l.id?"bg-emerald-600 text-white":"bg-[var(--dg-bg-secondary)] text-[var(--dg-text-muted)]"}`,children:o>l.id?e.jsx(ve,{"code-path":"src/components/server/ExcelServerImport.tsx:296:32",className:"h-4 w-4"}):l.id}),e.jsx("span",{"code-path":"src/components/server/ExcelServerImport.tsx:298:15",className:`ml-2 text-sm ${o===l.id?"text-[var(--dg-text-primary)]":"text-[var(--dg-text-muted)]"}`,children:l.title}),M<pe.length-1&&e.jsx("div",{"code-path":"src/components/server/ExcelServerImport.tsx:302:17",className:"w-12 h-0.5 bg-[var(--dg-border)] mx-3"})]},l.id))}),o===1&&e.jsxs("div",{"code-path":"src/components/server/ExcelServerImport.tsx:310:11",className:"space-y-6",children:[e.jsx(ke,{"code-path":"src/components/server/ExcelServerImport.tsx:312:13",className:"bg-[var(--dg-bg-secondary)] border-[var(--dg-border)]",children:e.jsx(Ee,{"code-path":"src/components/server/ExcelServerImport.tsx:313:15",className:"p-4",children:e.jsxs("div",{"code-path":"src/components/server/ExcelServerImport.tsx:314:17",className:"flex items-center justify-between",children:[e.jsxs("div",{"code-path":"src/components/server/ExcelServerImport.tsx:315:19",className:"flex items-center gap-3",children:[e.jsx("div",{"code-path":"src/components/server/ExcelServerImport.tsx:316:21",className:"w-10 h-10 rounded-lg bg-emerald-500/20 flex items-center justify-center",children:e.jsx(Ge,{"code-path":"src/components/server/ExcelServerImport.tsx:317:23"
Line truncated
|
||||
`),Z=new Blob(["\uFEFF"+ne],{type:"text/csv;charset=utf-8;"}),Q=URL.createObjectURL(Z),ce=document.createElement("a");ce.href=Q,ce.download=`servers_${new Date().toISOString().slice(0,10)}.csv`,ce.click(),URL.revokeObjectURL(Q),J.success(`已导出 ${o.length} 台服务器`)},or=8;return e.jsxs("div",{"code-path":"src/components/server/ServerManager.tsx:373:5",className:"space-y-6",children:[e.jsxs("div",{"code-path":"src/components/server/ServerManager.tsx:375:7",className:"flex items-center justify-between",children:[e.jsxs("div",{"code-path":"src/components/server/ServerManager.tsx:376:9",children:[e.jsx("h1",{"code-path":"src/components/server/ServerManager.tsx:377:11",className:"text-2xl font-bold text-[var(--dg-text-primary)]",children:"服务器管理"}),e.jsx("p",{"code-path":"src/components/server/ServerManager.tsx:378:11",className:"text-sm text-[var(--dg-text-muted)] mt-1",children:"管理云平台服务器资产"})]}),e.jsxs("div",{"code-path":"src/components/server/ServerManager.tsx:380:9",className:"flex items-center gap-2",children:[e.jsxs(N,{"code-path":"src/components/server/ServerManager.tsx:381:11",variant:"outline",className:"border-[var(--dg-border)] text-[var(--dg-text-secondary)] hover:text-[var(--dg-text-primary)] hover:bg-[var(--dg-bg-hover)]",onClick:()=>L(),children:[e.jsx(le,{"code-path":"src/components/server/ServerManager.tsx:386:13",className:xe("h-4 w-4 mr-2",c&&"animate-spin")}),"刷新"]}),e.jsxs(N,{"code-path":"src/components/server/ServerManager.tsx:389:11",variant:"outline",className:"border-[var(--dg-border)] text-[var(--dg-text-secondary)] hover:text-[var(--dg-text-primary)] hover:bg-[var(--dg-bg-hover)]",onClick:_r,children:[e.jsx(Ye,{"code-path":"src/components/server/ServerManager.tsx:394:13",className:"h-4 w-4 mr-2"}),"导出"]}),x("server:create")&&e.jsxs(gr,{"code-path":"src/components/server/ServerManager.tsx:398:11",children:[e.jsx(ur,{"code-path":"src/components/server/ServerManager.tsx:399:13",asChild:!0,children:e.jsxs(N,{"code-path":"src/components/server/ServerManager.tsx:400:15",variant:"outline",className:"border-[var(--dg-border)] text-[var(--dg-text-secondary)] hover:text-[var(--dg-text-primary)] hover:bg-[var(--dg-bg-hover)]",children:[e.jsx(Xe,{"code-path":"src/components/server/ServerManager.tsx:401:17",className:"h-4 w-4 mr-2"}),"批量导入"]})}),e.jsxs(br,{"code-path":"src/components/server/ServerManager.tsx:405:13",className:"bg-[var(--dg-bg-tertiary)] border-[var(--dg-border)] text-[var(--dg-text-primary)]",children:[e.jsx(Sr,{"code-path":"src/components/server/ServerManager.tsx:406:15",children:"选择导入方式"}),e.jsx(We,{"code-path":"src/components/server/ServerManager.tsx:407:15",className:"bg-[var(--dg-border)]"}),e.jsxs(he,{"code-path":"src/components/server/ServerManager.tsx:408:15",className:"hover:bg-[var(--dg-bg-hover)] cursor-pointer focus:bg-[var(--dg-bg-hover)] focus:text-[var(--dg-text-primary)]",onClick:()=>y(!0),children:[e.jsx(xr,{"code-path":"src/components/server/ServerManager.tsx:412:17",className:"h-4 w-4 mr-2 text-[var(--dg-blue)]"}),"云主机导入",e.jsx("span",{"code-path":"src/components/server/ServerManager.tsx:414:17",className:"ml-2 text-xs text-[var(--dg-text-muted)]",children:"从云平台同步"})]}),e.jsxs(he,{"code-path":"src/components/server/ServerManager.tsx:416:15",className:"hover:bg-[var(--dg-bg-hover)] cursor-pointer focus:bg-[var(--dg-bg-hover)] focus:text-[var(--dg-text-primary)]",onClick:()=>R(!0),children:[e.jsx(Ge,{"code-path":"src/components/server/ServerManager.tsx:420:17",className:"h-4 w-4 mr-2 text-emerald-400"}),"CSV导入",e.jsx("span",{"code-path":"src/components/server/ServerManager.tsx:422:17",className:"ml-2 text-xs text-[var(--dg-text-muted)]",children:"hostname + IP 即可"})]})]})]}),x("server:create")&&e.jsxs(N,{"code-path":"src/components/server/ServerManager.tsx:428:13",className:"bg-[var(--dg-blue)] hover:opacity-90 text-white",onClick:r,children:[e.jsx(os,{"code-path":"src/components/server/ServerManager.tsx:432:15",className:"h-4 w-4 mr-2"}),"添加服务器"]})]})]}),e.jsx(ls,{"code-path":"src/components/server/ServerManager.tsx:440:7",servers:o}),e.jsx(ke,{"code-path":"src/components/server/ServerManager.tsx:443:7",className:"bg-[var(--dg-bg-secondary)] border-[var(--dg-border)]",children:e.jsxs(Ee,{"code-path":"src/components/server/ServerManager.tsx:444:9",className:"p-0",children:[e.jsxs("div",{"code-path":"src/components/server/ServerManager.tsx:446:11",className:"flex items-center justify-between flex-wrap gap-4 p-4",children:[e.jsxs("div",{"code-path":"src/components/server/ServerManager.tsx:447:13",className:"flex items-center gap-3 flex-wrap",children:[e.jsxs("div",{"code-path":"src/components/server/ServerManager.tsx:448:15",className:"relative w-64",children:[e.jsx(jr,{"code-path":"src/components/server/ServerManager.tsx:449:17",className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-[var(--dg-text-muted)]"}),e.jsx(V,{"code-path":"src/components/server
Line truncated
|
||||
Reference in new issue
Block a user