WGDashboard/src/static/app/dist/assets/index-B2zc8CN2.js

2 lines
8.2 KiB
JavaScript
Raw Normal View History

2025-01-03 13:45:05 +08:00
import{r as C,o as D,a as o,c as d,b as e,d as s,e as g,f as m,t as _,_ as k,W as L,D as y,g as H,G as N,w as r,F as $,h as w,n as S,i as p,T as M,j as b,k as T,l as G,S as A}from"./index-CGY_8-KO.js";import{L as h}from"./localeText-FmUupiXC.js";import{M as V}from"./message-B1XjdL-d.js";import"./dayjs.min-BZb_e7nw.js";const W={class:"peerSettingContainer w-100 h-100 position-absolute top-0 start-0 overflow-y-scroll"},U={class:"container d-flex h-100 w-100"},z={class:"m-auto modal-dialog-centered dashboardModal"},B={class:"card rounded-3 shadow flex-grow-1"},O={class:"card-header bg-transparent d-flex align-items-center gap-2 border-0 p-4 pb-2"},R={class:"mb-0"},j={class:"card-body px-4 pb-4 d-flex flex-column gap-2"},F={class:"card text-decoration-none",target:"_blank",role:"button",href:"https://discord.gg/72TwzjeuWm"},q={class:"card-body d-flex gap-4 align-items-center"},I={class:"d-flex align-items-center"},E={class:"badge rounded-pill text-bg-primary ms-2"},J={key:0,class:"spinner-border spinner-border-sm",style:{width:"0.7rem",height:"0.7rem"}},P={key:1},K={class:"text-muted"},Q={class:"card text-decoration-none",href:"https://donaldzou.github.io/WGDashboard-Documentation/",target:"_blank"},X={class:"card-body d-flex gap-4 align-items-center"},Y={class:"mb-0"},Z={class:"text-muted"},ee={__name:"helpModal",setup(i){const t=C(!0),f=C(void 0);return D(()=>{t.value=!0,fetch("https://discord.com/api/guilds/1276818723637956628/widget.json").then(c=>c.json()).then(c=>{f.value=c,t.value=!1}).catch(()=>{t.value=!1})}),(c,a)=>(o(),d("div",W,[e("div",U,[e("div",z,[e("div",B,[e("div",O,[e("h4",R,[s(h,{t:"Help"})]),e("button",{type:"button",class:"btn-close ms-auto",onClick:a[0]||(a[0]=v=>c.$emit("close"))})]),e("div",j,[e("a",F,[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",E,[t.value?(o(),d("span",J)):g("",!0),f.value!==void 0&&!t.value?(o(),d("span",P,[a[1]||(a[1]=e("i",{class:"bi bi-person-fill me-2"},null,-1)),m(_(f.value.presence_count)+" Online ",1)])):g("",!0)])]),e("small",K,[s(h,{t:"Join our Discord server for quick help or chat about WGDashboard!"})])])])]),e("a",Q,[e("div",X,[a[4]||(a[4]=e("h1",{class:"mb-0"},[e("i",{class:"bi bi-hash"})],-1)),e("div",null,[e("h5",Y,[s(h,{t:"Official Documentation"})]),e("small",Z,[s(h,{t:"Official documentation contains User Guides and more..."})])])])])])])])])]))}},te={name:"navbar",components:{HelpModal:ee,LocaleText:h},setup(){const i=L(),t=y();return{wireguardConfigurationsStore:i,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",{},i=>{i.status?(i.data&&(this.updateAvailable=!0,this.updateUrl=i.data),this.updateMessage=i.message):(this.updateMessage=N("Failed to check available update"),console.log(`Failed to get update: ${i.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"},le={class:"nav flex-column px-2"},re={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"},ve={class:"nav flex-column px-2"},_e={class:"nav-item"},he={class:"nav-item"},pe={class:"nav-item"},ge={class:"nav flex-column px-2 mb-3"},xe={class:"nav-item"},Ce={class:"nav-item",style:{"font-size":"0.8rem"}},Se=["href"],ke={class:"nav-link text-muted rounded-3"},ye={key:1,class:"nav-link text-muted rounded-3"};function $e(i,t,