refactor(frontend): P1-P2 架构统一 — utils/hooks/api 模块化

P1:
- utils/storage.ts、theme.ts、validate.ts + index 统一出口
- request/store/useTheme 接入 storage;清零 confirm/alert
- PipelineManager、TerminalAuditTab 拆分子模块(<700行红线)

P2:
- api/monitor、api/deploy 子目录化
- hooks/api 扩展:servers/pipelines/alerts/audit/sessionCommands
- PipelineManager、AuditOperationsTab 接入 TanStack Query
This commit is contained in:
Logan.Li committed 2026-06-26 00:18:14 +08:00
1 parent d19a03d427
commit f45e203e21
196 files changed
+3228 -2018

No files matched your search

@@ -0,0 +1,11 @@
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-Bx7y-9BW.js","./index-HuRw9UhJ.js","./index-o387JJcy.css","./dashboard-H9WVvG1k.js","./server-BQNr9a-x.js","./index-GZwpRmKU.js","./pipeline-CRmSOJEC.js","./config-J-uY34Cv.js","./credential-snjgV65G.js","./automation-B8G9u7Xj.js","./alert-Bnyn6ibM.js","./alert-center-BbLaFZ2d.js","./site-DAeTLSaK.js","./trace-L8uY5gM3.js","./grafana-DTc3taUi.js","./datasource-CLdSbgtw.js","./metrics-Q051aLdz.js","./agent-CTqsAA8l.js","./cloud-sEaHmpLm.js","./terminal-DvxWm4UP.js","./approval-BpnRjDXJ.js","./ai-CnRvgCA9.js"])))=>i.map(i=>d[i]);
import{i as Ke,j as e,r as t,bd as Tr,D as _e,a as Te,b as qe,c as Re,d as Me,s as ir,Z as Ae,M as Ve,Q as ar,O as ve,o as Fe,B as N,a6 as $e,S as ze,e as Je,a3 as vr,a0 as xe,X as ue,v as hr,t as q,L as Le,at as Rr,ak as Mr,ah as Br,ap as Pr,aj as Qe,am as Ar,ai as $r,al as Or,aB as zr,W as Lr,b8 as gr,N as Hr,H as nr,aQ as ur,aR as br,aS as Sr,aT as jr,aU as We,aV as he,f as Ur}from"./index-HuRw9UhJ.js";import{C as ke,a as Ee}from"./card-B2Wqa0sK.js";import{I as W}from"./input-C9Xfv8um.js";import{C as ge}from"./checkbox-B7nWBaO4.js";import{b as Oe,e as se,T as Dr,a as Vr,c as de,d as Wr}from"./table-Du1vU-OM.js";import{S as fe,a as we,b as Ce,c as Ie,d as H}from"./select-KDzbUQs3.js";import{s as te,r as Gr}from"./server-BQNr9a-x.js";import{S as Kr}from"./stat-strip-CVviXwc6.js";import{B as $}from"./badge-CeS-g-Od.js";import{c as ye}from"./cloud-sEaHmpLm.js";import{R as le}from"./refresh-cw-CSycAyA2.js";import{S as Nr}from"./search-CcKEpJIn.js";import{x as qr,a as Jr}from"./xterm-DSqgeKvr.js";import{m as Qr,a as Xr,f as Zr}from"./xterm-utils-slbfdUHf.js";import{c as Xe,s as Yr}from"./credential-snjgV65G.js";import{M as yr,a as fr}from"./minimize-2-UErWMOt6.js";import{F as wr}from"./folder-open-BKJ-_5eY.js";import{U as Ze}from"./upload-oCjAhX91.js";import{F as dr,a as es}from"./folder-CyecCkCR.js";import{A as rs}from"./arrow-left-J2A6V6Vq.js";import{D as Ye}from"./download-CjFatm64.js";import{T as er}from"./trash-2-Cf9-88KL.js";import{L as V}from"./label-DvRDtaMA.js";import{T as lr}from"./textarea-Bzol9o6k.js";import{S as ss}from"./save-PutEGGnz.js";import{H as ts}from"./hard-drive-laLCm9TI.js";import{E as os}from"./ellipsis-DJJV1WjU.js";import{S as cs}from"./square-pen-DoCLytAo.js";import{P as as}from"./plus-BVwIGPvl.js";import"./index-DwvHXNyF.js";import"./chevron-up-GXrRy2ul.js";const ns=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],rr=Ke("chevron-left",ns);const ds=[["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",ds);const ls=[["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"}]],ps=Ke("folder-plus",ls);function ms({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(Kr,{"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 xs=[{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 is({open:s,onClose:x}){const[o,a]=t.useState([]),[c,h]=t.useState(1),[g,u]=t.useState(""),[m,T]=t.useState(null),[S,k]=t.useState([]),[n,y]=t.useState([]),[E,M]=t.useState(""),[C,f]=t.useState(!1),[v,I]=t.useState([]),[i,O]=t.useState([]),[G,j]=t.useState(!1),[U,p]=t.useState([]),[b,R]=t.useState(!1),[w,z]=t.useState(null),[ee,re]=t.useState("22"),[pe,l]=t.useState([]),[B,K]=t.useState(""),D=async()=>{try{const r=await ye.getAccounts();a(r?.list||[])}catch(r){console.error("加载云账号失败:",r)}};t.useEffect(()=>{s&&(D(),Tr(async()=>{const{credentialApi:r}=await import("./index-Bx7y-9BW.js");return{credentialApi:r}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21]),import.meta.url).then(({credentialApi:r})=>{r.list().then(_=>l(_?.list||[])).catch(()=>l([]))}))},[s]);const P=o.filter(r=>r.provider===g&&r.status==="active"),X=t.useCallback(async r=>{try{return(await ye.getAccountRegions(r))?.list||[]}catch{return[]}},[]),J=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 J(m.id)}catch{}},[m,X,J]),me=t.useCallback(async()=>{if(!(!m||n.length===0)){j(!0),p([]),I([]),O([]);try{const r=await ye.discoverInstances(m.id,n);I(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)){R(!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:B?Number(B):void 0});z(_||{imported:0,skipped:0})}cLine truncated
\x1B[31m[连接已关闭]\x1B[0m\r
`)},w.onerror=()=>{j.write(`\r
\x1B[31m[连接发生错误]\x1B[0m\r
`)},()=>{try{w.close(),j.dispose()}catch{}u.current=null,m.current=null,k(!1)}},[s,o,i]),t.useEffect(()=>{if(!s||!i)return;let j,U=0;const p=()=>{const b=g.current,R=T.current,w=u.current,z=m.current;if(!b||!R||!w){U++<30&&requestAnimationFrame(p);return}j=Xr(b,R,w,z);try{Zr(R,w,z)}catch{}};return p(),()=>j?.()},[s,i,n]),e.jsx(_e,{"code-path":"src/components/server/TerminalDialog.tsx:184:5",open:s,onOpenChange:x,children:e.jsxs(Te,{"code-path":"src/components/server/TerminalDialog.tsx:185: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:"960px",width:"92vw"},children:[e.jsxs(Re,{"code-path":"src/components/server/TerminalDialog.tsx:197:9",className:"sr-only",children:["终端 - ",a]}),e.jsx(Me,{"code-path":"src/components/server/TerminalDialog.tsx:198:9",className:"sr-only",children:"SSH 终端连接"}),e.jsxs("div",{"code-path":"src/components/server/TerminalDialog.tsx:200: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:201:11",className:"flex items-center gap-2 text-sm",children:[e.jsx("div",{"code-path":"src/components/server/TerminalDialog.tsx:202: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:203:13",className:"text-[var(--dg-text-primary)] font-medium",children:a}),e.jsxs("span",{"code-path":"src/components/server/TerminalDialog.tsx:204:13",className:"text-[var(--dg-text-muted)]",children:["(",c,")"]})]}),e.jsxs("div",{"code-path":"src/components/server/TerminalDialog.tsx:206:11",className:"flex items-center gap-1",children:[e.jsx("button",{"code-path":"src/components/server/TerminalDialog.tsx:207: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:211:29",className:"h-4 w-4"}):e.jsx(fr,{"code-path":"src/components/server/TerminalDialog.tsx:211:65",className:"h-4 w-4"})}),e.jsx("button",{"code-path":"src/components/server/TerminalDialog.tsx:213: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:217:15",className:"h-4 w-4"})})]})]}),!i&&e.jsxs("div",{"code-path":"src/components/server/TerminalDialog.tsx:223:11",className:"p-6 flex flex-col items-center justify-center gap-4",style:{height:"480px"},children:[e.jsx(hr,{"code-path":"src/components/server/TerminalDialog.tsx:224:13",className:"h-12 w-12 text-amber-400"}),e.jsxs("div",{"code-path":"src/components/server/TerminalDialog.tsx:225:13",className:"text-center",children:[e.jsx("p",{"code-path":"src/components/server/TerminalDialog.tsx:226:15",className:"text-[var(--dg-text-primary)] font-medium mb-1",children:"服务器未配置认证凭据"}),e.jsx("p",{"code-path":"src/components/server/TerminalDialog.tsx:227:15",className:"text-sm text-[var(--dg-text-muted)]",children:"请选择一个凭据用于 SSH 连接"})]}),E.length===0?e.jsx("p",{"code-path":"src/components/server/TerminalDialog.tsx:230:15",className:"text-xs text-[var(--dg-text-muted)]",children:"暂无可用凭据,请先去「凭证配置」添加"}):e.jsxs("select",{"code-path":"src/components/server/TerminalDialog.tsx:232:15",value:C,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:237:17",value:"",children:"-- 选择凭据 --"}),E.map(j=>e.jsxs("option",{"code-path":"src/components/server/TerminalDialog.tsx:239:19",value:String(j.id),children:[j.type==="ssh_key"?"🔑":"🔒"," ",j.name]},j.id))]}),e.jsx(N,{"code-path":"src/components/server/TerminalDialog.tsx:245:13",onClick:G,disabled:!C||v,className:"bg-[var(--dg-blue)] hover:opacity-90 text-white",children:v?"关联中...":"确认连接"})]}),i&&e.jsx("div",{"code-path":"src/components/server/TerminalDialog.tsx:256:11",ref:g,className:"xterm-terminal-host",style:{height:n?"calc(100vh - 49px)":"520px"}})]})})}const hs=s=>s<1024?`${s} B`:s<1048576?`${(s/1024).toFixed(1)} KB`:`${(s/1048576).toFixed(2)} MB`;function gs({open:s,onOpenChange:x,serverId:o,serverName:a}){const[c,h]=t.useState([]),[g,u]=t.useState([]),[m,T]=t.useState("/"),[S,k]=t.useState(!1),[n,y]=t.useState(""),[E,M]=t.useState(!1),[C,f]=t.useState(!1),v=t.useRef(null),I=t.useCallback(async p=>{if(o){k(!0),y("");try{const b=await te.listFiles(o,p),R=b?.data||b;h(R.items||[]),u(R.breadcrumbs||[]),T(R.path||p)}catch(b){y(b?.message||"加载目录失败"),h([ Line truncated
`).replace(/\r/g,`
`).split(`
`).filter(c=>c.trim());if(x.length<2)return[];const o=pr(x[0]).map(c=>c.toLowerCase()),a=[];for(let c=1;c<x.length;c++){const h=pr(x[c]),g={};o.forEach((u,m)=>{g[u]=h[m]??""}),a.push(g)}return a}function bs(s){return/^(\d{1,3}\.){3}\d{1,3}$/.test(s)&&s.split(".").every(x=>Number(x)>=0&&Number(x)<=255)}function Ss(){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 js({open:s,onClose:x}){const[o,a]=t.useState(1),[c,h]=t.useState(""),[,g]=t.useState("password"),[u,m]=t.useState(null),[T,S]=t.useState(!1),[k,n]=t.useState([]),[y,E]=t.useState([]),[M,C]=t.useState(!1),[f,v]=t.useState([]),[I,i]=t.useState(""),[O,G]=t.useState("22");t.useEffect(()=>{if(!s)return;let l=!1;return(async()=>{try{const[B,K]=await Promise.all([Gr.list(),Xe.list()]);if(l)return;const D=B?.list??[];E(D.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&&u){S(!0);try{const l=await u.text(),B=us(l);if(B.length===0){q.error("文件无有效数据,请使用模板格式(首行为表头)"),S(!1);return}const K=new Set,D=B.map((P,X)=>{const J=(P.hostname??"").trim(),A=(P.ip??"").trim(),me={row:X+2,hostname:J,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=[];J||L.push("主机名缺失"),A?bs(A)||L.push("IP格式错误"):L.push("IP缺失");const ie=`${J}|${A}`;return J&&A&&K.has(ie)?L.push("重复行"):K.add(ie),L.length>0&&(me.status="error",me.message=L.join("、")),me});n(D),a(o+1)}catch{q.error("文件解析失败,请确认是 CSV 格式")}finally{S(!1)}}else a(o+1)},U=()=>{o>1&&a(o-1)},p=l=>{l.target.files&&l.target.files[0]&&m(l.target.files[0])},b=()=>{a(1),h(""),G("22"),i(""),m(null),n([])},R=async()=>{const l=k.filter(B=>B.status==="valid");if(l.length!==0){C(!0);try{const B=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})),D=await te.batchCreate({servers:B,region_id:c||void 0,credential_id:I?Number(I):void 0,default_port:Number(O)||22})??{},P=D.success??0,X=D.skipped??0,J=D.failed??0;q.success(`导入完成:成功 ${P},跳过 ${X},失败 ${J}`),b(),x()}catch(B){q.error(B?.message||"导入失败,请重试")}finally{C(!1)}}},w=()=>{x(),b()},z=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:w,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(qe,{"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,B)=>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}),B<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
`),Y=new Blob(["\uFEFF"+ne],{type:"text/csv;charset=utf-8;"}),Q=URL.createObjectURL(Y),ce=document.createElement("a");ce.href=Q,ce.download=`servers_${new Date().toISOString().slice(0,10)}.csv`,ce.click(),URL.revokeObjectURL(Q),q.success(`已导出 ${o.length} 台服务器`)},cr=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(ur,{"code-path":"src/components/server/ServerManager.tsx:398:11",children:[e.jsx(br,{"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(Ze,{"code-path":"src/components/server/ServerManager.tsx:401:17",className:"h-4 w-4 mr-2"}),"批量导入"]})}),e.jsxs(Sr,{"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(jr,{"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(ir,{"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:()=>M(!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(as,{"code-path":"src/components/server/ServerManager.tsx:432:15",className:"h-4 w-4 mr-2"}),"添加服务器"]})]})]}),e.jsx(ms,{"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(Nr,{"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(W,{"code-path":"src/components/server Line truncated