2 lines
18 KiB
JavaScript
2 lines
18 KiB
JavaScript
import{as as h,a3 as ct,i as N,v as q,x as J,c as tt,n as et,m as nt,ap as rt,l as ut,Q as _t,t as dt,at as pt}from"./index-BTglIPU2.js?v=1773287522785";import{_ as mt}from"./index-BRQskX9P.js?v=1773287522785";import{_ as B}from"./index-DIKmrNCq.js?v=1773287522785";import{_ as L}from"./index.vue_vue_type_script_setup_true_lang-DgjjuUjT.js?v=1773287522785";import{_ as M}from"./index.vue_vue_type_script_setup_true_lang-BeO8Hyma.js?v=1773287522785";import{k as I,R as H,r as T,e as j,$ as w,Z as R,a0 as n,S as t,a9 as d,_ as b,aa as x,X as P,j as O,N as Q,a6 as G,w as st,F as ot,a8 as F,P as yt,L as ft,l as X,v as E,c as gt}from"./vue-core-DJjvd5ZC.js?v=1773287522785";import{u as D}from"./useLoading-CZ2gSAW7.js?v=1773287522785";import{u as z}from"./useTableData-BmkIKQ_R.js?v=1773287522785";import{u as V,i as bt}from"./useTableColumns-DDeyYvje.js?v=1773287522785";import{u as at}from"./index-BqDzHU0m.js?v=1773287522785";import{_ as W}from"./index.vue_vue_type_script_setup_true_lang-D8O2mMsP.js?v=1773287522785";import{_ as St}from"./index.vue_vue_type_script_setup_true_lang-CgKUoL60.js?v=1773287522785";import{a1 as Z,a6 as xt,b as Y,B as K,_ as ht,a0 as wt,k as it,a2 as lt,m as vt,a8 as kt}from"./naive-ui--dJnpVcV.js?v=1773287522785";import{_ as $t}from"./index.vue_vue_type_script_setup_true_lang-C5hb-Th7.js?v=1773287522785";import"./prismjs-BZPoR7_J.js?v=1773287522785";import"./index.vue_vue_type_script_setup_true_lang-B7YvCBmY.js?v=1773287522785";import"./data-BVsViUMm.js?v=1773287522785";import"./index-S15tYq5l.js?v=1773287522785";import"./copy-D-wIKr0q.js?v=1773287522785";import"./index.vue_vue_type_script_setup_true_lang-DeTfbeeM.js?v=1773287522785";import"./index-Cg6fMjw6.js?v=1773287522785";import"./firewall-jQIxKxfN.js?v=1773287522785";import"./index-K4YGya6V.js?v=1773287522785";const{t:U}=ct.global,It=()=>h.post("/plugin?name=syssafe&action=a&s=get_safe_status"),At=m=>h.post("/plugin?name=syssafe&action=a&s=set_safe_status",m,{requestOptions:{loading:U("Security.Api.Index_5"),successMessage:!0}}),Ct=()=>h.post("/plugin?name=syssafe&action=a&s=set_open",{},{requestOptions:{loading:U("Security.Api.Index_5"),successMessage:!0}}),Ht=m=>h.post("/plugin?name=syssafe&action=a&s=get_safe_config",m),Rt=m=>h.post("/plugin?name=syssafe&action=a&s=remove_safe_path",m,{requestOptions:{loading:U("Security.Api.Index_3"),successMessage:!0}}),Ut=m=>h.post("/plugin?name=syssafe&action=a&s=add_safe_path",m,{requestOptions:{loading:U("Security.Api.Index_4"),successMessage:!0}}),Pt=()=>h.post("/plugin?name=syssafe&action=a&s=get_ssh_limit_info"),Tt=m=>h.post("/plugin?name=syssafe&action=a&s=add_ssh_limit",m,{requestOptions:{loading:U("Security.Api.Index_4"),successMessage:!0}}),qt=m=>h.post("/plugin?name=syssafe&action=a&s=remove_ssh_limit",m,{requestOptions:{loading:U("Security.Api.Index_3"),successMessage:!0}}),Bt=m=>h.post("/data?action=getData",{...m,table:"logs",order:"id desc"}),Lt=()=>h.post("/plugin?name=syssafe&action=a&s=get_ssh_config"),Mt=m=>h.post("/plugin?name=syssafe&action=a&s=save_ssh_config",m,{requestOptions:{loading:U("Security.Api.Index_6"),successMessage:!0}}),Ot=()=>h.post("/plugin?name=syssafe&action=a&s=get_process_white"),Dt=m=>h.post("/plugin?name=syssafe&action=a&s=remove_process_white",m,{requestOptions:{loading:U("Security.Api.Index_3"),successMessage:!0}}),zt=m=>h.post("/plugin?name=syssafe&action=a&s=add_process_white",m,{requestOptions:{loading:U("Security.Api.Index_4"),successMessage:!0}}),Kt={class:"p-20px"},Nt=I({__name:"form",props:{data:{}},setup(m,{expose:l}){const{t:o}=H(),c=[{label:o("Security.Anti.Index_28"),value:"i"},{label:o("Security.Anti.Index_29"),value:"a"}],f=m,{getList:a}=f.data,{row:y}=f.data,s=T(null),r=j({path:"",chattr:"i",d_mode:""}),p={path:{required:!0,message:o("Security.Conf.Index_28"),trigger:["blur","input"]},d_mode:{required:!0,message:o("Security.Conf.Index_28"),trigger:["blur","input"]}};return l({onConfirm:async({hide:i})=>{var e;await((e=s.value)==null?void 0:e.validate()),await Ut({...r,s_key:y.key}),a==null||a(),i()}}),(i,e)=>{const S=St,_=Z,g=xt,A=Y,v=W;return w(),R("div",Kt,[n(v,{ref_key:"formRef",ref:s,model:t(r),rules:p},{default:d(()=>[n(_,{label:i.$t("Site.DelSite.index_2"),path:"path"},{default:d(()=>[n(S,{class:"w-280px",value:t(r).path,"onUpdate:value":e[0]||(e[0]=k=>t(r).path=k),placeholder:i.$t("Security.Anti.Index_26")},null,8,["value","placeholder"])]),_:1},8,["label"]),n(_,{label:i.$t("Security.Hardening.Index_8")},{default:d(()=>[n(g,{class:"w-280px",value:t(r).chattr,"onUpdate:value":e[1]||(e[1]=k=>t(r).chattr=k),options:c},null,8,["value"])]),_:1},8,["label"]),n(_,{label:i.$t("Security.Hardening.Index_9"),path:"d_mode"},{default:d(()=>[n(A,{class:"w-280px!",value:t(r).d_mode,"onUpdate:value":e[2]||(e[2]=k=>t(r).d_mode=k),type:"text",placeholder:i.$t("Security.Anti.Index_27")},null,8,["value","placeholder"])]),_:1},8,["label"])]),_:1},8,["model"])])}}}),jt={class:"p-20px"},Ft=I({__name:"index",props:{data:{}},setup(m){const{t:l}=H(),o=m,{data:c}=o,{keys:f,table:a,columns:y}=z([{key:"path",title:l("Site.DelSite.index_2")},{key:"chattr",title:l("Security.Hardening.Index_8"),render:e=>e.chattr=="i"?l("Security.Anti.Index_28"):l("Security.Anti.Index_29")},{key:"s_mode",title:l("Security.Hardening.Index_9"),render:e=>e.s_mode!==e.d_mode?"".concat(e.s_mode," >> ").concat(e.d_mode):e.d_mode},{key:"state",title:l("Config.Safe.index_156"),render:e=>n("span",{style:{color:e.state?"#20a53a":"#ff0029"}},[e.state?l("Security.Anti.Index_35"):l("Security.Anti.Index_36")])},V({width:130,title:l("Public.Table.Operation"),options:e=>[{label:l("Public.Btn.Del"),onClick:async()=>{await Rt({s_key:c.key,path:e.path}),await u()}}]})]),s=async()=>{i.data.row=c,i.show=!0},{loading:r,setLoading:p}=D(),u=async()=>{try{p(!0);const{message:e}=await Ht({s_key:c.key});N(e)&&(a.data=e.paths)}finally{f.value=[],p(!1)}};u();const i=q(l("Security.Anti.Index_30"),{getList:u});return(e,S)=>{const _=K,g=M,A=B,v=L,k=J;return w(),R("div",jt,[n(v,null,{toolsLeft:d(()=>[n(_,{type:"primary",onClick:s},{default:d(()=>[O(x(e.$t("Security.Anti.Index_30")),1)]),_:1})]),table:d(()=>[n(g,{"checked-row-keys":t(f),"onUpdate:checkedRowKeys":S[0]||(S[0]=C=>P(f)?f.value=C:null),loading:t(r),"loading-num":3,"max-height":340,data:t(a).data,columns:t(y)},null,8,["checked-row-keys","loading","data","columns"])]),pageLeft:d(()=>[n(A,null,{default:d(()=>[b("li",null,x(e.$t("Security.Anti.Index_31")),1),b("li",null,x(e.$t("Security.Anti.Index_32")),1),b("li",null,x(e.$t("Security.Anti.Index_33")),1),b("li",null,x(e.$t("Security.Anti.Index_34")),1)]),_:1})]),_:1}),n(k,{show:t(i).show,"onUpdate:show":S[1]||(S[1]=C=>t(i).show=C),title:t(i).title,data:t(i).data,width:500,footer:!0,component:Nt},null,8,["show","title","data"])])}}}),Vt={class:"p-20px"},Xt={class:"leading-32px"},Et=I({__name:"index",setup(m){const{t:l}=H(),o=T(null),c=j({cycle:120,limit_count:3,limit:3600}),f={cycle:{required:!0,type:"number",message:l("Security.Conf.Index_28"),trigger:["blur","input"]},limit_count:{required:!0,type:"number",message:l("Security.Conf.Index_28"),trigger:["blur","input"]},limit:{required:!0,type:"number",message:l("Security.Conf.Index_28"),trigger:["blur","input"]}},a=async()=>{var s;await((s=o.value)==null?void 0:s.validate()),await Mt(Q(c))};return(async()=>{const{message:s}=await Lt();N(s)&&(c.cycle=s.cycle,c.limit=s.limit,c.limit_count=s.limit_count)})(),(s,r)=>{const p=ht,u=Z,i=K,e=W,S=wt,_=B;return w(),R("div",Vt,[n(e,{ref_key:"formRef",ref:o,model:t(c),rules:f,inline:"","label-width":"auto",class:"form"},{default:d(()=>[n(u,{label:s.$t("Security.Anti.Index_37"),path:"cycle"},{default:d(()=>[n(p,{"show-button":!1,value:t(c).cycle,"onUpdate:value":r[0]||(r[0]=g=>t(c).cycle=g),class:"w-100px!"},null,8,["value"])]),_:1},8,["label"]),n(u,{label:s.$t("Security.Anti.Index_38"),path:"limit_count"},{default:d(()=>[n(p,{"show-button":!1,value:t(c).limit_count,"onUpdate:value":r[1]||(r[1]=g=>t(c).limit_count=g),class:"w-100px!"},null,8,["value"])]),_:1},8,["label"]),n(u,{label:s.$t("Security.Anti.Index_39"),path:"limit"},{default:d(()=>[n(p,{"show-button":!1,value:t(c).limit,"onUpdate:value":r[2]||(r[2]=g=>t(c).limit=g),class:"w-100px!"},null,8,["value"])]),_:1},8,["label"]),b("span",Xt,x(s.$t("Security.Anti.Index_40")),1),n(i,{type:"primary",class:"ml-auto",onClick:a},{default:d(()=>[O(x(s.$t("Site.Cert.index_60")),1)]),_:1})]),_:1},8,["model"]),n(S,{class:"mb-15px!"}),n(_,null,{default:d(()=>[b("li",null,x(s.$t("Security.Anti.Index_41")),1),b("li",null,x(s.$t("Security.Anti.Index_42")),1),b("li",null,x(s.$t("Security.Anti.Index_43")),1)]),_:1})])}}}),Gt=tt(Et,[["__scopeId","data-v-201446e2"]]),Jt={class:"p-20px"},Qt=I({__name:"form",props:{data:{}},setup(m,{expose:l}){const{t:o}=H(),c=m,{getList:f}=c.data,a=T(null),y=j({process_name:""}),s={process_name:{required:!0,message:o("Security.Conf.Index_28"),trigger:["blur","input"]}};return l({onConfirm:async({hide:p})=>{var u;await((u=a.value)==null?void 0:u.validate()),await zt(Q(y)),f==null||f(),p()}}),(p,u)=>{const i=Y,e=Z,S=W;return w(),R("div",Jt,[n(S,{ref_key:"formRef",ref:a,model:t(y),rules:s},{default:d(()=>[n(e,{label:p.$t("Home.index_24"),path:"process_name"},{default:d(()=>[n(i,{class:"w-280px!",value:t(y).process_name,"onUpdate:value":u[0]||(u[0]=_=>t(y).process_name=_),type:"text",placeholder:p.$t("Security.Anti.Index_22")},null,8,["value","placeholder"])]),_:1},8,["label"])]),_:1},8,["model"])])}}}),Wt={class:"p-20px"},Zt=I({__name:"index",setup(m){const{t:l}=H(),{keys:o,table:c,columns:f}=z([{key:"name",title:l("Home.index_24")},V({width:130,title:l("Public.Table.Operation"),options:u=>[{label:l("Public.Btn.Del"),onClick:async()=>{await Dt({process_name:u.name}),await r()}}]})]),a=async()=>{p.show=!0},{loading:y,setLoading:s}=D(),r=async()=>{try{s(!0);const{message:u}=await Ot();et(u)&&(c.data=u.map(i=>({name:i})))}finally{o.value=[],s(!1)}};r();const p=q(l("Security.Anti.Index_23"),{getList:r});return(u,i)=>{const e=K,S=M,_=B,g=L,A=J;return w(),R("div",Wt,[n(g,null,{toolsLeft:d(()=>[n(e,{type:"primary",onClick:a},{default:d(()=>[O(x(u.$t("Security.Anti.Index_23")),1)]),_:1})]),table:d(()=>[n(S,{"checked-row-keys":t(o),"onUpdate:checkedRowKeys":i[0]||(i[0]=v=>P(o)?o.value=v:null),loading:t(y),"loading-num":3,"max-height":340,data:t(c).data,columns:t(f)},null,8,["checked-row-keys","loading","data","columns"])]),pageLeft:d(()=>[n(_,null,{default:d(()=>[b("li",null,x(u.$t("Security.Anti.Index_24")),1),b("li",null,x(u.$t("Security.Anti.Index_25")),1)]),_:1})]),_:1}),n(A,{show:t(p).show,"onUpdate:show":i[1]||(i[1]=v=>t(p).show=v),title:t(p).title,data:t(p).data,width:500,footer:!0,component:Qt},null,8,["show","title","data"])])}}}),Yt={class:"color-#ff3333"},te=I({__name:"index",setup(m,{expose:l}){const{t:o}=H(),c=at(),{systemHardening:f}=G(c),a=q(),y=q(),s=q(),{keys:r,table:p,columns:u}=z([{key:"name",width:"10%",title:o("Site.TableRow.index_2")},{key:"ps",title:o("Security.Hardening.Index_5"),ellipsis:{tooltip:{width:"trigger"}}},bt({key:"open",title:o("Site.TableRow.index_14"),onClick:async(_,g)=>{if(!f.value){nt.error(o("Security.Hardening.Index_6")),S();return}await At({s_key:g.key})}}),V({width:130,title:o("Site.TableRow.index_30"),options:_=>[{label:o("Site.TableOP.index_3"),onClick:()=>{if(_.key==="ssh"){y.title="".concat(o("Security.Hardening.Index_7")," [").concat(_.name,"]"),y.show=!0;return}if(_.key==="process"){s.title="".concat(o("Security.Hardening.Index_7")," [").concat(_.name,"]"),s.show=!0;return}a.title="".concat(o("Security.Hardening.Index_7")," [").concat(_.name,"]"),a.data=_,a.show=!0}}]})]);st(()=>c.isRefresh,_=>{_&&(c.setRefresh(!1),S())});const{loading:i,setLoading:e}=D(),S=async()=>{try{e(!0);const{message:_}=await It();N(_)&&(f.value=_.open,p.data=_.list)}finally{r.value=[],e(!1)}};return S(),l({init:S}),(_,g)=>{const A=M,v=L,k=B,C=J;return w(),R(ot,null,[n(v,{feedback:!0},{table:d(()=>[n(A,{"checked-row-keys":t(r),"onUpdate:checkedRowKeys":g[0]||(g[0]=$=>P(r)?r.value=$:null),"row-key":"title",loading:t(i),data:t(p).data,columns:t(u)},null,8,["checked-row-keys","loading","data","columns"])]),_:1}),n(k,{class:"mt-16px"},{default:d(()=>[b("li",null,x(_.$t("Security.Hardening.Index_1")),1),b("li",null,x(_.$t("Security.Hardening.Index_2")),1),b("li",null,x(_.$t("Security.Hardening.Index_3")),1),b("li",Yt,x(_.$t("Security.Hardening.Index_4")),1)]),_:1}),n(C,{show:t(a).show,"onUpdate:show":g[1]||(g[1]=$=>t(a).show=$),title:t(a).title,data:t(a).data,width:700,"min-height":500,footer:!1,component:Ft},null,8,["show","title","data"]),n(C,{show:t(y).show,"onUpdate:show":g[2]||(g[2]=$=>t(y).show=$),title:t(y).title,data:t(y).data,width:800,footer:!1,component:Gt},null,8,["show","title","data"]),n(C,{show:t(s).show,"onUpdate:show":g[3]||(g[3]=$=>t(s).show=$),title:t(s).title,data:t(s).data,width:700,"min-height":580,footer:!1,component:Zt},null,8,["show","title","data"])],64)}}}),ee=I({__name:"index",setup(m,{expose:l}){const{t:o}=H(),{loading:c,setLoading:f}=D(),a=T(""),y=/^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$/,{keys:s,table:r,columns:p}=z([{key:"address",title:o("Security.Anti.Index_15"),width:"70%"},{key:"end",title:o("Security.History.Index_12"),render:e=>e.end==0?o("Security.Anti.Index_18"):e.end},V({width:130,title:o("Site.TableRow.index_30"),options:e=>[{label:o("Security.Anti.Index_19"),onClick:async()=>{await qt({ip:e.address}),i()}}]})]),u=async()=>{if(!y.test(a.value)){nt.error(o("Security.Anti.Index_20"));return}await Tt({ip:a.value}),i(),a.value=""},i=async()=>{try{f(!0);const{message:e}=await Pt();et(e)&&(r.data=e)}finally{s.value=[],f(!1)}};return i(),l({init:i}),(e,S)=>{const _=Y,g=K,A=it,v=M,k=L,C=B;return w(),R("div",null,[n(k,null,{toolsLeft:d(()=>[n(A,{class:"flex-nowrap!"},{default:d(()=>[n(_,{value:t(a),"onUpdate:value":S[0]||(S[0]=$=>P(a)?a.value=$:null),type:"text",placeholder:e.$t("Security.Anti.Index_15"),class:"w-280px!"},null,8,["value","placeholder"]),n(g,{type:"primary",onClick:u},{default:d(()=>[O(x(e.$t("Public.Btn.Add")),1)]),_:1})]),_:1})]),table:d(()=>[n(v,{"checked-row-keys":t(s),"onUpdate:checkedRowKeys":S[1]||(S[1]=$=>P(s)?s.value=$:null),"row-key":"address",loading:t(c),"max-height":440,data:t(r).data,columns:t(p)},null,8,["checked-row-keys","loading","data","columns"])]),_:1}),n(C,{class:"mt-16px"},{default:d(()=>[b("li",null,x(e.$t("Security.Anti.Index_16")),1),b("li",null,x(e.$t("Security.Anti.Index_17")),1)]),_:1})])}}}),ne=I({__name:"index",setup(m,{expose:l}){const{t:o}=H(),{keys:c,table:f,columns:a}=z([{key:"addtime",title:o("Site.Cert.index_68"),width:"20%"},{key:"log",title:o("Security.Anti.Index_21")}]),y=j({p:1,limit:10,search:"System hardening"}),{loading:s,setLoading:r}=D(),p=async()=>{try{r(!0);const{message:u}=await Bt(Q(y));N(u)&&(f.data=u.data,f.total=rt(u.page))}finally{c.value=[],r(!1)}};return p(),l({init:p}),(u,i)=>{const e=M,S=$t,_=L;return w(),F(_,{feedback:!0},{table:d(()=>[n(e,{"checked-row-keys":t(c),"onUpdate:checkedRowKeys":i[0]||(i[0]=g=>P(c)?c.value=g:null),"row-key":"addtime",loading:t(s),data:t(f).data,columns:t(a)},null,8,["checked-row-keys","loading","data","columns"])]),pageRight:d(()=>[n(S,{page:t(y).p,"onUpdate:page":i[1]||(i[1]=g=>t(y).p=g),"page-size":t(y).limit,"onUpdate:pageSize":i[2]||(i[2]=g=>t(y).limit=g),"item-count":t(f).total,"store-key":"security-log",onRefresh:p},null,8,["page","page-size","item-count"])]),_:1})}}}),se=I({__name:"index",setup(m){const{t:l}=H(),o=T("protection"),c=[{key:"protection",label:l("Security.Tabs.Index_8"),component:te},{key:"block",label:l("Security.Tabs.Index_9"),component:ee},{key:"operation",label:l("Security.Tabs.Index_10"),component:ne}];return(f,a)=>{const y=mt;return w(),F(y,{value:t(o),"onUpdate:value":a[0]||(a[0]=s=>P(o)?o.value=s:null),options:c},null,8,["value"])}}}),oe="/static/vite/images/protection-CwFHVs0J.png",ae="/static/vite/images/block-xNBPtTpa.png",ie="/static/vite/images/log-BCXKsR30.png",le={class:"pt-40px pb-40px"},ce={class:"mb-16px"},re={class:"ul-style"},ue={class:"text-center my-24px"},_e={class:"flex justify-center"},de={class:"item"},pe=["onClick"],me=I({__name:"conversion",setup(m){const l=T(0),o=["Protection","Block IP","Operation logs"],c=()=>{_t({source:102})};return(f,a)=>{const y=ut,s=K,r=vt,p=lt;return w(),F(p,null,{default:d(()=>[b("div",le,[a[2]||(a[2]=b("div",{class:"mb-24px text-center text-22px font-bold"}," System Hardening prevention features ",-1)),b("div",ce,[b("ul",re,[b("li",null,[n(y,{name:"security-system",size:"18"}),a[0]||(a[0]=b("span",{class:"ml-8px"},"Prevents the system from being implanted with a Trojan",-1))]),b("li",null,[n(y,{name:"security-surety",size:"30"}),a[1]||(a[1]=b("span",null,"Harden the system security configuration",-1))])])]),b("div",ue,[n(s,{type:"primary",class:"h-36px text-14px",onClick:c},{default:d(()=>[O(x(f.$t("WP.Transition.index_7")),1)]),_:1})]),b("div",_e,[b("div",de,[b("ul",null,[(w(),R(ot,null,yt(o,(u,i)=>b("li",{class:ft({active:t(l)==i}),key:i,onClick:e=>l.value=i},x(u),11,pe)),64))])]),X(n(r,{width:"100%",src:t(oe)},null,8,["src"]),[[E,t(l)==0]]),X(n(r,{width:"100%",src:t(ae)},null,8,["src"]),[[E,t(l)==1]]),X(n(r,{width:"100%",src:t(ie)},null,8,["src"]),[[E,t(l)==2]])])])]),_:1})}}}),ye=tt(me,[["__scopeId","data-v-f55518e2"]]),fe={key:0},ze=I({__name:"index",setup(m){const l=dt(),{isPro:o}=G(l),c=at(),{systemHardening:f}=G(c),a=T(f.value),y=gt(()=>f.value);st(y,p=>{a.value=p});const s=async()=>{await Ct(),await c.setRefresh(!0)};return(async()=>o.value&&await pt("syssafe"))(),(p,u)=>{const i=kt,e=it,S=lt;return t(o)?(w(),R("div",fe,[n(S,{class:"my-15px"},{default:d(()=>[n(e,{class:"p-15px items-center"},{default:d(()=>[b("span",null,x(p.$t("Security.Anti.Index_14")),1),n(i,{value:t(a),"onUpdate:value":[u[0]||(u[0]=_=>P(a)?a.value=_:null),s],"rubber-band":!1,size:"small"},null,8,["value"])]),_:1})]),_:1}),n(S,{class:"p-15px"},{default:d(()=>[n(se)]),_:1})])):(w(),F(ye,{key:1}))}}});export{ze as default};
|