System.register(["./index-legacy-sO5zj2jA.js?v=1773287522785","./index-legacy-DgZ0-E4f.js?v=1773287522785","./index.vue_vue_type_script_setup_true_lang-legacy-BWPgT9-g.js?v=1773287522785","./index.vue_vue_type_script_setup_true_lang-legacy-BBkGleHZ.js?v=1773287522785","./index.vue_vue_type_script_setup_true_lang-legacy-IFFYkvEY.js?v=1773287522785","./index-legacy-DQdImDha.js?v=1773287522785","./useTableData-legacy-3kc3lnk4.js?v=1773287522785","./ssh-legacy-DyU8FGQu.js?v=1773287522785","./vue-core-legacy-Cn1vuJ3s.js?v=1773287522785","./naive-ui-legacy-BW82sq8q.js?v=1773287522785","./useTableColumns-legacy-DP6ypvsQ.js?v=1773287522785","./index.vue_vue_type_script_setup_true_lang-legacy-BQ2Kqzbl.js?v=1773287522785","./data-legacy-B9xdUIE5.js?v=1773287522785","./prismjs-legacy-BN0FEcG9.js?v=1773287522785","./index-legacy-hh1mlQOF.js?v=1773287522785","./copy-legacy-CoXPjkKf.js?v=1773287522785","./index.vue_vue_type_script_setup_true_lang-legacy-B9P08_gB.js?v=1773287522785","./index-legacy-BFkuWVH1.js?v=1773287522785"],(function(e,a){"use strict";var l,t,i,n,s,u,c,o,p,r,g,d,m,_,y,v,S,x,j,h,f,w,b,k,B,L,z,A,H,N,U,$,C,P,R,q,D;return{setters:[e=>{l=e._},e=>{t=e._},e=>{i=e._},e=>{n=e._},e=>{s=e._},e=>{u=e.i,c=e.n,o=e.ap,p=e.m},e=>{r=e.u},e=>{g=e.m,d=e.n,m=e.i,_=e.p,y=e.q,v=e.t},e=>{S=e.k,x=e.R,j=e.r,h=e.e,f=e.$,w=e.Z,b=e.a0,k=e.a9,B=e.F,L=e.P,z=e.S,A=e._,H=e.aa,N=e.N,U=e.X,$=e.j},e=>{C=e.a8,P=e.k,R=e.b,q=e.B},e=>{D=e.u},null,null,null,null,null,null,null],execute:function(){const a={class:"mr-12px"},T=S({__name:"logs",props:{config:{}},emits:["setName"],setup(e,{expose:l,emit:p}){const _=e,y=p,{t:v}=x(),S=j(""),U=j([]),{table:$,columns:R,setLoading:q}=r([{key:"log",title:v("Security.SSH.Basic.LoginAlarm.logs_1")},{key:"addtime",title:v("Security.SSH.Basic.LoginAlarm.logs_2"),width:160}]),D=h({p:1,p_size:10}),T=async()=>{try{q(!0);const{message:e}=await d(N(D));u(e)&&($.data=c(e.data)?e.data:[],$.total=o(e.page))}finally{q(!1)}},F=async()=>{const{message:e}=await m();u(e)&&(S.value=e.result)};return T(),F(),(async()=>{const{config:e}=_;u(e)&&(U.value=Object.entries(e).map((([,e])=>({name:e.name,title:e.title}))))})(),l({init:()=>{T(),F()}}),(e,l)=>{const u=C,c=P,o=s,p=n,r=i,d=t;return f(),w("div",null,[b(c,{class:"mb-20px",size:20},{default:k((()=>[(f(!0),w(B,null,L(z(U),(e=>(f(),w("div",{key:e.name,class:"flex items-center"},[A("span",a,H(e.title),1),b(u,{value:z(S)===e.name,size:"small","onUpdate:value":a=>(async e=>{const a=S.value!==e;await g(a,{type:e}),await F(),y("setName",S.value)})(e.name)},null,8,["value","onUpdate:value"])])))),128))])),_:1}),b(r,null,{table:k((()=>[b(o,{"max-height":450,loading:z($).loading,data:z($).data,columns:z(R)},null,8,["loading","data","columns"])])),pageRight:k((()=>[b(p,{page:z(D).p,"onUpdate:page":l[0]||(l[0]=e=>z(D).p=e),"page-size":z(D).p_size,"onUpdate:pageSize":l[1]||(l[1]=e=>z(D).p_size=e),"item-count":z($).total,"show-size-picker":!1,"show-quick-jumper":!1,onRefresh:T},null,8,["page","page-size","item-count"])])),_:1}),b(d,{class:"mt-16px"},{default:k((()=>[A("li",null,H(e.$t("Security.SSH.Basic.LoginAlarm.logs_3")),1)])),_:1})])}}}),F={class:"flex"},O={class:"w-200px mr-10px mb-12px"},X=S({__name:"whitelist",setup(e,{expose:a}){const{t:l}=x(),t=j(""),i=async()=>{""!==t.value.trim()?(await v({ip:t.value}),t.value=""):p.error(l("Security.SSH.Basic.LoginAlarm.whitelist_1"))},{table:n,columns:u,setLoading:o}=r([{key:"ip",title:l("Security.SSH.Basic.LoginAlarm.whitelist_2")},D({width:100,options:e=>[{label:l("Public.Btn.Del"),onClick:async()=>{await _({ip:e.ip}),g()}}]})]),g=async()=>{try{o(!0);const{message:e}=await y();c(e)&&(n.data=e.map((e=>({ip:e}))))}finally{o(!1)}};return g(),a({init:g}),(e,a)=>{const l=R,c=q,o=s;return f(),w("div",null,[A("div",F,[A("div",O,[b(l,{value:z(t),"onUpdate:value":a[0]||(a[0]=e=>U(t)?t.value=e:null),placeholder:e.$t("Security.SSH.Basic.LoginAlarm.whitelist_1")},null,8,["value","placeholder"])]),b(c,{type:"primary",onClick:i},{default:k((()=>[$(H(e.$t("Public.Btn.Add")),1)])),_:1})]),b(o,{loading:z(n).loading,"max-height":500,data:z(n).data,columns:z(u)},null,8,["loading","data","columns"])])}}}),Z={class:"h-full"};e("default",S({__name:"index",props:{config:{}},emits:["setName"],setup(e,{emit:a}){const t=e,i=a,{t:n}=x(),s=j("login"),u=[{key:"login",label:n("Security.SSH.Basic.LoginAlarm.index_1"),data:{config:t.config,onSetName:e=>{i("setName",e)}},component:T},{key:"whitelist",label:n("Security.SSH.Basic.LoginAlarm.index_2"),component:X}];return(e,a)=>{const t=l;return f(),w("div",Z,[b(t,{value:z(s),"onUpdate:value":a[0]||(a[0]=e=>U(s)?s.value=e:null),data:u},null,8,["value"])])}}}))}}}));
