feat: 新增日志中心、功能优化与代码重构
- 新增 log_datasource.go / log_proxy.go / user_api_token.go 后端控制器 - 新增 log_datasource.go model - 新增 monitor/log-center.ts API 模块 - 新增 LogCenter 前端组件及页面 - 重构 deployment 相关组件 (HPDA/UpdateImageModal/bundle-yaml 等) - 新增 ResetPasswordDialog / code-snippet-block / copy-button 等 UI 组件 - 重构多个 k8s 相关组件 (TopologyView/ResourceVisualEditor/PodFileBrowser 等) - 更新多个 API 和工具函数 (auth.ts/monitor/index.ts/request.ts 等) - 更新静态资源 (index.html + 新 JS/CSS bundle) - 删除废弃静态资源文件
This commit is contained in:
1 parent
5ca0e6d83a
commit
8d46e8f352
197 files changed
+5014
-815
No files matched your search
@@ -0,0 +1,2 @@
|
||||
import{r as n,j as s}from"./vendor-codemirror-B1SGo4xl.js";import{u as K,D as J,a as X,b as Y,c as Z,d as ss,e as os,B as x,aw as ve,f as Ws,t as H,j as Hs,l as $,k as De}from"./index-lgmWPQDG.js";import{T as fe,a as Le,b as Gs,c as Ks}from"./tabs-CVrkiNvd.js";import{B as cs}from"./badge-Ca5YHtna.js";import{C as ys,a as gs,b as fs,c as Ls,d as Ts}from"./card-CdN7vcLa.js";import{I as D}from"./input-DBDfXZx0.js";import{T as Es,a as zs,b as es,c as C,d as $s,e as w}from"./table-DX6kWYMC.js";import{S as Rs,a as Is,b as _s,c as Fs,d as G}from"./select-Bv_WioDg.js";import{U as le,ag as Bs,aJ as ws,ah as Qs,v as de,y as qs,a as Js,N as Xs,L as Ss,R as Ys,S as Te,P as Zs,ar as we,aq as Ue,x as pe,T as se,j as ee,aO as te,ax as Ce,Q as Me,V as ie,a3 as ke,aw as Re,p as xe}from"./vendor-icons-BlY7QrxS.js";import{T as Ie}from"./textarea-ym7reYBG.js";import{L as bs}from"./label-Bzhjv1tR.js";import{C as _e}from"./checkbox-Dq3LPO2o.js";import{S as Ds}from"./switch-BGnej0rz.js";import{u as Fe}from"./use-toast-DNZLibQY.js";import"./index-5FEebgvX.js";function Oe({open:e,onOpenChange:l,editingUser:t,form:a,setForm:m,saving:p,onSubmit:b}){const[f,S]=n.useState([]);return n.useEffect(()=>{if(!e)return;let c=!1;return(async()=>{try{const L=await K.getRoles();if(c)return;const h=L?.list??[];S(h.map(y=>({id:String(y.id??""),name:y.name??y.code??""})))}catch{c||S([])}})(),()=>{c=!0}},[e]),s.jsx(J,{"code-path":"src/components/system/UserFormDialog.tsx:78:5",open:e,onOpenChange:l,children:s.jsxs(X,{"code-path":"src/components/system/UserFormDialog.tsx:79:7",className:"bg-slate-900 border-slate-800",children:[s.jsxs(Y,{"code-path":"src/components/system/UserFormDialog.tsx:80:9",children:[s.jsxs(Z,{"code-path":"src/components/system/UserFormDialog.tsx:81:11",className:"text-slate-100 flex items-center gap-2",children:[s.jsx(le,{"code-path":"src/components/system/UserFormDialog.tsx:82:13",className:"h-5 w-5 text-blue-400"}),t?"编辑用户":"新建用户"]}),s.jsx(ss,{"code-path":"src/components/system/UserFormDialog.tsx:85:11",className:"text-slate-500",children:t?"修改用户信息":"创建新的系统用户"})]}),s.jsxs("div",{"code-path":"src/components/system/UserFormDialog.tsx:90:9",className:"space-y-4",children:[s.jsxs("div",{"code-path":"src/components/system/UserFormDialog.tsx:91:11",className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{"code-path":"src/components/system/UserFormDialog.tsx:92:13",className:"space-y-2",children:[s.jsx("label",{"code-path":"src/components/system/UserFormDialog.tsx:93:15",className:"text-xs text-slate-500",children:"用户名"}),s.jsx(D,{"code-path":"src/components/system/UserFormDialog.tsx:94:15",value:a.username,onChange:c=>m({...a,username:c.target.value}),disabled:!!t,className:"bg-slate-800/50 border-slate-700 text-slate-200 placeholder:text-slate-500",placeholder:"登录用户名"})]}),s.jsxs("div",{"code-path":"src/components/system/UserFormDialog.tsx:102:13",className:"space-y-2",children:[s.jsx("label",{"code-path":"src/components/system/UserFormDialog.tsx:103:15",className:"text-xs text-slate-500",children:"昵称"}),s.jsx(D,{"code-path":"src/components/system/UserFormDialog.tsx:104:15",value:a.nickname,onChange:c=>m({...a,nickname:c.target.value}),className:"bg-slate-800/50 border-slate-700 text-slate-200 placeholder:text-slate-500",placeholder:"显示昵称"})]}),s.jsxs("div",{"code-path":"src/components/system/UserFormDialog.tsx:111:13",className:"space-y-2",children:[s.jsx("label",{"code-path":"src/components/system/UserFormDialog.tsx:112:15",className:"text-xs text-slate-500",children:"邮箱"}),s.jsx(D,{"code-path":"src/components/system/UserFormDialog.tsx:113:15",value:a.email,onChange:c=>m({...a,email:c.target.value}),className:"bg-slate-800/50 border-slate-700 text-slate-200 placeholder:text-slate-500",placeholder:"user@example.com"})]}),s.jsxs("div",{"code-path":"src/components/system/UserFormDialog.tsx:120:13",className:"space-y-2",children:[s.jsx("label",{"code-path":"src/components/system/UserFormDialog.tsx:121:15",className:"text-xs text-slate-500",children:"手机号"}),s.jsx(D,{"code-path":"src/components/system/UserFormDialog.tsx:122:15",value:a.phone,onChange:c=>m({...a,phone:c.target.value}),className:"bg-slate-800/50 border-slate-700 text-slate-200 placeholder:text-slate-500",placeholder:"可选"})]}),s.jsxs("div",{"code-path":"src/components/system/UserFormDialog.tsx:129:13",className:"space-y-2",children:[s.jsx("label",{"code-path":"src/components/system/UserFormDialog.tsx:130:15",className:"text-xs text-slate-500",children:"角色"}),s.jsxs(Rs,{"code-path":"src/components/system/UserFormDialog.tsx:131:15",value:a.role,onValueChange:c=>m({...a,role:c}),children:[s.jsx(Is,{"code-path":"src/components/system/UserFormDialog.tsx:132:17",className:"bg-slate-800/50 border-slate-700 text-slate-200",children:s.jsx(_s,{"code-path":"src/components/system/UserFormDialog.tsx:133:19",placeholder:"选择角色"})}),s.jsx(Fs,{"code-path":"src/components/system/UserFormDiLine truncated
|
||||
`).filter(v=>v.trim()&&!v.startsWith(""));if(ms.length<2)return;const xs=ms[0].split(",").map(v=>v.trim().toLowerCase()),Os=xs.findIndex(v=>v.includes("用户名")||v.includes("username")),Us=xs.findIndex(v=>v.includes("昵称")||v.includes("name")||v.includes("显示名")),Ps=xs.findIndex(v=>v.includes("邮箱")||v.includes("email")||v.includes("mail")),us=xs.findIndex(v=>v.includes("手机")||v.includes("phone")),Ns=xs.findIndex(v=>v.includes("角色")||v.includes("role")),vs=xs.findIndex(v=>v.includes("密码")||v.includes("password")),Cs=[];for(let v=1;v<ms.length;v++){const rs=ms[v].split(",").map(Ms=>Ms.trim());Cs.push({username:Os>=0?rs[Os]:"",nickname:Us>=0?rs[Us]:"",email:Ps>=0?rs[Ps]:"",phone:us>=0?rs[us]:"",role:Ns>=0?rs[Ns]:"",password:vs>=0?rs[vs]:""})}Q(Cs),F(null)},is.readAsText(ns,"UTF-8")},as=async()=>{U.setImporting(!0);try{const i=await K.batchImport({users:V,skip_existing:!0});F(i),await W()}catch(i){F({code:500,message:i?.message||"导入失败"})}finally{U.setImporting(!1)}};return s.jsxs("div",{"code-path":"src/components/system/SystemManager.tsx:234:5",className:"space-y-6",children:[s.jsx("div",{"code-path":"src/components/system/SystemManager.tsx:236:7",className:"flex items-center justify-between",children:s.jsxs("div",{"code-path":"src/components/system/SystemManager.tsx:237:9",children:[s.jsx("h1",{"code-path":"src/components/system/SystemManager.tsx:238:11",className:"text-2xl font-bold text-slate-100",children:"系统管理"}),s.jsx("p",{"code-path":"src/components/system/SystemManager.tsx:239:11",className:"text-sm text-slate-500 mt-1",children:"用户、权限与系统配置"})]})}),s.jsxs(fe,{"code-path":"src/components/system/SystemManager.tsx:244:7",value:a,onValueChange:m,className:"w-full",children:[s.jsxs(Le,{"code-path":"src/components/system/SystemManager.tsx:245:9",className:"bg-slate-800 border border-slate-700",children:[s.jsxs(Gs,{"code-path":"src/components/system/SystemManager.tsx:246:11",value:"users",className:"data-[state=active]:bg-slate-700",children:[s.jsx(ie,{"code-path":"src/components/system/SystemManager.tsx:247:13",className:"h-4 w-4 mr-2"}),"用户管理"]}),s.jsxs(Gs,{"code-path":"src/components/system/SystemManager.tsx:250:11",value:"roles",className:"data-[state=active]:bg-slate-700",children:[s.jsx(ee,{"code-path":"src/components/system/SystemManager.tsx:251:13",className:"h-4 w-4 mr-2"}),"角色权限"]}),s.jsxs(Gs,{"code-path":"src/components/system/SystemManager.tsx:254:11",value:"settings",className:"data-[state=active]:bg-slate-700",children:[s.jsx(xe,{"code-path":"src/components/system/SystemManager.tsx:255:13",className:"h-4 w-4 mr-2"}),"系统设置"]})]}),s.jsx(Ks,{"code-path":"src/components/system/SystemManager.tsx:260:9",value:"users",className:"mt-4 space-y-4",children:s.jsx(ze,{"code-path":"src/components/system/SystemManager.tsx:261:11",searchQuery:p,setSearchQuery:b,filteredUsers:ls,loading:c,selectedUser:h,setSelectedUser:y,getUserStatusBadge:ds,dialogOpen:M,setDialogOpen:E,editingUser:k,form:r,setForm:I,saving:ts,handleSubmit:A,openCreate:q,openEdit:ps,handleDelete:T,onResetPassword:i=>{y(null),j(i)},importDialogOpen:u,setImportDialogOpen:_,importPreview:V,setImportPreview:Q,importing:U.importing,importResult:hs,setImportResult:F,handleCsvUpload:O,handleBatchImport:as,ldapUsers:U.ldapUsers,ldapSelected:U.ldapSelected,setLdapSelected:U.setLdapSelected,ldapLoading:U.ldapLoading,ldapImportOUs:U.ldapImportOUs,ldapImportOUDN:U.ldapImportOUDN,setLdapImportOUDN:U.setLdapImportOUDN,loadLdapUsers:U.loadLdapUsers,handleLdapImport:U.handleLdapImport,setLdapUsers:U.setLdapUsers})}),s.jsx(Ks,{"code-path":"src/components/system/SystemManager.tsx:302:9",value:"roles",className:"mt-4 space-y-4",children:s.jsx(We,{"code-path":"src/components/system/SystemManager.tsx:303:11",selectedRole:g,setSelectedRole:P})}),s.jsx(Ks,{"code-path":"src/components/system/SystemManager.tsx:309:9",value:"settings",className:"mt-4",children:s.jsx(Xe,{"code-path":"src/components/system/SystemManager.tsx:310:11",...U.settingsTabProps})})]}),s.jsx(Ye,{"code-path":"src/components/system/SystemManager.tsx:314:7",user:N,onClose:()=>j(null)})]})}export{St as SystemManager};
|
||||
Reference in new issue
Block a user