System.register(["./index-legacy237.js?v=1753954525509","./public-legacy.js?v=1753954525509","./index.vue_vue_type_script_setup_true_lang-legacy4.js?v=1753954525509","./index.vue_vue_type_script_setup_true_lang-legacy5.js?v=1753954525509","./page_layout-legacy.js?v=1753954525509","./index-legacy58.js?v=1753954525509","./vue-legacy.js?v=1753954525509","./naive-legacy.js?v=1753954525509","./common-legacy.js?v=1753954525509","./__commonjsHelpers__-legacy.js?v=1753954525509","./index.vue_vue_type_script_setup_true_lang-legacy7.js?v=1753954525509","./index-legacy102.js?v=1753954525509","./index-legacy.js?v=1753954525509","./index.vue_vue_type_script_setup_true_lang-legacy.js?v=1753954525509","./index.vue_vue_type_script_setup_true_lang-legacy2.js?v=1753954525509","./index-legacy96.js?v=1753954525509","./config-legacy3.js?v=1753954525509","./index.vue_vue_type_script_setup_true_lang-legacy6.js?v=1753954525509"],(function(e,a){"use strict";var l,t,n,i,s,u,c,o,p,g,r,_,d,m,y,v,x,S,j,h,f,w,b,k,B,L,z,A,H,U,N,P,$,q,C,O,R;return{setters:[e=>{l=e._},e=>{t=e.b,n=e.f,i=e._,s=e.h},e=>{u=e._},e=>{c=e._},e=>{o=e.c,p=e.w,g=e.x,r=e.m},e=>{_=e.s,d=e.a,m=e.b,y=e.d,v=e.c,x=e.e},e=>{S=e.k,j=e.P,h=e.r,f=e.e,w=e.U,b=e.V,k=e.Q,B=e.a2,L=e.F,z=e.O,A=e.X,H=e.W,U=e.a3,N=e.N,P=e.ah,$=e.j},e=>{q=e.c5,C=e.bY,O=e.aq,R=e.ay},null,null,null,null,null,null,null,null,null,null],execute:function(){const a={class:"mr-12px"},D=S({__name:"logs",props:{config:{}},emits:["setName"],setup(e,{expose:l,emit:s}){const r=e,y=s,{t:v}=j(),x=h(""),S=h([]),{table:P,columns:$,setLoading:O}=t([{key:"log",title:v("Security.SSH.Basic.LoginAlarm.logs_1")},{key:"addtime",title:v("Security.SSH.Basic.LoginAlarm.logs_2"),width:160}]),R=f({p:1,p_size:10}),D=async()=>{try{O(!0);const{message:e}=await d(N(R));o(e)&&(P.data=p(e.data)?e.data:[],P.total=g(e.page))}finally{O(!1)}},F=async()=>{const{message:e}=await m();o(e)&&(x.value=e.result)};return D(),F(),(async()=>{const{config:e}=r;o(e)&&(S.value=Object.entries(e).map((([,e])=>({name:e.name,title:e.title}))))})(),l({init:()=>{D(),F()}}),(e,l)=>{const t=q,s=C,o=n,p=c,g=u,r=i;return w(),b("div",null,[k(s,{class:"mb-20px",size:20},{default:B((()=>[(w(!0),b(L,null,z(A(S),(e=>(w(),b("div",{key:e.name,class:"flex items-center"},[H("span",a,U(e.title),1),k(t,{value:A(x)===e.name,size:"small","onUpdate:value":a=>(async e=>{const a=x.value!==e;await _(a,{type:e}),await F(),y("setName",x.value)})(e.name)},null,8,["value","onUpdate:value"])])))),128))])),_:1}),k(g,null,{table:B((()=>[k(o,{"max-height":450,loading:A(P).loading,data:A(P).data,columns:A($)},null,8,["loading","data","columns"])])),pageRight:B((()=>[k(p,{page:A(R).p,"onUpdate:page":l[0]||(l[0]=e=>A(R).p=e),"page-size":A(R).p_size,"onUpdate:pageSize":l[1]||(l[1]=e=>A(R).p_size=e),"item-count":A(P).total,"show-size-picker":!1,"show-quick-jumper":!1,onRefresh:D},null,8,["page","page-size","item-count"])])),_:1}),k(r,{class:"mt-16px"},{default:B((()=>[H("li",null,U(e.$t("Security.SSH.Basic.LoginAlarm.logs_3")),1)])),_:1})])}}}),F={class:"flex"},Q={class:"w-200px mr-10px mb-12px"},V=S({__name:"whitelist",setup(e,{expose:a}){const{t:l}=j(),i=h(""),u=async()=>{""!==i.value.trim()?(await x({ip:i.value}),i.value=""):r.error(l("Security.SSH.Basic.LoginAlarm.whitelist_1"))},{table:c,columns:o,setLoading:g}=t([{key:"ip",title:l("Security.SSH.Basic.LoginAlarm.whitelist_2")},s({width:100,options:e=>[{label:l("Public.Btn.Del"),onClick:async()=>{await y({ip:e.ip}),_()}}]})]),_=async()=>{try{g(!0);const{message:e}=await v();p(e)&&(c.data=e.map((e=>({ip:e}))))}finally{g(!1)}};return _(),a({init:_}),(e,a)=>{const l=O,t=R,s=n;return w(),b("div",null,[H("div",F,[H("div",Q,[k(l,{value:A(i),"onUpdate:value":a[0]||(a[0]=e=>P(i)?i.value=e:null),placeholder:e.$t("Security.SSH.Basic.LoginAlarm.whitelist_1")},null,8,["value","placeholder"])]),k(t,{type:"primary",onClick:u},{default:B((()=>[$(U(e.$t("Public.Btn.Add")),1)])),_:1})]),k(s,{loading:A(c).loading,"max-height":500,data:A(c).data,columns:A(o)},null,8,["loading","data","columns"])])}}}),W={class:"h-full"};e("default",S({__name:"index",props:{config:{}},emits:["setName"],setup(e,{emit:a}){const t=e,n=a,{t:i}=j(),s=h("login"),u=[{key:"login",label:i("Security.SSH.Basic.LoginAlarm.index_1"),data:{config:t.config,onSetName:e=>{n("setName",e)}},component:D},{key:"whitelist",label:i("Security.SSH.Basic.LoginAlarm.index_2"),component:V}];return(e,a)=>{const t=l;return w(),b("div",W,[k(t,{value:A(s),"onUpdate:value":a[0]||(a[0]=e=>P(s)?s.value=e:null),data:u},null,8,["value"])])}}}))}}}));
