import{K as e,fO as a,j as s,e as l,c8 as t,X as r,_ as o}from"./utils-lib.js?v=1761009159";import{_ as i}from"./index105.js?v=1761009159";import{c as m,s as u,g as n,r as p,w as d,q as c,v,x as g,e as f,B as b,C as _,y as j,z as h,Q as w,G as x}from"./base-lib.js?v=1761009159";import{b as y,j as S}from"./form-item.js?v=1761009159";import{u as C}from"./column.js?v=1761009159";import{s as F,a as V,b as q,d as L}from"./index51.js?v=1761009159";import{L as B}from"./useController8.js?v=1761009159";import"./__commonjsHelpers__.js?v=1761009159";import"./index106.js?v=1761009159";import"./useStore6.js?v=1761009159";import"./index325.js?v=1761009159";import"./config.js?v=1761009159";import"./index126.js?v=1761009159";import"./index119.js?v=1761009159";import"./validator.js?v=1761009159";import"./firewall.js?v=1761009159";import"./useStore7.js?v=1761009159";const k={class:"p-[20px]"},D={class:"p-[2rem]"},I={class:"p-[2rem]"},E={class:"list-disc mt-[20px] pl-[28px]"},O={class:"h-[2.4rem]"},P=o(m({__name:"index",setup(o){const m=B(),{sForm:P,sendSource:T,logSystemDialog:U,logSystemForm:z,sourceForm:G,logSystemData:H,logSystemLoad:K,logSysForm:Q,logSystemList:X}=u(m),{getLogSystemData:A,getLogSystemSite:J,sendSourceConfirm:M}=m,{BtForm:N,submit:R}=e({data:z.value,options:e=>n(()=>[y("IP","ip",{attrs:{placeholder:"日志服务系统的ip",clearable:!0,class:"!w-22rem"},rules:[{required:!0,validator:(e,a,s)=>{t(a)||s(new Error("请输入正确的IP")),s()},trigger:["blur","change"]}]}),y("端口","port",{attrs:{placeholder:"请输入端口号",clearable:!0,"controls-position":"right",class:"!w-22rem",type:"number"},rules:[{required:!0,validator:(e,a,s)=>{r(a)&&a||s(new Error("请输入正确的端口(范围为1-65535)")),s()},trigger:["blur","change"]}]})]),submit:async(e,a,s)=>(await a(),await F(e.value))}),W=p({site:[],ip:z.value.port?z.value.ip+":"+z.value.port:"未配置"});d(z,e=>{X.value[0].ip,W.value.ip=e.port?e.ip+":"+e.port:"未配置"},{deep:!0});const{BtForm:Y,submit:Z}=e({data:W.value,options:e=>n(()=>[S("网站","site",V.value,{attrs:{multiple:!0,collapseTags:!0,class:"!w-22rem"},rules:[{required:!0,message:"请选择网站",trigger:"change"}]}),y("日志系统","ip",{attrs:{disabled:!0,class:"!w-22rem"}})]),submit:async(e,a,s)=>(await a(),await q({...e.value,server_id:X.value.length?X.value[0].id:""}))}),{BtTable:$}=a({request:A,columns:[{label:"已设置站点",prop:"site_name"},C([{onClick:L,title:"删除"}])]});return c(()=>{J()}),(e,a)=>{const t=x,r=i,o=s,m=l;return v(),g("div",k,[f(r,null,{"header-left":b(()=>[f(t,{onClick:a[0]||(a[0]=e=>T.value=!0),type:"primary"},{default:b(()=>a[5]||(a[5]=[_(" 设置发送源 ",-1)])),_:1,__:[5]}),f(t,{onClick:a[1]||(a[1]=e=>U.value=!0)},{default:b(()=>a[6]||(a[6]=[_("日志服务系统配置",-1)])),_:1,__:[6]})]),content:b(()=>[f(j($),{"max-height":"360"}),a[7]||(a[7]=h("ul",{class:"list-disc w-[50rem] pl-[1rem] mt-[12px] text-secondary"},[h("li",null,"注意：网站被访问后才会在日志服务系统中显示")],-1))]),_:1}),f(o,{title:"设置发送源",modelValue:j(T),"onUpdate:modelValue":a[2]||(a[2]=e=>w(T)?T.value=e:null),"show-footer":!0,area:[40],onConfirm:j(Z)},{default:b(()=>[h("div",D,[f(j(Y),{"label-width":"80px"})])]),_:1},8,["modelValue","onConfirm"]),f(o,{title:"日志服务系统配置",modelValue:j(U),"onUpdate:modelValue":a[3]||(a[3]=e=>w(U)?U.value=e:null),"show-footer":!0,area:[40],onConfirm:j(R),onCancel:a[4]||(a[4]=e=>(U.value=!1,K.value=!1,void(X.value.length>0&&Object.assign(z.value,X.value[0]))))},{default:b(()=>[h("div",I,[f(j(N),{"label-width":"80px"}),h("ul",E,[h("li",O,[f(m,{href:"https://www.bt.cn/bbs/thread-120054-1-1.html"},{default:b(()=>a[8]||(a[8]=[_(" 如何配置日志服务系统 ",-1)])),_:1,__:[8]})]),a[9]||(a[9]=h("li",null,"端口：日志服务收集端口，请在安装“日志服务系统”的机器通过 btlogs 8 获取",-1))])])]),_:1},8,["modelValue","onConfirm"])])}}}),[["__scopeId","data-v-a699a992"]]);export{P as default};
