mirror of
https://github.com/WGDashboard/WGDashboard-PRW.git
synced 2026-12-02 01:17:41 +00:00
chore: make the config lowercase and add new routes
This commit is contained in:
@@ -29,7 +29,7 @@ const route = useRoute()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="h-100 bg-body" :data-bs-theme="store.Configuration?.Server.wgdashboard_theme">
|
||||
<div class="h-100 bg-body" :data-bs-theme="store.Configuration?.server?.wgdashboard_theme ?? 'light'">
|
||||
<div style="z-index: 9999; height: 5px" class="position-absolute loadingBar top-0 start-0"></div>
|
||||
<nav class="navbar bg-dark sticky-top" data-bs-theme="dark" v-if="!route.meta.hideTopNav">
|
||||
<div class="container-fluid d-flex text-body align-items-center">
|
||||
|
||||
@@ -8,7 +8,7 @@ import { DashboardConfigurationStore } from "@/stores/DashboardConfigurationStor
|
||||
const dashboardConfigurationStore = DashboardConfigurationStore()
|
||||
const loading = ref(false)
|
||||
const values = reactive({
|
||||
enableClients: dashboardConfigurationStore.Configuration.Clients.enable
|
||||
enableClients: dashboardConfigurationStore.Configuration.clients.enable
|
||||
})
|
||||
|
||||
const toggling = ref(false)
|
||||
@@ -17,7 +17,7 @@ const updateSettings = async (key: string) => {
|
||||
await fetchPost("/api/updateDashboardConfigurationItem", {
|
||||
section: "Clients",
|
||||
key: key,
|
||||
value: dashboardConfigurationStore.Configuration.Clients[key]
|
||||
value: dashboardConfigurationStore.Configuration.clients[key]
|
||||
}, async (res) => {
|
||||
await dashboardConfigurationStore.getConfiguration()
|
||||
toggling.value = false
|
||||
@@ -41,11 +41,11 @@ const updateSettings = async (key: string) => {
|
||||
</h6>
|
||||
<div class="form-check form-switch ms-auto">
|
||||
<label class="form-check-label" for="oidc_switch">
|
||||
<LocaleText :t="dashboardConfigurationStore.Configuration.Clients.enable ? 'Enabled':'Disabled'"></LocaleText>
|
||||
<LocaleText :t="dashboardConfigurationStore.Configuration.clients.enable ? 'Enabled':'Disabled'"></LocaleText>
|
||||
</label>
|
||||
<input
|
||||
:disabled="toggling"
|
||||
v-model="dashboardConfigurationStore.Configuration.Clients.enable"
|
||||
v-model="dashboardConfigurationStore.Configuration.clients.enable"
|
||||
@change="updateSettings('enable')"
|
||||
class="form-check-input" type="checkbox" role="switch" id="oidc_switch">
|
||||
</div>
|
||||
@@ -58,11 +58,11 @@ const updateSettings = async (key: string) => {
|
||||
</h6>
|
||||
<div class="form-check form-switch ms-auto">
|
||||
<label class="form-check-label" for="sign_up_switch">
|
||||
<LocaleText :t="dashboardConfigurationStore.Configuration.Clients.sign_up ? 'Enabled':'Disabled'"></LocaleText>
|
||||
<LocaleText :t="dashboardConfigurationStore.Configuration.clients.sign_up ? 'Enabled':'Disabled'"></LocaleText>
|
||||
</label>
|
||||
<input
|
||||
:disabled="toggling"
|
||||
v-model="dashboardConfigurationStore.Configuration.Clients.sign_up"
|
||||
v-model="dashboardConfigurationStore.Configuration.clients.sign_up"
|
||||
@change="updateSettings('sign_up')"
|
||||
class="form-check-input" type="checkbox" role="switch" id="sign_up_switch">
|
||||
</div>
|
||||
|
||||
+1
-1
@@ -70,7 +70,7 @@ const saveRaw = async () => {
|
||||
:disabled="true"
|
||||
:read-only="saving"
|
||||
v-model="content"
|
||||
:theme="dashboardStore.Configuration.Server.wgdashboard_theme === 'dark' ? 'github-dark':'github'"
|
||||
:theme="dashboardStore.Configuration.server.wgdashboard_theme === 'dark' ? 'github-dark':'github'"
|
||||
:languages="[['ini', path]]"
|
||||
width="100%" height="600px">
|
||||
</CodeEditor>
|
||||
|
||||
@@ -50,7 +50,7 @@ export default {
|
||||
<div
|
||||
style="font-size: 0.8rem; color: #28a745"
|
||||
class="d-flex align-items-center"
|
||||
v-if="dashboardStore.Configuration.Server.wgdashboard_peer_list_display === 'list' && Peer.status === 'running'">
|
||||
v-if="dashboardStore.Configuration.server.wgdashboard_peer_list_display === 'list' && Peer.status === 'running'">
|
||||
<i class="bi bi-box-arrow-in-right me-2"></i>
|
||||
<span>
|
||||
{{ Peer.endpoint }}
|
||||
@@ -84,8 +84,8 @@ export default {
|
||||
{{Peer.name ? Peer.name : GetLocale('Untitled Peer')}}
|
||||
</h6>
|
||||
<div class="d-flex"
|
||||
:class="[dashboardStore.Configuration.Server.wgdashboard_peer_list_display === 'grid' ? 'gap-1 flex-column' : 'flex-row gap-3']">
|
||||
<div :class="{'d-flex gap-2 align-items-center' : dashboardStore.Configuration.Server.wgdashboard_peer_list_display === 'list'}">
|
||||
:class="[dashboardStore.Configuration.server.wgdashboard_peer_list_display === 'grid' ? 'gap-1 flex-column' : 'flex-row gap-3']">
|
||||
<div :class="{'d-flex gap-2 align-items-center' : dashboardStore.Configuration.server.wgdashboard_peer_list_display === 'list'}">
|
||||
<small class="text-muted">
|
||||
<LocaleText t="Public Key"></LocaleText>
|
||||
</small>
|
||||
@@ -93,7 +93,7 @@ export default {
|
||||
<samp>{{Peer.id}}</samp>
|
||||
</small>
|
||||
</div>
|
||||
<div :class="{'d-flex gap-2 align-items-center' : dashboardStore.Configuration.Server.wgdashboard_peer_list_display === 'list'}">
|
||||
<div :class="{'d-flex gap-2 align-items-center' : dashboardStore.Configuration.server.wgdashboard_peer_list_display === 'list'}">
|
||||
<small class="text-muted">
|
||||
<LocaleText t="Allowed IPs"></LocaleText>
|
||||
</small>
|
||||
@@ -102,7 +102,7 @@ export default {
|
||||
</small>
|
||||
</div>
|
||||
<div class="d-flex align-items-center gap-1"
|
||||
:class="{'ms-auto': dashboardStore.Configuration.Server.wgdashboard_peer_list_display === 'list'}"
|
||||
:class="{'ms-auto': dashboardStore.Configuration.server.wgdashboard_peer_list_display === 'list'}"
|
||||
>
|
||||
<PeerTagBadge :BackgroundColor="group.BackgroundColor" :GroupName="group.GroupName" :Icon="'bi-' + group.Icon"
|
||||
v-for="group in Object.values(ConfigurationInfo.Info.PeerGroups).filter(x => x.Peers.includes(Peer.id))"
|
||||
|
||||
@@ -26,11 +26,11 @@ const peerData = ref({
|
||||
allowed_ips: [],
|
||||
private_key: "",
|
||||
public_key: "",
|
||||
DNS: dashboardStore.Configuration.Peers.peer_global_dns,
|
||||
endpoint_allowed_ip: dashboardStore.Configuration.Peers.peer_endpoint_allowed_ip,
|
||||
DNS: dashboardStore.Configuration.peers.peer_global_dns,
|
||||
endpoint_allowed_ip: dashboardStore.Configuration.peers.peer_endpoint_allowed_ip,
|
||||
notes: "",
|
||||
keepalive: parseInt(dashboardStore.Configuration.Peers.peer_keep_alive),
|
||||
mtu: parseInt(dashboardStore.Configuration.Peers.peer_mtu),
|
||||
keepalive: parseInt(dashboardStore.Configuration.peers.peer_keep_alive),
|
||||
mtu: parseInt(dashboardStore.Configuration.peers.peer_mtu),
|
||||
preshared_key: "",
|
||||
preshared_key_bulkAdd: false,
|
||||
allowed_ips_validation: true,
|
||||
|
||||
@@ -31,10 +31,10 @@ export default {
|
||||
allowed_ips: [],
|
||||
private_key: "",
|
||||
public_key: "",
|
||||
DNS: this.dashboardStore.Configuration.Peers.peer_global_dns,
|
||||
endpoint_allowed_ip: this.dashboardStore.Configuration.Peers.peer_endpoint_allowed_ip,
|
||||
keepalive: parseInt(this.dashboardStore.Configuration.Peers.peer_keep_alive),
|
||||
mtu: parseInt(this.dashboardStore.Configuration.Peers.peer_mtu),
|
||||
DNS: this.dashboardStore.Configuration.peers.peer_global_dns,
|
||||
endpoint_allowed_ip: this.dashboardStore.Configuration.peers.peer_endpoint_allowed_ip,
|
||||
keepalive: parseInt(this.dashboardStore.Configuration.peers.peer_keep_alive),
|
||||
mtu: parseInt(this.dashboardStore.Configuration.peers.peer_mtu),
|
||||
preshared_key: "",
|
||||
preshared_key_bulkAdd: false,
|
||||
},
|
||||
|
||||
@@ -186,7 +186,7 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
'dashboardConfigurationStore.Configuration.Server.wgdashboard_refresh_interval'(){
|
||||
'dashboardConfigurationStore.Configuration.server.wgdashboard_refresh_interval'(){
|
||||
clearInterval(this.dashboardConfigurationStore.Peers.RefreshInterval);
|
||||
this.setPeerInterval();
|
||||
}
|
||||
@@ -282,7 +282,7 @@ export default {
|
||||
setPeerInterval(){
|
||||
this.dashboardConfigurationStore.Peers.RefreshInterval = setInterval(() => {
|
||||
this.getPeers()
|
||||
}, parseInt(this.dashboardConfigurationStore.Configuration.Server.wgdashboard_refresh_interval))
|
||||
}, parseInt(this.dashboardConfigurationStore.Configuration.server.wgdashboard_refresh_interval))
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
@@ -405,14 +405,14 @@ export default {
|
||||
x.allowed_ip.includes(this.wireguardConfigurationStore.searchString)
|
||||
}) : this.configurationPeers;
|
||||
|
||||
if (this.dashboardConfigurationStore.Configuration.Server.wgdashboard_sort === "restricted"){
|
||||
if (this.dashboardConfigurationStore.Configuration.server.wgdashboard_sort === "restricted"){
|
||||
return result.sort((a, b) => {
|
||||
if ( a[this.dashboardConfigurationStore.Configuration.Server.wgdashboard_sort]
|
||||
< b[this.dashboardConfigurationStore.Configuration.Server.wgdashboard_sort] ){
|
||||
if ( a[this.dashboardConfigurationStore.Configuration.server.wgdashboard_sort]
|
||||
< b[this.dashboardConfigurationStore.Configuration.server.wgdashboard_sort] ){
|
||||
return 1;
|
||||
}
|
||||
if ( a[this.dashboardConfigurationStore.Configuration.Server.wgdashboard_sort]
|
||||
> b[this.dashboardConfigurationStore.Configuration.Server.wgdashboard_sort]){
|
||||
if ( a[this.dashboardConfigurationStore.Configuration.server.wgdashboard_sort]
|
||||
> b[this.dashboardConfigurationStore.Configuration.server.wgdashboard_sort]){
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
@@ -420,12 +420,12 @@ export default {
|
||||
}
|
||||
|
||||
return result.sort((a, b) => {
|
||||
if ( a[this.dashboardConfigurationStore.Configuration.Server.wgdashboard_sort]
|
||||
< b[this.dashboardConfigurationStore.Configuration.Server.wgdashboard_sort] ){
|
||||
if ( a[this.dashboardConfigurationStore.Configuration.server.wgdashboard_sort]
|
||||
< b[this.dashboardConfigurationStore.Configuration.server.wgdashboard_sort] ){
|
||||
return -1;
|
||||
}
|
||||
if ( a[this.dashboardConfigurationStore.Configuration.Server.wgdashboard_sort]
|
||||
> b[this.dashboardConfigurationStore.Configuration.Server.wgdashboard_sort]){
|
||||
if ( a[this.dashboardConfigurationStore.Configuration.server.wgdashboard_sort]
|
||||
> b[this.dashboardConfigurationStore.Configuration.server.wgdashboard_sort]){
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
|
||||
@@ -108,7 +108,7 @@ const setFetchPeerListInterval = () => {
|
||||
clearInterval(fetchPeerListInterval.value)
|
||||
fetchPeerListInterval.value = setInterval(async () => {
|
||||
await fetchPeerList()
|
||||
}, parseInt(dashboardStore.Configuration.Server.wgdashboard_refresh_interval))
|
||||
}, parseInt(dashboardStore.Configuration.server.wgdashboard_refresh_interval))
|
||||
}
|
||||
setFetchPeerListInterval()
|
||||
onBeforeUnmount(() => {
|
||||
@@ -118,7 +118,7 @@ onBeforeUnmount(() => {
|
||||
})
|
||||
|
||||
watch(() => {
|
||||
return dashboardStore.Configuration.Server.wgdashboard_refresh_interval
|
||||
return dashboardStore.Configuration.server.wgdashboard_refresh_interval
|
||||
}, () => {
|
||||
setFetchPeerListInterval()
|
||||
})
|
||||
@@ -191,14 +191,14 @@ const searchPeers = computed(() => {
|
||||
wireguardConfigurationStore.Filter.ShowAllPeersWhenHiddenTags || (!wireguardConfigurationStore.Filter.ShowAllPeersWhenHiddenTags && taggedPeers.value.includes(x.id))
|
||||
));
|
||||
|
||||
if (dashboardStore.Configuration.Server.wgdashboard_sort === "restricted"){
|
||||
if (dashboardStore.Configuration.server.wgdashboard_sort === "restricted"){
|
||||
return result.sort((a, b) => {
|
||||
if ( a[dashboardStore.Configuration.Server.wgdashboard_sort]
|
||||
< b[dashboardStore.Configuration.Server.wgdashboard_sort] ){
|
||||
if ( a[dashboardStore.Configuration.server.wgdashboard_sort]
|
||||
< b[dashboardStore.Configuration.server.wgdashboard_sort] ){
|
||||
return 1;
|
||||
}
|
||||
if ( a[dashboardStore.Configuration.Server.wgdashboard_sort]
|
||||
> b[dashboardStore.Configuration.Server.wgdashboard_sort]){
|
||||
if ( a[dashboardStore.Configuration.server.wgdashboard_sort]
|
||||
> b[dashboardStore.Configuration.server.wgdashboard_sort]){
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
@@ -207,26 +207,26 @@ const searchPeers = computed(() => {
|
||||
|
||||
let re = []
|
||||
|
||||
if (dashboardStore.Configuration.Server.wgdashboard_sort === 'allowed_ip'){
|
||||
if (dashboardStore.Configuration.server.wgdashboard_sort === 'allowed_ip'){
|
||||
re = result.sort((a, b) => {
|
||||
if ( firstAllowedIPCount(a[dashboardStore.Configuration.Server.wgdashboard_sort])
|
||||
< firstAllowedIPCount(b[dashboardStore.Configuration.Server.wgdashboard_sort]) ){
|
||||
if ( firstAllowedIPCount(a[dashboardStore.Configuration.server.wgdashboard_sort])
|
||||
< firstAllowedIPCount(b[dashboardStore.Configuration.server.wgdashboard_sort]) ){
|
||||
return -1;
|
||||
}
|
||||
if ( firstAllowedIPCount(a[dashboardStore.Configuration.Server.wgdashboard_sort])
|
||||
> firstAllowedIPCount(b[dashboardStore.Configuration.Server.wgdashboard_sort])){
|
||||
if ( firstAllowedIPCount(a[dashboardStore.Configuration.server.wgdashboard_sort])
|
||||
> firstAllowedIPCount(b[dashboardStore.Configuration.server.wgdashboard_sort])){
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}).slice(0, showPeersCount.value)
|
||||
}else{
|
||||
re = result.sort((a, b) => {
|
||||
if ( a[dashboardStore.Configuration.Server.wgdashboard_sort]
|
||||
< b[dashboardStore.Configuration.Server.wgdashboard_sort] ){
|
||||
if ( a[dashboardStore.Configuration.server.wgdashboard_sort]
|
||||
< b[dashboardStore.Configuration.server.wgdashboard_sort] ){
|
||||
return -1;
|
||||
}
|
||||
if ( a[dashboardStore.Configuration.Server.wgdashboard_sort]
|
||||
> b[dashboardStore.Configuration.Server.wgdashboard_sort]){
|
||||
if ( a[dashboardStore.Configuration.server.wgdashboard_sort]
|
||||
> b[dashboardStore.Configuration.server.wgdashboard_sort]){
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
@@ -411,7 +411,7 @@ watch(() => route.query.id, (newValue) => {
|
||||
</PeerSearch>
|
||||
<TransitionGroup name="peerList" tag="div" class="row gx-2 gy-2 z-0 position-relative">
|
||||
<div class="col-12"
|
||||
:class="{'col-lg-6 col-xl-4': dashboardStore.Configuration.Server.wgdashboard_peer_list_display === 'grid'}"
|
||||
:class="{'col-lg-6 col-xl-4': dashboardStore.Configuration.server.wgdashboard_peer_list_display === 'grid'}"
|
||||
:key="peer.id"
|
||||
v-for="(peer, order) in searchPeers">
|
||||
<Peer :Peer="peer"
|
||||
|
||||
+2
-2
@@ -80,7 +80,7 @@ const toggleFetchRealtimeTraffic = () => {
|
||||
if (props.configurationInfo.Status){
|
||||
fetchRealtimeTrafficInterval.value = setInterval(() => {
|
||||
fetchRealtimeTraffic()
|
||||
}, parseInt(dashboardStore.Configuration.Server.wgdashboard_refresh_interval))
|
||||
}, parseInt(dashboardStore.Configuration.server.wgdashboard_refresh_interval))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ watch(() => props.configurationInfo.Status, () => {
|
||||
toggleFetchRealtimeTraffic()
|
||||
})
|
||||
|
||||
watch(() => dashboardStore.Configuration.Server.wgdashboard_refresh_interval, () => {
|
||||
watch(() => dashboardStore.Configuration.server.wgdashboard_refresh_interval, () => {
|
||||
toggleFetchRealtimeTraffic()
|
||||
})
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ export default {
|
||||
],
|
||||
defaultContainer: "amnezia-awg",
|
||||
description: this.selectedPeer.name,
|
||||
hostName: this.dashboardStore.Configuration.Peers.remote_endpoint
|
||||
hostName: this.dashboardStore.Configuration.peers.remote_endpoint
|
||||
}
|
||||
QRCode.toCanvas(
|
||||
document.querySelector("#awg_vpn_qrcode"), btoa(JSON.stringify(awgQRCodeObject)), (error) => {
|
||||
|
||||
+1
-1
@@ -151,7 +151,7 @@ export default {
|
||||
:clearable="false"
|
||||
:disabled="!edit"
|
||||
v-if="this.job.Field === 'date'"
|
||||
:dark="this.store.Configuration.Server.wgdashboard_theme === 'dark'"
|
||||
:dark="this.store.Configuration.server.wgdashboard_theme === 'dark'"
|
||||
/>
|
||||
|
||||
<input class="form-control form-control-sm form-control-dark rounded-3 flex-grow-1"
|
||||
|
||||
@@ -98,7 +98,7 @@ export default {
|
||||
class="btn w-100 btn-sm text-primary-emphasis bg-primary-subtle rounded-3 border-1 border-primary-subtle position-relative">
|
||||
<i class="bi bi-sort-up me-2"></i>
|
||||
<LocaleText t="Sort By"></LocaleText>
|
||||
<span class="badge text-bg-primary ms-2">{{this.sort[store.Configuration.Server.wgdashboard_sort]}}</span>
|
||||
<span class="badge text-bg-primary ms-2">{{this.sort[store.Configuration.server.wgdashboard_sort]}}</span>
|
||||
</button>
|
||||
<ul class="dropdown-menu rounded-3">
|
||||
<li v-for="(value, key) in this.sort" >
|
||||
@@ -108,7 +108,7 @@ export default {
|
||||
</small>
|
||||
<small class="ms-auto">
|
||||
<i class="bi bi-check-circle-fill"
|
||||
v-if="store.Configuration.Server.wgdashboard_sort === key"></i>
|
||||
v-if="store.Configuration.server.wgdashboard_sort === key"></i>
|
||||
</small>
|
||||
</button>
|
||||
</li>
|
||||
@@ -120,7 +120,7 @@ export default {
|
||||
class="btn btn-sm w-100 text-primary-emphasis bg-primary-subtle rounded-3 border-1 border-primary-subtle position-relative">
|
||||
<i class="bi bi-arrow-repeat me-2"></i>
|
||||
<LocaleText t="Refresh Interval"></LocaleText>
|
||||
<span class="badge text-bg-primary ms-2">{{this.interval[store.Configuration.Server.wgdashboard_refresh_interval]}}</span>
|
||||
<span class="badge text-bg-primary ms-2">{{this.interval[store.Configuration.server.wgdashboard_refresh_interval]}}</span>
|
||||
</button>
|
||||
<ul class="dropdown-menu rounded-3">
|
||||
<li v-for="(value, key) in this.interval" >
|
||||
@@ -130,7 +130,7 @@ export default {
|
||||
</small>
|
||||
<small class="ms-auto">
|
||||
<i class="bi bi-check-circle-fill"
|
||||
v-if="store.Configuration.Server.wgdashboard_refresh_interval === key"></i>
|
||||
v-if="store.Configuration.server.wgdashboard_refresh_interval === key"></i>
|
||||
</small>
|
||||
</button>
|
||||
</li>
|
||||
@@ -140,9 +140,9 @@ export default {
|
||||
<button
|
||||
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">
|
||||
<i class="bi me-2" :class="'bi-' + store.Configuration.Server.wgdashboard_peer_list_display"></i>
|
||||
<i class="bi me-2" :class="'bi-' + store.Configuration.server.wgdashboard_peer_list_display"></i>
|
||||
<LocaleText t="Display"></LocaleText>
|
||||
<span class="badge text-bg-primary ms-2">{{this.display[store.Configuration.Server.wgdashboard_peer_list_display]}}</span>
|
||||
<span class="badge text-bg-primary ms-2">{{this.display[store.Configuration.server.wgdashboard_peer_list_display]}}</span>
|
||||
</button>
|
||||
<ul class="dropdown-menu rounded-3">
|
||||
<li v-for="(value, key) in this.display" >
|
||||
@@ -152,7 +152,7 @@ export default {
|
||||
</small>
|
||||
<small class="ms-auto">
|
||||
<i class="bi bi-check-circle-fill"
|
||||
v-if="store.Configuration.Server.wgdashboard_peer_list_display === key"></i>
|
||||
v-if="store.Configuration.server.wgdashboard_peer_list_display === key"></i>
|
||||
</small>
|
||||
</button>
|
||||
</li>
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ await fetchGet("/api/email/ready", {}, (res) => {
|
||||
const store = DashboardConfigurationStore()
|
||||
const email = reactive({
|
||||
Receiver: "",
|
||||
Body: store.Configuration.Email.email_template,
|
||||
Body: store.Configuration.email.email_template,
|
||||
Subject: "",
|
||||
IncludeAttachment: false,
|
||||
ConfigurationName: props.selectedPeer.configuration.Name,
|
||||
|
||||
@@ -155,7 +155,7 @@ export default {
|
||||
format="yyyy-MM-dd HH:mm:ss"
|
||||
preview-format="yyyy-MM-dd HH:mm:ss"
|
||||
|
||||
:dark="this.store.Configuration.Server.wgdashboard_theme === 'dark'"
|
||||
:dark="this.store.Configuration.server.wgdashboard_theme === 'dark'"
|
||||
/>
|
||||
</div>
|
||||
<div class="d-flex gap-2 flex-column flex-sm-row">
|
||||
|
||||
@@ -27,7 +27,7 @@ export default {
|
||||
computed: {
|
||||
getActiveCrossServer(){
|
||||
if (this.dashboardConfigurationStore.ActiveServerConfiguration){
|
||||
return new URL(this.dashboardConfigurationStore.CrossServerConfiguration.ServerList
|
||||
return new URL(this.dashboardConfigurationStore.CrossServerConfiguration.serverList
|
||||
[this.dashboardConfigurationStore.ActiveServerConfiguration].host)
|
||||
}
|
||||
return undefined
|
||||
@@ -57,7 +57,7 @@ export default {
|
||||
<template>
|
||||
<div class="col-md-3 col-lg-2 d-md-block p-2 navbar-container bg-transparent"
|
||||
:class="{active: this.dashboardConfigurationStore.ShowNavBar}"
|
||||
:data-bs-theme="dashboardConfigurationStore.Configuration.Server.wgdashboard_theme"
|
||||
:data-bs-theme="dashboardConfigurationStore.Configuration.server.wgdashboard_theme"
|
||||
>
|
||||
<nav id="sidebarMenu" class=" bg-body-tertiary sidebar border h-100 rounded-3 shadow overflow-y-scroll" >
|
||||
<div class="sidebar-sticky ">
|
||||
@@ -152,12 +152,12 @@ export default {
|
||||
<a :href="this.updateUrl" v-if="this.updateAvailable" class="text-decoration-none rounded-3" target="_blank">
|
||||
<small class="nav-link text-muted rounded-3" >
|
||||
<LocaleText :t="this.updateMessage"></LocaleText>
|
||||
(<LocaleText t="Current Version:"></LocaleText> {{ dashboardConfigurationStore.Configuration.Server.version }})
|
||||
(<LocaleText t="Current Version:"></LocaleText> {{ dashboardConfigurationStore.Configuration.server.version }})
|
||||
</small>
|
||||
</a>
|
||||
<small class="nav-link text-muted rounded-3" v-else>
|
||||
<LocaleText :t="this.updateMessage"></LocaleText>
|
||||
({{ dashboardConfigurationStore.Configuration.Server.version }})
|
||||
({{ dashboardConfigurationStore.Configuration.server.version }})
|
||||
</small>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -112,7 +112,7 @@ const uploadReady = computed(() => {
|
||||
:read-only="true"
|
||||
:display-language="true"
|
||||
v-model="uploadFiles[t].content"
|
||||
:theme="dashboardStore.Configuration.Server.wgdashboard_theme === 'dark' ? 'github-dark':'github'"
|
||||
:theme="dashboardStore.Configuration.server.wgdashboard_theme === 'dark' ? 'github-dark':'github'"
|
||||
:languages="[[t, uploadFiles[t].filename]]"
|
||||
width="100%" height="500px">
|
||||
</CodeEditor>
|
||||
|
||||
@@ -42,7 +42,7 @@ export default {
|
||||
if (res.status){
|
||||
this.isValid = true;
|
||||
this.showInvalidFeedback = false;
|
||||
this.store.Configuration.Account[this.targetData] = this.value
|
||||
this.store.Configuration.account[this.targetData] = this.value
|
||||
clearTimeout(this.timeout)
|
||||
this.timeout = setTimeout(() => {
|
||||
this.isValid = false;
|
||||
|
||||
@@ -28,7 +28,7 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.value = this.store.Configuration.Account[this.targetData];
|
||||
this.value = this.store.Configuration.account[this.targetData];
|
||||
},
|
||||
methods:{
|
||||
async useValidation(e){
|
||||
@@ -43,7 +43,7 @@ export default {
|
||||
if (res.status){
|
||||
this.isValid = true;
|
||||
this.showInvalidFeedback = false;
|
||||
this.store.Configuration.Account[this.targetData] = this.value
|
||||
this.store.Configuration.account[this.targetData] = this.value
|
||||
clearTimeout(this.timeout)
|
||||
this.timeout = setTimeout(() => this.isValid = false, 5000);
|
||||
}else{
|
||||
|
||||
@@ -18,7 +18,7 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.status = this.store.Configuration.Account["enable_totp"]
|
||||
this.status = this.store.Configuration.account["enable_totp"]
|
||||
},
|
||||
methods: {
|
||||
async resetMFA(){
|
||||
@@ -59,7 +59,7 @@ export default {
|
||||
<button class="btn bg-warning-subtle text-warning-emphasis border-1 border-warning-subtle ms-auto rounded-3 shadow-sm"
|
||||
v-if="this.status" @click="this.resetMFA()">
|
||||
<i class="bi bi-shield-lock-fill me-2"></i>
|
||||
<LocaleText t="Reset" v-if='this.store.Configuration.Account["totp_verified"]'></LocaleText>
|
||||
<LocaleText t="Reset" v-if='this.store.Configuration.account["totp_verified"]'></LocaleText>
|
||||
<LocaleText t="Setup" v-else></LocaleText>
|
||||
MFA
|
||||
</button>
|
||||
|
||||
@@ -15,7 +15,7 @@ export default {
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
value: this.store.Configuration.Server.wgdashboard_apikey,
|
||||
value: this.store.Configuration.server.wgdashboard_apikey,
|
||||
apiKeys: [],
|
||||
newDashboardAPIKey: false
|
||||
}
|
||||
@@ -28,11 +28,11 @@ export default {
|
||||
value: this.value
|
||||
}, (res) => {
|
||||
if (res.status){
|
||||
this.store.Configuration.Peers[this.targetData] = this.value;
|
||||
this.store.Configuration.peers[this.targetData] = this.value;
|
||||
this.store.newMessage("Server",
|
||||
`API Keys function is successfully ${this.value ? 'enabled':'disabled'}`, "success")
|
||||
}else{
|
||||
this.value = this.store.Configuration.Peers[this.targetData];
|
||||
this.value = this.store.Configuration.peers[this.targetData];
|
||||
this.store.newMessage("Server",
|
||||
`API Keys function is failed to ${this.value ? 'enabled':'disabled'}`, "danger")
|
||||
}
|
||||
|
||||
+1
-1
@@ -79,7 +79,7 @@ export default {
|
||||
preview-format="yyyy-MM-dd HH:mm:ss"
|
||||
:clearable="false"
|
||||
:disabled="this.newKeyData.NeverExpire || this.submitting"
|
||||
:dark="this.store.Configuration.Server.wgdashboard_theme === 'dark'"
|
||||
:dark="this.store.Configuration.server.wgdashboard_theme === 'dark'"
|
||||
/>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
|
||||
@@ -13,7 +13,7 @@ onMounted(() => {
|
||||
await fetchPost("/api/updateDashboardConfigurationItem", {
|
||||
section: "Email",
|
||||
key: id,
|
||||
value: store.Configuration.Email[id]
|
||||
value: store.Configuration.email[id]
|
||||
}, (res) => {
|
||||
if (res.status){
|
||||
x.classList.remove('is-invalid')
|
||||
@@ -74,7 +74,7 @@ const sendTestEmail = async () => {
|
||||
<div class="col-12">
|
||||
<div class="form-check mb-2 form-switch">
|
||||
<input class="form-check-input" type="checkbox" role="switch"
|
||||
v-model="store.Configuration.Email.authentication_required"
|
||||
v-model="store.Configuration.email.authentication_required"
|
||||
id="authentication_required">
|
||||
<label class="form-check-label" for="authentication_required">
|
||||
<LocaleText t="Require SMTP Authentication"></LocaleText>
|
||||
@@ -89,7 +89,7 @@ const sendTestEmail = async () => {
|
||||
</small></strong>
|
||||
</label>
|
||||
<input id="server"
|
||||
v-model="store.Configuration.Email.server"
|
||||
v-model="store.Configuration.email.server"
|
||||
type="text" class="form-control rounded-3">
|
||||
</div>
|
||||
</div>
|
||||
@@ -101,7 +101,7 @@ const sendTestEmail = async () => {
|
||||
</small></strong>
|
||||
</label>
|
||||
<input id="port"
|
||||
v-model="store.Configuration.Email.port"
|
||||
v-model="store.Configuration.email.port"
|
||||
type="text" class="form-control rounded-3">
|
||||
</div>
|
||||
</div>
|
||||
@@ -113,7 +113,7 @@ const sendTestEmail = async () => {
|
||||
</small></strong>
|
||||
</label>
|
||||
<select class="form-select rounded-3"
|
||||
v-model="store.Configuration.Email.encryption"
|
||||
v-model="store.Configuration.email.encryption"
|
||||
id="encryption">
|
||||
<option value="IMPLICITTLS">
|
||||
IMPLICIT TLS
|
||||
@@ -127,7 +127,7 @@ const sendTestEmail = async () => {
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 col-lg-4" v-if="store.Configuration.Email.authentication_required">
|
||||
<div class="col-12 col-lg-4" v-if="store.Configuration.email.authentication_required">
|
||||
<div class="form-group">
|
||||
<label for="username" class="text-muted mb-1">
|
||||
<strong><small>
|
||||
@@ -135,11 +135,11 @@ const sendTestEmail = async () => {
|
||||
</small></strong>
|
||||
</label>
|
||||
<input id="username"
|
||||
v-model="store.Configuration.Email.username"
|
||||
v-model="store.Configuration.email.username"
|
||||
type="text" class="form-control rounded-3">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 col-lg-4" v-if="store.Configuration.Email.authentication_required">
|
||||
<div class="col-12 col-lg-4" v-if="store.Configuration.email.authentication_required">
|
||||
<div class="form-group">
|
||||
<label for="email_password" class="text-muted mb-1">
|
||||
<strong><small>
|
||||
@@ -147,7 +147,7 @@ const sendTestEmail = async () => {
|
||||
</small></strong>
|
||||
</label>
|
||||
<input id="email_password"
|
||||
v-model="store.Configuration.Email.email_password"
|
||||
v-model="store.Configuration.email.email_password"
|
||||
type="password" class="form-control rounded-3">
|
||||
</div>
|
||||
</div>
|
||||
@@ -160,7 +160,7 @@ const sendTestEmail = async () => {
|
||||
</small></strong>
|
||||
</label>
|
||||
<input id="send_from"
|
||||
v-model="store.Configuration.Email.send_from"
|
||||
v-model="store.Configuration.email.send_from"
|
||||
type="text" class="form-control rounded-3">
|
||||
</div>
|
||||
</div>
|
||||
@@ -201,7 +201,7 @@ const sendTestEmail = async () => {
|
||||
</small>
|
||||
</label>
|
||||
<textarea class="form-control rounded-3 font-monospace"
|
||||
v-model="store.Configuration.Email.email_template"
|
||||
v-model="store.Configuration.email.email_template"
|
||||
id="email_template"
|
||||
style="min-height: 400px"></textarea>
|
||||
</div>
|
||||
|
||||
@@ -23,8 +23,8 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.ipAddress = this.store.Configuration.Server.app_ip
|
||||
this.port = this.store.Configuration.Server.app_port
|
||||
this.ipAddress = this.store.Configuration.server.app_ip
|
||||
this.port = this.store.Configuration.server.app_port
|
||||
},
|
||||
methods: {
|
||||
async useValidation(e, targetData, value){
|
||||
@@ -38,7 +38,7 @@ export default {
|
||||
if (res.status){
|
||||
e.target.classList.add("is-valid")
|
||||
this.showInvalidFeedback = false;
|
||||
this.store.Configuration.Server[targetData] = value
|
||||
this.store.Configuration.server[targetData] = value
|
||||
clearTimeout(this.timeout)
|
||||
this.timeout = setTimeout(() => {
|
||||
e.target.classList.remove("is-valid")
|
||||
|
||||
@@ -26,7 +26,7 @@ export default {
|
||||
lang_id: lang_id
|
||||
}, (res) => {
|
||||
if (res.status){
|
||||
this.store.Configuration.Server.wgdashboard_language = lang_id;
|
||||
this.store.Configuration.server.wgdashboard_language = lang_id;
|
||||
this.store.Locale = res.data
|
||||
}else{
|
||||
this.store.newMessage("Server", "WGDashboard language update failed", "danger")
|
||||
@@ -36,7 +36,7 @@ export default {
|
||||
},
|
||||
computed:{
|
||||
currentLanguage(){
|
||||
let lang = this.store.Configuration.Server.wgdashboard_language;
|
||||
let lang = this.store.Configuration.server.wgdashboard_language;
|
||||
return this.languages.find(x => x.lang_id === lang)
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -29,8 +29,8 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.app_ip = this.store.Configuration.Server.app_ip;
|
||||
this.app_port = this.store.Configuration.Server.app_port;
|
||||
this.app_ip = this.store.Configuration.server.app_ip;
|
||||
this.app_port = this.store.Configuration.server.app_port;
|
||||
},
|
||||
methods:{
|
||||
async useValidation(){
|
||||
@@ -43,7 +43,7 @@ export default {
|
||||
if (res.status){
|
||||
this.isValid = true;
|
||||
this.showInvalidFeedback = false;
|
||||
this.store.Configuration.Account[this.targetData] = this.value
|
||||
this.store.Configuration.account[this.targetData] = this.value
|
||||
clearTimeout(this.timeout)
|
||||
this.timeout = setTimeout(() => this.isValid = false, 5000);
|
||||
}else{
|
||||
|
||||
+2
-2
@@ -32,7 +32,7 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.value = this.store.Configuration.Server[this.targetData];
|
||||
this.value = this.store.Configuration.server[this.targetData];
|
||||
},
|
||||
methods:{
|
||||
async useValidation(){
|
||||
@@ -46,7 +46,7 @@ export default {
|
||||
if (res.status){
|
||||
this.isValid = true;
|
||||
this.showInvalidFeedback = false;
|
||||
this.store.Configuration.Account[this.targetData] = this.value
|
||||
this.store.Configuration.account[this.targetData] = this.value
|
||||
clearTimeout(this.timeout)
|
||||
this.timeout = setTimeout(() => this.isValid = false, 5000);
|
||||
this.WireguardConfigurationStore.getConfigurations()
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ import {WireguardConfigurationsStore} from "@/stores/WireguardConfigurationsStor
|
||||
import {fetchPost} from "@/utilities/fetch.js";
|
||||
const store = DashboardConfigurationStore()
|
||||
const wireguardConfigurationStore = WireguardConfigurationsStore()
|
||||
const data = ref(store.Configuration.WireGuardConfiguration.autostart)
|
||||
const data = ref(store.Configuration.wireguardconfiguration.autostart)
|
||||
|
||||
const configurations = computed(() => {
|
||||
return wireguardConfigurationStore.Configurations.map(x => x.Name)
|
||||
|
||||
@@ -18,7 +18,7 @@ export default {
|
||||
value: value
|
||||
}, (res) => {
|
||||
if (res.status){
|
||||
this.dashboardConfigurationStore.Configuration.Server.wgdashboard_theme = value;
|
||||
this.dashboardConfigurationStore.Configuration.server.wgdashboard_theme = value;
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -36,13 +36,13 @@ export default {
|
||||
<div class="d-flex gap-1">
|
||||
<button class="btn bg-primary-subtle text-primary-emphasis flex-grow-1"
|
||||
@click="this.switchTheme('light')"
|
||||
:class="{active: this.dashboardConfigurationStore.Configuration.Server.wgdashboard_theme === 'light'}">
|
||||
:class="{active: this.dashboardConfigurationStore.Configuration.server.wgdashboard_theme === 'light'}">
|
||||
<i class="bi bi-sun-fill me-2"></i>
|
||||
<LocaleText t="Light"></LocaleText>
|
||||
</button>
|
||||
<button class="btn bg-primary-subtle text-primary-emphasis flex-grow-1"
|
||||
@click="this.switchTheme('dark')"
|
||||
:class="{active: this.dashboardConfigurationStore.Configuration.Server.wgdashboard_theme === 'dark'}">
|
||||
:class="{active: this.dashboardConfigurationStore.Configuration.server.wgdashboard_theme === 'dark'}">
|
||||
<i class="bi bi-moon-fill me-2"></i>
|
||||
<LocaleText t="Dark"></LocaleText>
|
||||
</button>
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ import {DashboardConfigurationStore} from "@/stores/DashboardConfigurationStore.
|
||||
|
||||
const store = WireguardConfigurationsStore()
|
||||
const dashboardStore = DashboardConfigurationStore()
|
||||
const peerTrackingStatus = ref(dashboardStore.Configuration.WireGuardConfiguration.peer_tracking)
|
||||
const peerTrackingStatus = ref(dashboardStore.Configuration.wireguardconfiguration.peer_tracking)
|
||||
const loaded = ref(false)
|
||||
const trackingData = ref({})
|
||||
onMounted(async () => {
|
||||
|
||||
@@ -29,7 +29,7 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.value = this.store.Configuration.Peers[this.targetData];
|
||||
this.value = this.store.Configuration.peers[this.targetData];
|
||||
},
|
||||
methods:{
|
||||
async useValidation(){
|
||||
@@ -42,7 +42,7 @@ export default {
|
||||
if (res.status){
|
||||
this.isValid = true;
|
||||
this.showInvalidFeedback = false;
|
||||
this.store.Configuration.Peers[this.targetData] = this.value
|
||||
this.store.Configuration.peers[this.targetData] = this.value
|
||||
clearTimeout(this.timeout)
|
||||
this.timeout = setTimeout(() => this.isValid = false, 5000);
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ export default {
|
||||
|
||||
<template>
|
||||
<div class="container-fluid login-container-fluid d-flex main pt-5 overflow-scroll"
|
||||
:data-bs-theme="this.store.Configuration.Server.wgdashboard_theme">
|
||||
:data-bs-theme="this.store.Configuration.server.wgdashboard_theme">
|
||||
<div class="m-auto text-body" style="width: 500px">
|
||||
<div class="d-flex flex-column">
|
||||
<div>
|
||||
|
||||
@@ -28,12 +28,12 @@ export default {
|
||||
</div>
|
||||
<div class="w-100 d-flex gap-3 flex-column p-3 border border-1 border-secondary-subtle rounded-3"
|
||||
style="height: 400px; overflow-y: scroll">
|
||||
<RemoteServer v-for="(server, key) in this.store.CrossServerConfiguration.ServerList"
|
||||
<RemoteServer v-for="(server, key) in this.store.CrossServerConfiguration.serverList"
|
||||
@setActiveServer="this.store.setActiveCrossServer(key)"
|
||||
@delete="this.store.deleteCrossServerConfiguration(key)"
|
||||
:key="key"
|
||||
:server="server"></RemoteServer>
|
||||
<h6 class="text-muted m-auto" v-if="Object.keys(this.store.CrossServerConfiguration.ServerList).length === 0">
|
||||
<h6 class="text-muted m-auto" v-if="Object.keys(this.store.CrossServerConfiguration.serverList).length === 0">
|
||||
<LocaleText t="Click"></LocaleText>
|
||||
<i class="bi bi-plus-circle-fill mx-1"></i>
|
||||
<LocaleText t="to add your server"></LocaleText>
|
||||
|
||||
@@ -41,19 +41,19 @@ export const DashboardConfigurationStore = defineStore('DashboardConfigurationSt
|
||||
window.localStorage.setItem('CrossServerConfiguration', JSON.stringify(this.CrossServerConfiguration))
|
||||
},
|
||||
addCrossServerConfiguration(){
|
||||
this.CrossServerConfiguration.ServerList[v4().toString()] = {
|
||||
this.CrossServerConfiguration.serverList[v4().toString()] = {
|
||||
host: "",
|
||||
apiKey: "",
|
||||
active: false
|
||||
}
|
||||
},
|
||||
deleteCrossServerConfiguration(key){
|
||||
delete this.CrossServerConfiguration.ServerList[key];
|
||||
delete this.CrossServerConfiguration.serverList[key];
|
||||
},
|
||||
getActiveCrossServer(){
|
||||
const key = localStorage.getItem('ActiveCrossServerConfiguration');
|
||||
if (key !== null){
|
||||
return this.CrossServerConfiguration.ServerList[key]
|
||||
return this.CrossServerConfiguration.serverList[key]
|
||||
}
|
||||
return undefined
|
||||
},
|
||||
|
||||
@@ -19,7 +19,7 @@ export default {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="container-fluid flex-grow-1 main" :data-bs-theme="this.dashboardConfigurationStore.Configuration.Server.wgdashboard_theme">
|
||||
<div class="container-fluid flex-grow-1 main" :data-bs-theme="this.dashboardConfigurationStore.Configuration.server.wgdashboard_theme">
|
||||
<div class="row h-100">
|
||||
<Navbar></Navbar>
|
||||
<main class="col-md-9 col-lg-10 overflow-y-scroll mb-0 pt-2">
|
||||
|
||||
@@ -56,7 +56,7 @@ export default {
|
||||
|
||||
<template>
|
||||
<div class="container-fluid login-container-fluid d-flex main pt-5 overflow-scroll"
|
||||
:data-bs-theme="this.store.Configuration.Server.wgdashboard_theme">
|
||||
:data-bs-theme="this.store.Configuration.server.wgdashboard_theme">
|
||||
<div class="m-auto text-body" style="width: 500px">
|
||||
<span class="dashboardLogo display-4">
|
||||
<LocaleText t="Nice to meet you!"></LocaleText>
|
||||
|
||||
Reference in New Issue
Block a user