import{u as a,n as e,Q as l,P as s,M as t,p as n,aH as i,l as r,k as o,j as u}from"./utils-lib.js?v=1761009159";import{_ as m}from"./index120.js?v=1761009159";import{_ as d}from"./index105.js?v=1761009159";import{c,r as p,b7 as _,e as y,an as w,q as f,H as g,v,x as h,y as b,B as j,C as x,I as k,z as C,N as S,Q as V,G as I}from"./base-lib.js?v=1761009159";import{Z as H,S as q,_ as T,$ as D,a0 as E,l as P}from"./firewall.js?v=1761009159";import{u as z}from"./column.js?v=1761009159";import{l as A}from"./validator.js?v=1761009159";import"./__commonjsHelpers__.js?v=1761009159";import"./index106.js?v=1761009159";const F={key:0},N={class:"p-[2rem] flex items-center"},O=c({__name:"index",setup(c){const{mainHeight:O,payment:L}=a(),Q=p(!1),R=p(""),U=p(!1),B=p([]),G=p([]),M=p(!1),Z=_({title:"SSH系统账号管理-功能介绍",ps:"SSH系统账号管理通常涉及到在服务器上创建、删除和管理SSH用户账户的过程。这些账户可以用于通过SSH（安全壳层）协议远程访问服务器。这种管理工作通常由系统管理员进行，以确保只有授权的用户可以访问服务器。",source:305,desc:["创建系统用户","修改系统用户密码","删除系统用户","记录日志","防入侵"],isInstall:M.value,tabImgs:[{title:"概览",imgSrc:"https://www.bt.cn/Public/new/plugin/introduce/firewall/ssh_system_manage.png"}],pluginInfo:{name:"bt_security"}}),$=async()=>{A({name:"bt_security"})},J=()=>{e({title:"创建系统用户",area:42,showFooter:!0,compData:{refreshFn:X},component:()=>l(()=>import("./add-user.js?v=1761009159"),__vite__mapDeps([]),import.meta.url)})},K=async()=>{if(!R.value)return t.error("请输入新密码");await s({loading:"正在设置密码，请稍后...",request:q({username:G.value[0],password:R.value}),message:!0}),Q.value=!1,R.value=""},W=async(a,e,l)=>{await s({loading:"正在"+(a?"开启":"关闭")+(3===l?"防入侵":"记录日志")+"，请稍后...",request:3===l?D(a,{user:e[0]}):E(a,{uid:e[1]}),message:!0}),X()},X=async()=>{U.value=!0;const{data:a,msg:e}=await P();if(!a.status&&"插件不存在!"===e)return Z.isInstall=!1,M.value=!0,void Y();Z.isInstall=!0,M.value=!1,B.value=a.system_user,U.value=!1},Y=async()=>{try{const{data:a}=await i({sName:"bt_security"});Z.pluginInfo=a}catch(a){}},aa=[{label:"用户名",render:a=>a[0]},{label:"防入侵",width:100,render:a=>y(w,{modelValue:a[3],size:"small",onChange:e=>W(e,a,3)},null)},{label:"记录日志",width:100,render:a=>y(w,{modelValue:a[5],size:"small",onChange:e=>W(e,a,5)},null)},{label:"备注",render:a=>a[6]},z([{onClick:async a=>{const n=await s({loading:"正在获取日志，请稍后...",request:H({user:a[0]}),data:Array});if(!n.length)return t.error("当前暂无日志");G.value={user:a[0],dateTime:n[0],dateOptions:n.map(a=>({title:a,key:a}))},e({title:"命令日志",area:72,component:()=>l(()=>import("./index461.js?v=1761009159"),__vite__mapDeps([]),import.meta.url),compData:G.value})},title:"命令日志",width:70},{onClick:a=>{G.value=a,Q.value=!0},title:"重置密码",width:70},{onClick:async a=>{await n({icon:"warning-filled",title:"删除[".concat(a[0],"]用户"),content:"危险操作，正在删除[".concat(a[0],"]用户，请在下方输入'确认删除'"),input:{content:"确认删除"},type:"input"}),await s({loading:"正在删除中,请稍后...",request:T({username:a[0]}),message:!0}),X()},title:"删除"}])];return f(X),(a,e)=>{const l=I,s=r,t=d,n=m,i=o,c=u,p=g("bt-loading");return v(),h("div",null,["ltd"!==b(L).authType||b(M)?(v(),S(n,{key:1,data:b(Z),class:"px-[20%] py-[2rem]"},null,8,["data"])):(v(),h("div",F,[y(t,null,{"header-left":j(()=>[y(l,{type:"primary",onClick:J},{default:j(()=>e[3]||(e[3]=[x(" 创建系统用户 ",-1)])),_:1,__:[3]}),y(l,{onClick:$},{default:j(()=>e[4]||(e[4]=[x("堡塔防入侵",-1)])),_:1,__:[4]})]),content:j(()=>[k(y(s,{column:aa,data:b(B)},null,8,["data"]),[[p,b(U)],[p,"正在加载列表，请稍后...","title"]])]),_:1}),e[5]||(e[5]=C("ul",{class:"mt-[.8rem] leading-8 text-small list-disc ml-[2rem]"},[C("li",null,"开启防提权，系统会针对该用户操作命令进行限制，并记录跟踪"),C("li",null,"不开启防提权，系统只针对该用户操作过的命令做记录跟踪"),C("li",null,"目前防提权默认只针对www,redis,mysql操作引起的提权问题进行处理"),C("li",{class:"text-danger"},"消息推送需要更新至最新面板的版本(2020-06-17日之后安装的版本|或者2020-06-17日之后点击过修复面板)")],-1))])),y(c,{title:"修改密码",modelValue:b(Q),"onUpdate:modelValue":e[1]||(e[1]=a=>V(Q)?Q.value=a:null),area:38,showFooter:"",onConfirm:K,onCancel:e[2]||(e[2]=()=>R.value="")},{default:j(()=>[C("div",N,[e[6]||(e[6]=C("span",{class:"inline-block w-[8rem] text-right"},"新密码",-1)),y(i,{class:"ml-[1.2rem]",isNull:!0,iconType:"refresh",modelValue:b(R),"onUpdate:modelValue":e[0]||(e[0]=a=>V(R)?R.value=a:null),placeholder:"请输入新密码"},null,8,["modelValue"])])]),_:1},8,["modelValue"])])}}});export{O as default};
function __vite__mapDeps(indexes) {
  if (!__vite__mapDeps.viteFileDeps) {
    __vite__mapDeps.viteFileDeps = []
  }
  return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
}
