← Back
Editing: store5.js
import{j as e,aE as t,r as a,o as s,g as o}from"./base-lib.js?v=1765440387";import{n as l,u as c,K as n,S as i,ai as r,M as p,cD as d,o as u,Z as m,aq as f,cV as v}from"./utils-lib.js?v=1765440387";import{p as y,l as g,k as _}from"./validator.js?v=1765440387";const h=(e={})=>l.post("plugin/get_soft_list",{data:e,check:"object"}),w=e=>l.post("plugin?action=add_index",{data:{sName:e},customType:"model",check:"msg"}),j=e=>l.post("plugin?action=remove_index",{data:{sName:e},customType:"model",check:"msg"}),k=(e={})=>l.post("warning/get_list",{data:e}),b=()=>l.post("warning/get_result",{check:"object"}),T=()=>l.post("project/safecloud/get_safe_overview",{customType:"model"}),x=()=>l.post("project/safecloud/get_pending_alarm_trend",{customType:"model"}),S=()=>l.post("project/safecloud/get_security_trend",{customType:"model"}),L=()=>l.post("project/safecloud/get_security_dynamic",{customType:"model"}),q=()=>l.post("/plugin?action=a&name=bt_hids&s=set_process",{customType:"model"}),I=()=>l.post("system/ReMemory"),C=e=>l.post("monitor/process_management/kill_process_all",{data:e,customType:"model",check:"msg"}),A=()=>l.post("warning/get_scan_bar",{check:"object"}),O=()=>l.post("safe/security/get_repair_bar",{check:"object",customType:"model"}),E=()=>l.post("panel/overview/GetOverview",{check:"array",customType:"model"}),H=e=>l.post("panel/overview/AddOverview",{data:e,check:"msg",customType:"model"}),R=e=>l.post("panel/overview/SetOverview",{data:e,check:"msg",customType:"model"}),P=e=>l.post("panel/overview/SortOverview",{data:e,check:"msg",customType:"model"}),M=e=>l.post("panel/overview/DelOverview",{data:e,check:"msg",customType:"model"}),V=()=>l.post("warning/get_tmp_result"),D=()=>l.post("warning/kill_get_list"),F=e=>l.post("system/set_rname",{data:e,check:"msg"}),N=e=>l.post("/mod/ssh/com/index_ssh_info",{data:e,check:"array",customType:"model"}),B=()=>l.post("/safe/exportreport/get_pdf",{check:"object",customType:"model"}),G=()=>l.post("/project/safecloud/get_safecloud_list",{check:"object",customType:"model"}),K=(e={})=>l.post("/project/safecloud/get_webshell_result",{data:e,customType:"model",check:"object"}),W=()=>l.post("/project/scanning/get_vuln_info",{check:"object",customType:"model"}),z=()=>l.post("/project/safecloud/get_config",{customType:"model",check:"object"}),X=e=>l.post("/project/safecloud/set_config",{data:e,customType:"model",check:"object"}),Y=e=>l.post("/project/safecloud/ignore_file",{data:e,customType:"model",check:"object"}),Z=e=>l.post("/project/safecloud/deal_webshell_file",{data:e,customType:"model",check:"object"}),$=e=>l.post("/project/safecloud/set_alarm_config",{data:e,customType:"model",check:"object"}),J=e("SOFTWARE-STORE",()=>{const e=t(),{forceLtd:k,aliyunEcsLtd:b}=c(),T=a(""),x=a(!1),S=a([]),L=a(),q=a([]),I=a([]),C=a(!1),A=a(!1),O=a(0),E=a(!1);let H=a([]),R=[];const P=async(e="")=>{if(!E.value){if(r(e)&&""!==e){E.value=!0;const t=o(()=>{if(!e)return H.value;const t=e.toLowerCase();return R.filter(e=>e.name.toLowerCase().includes(t)||e.ps.toLowerCase().includes(t)||e.title.toLowerCase().includes(t))});return H.value=t.value,void(E.value=!1)}M(e)}},M=s(async e=>{await n({loading:E,request:h({p:1,type:-1,tojs:"soft.get_list",query:e,force:0,row:100}),data:{"list.data":[Array,H],"list.page":i(O)},success:e=>{H.value=e["list.data"].filter(e=>e.index_display).concat(e["list.data"].filter(e=>!e.index_display)),R=H.value}})},5e3),V=e=>{const t=e?R.filter(t=>{if(t.title.toLowerCase().includes(e.trim().toLowerCase()))return{value:t.title}}):R;let a=[];return t.forEach((e,t,s)=>{a.push({value:e.title})}),a},D=()=>{if(q.value.length<=12&&(S.value.length>0&&!k.value&&!b.value?I.value=[...q.value,...S.value].slice(0,12):I.value=[...q.value].slice(0,12)),I.value.length<12)for(;I.value.length<12;)I.value.push({})},F=e=>{y({disablePro:!(8===e.type),sourceId:{total:41,monitor:175,btwaf:40,tamper_core:42,bt_security:43,oneav:44,security_notice:56}[e.name]||0})},N=()=>{const e=document.querySelector(".soft-wrapper");d.create(e,{animation:500,handle:".soft-move",chosenClass:"ghost",onEnd:async e=>{const t=I.value.splice(e.oldIndex,1)[0];I.value.splice(e.newIndex,0,t),B()}})},B=()=>{let e=I.value.filter(e=>void 0!==e.id&&e.name).map(e=>e.name).join("|");var t;n({request:(t={ssort:e},l.post("plugin/sort_index",{data:t}))})};return{popShow:A,isGetSoft:C,pluginKeyword:T,recommendList:S,containerRef:L,mySoftList:H,tableLoading:E,softShowList:I,load:async()=>{let e=Math.ceil(O.value/12),t=Math.ceil(H.value.length/12);if(t>=e)return;const{data:a}=await h({p:t+1,type:-1,tojs:"soft.get_list",force:0,row:12});H.value=H.value.concat(a.list.data)},createSoftList:D,getHomeInstallSoftData:async()=>{await n({loading:C,request:l.post("plugin/get_index_list"),success:e=>{const t=e.data.filter(e=>e.setup);I.value=t,q.value=t,D(),N()}})},getRecommendInfo:async()=>{await n({request:v(),success:e=>{var t;Array.isArray(e.data)&&e.data.length>0&&(S.value=(null==(t=e.data[1])?void 0:t.list)||[])}})},goSoft:()=>{e.push({path:"/soft"})},showPopoverHandle:P,leave:e=>{const t=e.offsetX,a=e.offsetY,s=L.value.offsetWidth,o=L.value.offsetHeight;if(t<0||a<0||t>=s||a>=o){const e=document.querySelector(".soft-search-popover");e&&"none"!=(null==e?void 0:e.style.display)?A.value=!0:(A.value=!1,T.value="")}},querySearch:(e,t)=>{t(V(e))},searchPluginHandle:(e="")=>{""==T.value?(x.value=!1,P()):(x.value=!0,P(T.value))},renderSoftImages:e=>"".concat("/static/img/soft_ico","/ico-").concat(e.replace(/-+[{0-9},\.,]+$/,""),".png"),changeSwitchHandle:async(e,t)=>{const a=R.filter(e=>e.index_display).length;if(R.length,H.value.length,a>12&&e.index_display)return e.index_display=!e.index_display,p.error("首页最多只能显示12个软件!");try{const t=e.index_display?w:j;await n({loading:"正在处理,请稍后...",request:t(e.name),message:!0,success:e=>{e.status&&(H.value=H.value.map(e=>(e.name==e.name&&(e.index_display=e.index_display),e)),R=R.map(e=>(e.name==e.name&&(e.index_display=e.index_display),e)),q.value=R.filter(e=>e.index_display)),D()}})}catch(s){e.index_display=!e.index_display}},openSoftView:async e=>(e.endtime>=0||0===e.price?g({name:e.name,pluginInfo:e}):(await u({title:"购买插件",content:"插件已过期,是否前往购买?"}),F(e)),!1),softStatusColor:e=>e.status||"phpmyadmin"===e.name?"#20A53A":"#FF4949",softStatus:e=>e.status||"phpmyadmin"===e.name?"start":"stop",openRecommendSoftView:e=>{if(e.name&&!e.install&&!m(e.isBuy))return g({name:e.name,pluginInfo:e}),!1},openSoftPreLink:e=>{window.open(e.preview,"_blank","noopener,noreferrer")},openLtdPayView:F,openInstall:async e=>{const{data:t}=await f({sName:e.name});if("-1"===t.task)return p.error("当前插件正在安装,不可重复安装");_({name:t.name,type:"i",pluginInfo:t})}}});export{K as A,W as B,$ as C,J as H,H as a,R as b,I as c,M as d,P as e,G as f,E as g,b as h,N as i,z as j,C as k,X as l,D as m,V as n,A as o,O as p,k as q,q as r,F as s,x as t,S as u,L as v,T as w,B as x,Y as y,Z as z};
Save File
Cancel