Files
yakpanel-core/YakPanel/static/vite/js/index-BKBCjars.js
2026-04-07 02:04:22 +05:30

2 lines
12 KiB
JavaScript

import{as as w,a3 as at,w as it,n as F,v as E,m as lt,x as N,i as V,h as ct,ap as rt,l as ut,Q as _t,c as pt,t as dt,at as mt}from"./index-BTglIPU2.js?v=1773287522785";import{_ as yt}from"./index-BRQskX9P.js?v=1773287522785";import{_ as Q}from"./index-DIKmrNCq.js?v=1773287522785";import{_ as O}from"./index.vue_vue_type_script_setup_true_lang-BeO8Hyma.js?v=1773287522785";import{k as $,R as I,r as L,n as gt,e as W,$ as S,Z as C,a0 as i,a9 as x,_ as p,aa as v,S as t,X as P,a6 as D,w as G,F as H,j as X,a8 as U,P as ft,L as xt,l as q,v as B,c as z}from"./vue-core-DJjvd5ZC.js?v=1773287522785";import{u as R}from"./useLoading-CZ2gSAW7.js?v=1773287522785";import{u as T}from"./useTableData-BmkIKQ_R.js?v=1773287522785";import{i as K,u as Y}from"./useTableColumns-DDeyYvje.js?v=1773287522785";import{u as Z}from"./index-BqDzHU0m.js?v=1773287522785";import{_ as j}from"./index.vue_vue_type_script_setup_true_lang-DgjjuUjT.js?v=1773287522785";import{k as J,a6 as bt,a1 as vt,b as wt,B as tt,a2 as et,m as ht,a8 as kt,a0 as St}from"./naive-ui--dJnpVcV.js?v=1773287522785";import{_ as At}from"./index.vue_vue_type_script_setup_true_lang-D8O2mMsP.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"./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.vue_vue_type_script_setup_true_lang-B7YvCBmY.js?v=1773287522785";const{t:A}=at.global,It=()=>w.post("/plugin?action=a&name=bt_security&s=get_total_all"),Ct=()=>w.post("/plugin?action=a&name=bt_security&s=start_bt_security",{},{requestOptions:{loading:A("Security.Api.Index_1"),successMessage:!0}}),Pt=()=>w.post("/plugin?action=a&name=bt_security&s=stop_bt_security",{},{requestOptions:{loading:A("Security.Api.Index_2"),successMessage:!0}}),Lt=c=>w.post("/plugin?action=a&name=bt_security&s=start_user_security",c,{requestOptions:{loading:A("Security.Api.Index_1"),successMessage:!0}}),Ot=c=>w.post("/plugin?action=a&name=bt_security&s=stop_user_security",c,{requestOptions:{loading:A("Security.Api.Index_2"),successMessage:!0}}),Ut=c=>w.post("/plugin?action=a&name=bt_security&s=start_user_log",c,{requestOptions:{loading:A("Security.Api.Index_1"),successMessage:!0}}),Rt=c=>w.post("/plugin?action=a&name=bt_security&s=stop_user_log",c,{requestOptions:{loading:A("Security.Api.Index_2"),successMessage:!0}}),Tt=c=>w.post("/plugin?action=a&name=bt_security&s=get_logs_list",c,{requestOptions:{loading:A("Site.Api.Index_10"),successMessage:!1}}),Mt=c=>w.post("/plugin?action=a&name=bt_security&s=get_user_log",c),qt=()=>w.post("/plugin?action=a&name=bt_security&s=porcess_set_up_log"),Bt=c=>w.post("/plugin?action=a&name=bt_security&s=del_porcess_log",c,{requestOptions:{loading:A("Security.Api.Index_3"),successMessage:!0}}),zt=c=>w.post("/plugin?action=a&name=bt_security&s=add_porcess_log",c,{requestOptions:{loading:A("Security.Api.Index_4"),successMessage:!0}}),Dt=c=>w.post("/plugin?action=a&name=bt_security&s=get_log",c),Ft={class:"p-20px"},Wt=$({__name:"log",props:{data:{}},setup(c,{expose:d}){const{t:s}=I(),m=c,{date:r,name:e}=m.data,l=L([]),{keys:g,table:y,columns:f}=T([{key:"log",title:s("Ftp.Analysis.Index_27"),render:()=>e},{key:"cwd",title:s("Security.Anti.Index_46")},{key:"cmd",title:s("Security.Anti.Index_47")},{key:"filename",title:s("Security.Anti.Index_48")},{key:"cwd",title:s("Config.Safe.index_152"),render:_=>it(_.timestamp)}]);gt(()=>{l.value=r.map(_=>({label:_,value:_}))});const u=W({p:1,num:999,day:r[0]}),o=()=>({...u,user:e}),{loading:n,setLoading:a}=R(),b=async()=>{try{a(!0);const{message:_}=await Mt(o());F(_)&&(y.data=_,y.total=_.length)}finally{g.value=[],a(!1)}};return b(),d({init:b}),(_,h)=>{const k=bt,nt=J,st=O,ot=j;return S(),C("div",Ft,[i(nt,{class:"flex-nowrap! items-center mb-10px"},{default:x(()=>[p("span",null,v(_.$t("Security.Anti.Index_45")),1),i(k,{class:"w-150px",value:t(u).day,"onUpdate:value":[h[0]||(h[0]=M=>t(u).day=M),b],options:t(l)},null,8,["value","options"])]),_:1}),i(ot,null,{table:x(()=>[i(st,{"checked-row-keys":t(g),"onUpdate:checkedRowKeys":h[1]||(h[1]=M=>P(g)?g.value=M:null),loading:t(n),data:t(y).data,"max-height":350,columns:t(f)},null,8,["checked-row-keys","loading","data","columns"])]),_:1})])}}}),jt=$({__name:"index",setup(c,{expose:d}){const{t:s}=I(),m=Z(),{antiForm:r}=D(m),e=E(),{keys:l,table:g,columns:y}=T([{key:"user",title:s("Ftp.Analysis.Index_27")},{key:"total",title:s("Security.Anti.Index_7")},{key:"today",title:s("Public.Search.Today")},K({key:"protection",title:s("Security.Tabs.Index_8"),minWidth:60,onClick:async(n,a)=>{n?await Lt({user:a.user}):await Ot({user:a.user})}}),K({key:"log",title:s("Security.Anti.Index_8"),minWidth:60,onClick:async(n,a)=>{n?await Ut({uid:a.uid}):await Rt({uid:a.uid})}}),{key:"remark",title:s("Site.Proxy.index_3")},Y({width:130,title:s("Public.Table.Operation"),options:n=>[{label:s("Site.Proxy.index_51"),onClick:async()=>{const{message:a}=await Tt({user:n.user});if(F(a)&&!a.length){lt.error(s("Security.Anti.Index_44"));return}e.title="[".concat(n.user,"] - ").concat(s("Site.Proxy.index_51")),e.data.date=a,e.data.name=n.user,e.show=!0}}]})]);G(()=>m.isRefresh,n=>{n&&(m.setRefresh(!1),o())});const{loading:f,setLoading:u}=R(),o=async()=>{try{u(!0);const{message:n}=await It();V(n)&&(r.value.switch=n.open,r.value.times=n.totla_times,r.value.days=n.totla_days,g.data=n.system_user.map(a=>({user:a[0],total:a[4].totla,today:a[4].day_totla,protection:a[3],log:a[5],remark:a[6],uid:a[1]})))}finally{l.value=[],u(!1)}};return o(),d({init:o}),(n,a)=>{const b=O,_=Q,h=N;return S(),C(H,null,[i(b,{"checked-row-keys":t(l),"onUpdate:checkedRowKeys":a[0]||(a[0]=k=>P(l)?l.value=k:null),"row-key":"user","max-height":750,loading:t(f),data:t(g).data,columns:t(y)},null,8,["checked-row-keys","loading","data","columns"]),i(_,{class:"mt-16px"},{default:x(()=>[p("li",null,v(n.$t("Security.Anti.Index_4")),1),p("li",null,v(n.$t("Security.Anti.Index_5")),1),p("li",null,v(n.$t("Security.Anti.Index_6")),1)]),_:1}),i(h,{show:t(e).show,"onUpdate:show":a[1]||(a[1]=k=>t(e).show=k),title:t(e).title,data:t(e).data,width:750,"min-height":268,footer:!1,component:Wt},null,8,["show","title","data"])],64)}}}),Kt={class:"p-20px"},Et={class:"w-280px"},Nt={class:"color-#ff3333"},Vt=$({__name:"form",props:{data:{}},setup(c,{expose:d}){const{t:s}=I(),m=c,{getList:r}=m.data,e=L(null),l=W({name:""}),g={name:{required:!0,message:s("Security.Conf.Index_28"),trigger:["blur","input"]}};return d({onConfirm:async({hide:f})=>{var u;await((u=e.value)==null?void 0:u.validate()),await zt({cmd:l.name}),r==null||r(),f()}}),(f,u)=>{const o=wt,n=vt,a=At,b=Q;return S(),C("div",Kt,[i(a,{ref_key:"formRef",ref:e,model:t(l),rules:g},{default:x(()=>[i(n,{label:f.$t("Home.index_24"),path:"name"},{default:x(()=>[p("div",Et,[i(o,{type:"text",value:t(l).name,"onUpdate:value":u[0]||(u[0]=_=>t(l).name=_),placeholder:"e.g:/bin/bash"},null,8,["value"])])]),_:1},8,["label"])]),_:1},8,["model"]),i(b,{class:"mt-4px"},{default:x(()=>[p("li",Nt,v(f.$t("Security.Anti.Index_9")),1)]),_:1})])}}}),Qt=$({__name:"index",setup(c,{expose:d}){const{t:s}=I(),{loading:m,setLoading:r}=R(),{keys:e,table:l,columns:g}=T([{key:"whitelist",title:s("Security.Anti.Index_11")},Y({width:130,options:o=>[{label:s("Public.Btn.Del"),onClick:()=>{ct({title:"".concat(s("Security.Anti.Index_12")," [").concat(o.whitelist,"]"),content:s("Security.Anti.Index_13"),onConfirm:async({hide:n})=>{await Bt({cmd:o.whitelist}),y(),n()}})}}]})]),y=async()=>{try{r(!0);const{message:o}=await qt();F(o)&&(l.data=o.map(n=>({whitelist:n})))}finally{e.value=[],r(!1)}};y(),d({init:y});const f=()=>{u.show=!0},u=E(s("Security.Anti.Index_10"),{getList:y});return(o,n)=>{const a=tt,b=O,_=j,h=N;return S(),C("div",null,[i(_,null,{toolsLeft:x(()=>[i(a,{type:"primary",onClick:f},{default:x(()=>[X(v(o.$t("Security.Anti.Index_10")),1)]),_:1})]),table:x(()=>[i(b,{"checked-row-keys":t(e),"onUpdate:checkedRowKeys":n[0]||(n[0]=k=>P(e)?e.value=k:null),"row-key":"whitelist",loading:t(m),"max-height":440,data:t(l).data,columns:t(g)},null,8,["checked-row-keys","loading","data","columns"])]),_:1}),i(h,{show:t(u).show,"onUpdate:show":n[1]||(n[1]=k=>t(u).show=k),title:t(u).title,data:t(u).data,width:480,footer:!0,component:Vt},null,8,["show","title","data"])])}}}),Gt=$({__name:"index",setup(c,{expose:d}){const{t:s}=I(),{keys:m,table:r,columns:e}=T([{key:"log",title:s("Public.Table.Operation")},{key:"addtime",align:"right",title:s("Site.Cert.index_68")}]),l=W({p:1,limit:10}),{loading:g,setLoading:y}=R(),f=async()=>{try{y(!0);const{message:u}=await Dt(l);V(u)&&(r.data=u.data,r.total=rt(u.page))}finally{m.value=[],y(!1)}};return f(),d({init:f}),(u,o)=>{const n=O,a=$t,b=j;return S(),U(b,{feedback:!0},{table:x(()=>[i(n,{"checked-row-keys":t(m),"onUpdate:checkedRowKeys":o[0]||(o[0]=_=>P(m)?m.value=_:null),"row-key":"log",loading:t(g),data:t(r).data,columns:t(e)},null,8,["checked-row-keys","loading","data","columns"])]),pageRight:x(()=>[i(a,{page:t(l).p,"onUpdate:page":o[1]||(o[1]=_=>t(l).p=_),"page-size":t(l).limit,"onUpdate:pageSize":o[2]||(o[2]=_=>t(l).limit=_),"item-count":t(r).total,"store-key":"security-anti",onRefresh:f},null,8,["page","page-size","item-count"])]),_:1})}}}),Ht=$({__name:"index",setup(c){const{t:d}=I(),s=L("overview"),m=[{key:"overview",label:d("Security.Tabs.Index_5"),component:jt},{key:"whitelist",label:d("Security.Tabs.Index_6"),component:Qt},{key:"operation",label:d("Security.Tabs.Index_7"),component:Gt}];return(r,e)=>{const l=yt;return S(),U(l,{value:t(s),"onUpdate:value":e[0]||(e[0]=g=>P(s)?s.value=g:null),options:m},null,8,["value"])}}}),Xt="/static/vite/images/overview-Btj8Qdw-.png",Yt="/static/vite/images/whitelist-DxBoEPxy.png",Zt="/static/vite/images/logs-C3s4YCaO.png",Jt={class:"pt-40px pb-40px"},te={class:"mb-16px"},ee={class:"ul-style"},ne={class:"text-center my-24px"},se={class:"flex justify-center"},oe={class:"item"},ae=["onClick"],ie=$({__name:"conversion",setup(c){const d=L(0),s=["Overview","Process whitelist","Operation logs"],m=()=>{_t({source:105})};return(r,e)=>{const l=ut,g=tt,y=ht,f=et;return S(),U(f,null,{default:x(()=>[p("div",Jt,[e[3]||(e[3]=p("div",{class:"mb-24px text-center text-22px font-bold"},"Anti Intrusion prevention features",-1)),p("div",te,[p("ul",ee,[p("li",null,[i(l,{name:"security-lixian",size:"22"}),e[0]||(e[0]=p("span",{class:"ml-4px"},"Prevents the program from hanging",-1))]),p("li",null,[i(l,{name:"security-sanfang",size:"20"}),e[1]||(e[1]=p("span",{class:"ml-4px"},"Stop the mining virus",-1))]),p("li",null,[i(l,{name:"security-webshell",size:"26"}),e[2]||(e[2]=p("span",null,"Prevent Privilege Escalation Attacks",-1))])])]),p("div",ne,[i(g,{type:"primary",class:"h-36px text-14px",onClick:m},{default:x(()=>[X(v(r.$t("WP.Transition.index_7")),1)]),_:1})]),p("div",se,[p("div",oe,[p("ul",null,[(S(),C(H,null,ft(s,(u,o)=>p("li",{class:xt({active:t(d)==o}),key:o,onClick:n=>d.value=o},v(u),11,ae)),64))])]),q(i(y,{width:"100%",src:t(Xt)},null,8,["src"]),[[B,t(d)==0]]),q(i(y,{width:"100%",src:t(Yt)},null,8,["src"]),[[B,t(d)==1]]),q(i(y,{width:"100%",src:t(Zt)},null,8,["src"]),[[B,t(d)==2]])])])]),_:1})}}}),le=pt(ie,[["__scopeId","data-v-f9cef105"]]),ce={key:0},Le=$({__name:"index",setup(c){const d=dt(),{isPro:s}=D(d),m=Z(),{antiForm:r}=D(m),e=L(r.value.switch),l=z(()=>r.value.switch);G(l,o=>{e.value=o});const g=z(()=>r.value.times),y=z(()=>r.value.days),f=async o=>{o?await Ct():await Pt(),await m.setRefresh(!0)};return(async()=>s.value&&await mt("bt_security"))(),(o,n)=>{const a=kt,b=St,_=J,h=et;return t(s)?(S(),C("div",ce,[i(h,{class:"my-15px"},{default:x(()=>[i(_,{class:"p-15px items-center"},{default:x(()=>[p("span",null,v(o.$t("Security.Anti.Index_1")),1),i(a,{value:t(e),"onUpdate:value":[n[0]||(n[0]=k=>P(e)?e.value=k:null),f],"rubber-band":!1,size:"small"},null,8,["value"]),i(b,{vertical:""}),p("span",null,v(o.$t("Security.Anti.Index_2"))+": "+v(t(g)),1),i(b,{vertical:""}),p("span",null,v(o.$t("Security.Anti.Index_3"))+": "+v(t(y)),1)]),_:1})]),_:1}),i(h,{class:"p-15px"},{default:x(()=>[i(Ht)]),_:1})])):(S(),U(le,{key:1}))}}});export{Le as default};