mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2025-04-19 08:55:12 +00:00
2 lines
8.1 KiB
JavaScript
2 lines
8.1 KiB
JavaScript
|
import{r as C,o as D,a as o,c as l,b as e,d as s,e as g,f as m,t as v,_ as k,W as L,D as $,g as H,G as N,w as c,F as y,h as w,n as S,i as _,T as M,j as b,k as A,l as G,S as T}from"./index-CP9pHThw.js";import{L as h}from"./localeText-DgEvbt12.js";import{M as V}from"./message-Yb5Da6zq.js";import"./dayjs.min-BfBaVRGN.js";const U={class:"peerSettingContainer w-100 h-100 position-absolute top-0 start-0 overflow-y-scroll"},W={class:"container d-flex h-100 w-100"},B={class:"m-auto modal-dialog-centered dashboardModal"},O={class:"card rounded-3 shadow flex-grow-1"},R={class:"card-header bg-transparent d-flex align-items-center gap-2 border-0 p-4 pb-2"},z={class:"mb-0"},F={class:"card-body px-4 pb-4 d-flex flex-column gap-2"},j={class:"card text-decoration-none",target:"_blank",role:"button",href:"https://discord.com/invite/ZkJSPAaQ"},q={class:"card-body d-flex gap-4 align-items-center"},I={class:"d-flex align-items-center"},J={class:"badge rounded-pill text-bg-primary ms-2"},P={key:0,class:"spinner-border spinner-border-sm",style:{width:"0.7rem",height:"0.7rem"}},E={key:1},Q={class:"text-muted"},Z={class:"card text-decoration-none",href:"https://donaldzou.github.io/WGDashboard-Documentation/",target:"_blank"},K={class:"card-body d-flex gap-4 align-items-center"},X={class:"mb-0"},Y={class:"text-muted"},ee={__name:"helpModal",setup(n){const t=C(!0),f=C(void 0);return D(()=>{t.value=!0,fetch("https://discord.com/api/guilds/1276818723637956628/widget.json").then(d=>d.json()).then(d=>{f.value=d,t.value=!1}).catch(()=>{t.value=!1})}),(d,a)=>(o(),l("div",U,[e("div",W,[e("div",B,[e("div",O,[e("div",R,[e("h4",z,[s(h,{t:"Help"})]),e("button",{type:"button",class:"btn-close ms-auto",onClick:a[0]||(a[0]=p=>d.$emit("close"))})]),e("div",F,[e("a",j,[e("div",q,[a[3]||(a[3]=e("h1",{class:"mb-0"},[e("i",{class:"bi bi-discord"})],-1)),e("div",null,[e("div",I,[a[2]||(a[2]=e("h5",{class:"mb-0"}," Discord Server ",-1)),e("span",J,[t.value?(o(),l("span",P)):g("",!0),f.value!==void 0&&!t.value?(o(),l("span",E,[a[1]||(a[1]=e("i",{class:"bi bi-person-fill me-2"},null,-1)),m(v(f.value.presence_count)+" Online ",1)])):g("",!0)])]),e("small",Q,[s(h,{t:"Join our Discord server for quick help or chat about WGDashboard!"})])])])]),e("a",Z,[e("div",K,[a[4]||(a[4]=e("h1",{class:"mb-0"},[e("i",{class:"bi bi-hash"})],-1)),e("div",null,[e("h5",X,[s(h,{t:"Official Documentation"})]),e("small",Y,[s(h,{t:"Official documentation contains User Guides and more..."})])])])])])])])])]))}},te={name:"navbar",components:{HelpModal:ee,LocaleText:h},setup(){const n=L(),t=$();return{wireguardConfigurationsStore:n,dashboardConfigurationStore:t}},data(){return{updateAvailable:!1,updateMessage:"Checking for update...",updateUrl:"",openHelpModal:!1}},computed:{getActiveCrossServer(){if(this.dashboardConfigurationStore.ActiveServerConfiguration)return new URL(this.dashboardConfigurationStore.CrossServerConfiguration.ServerList[this.dashboardConfigurationStore.ActiveServerConfiguration].host)}},mounted(){H("/api/getDashboardUpdate",{},n=>{n.status?(n.data&&(this.updateAvailable=!0,this.updateUrl=n.data),this.updateMessage=n.message):(this.updateMessage=N("Failed to check available update"),console.log(`Failed to get update: ${n.message}`))})}},se=["data-bs-theme"],oe={id:"sidebarMenu",class:"bg-body-tertiary sidebar border h-100 rounded-3 shadow overflow-y-scroll"},ae={class:"sidebar-sticky"},ne={class:"text-white text-center m-0 py-3 mb-3 btn-brand"},ie={key:0,class:"ms-auto"},re={class:"nav flex-column px-2"},le={class:"nav-item"},de={class:"nav-item"},ce={class:"nav-item"},ue={class:"sidebar-heading px-3 mt-4 mb-1 text-muted text-center"},me={class:"nav flex-column px-2"},be={class:"nav-item"},fe={class:"sidebar-heading px-3 mt-4 mb-1 text-muted text-center"},pe={class:"nav flex-column px-2"},ve={class:"nav-item"},he={class:"nav-item"},_e={class:"nav flex-column px-2 mb-3"},ge={class:"nav-item"},xe={class:"nav-item",style:{"font-size":"0.8rem"}},Ce=["href"],Se={class:"nav-link text-muted rounded-3"},ke={key:1,class:"nav-link text-muted rounded-3"};function $e(n,t,f,d,a,p){const i
|