Files
WGDashboard/src/static/app/dist/assets/peerList-o-Wxckea.js
Donald Zou 1ed8b9f2d5 Build
2025-08-20 15:10:55 +08:00

3 lines
38 KiB
JavaScript

const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./peerAssignModal-BmtcFTRj.js","./localeText-DLy59bHL.js","./index-CzqOJ-1c.js","./index-CjwGNVZm.css","./DashboardClientAssignmentStore-dtjztho4.js","./peerAssignModal--_bmFbmn.css","./peerShareLinkModal-BROH8u6k.js","./dayjs.min-JZg_sID1.js","./vue-datepicker-CjOQFPRX.js","./peerShareLinkModal-DgDHiTOw.css","./peerJobs-PZJRpjH8.js","./schedulePeerJob-fDL63QMr.js","./schedulePeerJob-BGJSEouo.css","./peerJobs-D_dDl936.css","./peerQRCode-Cum9t0GO.js","./browser-BpWoKTLE.js","./peerQRCode-DuWWfBch.css","./peerConfigurationFile-Cfcsl8WC.js","./peerConfigurationFile-Z9ms5mIx.css","./peerSettings-B3y2jLvd.js","./peerSettings-CSjO_Okh.css","./peerSearchBar-CYvD1xMf.js","./peerSearchBar-po3U3-YC.css","./peerJobsAllModal-BTg_ZhOp.js","./peerJobsLogsModal-DtUk9PHB.js","./editConfiguration-BvaAoq0Y.js","./editConfiguration-ChlGwssr.css","./selectPeers-Ccc2xnjb.js","./selectPeers-ChWyERy7.css","./peerAddModal-D97S-FAi.js","./peerAddModal-B4gIHs91.css"])))=>i.map(i=>d[i]);
import{r as M,K as de,D as H,o as ue,H as q,x as ne,q as N,c as v,f as r,a as e,b as d,u as D,d as S,t as x,g as Q,_ as Y,h as K,F,i as ee,n as L,z as j,G as E,W as ce,M as ve,N as be,O as V,w as J,k as ae,e as T,j as C,P as R,T as oe,Q as I,J as he,m as me,y as _e,L as ye,v as Pe,S as $e}from"./index-CzqOJ-1c.js";import{_ as we}from"./protocolBadge-rbD-b8V3.js";import{L as O}from"./localeText-DLy59bHL.js";import{C as Se,L as xe,B as Ce,a as ke,b as Oe,c as Me,p as De,d as Ae,e as Le,f as Re,P as Ie,h as Ee,g as re}from"./index-DcZTifjX.js";import{d as Te}from"./dayjs.min-JZg_sID1.js";const Be={class:"row gx-2 gy-2 mb-3"},Ne={class:"col-12"},Je={class:"card rounded-3 bg-transparent",style:{height:"270px"}},Fe={class:"card-header bg-transparent border-0"},je={class:"text-muted"},Ve={class:"card-body pt-1"},Ue={class:"col-sm col-lg-6"},Ge={class:"card rounded-3 bg-transparent",style:{height:"270px"}},Qe={class:"card-header bg-transparent border-0 d-flex align-items-center"},ze={class:"text-muted"},We={key:0,class:"text-primary fw-bold ms-auto"},qe={class:"card-body pt-1"},Ke={class:"col-sm col-lg-6"},He={class:"card rounded-3 bg-transparent",style:{height:"270px"}},Ye={class:"card-header bg-transparent border-0 d-flex align-items-center"},Ze={class:"text-muted"},Xe={key:0,class:"text-success fw-bold ms-auto"},et={class:"card-body pt-1"},tt={__name:"peerDataUsageCharts",props:{configurationPeers:Array,configurationInfo:Object},setup(o){Se.register(xe,Ce,ke,Oe,Me,De,Ae,Le,Re,Ie);const t=o,l=M({timestamp:[],data:[]}),i=M({timestamp:[],data:[]}),P=de(),y=H(),u=M(void 0),m=async()=>{await Q("/api/getWireguardConfigurationRealtimeTraffic",{configurationName:P.params.id},_=>{let b=Te().format("hh:mm:ss A");(_.data.sent!==0&&_.data.recv!==0||l.value.data.length>0&&i.value.data.length>0)&&(l.value.timestamp.push(b),l.value.data.push(_.data.sent),i.value.timestamp.push(b),i.value.data.push(_.data.recv))})},n=()=>{clearInterval(u.value),u.value=void 0,t.configurationInfo.Status&&(u.value=setInterval(()=>{m()},parseInt(y.Configuration.Server.dashboard_refresh_interval)))};ue(()=>{n()}),q(()=>t.configurationInfo.Status,()=>{n()}),q(()=>y.Configuration.Server.dashboard_refresh_interval,()=>{n()}),ne(()=>{clearInterval(u.value),u.value=void 0});const f=N(()=>{let _=t.configurationPeers.filter(b=>b.cumu_data+b.total_data>0);return{labels:_.map(b=>b.name?b.name:`Untitled Peer - ${b.id}`),datasets:[{label:"Total Data Usage",data:_.map(b=>b.cumu_data+b.total_data),backgroundColor:_.map(b=>"#ffc107"),tooltip:{callbacks:{label:b=>`${b.formattedValue} GB`}}}]}}),g=N(()=>({labels:[...l.value.timestamp],datasets:[{label:"Data Sent",data:[...l.value.data],fill:!1,borderColor:"#198754",backgroundColor:"#198754",tension:0}]})),A=N(()=>({labels:[...i.value.timestamp],datasets:[{label:"Data Received",data:[...i.value.data],fill:!1,borderColor:"#0d6efd",backgroundColor:"#0d6efd",tension:0}]})),h=N(()=>({responsive:!0,plugins:{legend:{display:!1}},scales:{x:{ticks:{display:!1},grid:{display:!1}},y:{ticks:{callback:(_,b)=>`${Math.round((_+Number.EPSILON)*1e3)/1e3} GB`},grid:{display:!1}}}})),$=N(()=>({responsive:!0,plugins:{legend:{display:!1},tooltip:{callbacks:{label:_=>`${_.formattedValue} MB/s`}}},scales:{x:{ticks:{display:!1},grid:{display:!0}},y:{ticks:{callback:(_,b)=>`${Math.round((_+Number.EPSILON)*1e3)/1e3} MB/s`},grid:{display:!0}}}}));return(_,b)=>(r(),v("div",Be,[e("div",Ne,[e("div",Je,[e("div",Fe,[e("small",je,[d(O,{t:"Peers Data Usage"})])]),e("div",Ve,[d(D(Ee),{data:f.value,options:h.value,style:{width:"100%",height:"200px","max-height":"200px"}},null,8,["data","options"])])])]),e("div",Ue,[e("div",Ge,[e("div",Qe,[e("small",ze,[d(O,{t:"Real Time Received Data Usage"})]),i.value.data.length>0?(r(),v("small",We,x(i.value.data[i.value.data.length-1])+" MB/s ",1)):S("",!0)]),e("div",qe,[d(D(re),{options:$.value,data:A.value,style:{width:"100%",height:"200px","max-height":"200px"}},null,8,["options","data"])])])]),e("div",Ke,[e("div",He,[e("div",Ye,[e("small",Ze,[d(O,{t:"Real Time Sent Data Usage"})]),l.value.data.length>0?(r(),v("small",Xe,x(l.value.data[l.value.data.length-1])+" MB/s ",1)):S("",!0)]),e("div",et,[d(D(re),{options:$.value,data:g.value,style:{width:"100%",height:"200px","max-height":"200px"}},null,8,["options","data"])])])])]))}},st={name:"peerSearch",components:{LocaleText:O},setup(){const o=H(),t=ce();return{store:o,wireguardConfigurationStore:t}},props:{configuration:Object},data(){return{sort:{status:E("Status"),name:E("Name"),allowed_ip:E("Allowed IPs"),restricted:E("Restricted")},interval:{5e3:E("5 Seconds"),1e4:E("10 Seconds"),3e4:E("30 Seconds"),6e4:E("1 Minutes")},display:{grid:E("Grid"),list:E("List")},searchString:"",searchStringTimeout:void 0,showDisplaySettings:!1,showMoreSettings:!1}},methods:{updateSort(o){j("/api/updateDashboardConfigurationItem",{section:"Server",key:"dashboard_sort",value:o},t=>{t.status&&this.store.getConfiguration()})},updateRefreshInterval(o){j("/api/updateDashboardConfigurationItem",{section:"Server",key:"dashboard_refresh_interval",value:o},t=>{t.status&&this.store.getConfiguration()})},updateDisplay(o){j("/api/updateDashboardConfigurationItem",{section:"Server",key:"dashboard_peer_list_display",value:o},t=>{t.status&&this.store.getConfiguration()})},downloadAllPeer(){Q(`/api/downloadAllPeers/${this.configuration.Name}`,{},o=>{o.data.forEach(t=>{t.fileName=t.fileName+".conf"}),window.wireguard.generateZipFiles(o,this.configuration.Name)})}}},ot={class:"d-flex flex-column gap-2 my-4"},nt={class:"d-flex gap-2 peerSearchContainer"},at={class:"dropdown"},lt={"data-bs-toggle":"dropdown",class:"btn w-100 btn-sm text-primary-emphasis bg-primary-subtle rounded-3 border-1 border-primary-subtle position-relative"},rt={class:"badge text-bg-primary ms-2"},it={class:"dropdown-menu rounded-3"},dt=["onClick"],ut={class:"ms-auto"},ct={key:0,class:"bi bi-check-circle-fill"},mt={class:"dropdown"},pt={"data-bs-toggle":"dropdown",class:"btn btn-sm w-100 text-primary-emphasis bg-primary-subtle rounded-3 border-1 border-primary-subtle position-relative"},ft={class:"badge text-bg-primary ms-2"},gt={class:"dropdown-menu rounded-3"},vt=["onClick"],bt={class:"ms-auto"},ht={key:0,class:"bi bi-check-circle-fill"},_t={class:"dropdown"},yt={"data-bs-toggle":"dropdown",class:"btn btn-sm w-100 text-primary-emphasis bg-primary-subtle rounded-3 border-1 border-primary-subtle position-relative"},Pt={class:"badge text-bg-primary ms-2"},$t={class:"dropdown-menu rounded-3"},wt=["onClick"],St={class:"ms-auto"},xt={key:0,class:"bi bi-check-circle-fill"};function Ct(o,t,l,i,P,y){const u=K("LocaleText");return r(),v("div",ot,[e("div",nt,[e("div",at,[e("button",lt,[t[4]||(t[4]=e("i",{class:"bi bi-sort-up me-2"},null,-1)),d(u,{t:"Sort By"}),e("span",rt,x(this.sort[i.store.Configuration.Server.dashboard_sort]),1)]),e("ul",it,[(r(!0),v(F,null,ee(this.sort,(m,n)=>(r(),v("li",null,[e("button",{class:"dropdown-item d-flex align-items-center",onClick:f=>this.updateSort(n)},[e("small",null,x(m),1),e("small",ut,[i.store.Configuration.Server.dashboard_sort===n?(r(),v("i",ct)):S("",!0)])],8,dt)]))),256))])]),e("div",mt,[e("button",pt,[t[5]||(t[5]=e("i",{class:"bi bi-arrow-repeat me-2"},null,-1)),d(u,{t:"Refresh Interval"}),e("span",ft,x(this.interval[i.store.Configuration.Server.dashboard_refresh_interval]),1)]),e("ul",gt,[(r(!0),v(F,null,ee(this.interval,(m,n)=>(r(),v("li",null,[e("button",{class:"dropdown-item d-flex align-items-center",onClick:f=>this.updateRefreshInterval(n)},[e("small",null,x(m),1),e("small",bt,[i.store.Configuration.Server.dashboard_refresh_interval===n?(r(),v("i",ht)):S("",!0)])],8,vt)]))),256))])]),e("div",_t,[e("button",yt,[e("i",{class:L(["bi me-2","bi-"+i.store.Configuration.Server.dashboard_peer_list_display])},null,2),d(u,{t:"Display"}),e("span",Pt,x(this.display[i.store.Configuration.Server.dashboard_peer_list_display]),1)]),e("ul",$t,[(r(!0),v(F,null,ee(this.display,(m,n)=>(r(),v("li",null,[e("button",{class:"dropdown-item d-flex align-items-center",onClick:f=>this.updateDisplay(n)},[e("small",null,x(m),1),e("small",St,[i.store.Configuration.Server.dashboard_peer_list_display===n?(r(),v("i",xt)):S("",!0)])],8,wt)]))),256))])]),e("button",{class:"btn btn-sm text-primary-emphasis bg-primary-subtle rounded-3 border-1 border-primary-subtle ms-lg-auto",onClick:t[0]||(t[0]=m=>this.$emit("search"))},[t[6]||(t[6]=e("i",{class:"bi bi-search me-2"},null,-1)),d(u,{t:"Search"})]),e("button",{class:"btn btn-sm text-primary-emphasis bg-primary-subtle rounded-3 border-1 border-primary-subtle",onClick:t[1]||(t[1]=m=>this.downloadAllPeer())},[t[7]||(t[7]=e("i",{class:"bi bi-download me-2 me-lg-0 me-xl-2"},null,-1)),d(u,{t:"Download All",class:"d-sm-block d-lg-none d-xl-block"})]),e("button",{class:"btn btn-sm text-primary-emphasis bg-primary-subtle rounded-3 border-1 border-primary-subtle",onClick:t[2]||(t[2]=m=>this.$emit("selectPeers"))},[t[8]||(t[8]=e("i",{class:"bi bi-check2-all me-2 me-lg-0 me-xl-2"},null,-1)),d(u,{t:"Select Peers",class:"d-sm-block d-lg-none d-xl-block"})]),e("button",{class:"btn btn-sm text-primary-emphasis bg-primary-subtle rounded-3 border-1 border-primary-subtle",onClick:t[3]||(t[3]=m=>this.$emit("jobsAll")),type:"button","aria-expanded":"false"},[t[9]||(t[9]=e("i",{class:"bi bi-person-walking me-2 me-lg-0 me-xl-2"},null,-1)),d(u,{t:"Active Jobs",class:"d-sm-block d-lg-none d-xl-block"})])])])}const kt=Y(st,[["render",Ct],["__scopeId","data-v-7af0f399"]]);function Ot(o){return ve()?(be(o),!0):!1}const pe=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Mt=Object.prototype.toString,Dt=o=>Mt.call(o)==="[object Object]",G=()=>{},At=Lt();function Lt(){var o,t;return pe&&((o=window?.navigator)==null?void 0:o.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((t=window?.navigator)==null?void 0:t.maxTouchPoints)>2&&/iPad|Macintosh/.test(window?.navigator.userAgent))}function te(o){return Array.isArray(o)?o:[o]}function Rt(o,t,l){return q(o,t,{...l,immediate:!0})}const fe=pe?window:void 0;function W(o){var t;const l=V(o);return(t=l?.$el)!=null?t:l}function se(...o){const t=[],l=()=>{t.forEach(m=>m()),t.length=0},i=(m,n,f,g)=>(m.addEventListener(n,f,g),()=>m.removeEventListener(n,f,g)),P=N(()=>{const m=te(V(o[0])).filter(n=>n!=null);return m.every(n=>typeof n!="string")?m:void 0}),y=Rt(()=>{var m,n;return[(n=(m=P.value)==null?void 0:m.map(f=>W(f)))!=null?n:[fe].filter(f=>f!=null),te(V(P.value?o[1]:o[0])),te(D(P.value?o[2]:o[1])),V(P.value?o[3]:o[2])]},([m,n,f,g])=>{if(l(),!m?.length||!n?.length||!f?.length)return;const A=Dt(g)?{...g}:g;t.push(...m.flatMap(h=>n.flatMap($=>f.map(_=>i(h,$,_,A)))))},{flush:"post"}),u=()=>{y(),l()};return Ot(l),u}let ie=!1;function It(o,t,l={}){const{window:i=fe,ignore:P=[],capture:y=!0,detectIframe:u=!1,controls:m=!1}=l;if(!i)return m?{stop:G,cancel:G,trigger:G}:G;if(At&&!ie){ie=!0;const a={passive:!0};Array.from(i.document.body.children).forEach(w=>w.addEventListener("click",G,a)),i.document.documentElement.addEventListener("click",G,a)}let n=!0;const f=a=>V(P).some(w=>{if(typeof w=="string")return Array.from(i.document.querySelectorAll(w)).some(k=>k===a.target||a.composedPath().includes(k));{const k=W(w);return k&&(a.target===k||a.composedPath().includes(k))}});function g(a){const w=V(a);return w&&w.$.subTree.shapeFlag===16}function A(a,w){const k=V(a),B=k.$.subTree&&k.$.subTree.children;return B==null||!Array.isArray(B)?!1:B.some(z=>z.el===w.target||w.composedPath().includes(z.el))}const h=a=>{const w=W(o);if(a.target!=null&&!(!(w instanceof Element)&&g(o)&&A(o,a))&&!(!w||w===a.target||a.composedPath().includes(w))){if("detail"in a&&a.detail===0&&(n=!f(a)),!n){n=!0;return}t(a)}};let $=!1;const _=[se(i,"click",a=>{$||($=!0,setTimeout(()=>{$=!1},0),h(a))},{passive:!0,capture:y}),se(i,"pointerdown",a=>{const w=W(o);n=!f(a)&&!!(w&&!a.composedPath().includes(w))},{passive:!0}),u&&se(i,"blur",a=>{setTimeout(()=>{var w;const k=W(o);((w=i.document.activeElement)==null?void 0:w.tagName)==="IFRAME"&&!k?.contains(i.document.activeElement)&&t(a)},0)},{passive:!0})].filter(Boolean),b=()=>_.forEach(a=>a());return m?{stop:b,cancel:()=>{n=!1},trigger:a=>{n=!0,h(a),n=!1}}:b}const Et={key:0,class:"position-absolute d-block p-1 px-2 bg-body text-body rounded-3 border shadow"},Tt={__name:"peerSettingsDropdownTool",props:{icon:String,title:String},emits:["click"],setup(o,{emit:t}){const l=t,i=M(!1);return(P,y)=>(r(),v("a",{class:"dropdown-item text-center px-0 rounded-3 position-relative",role:"button",onMouseenter:y[0]||(y[0]=u=>i.value=!0),onMouseleave:y[1]||(y[1]=u=>i.value=!1),onClick:y[2]||(y[2]=u=>l("click"))},[e("i",{class:L(["me-auto bi",o.icon])},null,2),d(ae,{name:"zoomReversed"},{default:J(()=>[i.value?(r(),v("span",Et,[e("small",null,[d(O,{t:o.title},null,8,["t"])])])):S("",!0)]),_:1})],32))}},Bt=Y(Tt,[["__scopeId","data-v-d4e41a56"]]),Nt={name:"peerSettingsDropdown",components:{PeerSettingsDropdownTool:Bt,LocaleText:O},setup(){return{dashboardStore:H()}},props:{Peer:Object},data(){return{deleteBtnDisabled:!1,restrictBtnDisabled:!1,allowAccessBtnDisabled:!1,confirmDelete:!1}},methods:{downloadPeer(){Q("/api/downloadPeer/"+this.$route.params.id,{id:this.Peer.id},o=>{if(o.status){const t=new Blob([o.data.file],{type:"text/plain"}),l=URL.createObjectURL(t),i=`${o.data.fileName}.conf`,P=document.createElement("a");P.href=l,P.download=i,P.click(),this.dashboardStore.newMessage("WGDashboard","Peer download started","success")}else this.dashboardStore.newMessage("Server",o.message,"danger")})},downloadQRCode(o){Q("/api/downloadPeer/"+this.$route.params.id,{id:this.Peer.id},t=>{t.status?this.$emit(o,t.data.file):this.dashboardStore.newMessage("Server",t.message,"danger")})},deletePeer(){this.deleteBtnDisabled=!0,j(`/api/deletePeers/${this.$route.params.id}`,{peers:[this.Peer.id]},o=>{this.dashboardStore.newMessage("Server",o.message,o.status?"success":"danger"),this.$emit("refresh"),this.deleteBtnDisabled=!1})},restrictPeer(){this.restrictBtnDisabled=!0,j(`/api/restrictPeers/${this.$route.params.id}`,{peers:[this.Peer.id]},o=>{this.dashboardStore.newMessage("Server",o.message,o.status?"success":"danger"),this.$emit("refresh"),this.restrictBtnDisabled=!1})},allowAccessPeer(){this.allowAccessBtnDisabled=!0,j(`/api/allowAccessPeers/${this.$route.params.id}`,{peers:[this.Peer.id]},o=>{this.dashboardStore.newMessage("Server",o.message,o.status?"success":"danger"),this.$emit("refresh"),this.allowAccessBtnDisabled=!1})}}},Jt={class:"dropdown-menu mt-2 shadow-lg d-block rounded-3",style:{"max-width":"200px"}},Ft={style:{"font-size":"0.8rem","padding-left":"var(--bs-dropdown-item-padding-x)","padding-right":"var(--bs-dropdown-item-padding-x)"}},jt={class:"text-body d-flex"},Vt={class:"ms-auto"},Ut={key:1},Gt={class:"w-100 dropdown-item text-muted",style:{"white-space":"break-spaces","font-size":"0.7rem"}},Qt={key:2},zt={class:"d-flex",style:{"padding-left":"var(--bs-dropdown-item-padding-x)","padding-right":"var(--bs-dropdown-item-padding-x)"}},Wt={key:1,class:"confirmDelete"},qt={style:{"white-space":"break-spaces"},class:"mb-2 d-block fw-bold"},Kt={class:"d-flex w-100 gap-2"},Ht=["disabled"],Yt=["disabled"],Zt={key:1};function Xt(o,t,l,i,P,y){const u=K("LocaleText"),m=K("PeerSettingsDropdownTool");return r(),v("ul",Jt,[this.Peer.restricted?(r(),v("li",Zt,[e("a",{class:L(["dropdown-item d-flex text-warning",{disabled:this.allowAccessBtnDisabled}]),onClick:t[11]||(t[11]=n=>this.allowAccessPeer()),role:"button"},[t[25]||(t[25]=e("i",{class:"me-auto bi bi-unlock"},null,-1)),this.allowAccessBtnDisabled?(r(),C(u,{key:1,t:"Allowing Access..."})):(r(),C(u,{key:0,t:"Allow Access"}))],2)])):(r(),v(F,{key:0},[this.confirmDelete?(r(),v("li",Wt,[e("p",qt,[d(u,{t:"Are you sure to delete this peer?"})]),e("div",Kt,[e("button",{onClick:t[9]||(t[9]=n=>this.deletePeer()),disabled:this.deleteBtnDisabled,class:"flex-grow-1 ms-auto btn btn-sm bg-danger"},[d(u,{t:"Yes"})],8,Ht),e("button",{disabled:this.deleteBtnDisabled,onClick:t[10]||(t[10]=n=>this.confirmDelete=!1),class:"flex-grow-1 btn btn-sm bg-secondary-subtle text-secondary-emphasis border border-secondary-subtle"},[d(u,{t:"No"})],8,Yt)])])):(r(),v(F,{key:0},[this.Peer.status==="running"?(r(),v(F,{key:0},[e("li",Ft,[e("span",jt,[t[12]||(t[12]=e("i",{class:"bi bi-box-arrow-in-right"},null,-1)),e("span",Vt,x(this.Peer.endpoint),1)])]),t[13]||(t[13]=e("li",null,[e("hr",{class:"dropdown-divider"})],-1))],64)):S("",!0),this.Peer.private_key?(r(),v("li",Qt,[t[14]||(t[14]=e("div",{class:"text-center text-muted"},null,-1)),e("div",zt,[d(m,{icon:"bi-download",title:"Download",onClick:t[0]||(t[0]=n=>this.downloadPeer())}),d(m,{icon:"bi-qr-code",title:"QR Code",onClick:t[1]||(t[1]=n=>this.$emit("qrcode"))}),d(m,{icon:"bi-body-text",title:"Configuration File",onClick:t[2]||(t[2]=n=>this.$emit("configurationFile"))}),d(m,{icon:"bi-share",title:"Share Peer",onClick:t[3]||(t[3]=n=>this.$emit("share"))})])])):(r(),v("li",Ut,[e("small",Gt,[d(u,{t:"Download & QR Code is not available due to no private key set for this peer"})])])),t[23]||(t[23]=e("li",null,[e("hr",{class:"dropdown-divider"})],-1)),e("li",null,[e("a",{class:"dropdown-item d-flex",role:"button",onClick:t[4]||(t[4]=n=>this.$emit("setting"))},[t[15]||(t[15]=e("i",{class:"me-auto bi bi-pen"},null,-1)),t[16]||(t[16]=T()),d(u,{t:"Peer Settings"})])]),e("li",null,[e("a",{class:"dropdown-item d-flex",role:"button",onClick:t[5]||(t[5]=n=>this.$emit("jobs"))},[t[17]||(t[17]=e("i",{class:"me-auto bi bi-app-indicator"},null,-1)),t[18]||(t[18]=T()),d(u,{t:"Schedule Jobs"})])]),e("li",null,[e("a",{class:"dropdown-item d-flex",role:"button",onClick:t[6]||(t[6]=n=>this.$emit("assign"))},[t[19]||(t[19]=e("i",{class:"me-auto bi bi-diagram-2"},null,-1)),t[20]||(t[20]=T()),d(u,{t:"Assign Peer"})])]),t[24]||(t[24]=e("li",null,[e("hr",{class:"dropdown-divider"})],-1)),e("li",null,[e("a",{class:L(["dropdown-item d-flex text-warning",{disabled:this.restrictBtnDisabled}]),onClick:t[7]||(t[7]=n=>this.restrictPeer()),role:"button"},[t[21]||(t[21]=e("i",{class:"me-auto bi bi-lock"},null,-1)),this.restrictBtnDisabled?(r(),C(u,{key:1,t:"Restricting..."})):(r(),C(u,{key:0,t:"Restrict Access"}))],2)]),e("li",null,[e("a",{class:L(["dropdown-item d-flex fw-bold text-danger",{disabled:this.deleteBtnDisabled}]),onClick:t[8]||(t[8]=n=>this.confirmDelete=!0),role:"button"},[t[22]||(t[22]=e("i",{class:"me-auto bi bi-trash"},null,-1)),this.deleteBtnDisabled?(r(),C(u,{key:1,t:"Deleting..."})):(r(),C(u,{key:0,t:"Delete"}))],2)])],64))],64))])}const es=Y(Nt,[["render",Xt],["__scopeId","data-v-d636c35d"]]),ts={name:"peer",methods:{GetLocale:E},components:{LocaleText:O,PeerSettingsDropdown:es},props:{Peer:Object},data(){return{}},setup(){const o=M(null),t=M(!1),l=H();return It(o,i=>{t.value=!1}),{target:o,subMenuOpened:t,dashboardStore:l}},computed:{getLatestHandshake(){return this.Peer.latest_handshake.includes(",")?this.Peer.latest_handshake.split(",")[0]:this.Peer.latest_handshake}}},ss=["id"],os={key:0,class:"card-header bg-transparent d-flex align-items-center gap-2 border-0"},ns={key:0,style:{"font-size":"0.8rem",color:"#28a745"},class:"d-flex align-items-center"},as={style:{"font-size":"0.8rem"},class:"ms-auto d-flex gap-2"},ls={class:"text-primary"},rs={class:"text-success"},is={key:0,class:"text-secondary"},ds={key:1,class:"border-0 card-header bg-transparent text-warning fw-bold",style:{"font-size":"0.8rem"}},us={class:"card-body pt-1",style:{"font-size":"0.9rem"}},cs={class:"text-muted"},ms={class:"d-block"},ps={class:"text-muted"},fs={class:"d-block"},gs={class:"d-flex align-items-end ms-auto"};function vs(o,t,l,i,P,y){const u=K("LocaleText"),m=K("PeerSettingsDropdown");return r(),v("div",{class:L(["card shadow-sm rounded-3 peerCard",{"border-warning":l.Peer.restricted}]),id:"peer_"+l.Peer.id},[e("div",null,[l.Peer.restricted?(r(),v("div",ds,[t[14]||(t[14]=e("i",{class:"bi-lock-fill me-2"},null,-1)),d(u,{t:"Access Restricted"})])):(r(),v("div",os,[e("div",{class:L(["dot ms-0",{active:l.Peer.status==="running"}])},null,2),i.dashboardStore.Configuration.Server.dashboard_peer_list_display==="list"&&l.Peer.status==="running"?(r(),v("div",ns,[t[8]||(t[8]=e("i",{class:"bi bi-box-arrow-in-right me-2"},null,-1)),e("span",null,x(l.Peer.endpoint),1)])):S("",!0),e("div",as,[e("span",ls,[t[9]||(t[9]=e("i",{class:"bi bi-arrow-down"},null,-1)),e("strong",null,x((l.Peer.cumu_receive+l.Peer.total_receive).toFixed(4)),1),t[10]||(t[10]=T(" GB "))]),e("span",rs,[t[11]||(t[11]=e("i",{class:"bi bi-arrow-up"},null,-1)),e("strong",null,x((l.Peer.cumu_sent+l.Peer.total_sent).toFixed(4)),1),t[12]||(t[12]=T(" GB "))]),l.Peer.latest_handshake!=="No Handshake"?(r(),v("span",is,[t[13]||(t[13]=e("i",{class:"bi bi-arrows-angle-contract"},null,-1)),T(" "+x(y.getLatestHandshake)+" ago ",1)])):S("",!0)])]))]),e("div",us,[e("h6",null,x(l.Peer.name?l.Peer.name:y.GetLocale("Untitled Peer")),1),e("div",{class:L(["d-flex",[i.dashboardStore.Configuration.Server.dashboard_peer_list_display==="grid"?"gap-1 flex-column":"flex-row gap-3"]])},[e("div",{class:L({"d-flex gap-2 align-items-center":i.dashboardStore.Configuration.Server.dashboard_peer_list_display==="list"})},[e("small",cs,[d(u,{t:"Public Key"})]),e("small",ms,[e("samp",null,x(l.Peer.id),1)])],2),e("div",{class:L({"d-flex gap-2 align-items-center":i.dashboardStore.Configuration.Server.dashboard_peer_list_display==="list"})},[e("small",ps,[d(u,{t:"Allowed IPs"})]),e("small",fs,[e("samp",null,x(l.Peer.allowed_ip),1)])],2),e("div",gs,[e("div",{class:L(["ms-auto px-2 rounded-3 subMenuBtn",{active:this.subMenuOpened}])},[e("a",{role:"button",class:"text-body",onClick:t[0]||(t[0]=n=>this.subMenuOpened=!0)},t[15]||(t[15]=[e("h5",{class:"mb-0"},[e("i",{class:"bi bi-three-dots"})],-1)])),d(ae,{name:"slide-fade"},{default:J(()=>[this.subMenuOpened?(r(),C(m,{key:0,onQrcode:t[1]||(t[1]=n=>this.$emit("qrcode")),onConfigurationFile:t[2]||(t[2]=n=>this.$emit("configurationFile")),onSetting:t[3]||(t[3]=n=>this.$emit("setting")),onJobs:t[4]||(t[4]=n=>this.$emit("jobs")),onRefresh:t[5]||(t[5]=n=>this.$emit("refresh")),onShare:t[6]||(t[6]=n=>this.$emit("share")),onAssign:t[7]||(t[7]=n=>this.$emit("assign")),Peer:l.Peer,ref:"target"},null,8,["Peer"])):S("",!0)]),_:1})],2)])],2)])],10,ss)}const bs=Y(ts,[["render",vs],["__scopeId","data-v-b909bf3c"]]),hs={__name:"peerListModals",props:{configurationModals:Object,configurationModalSelectedPeer:Object},emits:["refresh"],setup(o,{emit:t}){const l=t,i=R(()=>I(()=>import("./peerAssignModal-BmtcFTRj.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)),P=R(()=>I(()=>import("./peerShareLinkModal-BROH8u6k.js"),__vite__mapDeps([6,2,3,7,8,1,9]),import.meta.url)),y=R(()=>I(()=>import("./peerJobs-PZJRpjH8.js"),__vite__mapDeps([10,11,2,3,8,7,1,12,13]),import.meta.url)),u=R(()=>I(()=>import("./peerQRCode-Cum9t0GO.js"),__vite__mapDeps([14,15,2,3,1,16]),import.meta.url)),m=R(()=>I(()=>import("./peerConfigurationFile-Cfcsl8WC.js"),__vite__mapDeps([17,2,3,1,15,18]),import.meta.url)),n=R(()=>I(()=>import("./peerSettings-B3y2jLvd.js"),__vite__mapDeps([19,2,3,1,20]),import.meta.url));return(f,g)=>(r(),C(oe,{name:"zoom"},{default:J(()=>[o.configurationModals.peerSetting.modalOpen?(r(),C(D(n),{key:"PeerSettingsModal",selectedPeer:o.configurationModalSelectedPeer,onRefresh:g[0]||(g[0]=A=>l("refresh")),onClose:g[1]||(g[1]=A=>o.configurationModals.peerSetting.modalOpen=!1)},null,8,["selectedPeer"])):S("",!0),o.configurationModals.peerQRCode.modalOpen?(r(),C(D(u),{key:"PeerQRCodeModal",selectedPeer:o.configurationModalSelectedPeer,onClose:g[2]||(g[2]=A=>o.configurationModals.peerQRCode.modalOpen=!1)},null,8,["selectedPeer"])):S("",!0),o.configurationModals.peerScheduleJobs.modalOpen?(r(),C(D(y),{key:"PeerJobsModal",onRefresh:g[3]||(g[3]=A=>l("refresh")),selectedPeer:o.configurationModalSelectedPeer,onClose:g[4]||(g[4]=A=>o.configurationModals.peerScheduleJobs.modalOpen=!1)},null,8,["selectedPeer"])):S("",!0),o.configurationModals.peerShare.modalOpen?(r(),C(D(P),{key:"PeerShareLinkModal",onClose:g[5]||(g[5]=A=>{o.configurationModals.peerShare.modalOpen=!1}),selectedPeer:o.configurationModalSelectedPeer},null,8,["selectedPeer"])):S("",!0),o.configurationModals.peerConfigurationFile.modalOpen?(r(),C(D(m),{key:4,onClose:g[6]||(g[6]=A=>o.configurationModals.peerConfigurationFile.modalOpen=!1),selectedPeer:o.configurationModalSelectedPeer},null,8,["selectedPeer"])):S("",!0),o.configurationModals.assignPeer.modalOpen?(r(),C(D(i),{key:5,selectedPeer:o.configurationModalSelectedPeer,onClose:g[7]||(g[7]=A=>o.configurationModals.assignPeer.modalOpen=!1)},null,8,["selectedPeer"])):S("",!0)]),_:1}))}},_s={style:{"margin-bottom":"20px",height:"1px"},id:"loadMore"},ys={__name:"peerIntersectionObserver",props:["peerListLength","showPeersCount"],emits:["loadMore"],setup(o,{emit:t}){const l=M(void 0),i=t;return ue(()=>{l.value=new IntersectionObserver(P=>{P.forEach(y=>{y.isIntersecting&&i("loadMore")})},{rootMargin:"20px",threshold:1}),l.value.observe(document.querySelector("#loadMore"))}),ne(()=>{l.value.disconnect()}),(P,y)=>(r(),v("div",_s))}},Ps={class:"d-flex gap-1 flex-column"},$s=he({__name:"configurationDescription",props:["configuration"],setup(o){const t=o,l=M(t.configuration.Info.Description),i=M(!1),P=M(!1),y=async()=>{await j("/api/updateWireguardConfigurationInfo",{Name:t.configuration.Name,Key:"Description",Value:l.value},m=>{P.value=m.status,u()})},u=()=>{i.value=!0,setTimeout(()=>{i.value=!1},3e3)};return(m,n)=>(r(),v("div",Ps,[n[2]||(n[2]=e("label",{for:"configurationDescription"},[e("small",{style:{"white-space":"nowrap"},class:"text-muted"},[e("i",{class:"bi bi-pencil-fill me-2"}),T("Notes ")])],-1)),me(e("input",{type:"text",class:L([[i.value?[P.value?"is-valid":"is-invalid"]:void 0],"form-control rounded-3 bg-transparent form-control-sm"]),id:"configurationDescription","onUpdate:modelValue":n[0]||(n[0]=f=>l.value=f),onChange:n[1]||(n[1]=f=>y())},null,34),[[_e,l.value]])]))}}),ws={class:"container-fluid"},Ss={class:"d-flex align-items-sm-start flex-column flex-sm-row gap-3"},xs={class:"text-muted d-flex align-items-center gap-2"},Cs={class:"mb-0"},ks={class:"d-flex align-items-center gap-3"},Os={class:"mb-0 display-4"},Ms={class:"ms-sm-auto d-flex gap-2 flex-column"},Ds={class:"card rounded-3 bg-transparent"},As={class:"card-body py-2 d-flex align-items-center"},Ls={class:"text-muted"},Rs={class:"form-check form-switch mb-0 ms-auto pe-0 me-0"},Is=["for"],Es={key:2,class:"spinner-border spinner-border-sm ms-2","aria-hidden":"true"},Ts=["disabled","id"],Bs={class:"d-flex gap-2"},Ns={class:"row mt-3 gy-2 gx-2 mb-2"},Js={class:"col-12 col-lg-3"},Fs={class:"card rounded-3 bg-transparent h-100"},js={class:"card-body py-2 d-flex flex-column justify-content-center"},Vs={class:"mb-0 text-muted"},Us={class:"col-12 col-lg-3"},Gs={class:"card rounded-3 bg-transparent h-100"},Qs={class:"card-body py-2 d-flex flex-column justify-content-center"},zs={class:"mb-0 text-muted"},Ws={style:{"word-break":"break-all"},class:"col-12 col-lg-6"},qs={class:"card rounded-3 bg-transparent h-100"},Ks={class:"card-body py-2 d-flex flex-column justify-content-center"},Hs={class:"mb-0 text-muted"},Ys={class:"row gx-2 gy-2 mb-2"},Zs={class:"col-12 col-lg-3"},Xs={class:"card rounded-3 bg-transparent h-100"},eo={class:"card-body d-flex"},to={class:"mb-0 text-muted"},so={class:"h4"},oo={class:"col-12 col-lg-3"},no={class:"card rounded-3 bg-transparent h-100"},ao={class:"card-body d-flex"},lo={class:"mb-0 text-muted"},ro={class:"h4"},io={class:"col-12 col-lg-3"},uo={class:"card rounded-3 bg-transparent h-100"},co={class:"card-body d-flex"},mo={class:"mb-0 text-muted"},po={class:"h4 text-primary"},fo={class:"col-12 col-lg-3"},go={class:"card rounded-3 bg-transparent h-100"},vo={class:"card-body d-flex"},bo={class:"mb-0 text-muted"},ho={class:"h4 text-success"},_o={style:{"margin-bottom":"80px"}},yo=20,Po={__name:"peerList",async setup(o){let t,l;const i=R(()=>I(()=>import("./peerSearchBar-CYvD1xMf.js"),__vite__mapDeps([21,2,3,1,22]),import.meta.url)),P=R(()=>I(()=>import("./peerJobsAllModal-BTg_ZhOp.js"),__vite__mapDeps([23,11,2,3,8,7,1,12]),import.meta.url)),y=R(()=>I(()=>import("./peerJobsLogsModal-DtUk9PHB.js"),__vite__mapDeps([24,7,2,3,1]),import.meta.url)),u=R(()=>I(()=>import("./editConfiguration-BvaAoq0Y.js"),__vite__mapDeps([25,2,3,1,7,26]),import.meta.url)),m=R(()=>I(()=>import("./selectPeers-Ccc2xnjb.js"),__vite__mapDeps([27,2,3,1,28]),import.meta.url)),n=R(()=>I(()=>import("./peerAddModal-D97S-FAi.js"),__vite__mapDeps([29,2,3,1,30]),import.meta.url)),f=H(),g=ce(),A=de(),h=M({}),$=M([]),_=M(!1),b=M({}),a=M({peerNew:{modalOpen:!1},peerSetting:{modalOpen:!1},peerScheduleJobs:{modalOpen:!1},peerQRCode:{modalOpen:!1},peerConfigurationFile:{modalOpen:!1},peerCreate:{modalOpen:!1},peerScheduleJobsAll:{modalOpen:!1},peerScheduleJobsLogs:{modalOpen:!1},peerShare:{modalOpen:!1},editConfiguration:{modalOpen:!1},selectPeers:{modalOpen:!1},backupRestore:{modalOpen:!1},deleteConfiguration:{modalOpen:!1},editRawConfigurationFile:{modalOpen:!1},assignPeer:{modalOpen:!1}}),w=M(!1),k=async()=>{await Q("/api/getWireguardConfigurationInfo",{configurationName:A.params.id},p=>{p.status&&(h.value=p.data.configurationInfo,$.value=p.data.configurationPeers,$.value.forEach(s=>{s.restricted=!1}),p.data.configurationRestrictedPeers.forEach(s=>{s.restricted=!0,$.value.push(s)}))})};[t,l]=ye(()=>k()),await t,l();const B=M(void 0),z=()=>{clearInterval(B.value),B.value=setInterval(async()=>{await k()},parseInt(f.Configuration.Server.dashboard_refresh_interval))};z(),ne(()=>{clearInterval(B.value),B.value=void 0}),q(()=>f.Configuration.Server.dashboard_refresh_interval,()=>{z()});const ge=async()=>{_.value=!0,await Q("/api/toggleWireguardConfiguration",{configurationName:h.value.Name},p=>{p.status?f.newMessage("Server",`${h.value.Name} ${p.data?"is on":"is off"}`,"success"):f.newMessage("Server",p.message,"danger"),g.Configurations.find(s=>s.Name===h.value.Name).Status=p.data,h.value.Status=p.data,_.value=!1})},Z=N(()=>({connectedPeers:$.value.filter(p=>p.status==="running").length,totalUsage:$.value.length>0?$.value.filter(p=>!p.restricted).map(p=>p.total_data+p.cumu_data).reduce((p,s)=>p+s,0).toFixed(4):0,totalReceive:$.value.length>0?$.value.filter(p=>!p.restricted).map(p=>p.total_receive+p.cumu_receive).reduce((p,s)=>p+s,0).toFixed(4):0,totalSent:$.value.length>0?$.value.filter(p=>!p.restricted).map(p=>p.total_sent+p.cumu_sent).reduce((p,s)=>p+s,0).toFixed(4):0})),X=M(10),le=N(()=>{const p=g.searchString?$.value.filter(s=>s.name.includes(g.searchString)||s.id.includes(g.searchString)||s.allowed_ip.includes(g.searchString)):$.value;return f.Configuration.Server.dashboard_sort==="restricted"?p.sort((s,c)=>s[f.Configuration.Server.dashboard_sort]<c[f.Configuration.Server.dashboard_sort]?1:s[f.Configuration.Server.dashboard_sort]>c[f.Configuration.Server.dashboard_sort]?-1:0).slice(0,X.value):p.sort((s,c)=>s[f.Configuration.Server.dashboard_sort]<c[f.Configuration.Server.dashboard_sort]?-1:s[f.Configuration.Server.dashboard_sort]>c[f.Configuration.Server.dashboard_sort]?1:0).slice(0,X.value)});return q(()=>A.query.id,p=>{p?g.searchString=p:g.searchString=void 0},{immediate:!0}),(p,s)=>(r(),v("div",ws,[e("div",Ss,[e("div",null,[e("div",xs,[e("h5",Cs,[d(we,{protocol:h.value.Protocol},null,8,["protocol"])])]),e("div",ks,[e("h1",Os,[e("samp",null,x(h.value.Name),1)])])]),e("div",Ms,[e("div",Ds,[e("div",As,[e("small",Ls,[d(O,{t:"Status"})]),e("div",{class:L(["dot ms-2",{active:h.value.Status}])},null,2),e("div",Rs,[e("label",{class:"form-check-label",style:{cursor:"pointer"},for:"switch"+h.value.id},[h.value.Status&&!_.value?(r(),C(O,{key:0,t:"On"})):!h.value.Status&&!_.value?(r(),C(O,{key:1,t:"Off"})):S("",!0),_.value?(r(),v("span",Es)):S("",!0)],8,Is),me(e("input",{class:"form-check-input",style:{cursor:"pointer"},disabled:_.value,type:"checkbox",role:"switch",id:"switch"+h.value.id,onChange:s[0]||(s[0]=c=>ge()),"onUpdate:modelValue":s[1]||(s[1]=c=>h.value.Status=c)},null,40,Ts),[[Pe,h.value.Status]])])])]),e("div",Bs,[e("a",{role:"button",onClick:s[2]||(s[2]=c=>a.value.peerNew.modalOpen=!0),class:"titleBtn py-2 text-decoration-none btn text-primary-emphasis bg-primary-subtle rounded-3 border-1 border-primary-subtle"},[s[29]||(s[29]=e("i",{class:"bi bi-plus-circle me-2"},null,-1)),d(O,{t:"Peer"})]),e("button",{class:"titleBtn py-2 text-decoration-none btn text-primary-emphasis bg-primary-subtle rounded-3 border-1 border-primary-subtle",onClick:s[3]||(s[3]=c=>a.value.editConfiguration.modalOpen=!0),type:"button","aria-expanded":"false"},[s[30]||(s[30]=e("i",{class:"bi bi-gear-fill me-2"},null,-1)),d(O,{t:"Configuration Settings"})])])])]),s[35]||(s[35]=e("hr",null,null,-1)),d($s,{configuration:h.value},null,8,["configuration"]),e("div",Ns,[e("div",Js,[e("div",Fs,[e("div",js,[e("p",Vs,[e("small",null,[d(O,{t:"Address"})])]),T(" "+x(h.value.Address),1)])])]),e("div",Us,[e("div",Gs,[e("div",Qs,[e("p",zs,[e("small",null,[d(O,{t:"Listen Port"})])]),T(" "+x(h.value.ListenPort),1)])])]),e("div",Ws,[e("div",qs,[e("div",Ks,[e("p",Hs,[e("small",null,[d(O,{t:"Public Key"})])]),e("samp",null,x(h.value.PublicKey),1)])])])]),e("div",Ys,[e("div",Zs,[e("div",Xs,[e("div",eo,[e("div",null,[e("p",to,[e("small",null,[d(O,{t:"Connected Peers"})])]),e("strong",so,x(Z.value.connectedPeers)+" / "+x($.value.length),1)]),s[31]||(s[31]=e("i",{class:"bi bi-ethernet ms-auto h2 text-muted"},null,-1))])])]),e("div",oo,[e("div",no,[e("div",ao,[e("div",null,[e("p",lo,[e("small",null,[d(O,{t:"Total Usage"})])]),e("strong",ro,x(Z.value.totalUsage)+" GB",1)]),s[32]||(s[32]=e("i",{class:"bi bi-arrow-down-up ms-auto h2 text-muted"},null,-1))])])]),e("div",io,[e("div",uo,[e("div",co,[e("div",null,[e("p",mo,[e("small",null,[d(O,{t:"Total Received"})])]),e("strong",po,x(Z.value.totalReceive)+" GB",1)]),s[33]||(s[33]=e("i",{class:"bi bi-arrow-down ms-auto h2 text-muted"},null,-1))])])]),e("div",fo,[e("div",go,[e("div",vo,[e("div",null,[e("p",bo,[e("small",null,[d(O,{t:"Total Sent"})])]),e("strong",ho,x(Z.value.totalSent)+" GB",1)]),s[34]||(s[34]=e("i",{class:"bi bi-arrow-up ms-auto h2 text-muted"},null,-1))])])])]),d(tt,{configurationPeers:$.value,configurationInfo:h.value},null,8,["configurationPeers","configurationInfo"]),s[36]||(s[36]=e("hr",null,null,-1)),e("div",_o,[$.value.length>0?(r(),C(kt,{key:0,onSearch:s[4]||(s[4]=c=>w.value=!0),onJobsAll:s[5]||(s[5]=c=>a.value.peerScheduleJobsAll.modalOpen=!0),onJobLogs:s[6]||(s[6]=c=>a.value.peerScheduleJobsLogs.modalOpen=!0),onEditConfiguration:s[7]||(s[7]=c=>a.value.editConfiguration.modalOpen=!0),onSelectPeers:s[8]||(s[8]=c=>a.value.selectPeers.modalOpen=!0),onBackupRestore:s[9]||(s[9]=c=>a.value.backupRestore.modalOpen=!0),onDeleteConfiguration:s[10]||(s[10]=c=>a.value.deleteConfiguration.modalOpen=!0),configuration:h.value},null,8,["configuration"])):S("",!0),d(oe,{name:"peerList",tag:"div",class:"row gx-2 gy-2 z-0 position-relative"},{default:J(()=>[(r(!0),v(F,null,ee(le.value,c=>(r(),v("div",{class:L(["col-12",{"col-lg-6 col-xl-4":D(f).Configuration.Server.dashboard_peer_list_display==="grid"}]),key:c.id},[d(bs,{Peer:c,onShare:U=>{a.value.peerShare.modalOpen=!0,b.value=c},onRefresh:s[11]||(s[11]=U=>k()),onJobs:U=>{a.value.peerScheduleJobs.modalOpen=!0,b.value=c},onSetting:U=>{a.value.peerSetting.modalOpen=!0,b.value=c},onQrcode:U=>{b.value=c,a.value.peerQRCode.modalOpen=!0},onConfigurationFile:U=>{b.value=c,a.value.peerConfigurationFile.modalOpen=!0},onAssign:U=>{b.value=c,a.value.assignPeer.modalOpen=!0}},null,8,["Peer","onShare","onJobs","onSetting","onQrcode","onConfigurationFile","onAssign"])],2))),128))]),_:1})]),d(ae,{name:"slideUp"},{default:J(()=>[w.value?(r(),C(D(i),{key:0,onClose:s[12]||(s[12]=c=>w.value=!1)})):S("",!0)]),_:1}),d(hs,{configurationModals:a.value,configurationModalSelectedPeer:b.value,onRefresh:s[13]||(s[13]=c=>k())},null,8,["configurationModals","configurationModalSelectedPeer"]),d(oe,{name:"zoom"},{default:J(()=>[(r(),C($e,{key:"PeerAddModal"},{default:J(()=>[a.value.peerNew.modalOpen?(r(),C(D(n),{key:0,onClose:s[14]||(s[14]=c=>a.value.peerNew.modalOpen=!1),onAddedPeers:s[15]||(s[15]=c=>{a.value.peerNew.modalOpen=!1,k()})})):S("",!0)]),_:1})),a.value.peerScheduleJobsAll.modalOpen?(r(),C(D(P),{key:"PeerJobsAllModal",onRefresh:s[16]||(s[16]=c=>k()),onAllLogs:s[17]||(s[17]=c=>a.value.peerScheduleJobsLogs.modalOpen=!0),onClose:s[18]||(s[18]=c=>a.value.peerScheduleJobsAll.modalOpen=!1),configurationPeers:$.value},null,8,["configurationPeers"])):S("",!0),a.value.peerScheduleJobsLogs.modalOpen?(r(),C(D(y),{key:"PeerJobsLogsModal",onClose:s[19]||(s[19]=c=>a.value.peerScheduleJobsLogs.modalOpen=!1),configurationInfo:h.value},null,8,["configurationInfo"])):S("",!0),a.value.editConfiguration.modalOpen?(r(),C(D(u),{key:"EditConfigurationModal",onEditRaw:s[20]||(s[20]=c=>a.value.editRawConfigurationFile.modalOpen=!0),onClose:s[21]||(s[21]=c=>a.value.editConfiguration.modalOpen=!1),onDataChanged:s[22]||(s[22]=c=>h.value=c),onRefresh:s[23]||(s[23]=c=>k()),onBackupRestore:s[24]||(s[24]=c=>a.value.backupRestore.modalOpen=!0),onDeleteConfiguration:s[25]||(s[25]=c=>a.value.deleteConfiguration.modalOpen=!0),configurationInfo:h.value},null,8,["configurationInfo"])):S("",!0),a.value.selectPeers.modalOpen?(r(),C(D(m),{key:3,onRefresh:s[26]||(s[26]=c=>k()),configurationPeers:$.value,onClose:s[27]||(s[27]=c=>a.value.selectPeers.modalOpen=!1)},null,8,["configurationPeers"])):S("",!0)]),_:1}),d(ys,{showPeersCount:X.value,peerListLength:le.value.length,onLoadMore:s[28]||(s[28]=c=>X.value+=yo)},null,8,["showPeersCount","peerListLength"])]))}},ko=Y(Po,[["__scopeId","data-v-d696f4ea"]]);export{ko as default};