mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2024-11-22 07:10:09 +01:00
Finished translating most of the UI. Left with notifications
This commit is contained in:
parent
17a9fe5024
commit
94bf1c2484
@ -1983,7 +1983,10 @@ def API_ping_getAllPeersIpAddress():
|
|||||||
allowed_ip = p.allowed_ip.replace(" ", "").split(",")
|
allowed_ip = p.allowed_ip.replace(" ", "").split(",")
|
||||||
parsed = []
|
parsed = []
|
||||||
for x in allowed_ip:
|
for x in allowed_ip:
|
||||||
ip = ipaddress.ip_network(x, strict=False)
|
try:
|
||||||
|
ip = ipaddress.ip_network(x, strict=False)
|
||||||
|
except ValueError as e:
|
||||||
|
print(f"{p.id} - {c.Name}")
|
||||||
if len(list(ip.hosts())) == 1:
|
if len(list(ip.hosts())) == 1:
|
||||||
parsed.append(str(ip.hosts()[0]))
|
parsed.append(str(ip.hosts()[0]))
|
||||||
endpoint = p.endpoint.replace(" ", "").replace("(none)", "")
|
endpoint = p.endpoint.replace(" ", "").replace("(none)", "")
|
||||||
@ -2073,7 +2076,7 @@ def API_getDashboardUpdate():
|
|||||||
htmlUrl = data.get('html_url')
|
htmlUrl = data.get('html_url')
|
||||||
if tagName is not None and htmlUrl is not None:
|
if tagName is not None and htmlUrl is not None:
|
||||||
if tagName != DASHBOARD_VERSION:
|
if tagName != DASHBOARD_VERSION:
|
||||||
return ResponseObject(message=f"{tagName} is now avaible for update!", data=htmlUrl)
|
return ResponseObject(message=f"{tagName} is now available for update!", data=htmlUrl)
|
||||||
else:
|
else:
|
||||||
return ResponseObject(message="You're on the latest version")
|
return ResponseObject(message="You're on the latest version")
|
||||||
return ResponseObject(False)
|
return ResponseObject(False)
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "app",
|
"name": "app",
|
||||||
"version": "4.0.2",
|
"version": "4.1.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@ -2,9 +2,12 @@
|
|||||||
import {fetchGet} from "@/utilities/fetch.js";
|
import {fetchGet} from "@/utilities/fetch.js";
|
||||||
import {WireguardConfigurationsStore} from "@/stores/WireguardConfigurationsStore.js";
|
import {WireguardConfigurationsStore} from "@/stores/WireguardConfigurationsStore.js";
|
||||||
import {DashboardConfigurationStore} from "@/stores/DashboardConfigurationStore.js";
|
import {DashboardConfigurationStore} from "@/stores/DashboardConfigurationStore.js";
|
||||||
|
import LocaleText from "@/components/text/localeText.vue";
|
||||||
|
import {GetLocale} from "@/utilities/locale.js";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "allowedIPsInput",
|
name: "allowedIPsInput",
|
||||||
|
components: {LocaleText},
|
||||||
props: {
|
props: {
|
||||||
data: Object,
|
data: Object,
|
||||||
saving: Boolean,
|
saving: Boolean,
|
||||||
@ -30,6 +33,9 @@ export default {
|
|||||||
this.availableIp.filter(x =>
|
this.availableIp.filter(x =>
|
||||||
x.includes(this.availableIpSearchString) && !this.data.allowed_ips.includes(x)) :
|
x.includes(this.availableIpSearchString) && !this.data.allowed_ips.includes(x)) :
|
||||||
this.availableIp.filter(x => !this.data.allowed_ips.includes(x))
|
this.availableIp.filter(x => !this.data.allowed_ips.includes(x))
|
||||||
|
},
|
||||||
|
inputGetLocale(){
|
||||||
|
return GetLocale("Enter IP Address/CIDR")
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@ -40,7 +46,7 @@ export default {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
this.allowedIpFormatError = true;
|
this.allowedIpFormatError = true;
|
||||||
this.dashboardStore.newMessage('WGDashboard', 'Allowed IP is invalid', 'danger')
|
this.dashboardStore.newMessage('WGDashboard', 'Allowed IPs is invalid', 'danger')
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -63,7 +69,11 @@ export default {
|
|||||||
<template>
|
<template>
|
||||||
<div :class="{inactiveField: this.bulk}">
|
<div :class="{inactiveField: this.bulk}">
|
||||||
<label for="peer_allowed_ip_textbox" class="form-label">
|
<label for="peer_allowed_ip_textbox" class="form-label">
|
||||||
<small class="text-muted">Allowed IPs <code>(Required)</code></small>
|
<small class="text-muted">
|
||||||
|
<LocaleText t="Allowed IPs"></LocaleText>
|
||||||
|
<code>
|
||||||
|
<LocaleText t="(Required)"></LocaleText>
|
||||||
|
</code></small>
|
||||||
</label>
|
</label>
|
||||||
<div class="d-flex gap-2 flex-wrap" :class="{'mb-2': this.data.allowed_ips.length > 0}">
|
<div class="d-flex gap-2 flex-wrap" :class="{'mb-2': this.data.allowed_ips.length > 0}">
|
||||||
<TransitionGroup name="list">
|
<TransitionGroup name="list">
|
||||||
@ -77,7 +87,7 @@ export default {
|
|||||||
<div class="d-flex gap-2 align-items-center">
|
<div class="d-flex gap-2 align-items-center">
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<input type="text" class="form-control form-control-sm rounded-start-3"
|
<input type="text" class="form-control form-control-sm rounded-start-3"
|
||||||
placeholder="Enter IP Address/CIDR"
|
:placeholder="this.inputGetLocale"
|
||||||
:class="{'is-invalid': this.allowedIpFormatError}"
|
:class="{'is-invalid': this.allowedIpFormatError}"
|
||||||
v-model="customAvailableIp"
|
v-model="customAvailableIp"
|
||||||
:disabled="bulk">
|
:disabled="bulk">
|
||||||
@ -88,23 +98,29 @@ export default {
|
|||||||
<i class="bi bi-plus-lg"></i>
|
<i class="bi bi-plus-lg"></i>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<small class="text-muted">or</small>
|
<small class="text-muted">
|
||||||
|
<LocaleText t="or"></LocaleText>
|
||||||
|
</small>
|
||||||
<div class="dropdown flex-grow-1">
|
<div class="dropdown flex-grow-1">
|
||||||
<button class="btn btn-outline-secondary btn-sm dropdown-toggle rounded-3 w-100"
|
<button class="btn btn-outline-secondary btn-sm dropdown-toggle rounded-3 w-100"
|
||||||
:disabled="!availableIp || bulk"
|
:disabled="!availableIp || bulk"
|
||||||
data-bs-auto-close="outside"
|
data-bs-auto-close="outside"
|
||||||
type="button" data-bs-toggle="dropdown" aria-expanded="false">
|
type="button" data-bs-toggle="dropdown" aria-expanded="false">
|
||||||
<i class="bi bi-filter-circle me-2"></i>
|
<i class="bi bi-filter-circle me-2"></i>
|
||||||
Pick Available IP
|
<LocaleText t="Pick Available IP"></LocaleText>
|
||||||
</button>
|
</button>
|
||||||
<ul class="dropdown-menu mt-2 shadow w-100 dropdown-menu-end rounded-3"
|
<ul class="dropdown-menu mt-2 shadow w-100 dropdown-menu-end rounded-3"
|
||||||
v-if="this.availableIp"
|
v-if="this.availableIp"
|
||||||
style="overflow-y: scroll; max-height: 270px; width: 300px !important;">
|
style="overflow-y: scroll; max-height: 270px; width: 300px !important;">
|
||||||
<li>
|
<li>
|
||||||
<div class="px-3 pb-2 pt-1">
|
<div class="px-3 pb-2 pt-1 d-flex gap-3 align-items-center">
|
||||||
<input class="form-control form-control-sm rounded-3"
|
<label for="availableIpSearchString" class="text-muted">
|
||||||
v-model="this.availableIpSearchString"
|
<i class="bi bi-search"></i>
|
||||||
placeholder="Search...">
|
</label>
|
||||||
|
<input
|
||||||
|
id="availableIpSearchString"
|
||||||
|
class="form-control form-control-sm rounded-3"
|
||||||
|
v-model="this.availableIpSearchString">
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li v-for="ip in this.searchAvailableIps" >
|
<li v-for="ip in this.searchAvailableIps" >
|
||||||
@ -113,7 +129,9 @@ export default {
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li v-if="this.searchAvailableIps.length === 0">
|
<li v-if="this.searchAvailableIps.length === 0">
|
||||||
<small class="px-3 text-muted">No available IP containing "{{this.availableIpSearchString}}"</small>
|
<small class="px-3 text-muted">
|
||||||
|
<LocaleText t="No available IP containing"></LocaleText>
|
||||||
|
"{{this.availableIpSearchString}}"</small>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,10 +1,19 @@
|
|||||||
<script>
|
<script>
|
||||||
|
import LocaleText from "@/components/text/localeText.vue";
|
||||||
|
import {GetLocale} from "@/utilities/locale.js";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "bulkAdd",
|
name: "bulkAdd",
|
||||||
|
components: {LocaleText},
|
||||||
props: {
|
props: {
|
||||||
saving: Boolean,
|
saving: Boolean,
|
||||||
data: Object,
|
data: Object,
|
||||||
availableIp: undefined
|
availableIp: undefined
|
||||||
|
},
|
||||||
|
computed:{
|
||||||
|
bulkAddGetLocale(){
|
||||||
|
return GetLocale("How many peers you want to add?")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@ -17,20 +26,22 @@ export default {
|
|||||||
:disabled="!this.availableIp"
|
:disabled="!this.availableIp"
|
||||||
id="bulk_add" v-model="this.data.bulkAdd">
|
id="bulk_add" v-model="this.data.bulkAdd">
|
||||||
<label class="form-check-label me-2" for="bulk_add">
|
<label class="form-check-label me-2" for="bulk_add">
|
||||||
<small><strong>Bulk Add</strong></small>
|
<small><strong>
|
||||||
|
<LocaleText t="Bulk Add"></LocaleText>
|
||||||
|
</strong></small>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<p :class="{'mb-0': !this.data.bulkAdd}"><small class="text-muted d-block">
|
<p :class="{'mb-0': !this.data.bulkAdd}"><small class="text-muted d-block">
|
||||||
By adding peers by bulk, each peer's name will be auto generated, and Allowed IP will be assign to the next available IP.
|
<LocaleText t="By adding peers by bulk, each peer's name will be auto generated, and Allowed IP will be assign to the next available IP."></LocaleText>
|
||||||
</small></p>
|
</small></p>
|
||||||
|
|
||||||
<div class="form-group" v-if="this.data.bulkAdd">
|
<div class="form-group" v-if="this.data.bulkAdd">
|
||||||
<input class="form-control form-control-sm rounded-3 mb-1" type="number" min="1"
|
<input class="form-control form-control-sm rounded-3 mb-1" type="number" min="1"
|
||||||
:max="this.availableIp.length"
|
:max="this.availableIp.length"
|
||||||
v-model="this.data.bulkAddAmount"
|
v-model="this.data.bulkAddAmount"
|
||||||
placeholder="How many peers you want to add?">
|
:placeholder="this.bulkAddGetLocale">
|
||||||
<small class="text-muted">
|
<small class="text-muted">
|
||||||
You can add up to <strong>{{this.availableIp.length}}</strong> peers
|
<LocaleText :t="`You can add up to ` + this.availableIp.length + ' peers'"></LocaleText>
|
||||||
</small>
|
</small>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
<script>
|
<script>
|
||||||
import {WireguardConfigurationsStore} from "@/stores/WireguardConfigurationsStore.js";
|
import {WireguardConfigurationsStore} from "@/stores/WireguardConfigurationsStore.js";
|
||||||
import {DashboardConfigurationStore} from "@/stores/DashboardConfigurationStore.js";
|
import {DashboardConfigurationStore} from "@/stores/DashboardConfigurationStore.js";
|
||||||
|
import LocaleText from "@/components/text/localeText.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "dnsInput",
|
name: "dnsInput",
|
||||||
|
components: {LocaleText},
|
||||||
props: {
|
props: {
|
||||||
|
|
||||||
data: Object,
|
data: Object,
|
||||||
@ -50,7 +52,9 @@ export default {
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<label for="peer_DNS_textbox" class="form-label">
|
<label for="peer_DNS_textbox" class="form-label">
|
||||||
<small class="text-muted">DNS</small>
|
<small class="text-muted">
|
||||||
|
<LocaleText t="DNS"></LocaleText>
|
||||||
|
</small>
|
||||||
</label>
|
</label>
|
||||||
<input type="text" class="form-control form-control-sm rounded-3"
|
<input type="text" class="form-control form-control-sm rounded-3"
|
||||||
:class="{'is-invalid': this.error}"
|
:class="{'is-invalid': this.error}"
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
<script>
|
<script>
|
||||||
import {DashboardConfigurationStore} from "@/stores/DashboardConfigurationStore.js";
|
import {DashboardConfigurationStore} from "@/stores/DashboardConfigurationStore.js";
|
||||||
import {WireguardConfigurationsStore} from "@/stores/WireguardConfigurationsStore.js";
|
import {WireguardConfigurationsStore} from "@/stores/WireguardConfigurationsStore.js";
|
||||||
|
import LocaleText from "@/components/text/localeText.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "endpointAllowedIps",
|
name: "endpointAllowedIps",
|
||||||
|
components: {LocaleText},
|
||||||
props: {
|
props: {
|
||||||
data: Object,
|
data: Object,
|
||||||
saving: Boolean
|
saving: Boolean
|
||||||
@ -47,7 +49,11 @@ export default {
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<label for="peer_endpoint_allowed_ips" class="form-label">
|
<label for="peer_endpoint_allowed_ips" class="form-label">
|
||||||
<small class="text-muted">Endpoint Allowed IPs <code>(Required)</code></small>
|
<small class="text-muted">
|
||||||
|
<LocaleText t="Endpoint Allowed IPs"></LocaleText>
|
||||||
|
<code>
|
||||||
|
<LocaleText t="(Required)"></LocaleText>
|
||||||
|
</code></small>
|
||||||
</label>
|
</label>
|
||||||
<input type="text" class="form-control form-control-sm rounded-3"
|
<input type="text" class="form-control form-control-sm rounded-3"
|
||||||
:class="{'is-invalid': error}"
|
:class="{'is-invalid': error}"
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
<script>
|
<script>
|
||||||
|
import LocaleText from "@/components/text/localeText.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "mtuInput",
|
name: "mtuInput",
|
||||||
|
components: {LocaleText},
|
||||||
props: {
|
props: {
|
||||||
data: Object,
|
data: Object,
|
||||||
saving: Boolean
|
saving: Boolean
|
||||||
@ -10,7 +13,9 @@ export default {
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<label for="peer_mtu" class="form-label"><small class="text-muted">MTU</small></label>
|
<label for="peer_mtu" class="form-label"><small class="text-muted">
|
||||||
|
<LocaleText t="MTU"></LocaleText>
|
||||||
|
</small></label>
|
||||||
<input type="number" class="form-control form-control-sm rounded-3"
|
<input type="number" class="form-control form-control-sm rounded-3"
|
||||||
:disabled="this.saving"
|
:disabled="this.saving"
|
||||||
v-model="this.data.mtu"
|
v-model="this.data.mtu"
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
<script>
|
<script>
|
||||||
|
import LocaleText from "@/components/text/localeText.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "nameInput",
|
name: "nameInput",
|
||||||
|
components: {LocaleText},
|
||||||
props: {
|
props: {
|
||||||
bulk: Boolean,
|
bulk: Boolean,
|
||||||
data: Object,
|
data: Object,
|
||||||
@ -12,7 +15,9 @@ export default {
|
|||||||
<template>
|
<template>
|
||||||
<div :class="{inactiveField: this.bulk}">
|
<div :class="{inactiveField: this.bulk}">
|
||||||
<label for="peer_name_textbox" class="form-label">
|
<label for="peer_name_textbox" class="form-label">
|
||||||
<small class="text-muted">Name</small>
|
<small class="text-muted">
|
||||||
|
<LocaleText t="Name"></LocaleText>
|
||||||
|
</small>
|
||||||
</label>
|
</label>
|
||||||
<input type="text" class="form-control form-control-sm rounded-3"
|
<input type="text" class="form-control form-control-sm rounded-3"
|
||||||
:disabled="this.saving || this.bulk"
|
:disabled="this.saving || this.bulk"
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
<script>
|
<script>
|
||||||
|
import LocaleText from "@/components/text/localeText.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "persistentKeepAliveInput",
|
name: "persistentKeepAliveInput",
|
||||||
|
components: {LocaleText},
|
||||||
props: {
|
props: {
|
||||||
data: Object,
|
data: Object,
|
||||||
saving: Boolean
|
saving: Boolean
|
||||||
@ -11,7 +14,9 @@ export default {
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<label for="peer_keep_alive" class="form-label">
|
<label for="peer_keep_alive" class="form-label">
|
||||||
<small class="text-muted">Persistent Keepalive</small>
|
<small class="text-muted">
|
||||||
|
<LocaleText t="Persistent Keepalive"></LocaleText>
|
||||||
|
</small>
|
||||||
</label>
|
</label>
|
||||||
<input type="number" class="form-control form-control-sm rounded-3"
|
<input type="number" class="form-control form-control-sm rounded-3"
|
||||||
:disabled="this.saving"
|
:disabled="this.saving"
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
<script>
|
<script>
|
||||||
|
import LocaleText from "@/components/text/localeText.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "presharedKeyInput",
|
name: "presharedKeyInput",
|
||||||
|
components: {LocaleText},
|
||||||
props: {
|
props: {
|
||||||
data: Object,
|
data: Object,
|
||||||
saving: Boolean
|
saving: Boolean
|
||||||
@ -26,7 +29,9 @@ export default {
|
|||||||
<div>
|
<div>
|
||||||
<div class="d-flex align-items-start">
|
<div class="d-flex align-items-start">
|
||||||
<label for="peer_preshared_key_textbox" class="form-label">
|
<label for="peer_preshared_key_textbox" class="form-label">
|
||||||
<small class="text-muted">Pre-Shared Key</small>
|
<small class="text-muted">
|
||||||
|
<LocaleText t="Pre-Shared Key"></LocaleText>
|
||||||
|
</small>
|
||||||
</label>
|
</label>
|
||||||
<div class="form-check form-switch ms-auto">
|
<div class="form-check form-switch ms-auto">
|
||||||
<input class="form-check-input" type="checkbox" role="switch"
|
<input class="form-check-input" type="checkbox" role="switch"
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
<script>
|
<script>
|
||||||
import "@/utilities/wireguard.js"
|
import "@/utilities/wireguard.js"
|
||||||
import {DashboardConfigurationStore} from "@/stores/DashboardConfigurationStore.js";
|
import {DashboardConfigurationStore} from "@/stores/DashboardConfigurationStore.js";
|
||||||
|
import LocaleText from "@/components/text/localeText.vue";
|
||||||
export default {
|
export default {
|
||||||
name: "privatePublicKeyInput",
|
name: "privatePublicKeyInput",
|
||||||
|
components: {LocaleText},
|
||||||
props: {
|
props: {
|
||||||
data: Object,
|
data: Object,
|
||||||
saving: Boolean,
|
saving: Boolean,
|
||||||
@ -75,7 +77,11 @@ export default {
|
|||||||
<div class="d-flex gap-2 flex-column" :class="{inactiveField: this.bulk}">
|
<div class="d-flex gap-2 flex-column" :class="{inactiveField: this.bulk}">
|
||||||
<div>
|
<div>
|
||||||
<label for="peer_private_key_textbox" class="form-label">
|
<label for="peer_private_key_textbox" class="form-label">
|
||||||
<small class="text-muted">Private Key <code>(Required for QR Code and Download)</code></small>
|
<small class="text-muted">
|
||||||
|
<LocaleText t="Private Key"></LocaleText>
|
||||||
|
<code>
|
||||||
|
<LocaleText t="(Required for QR Code and Download)"></LocaleText>
|
||||||
|
</code></small>
|
||||||
</label>
|
</label>
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<input type="text" class="form-control form-control-sm rounded-start-3"
|
<input type="text" class="form-control form-control-sm rounded-start-3"
|
||||||
@ -94,14 +100,20 @@ export default {
|
|||||||
<div>
|
<div>
|
||||||
<div class="d-flex">
|
<div class="d-flex">
|
||||||
<label for="public_key" class="form-label">
|
<label for="public_key" class="form-label">
|
||||||
<small class="text-muted">Public Key <code>(Required)</code></small>
|
<small class="text-muted">
|
||||||
|
<LocaleText t="Public Key"></LocaleText>
|
||||||
|
<code>
|
||||||
|
<LocaleText t="(Required)"></LocaleText>
|
||||||
|
</code></small>
|
||||||
</label>
|
</label>
|
||||||
<div class="form-check form-switch ms-auto">
|
<div class="form-check form-switch ms-auto">
|
||||||
<input class="form-check-input" type="checkbox" role="switch"
|
<input class="form-check-input" type="checkbox" role="switch"
|
||||||
:disabled="this.bulk"
|
:disabled="this.bulk"
|
||||||
id="enablePublicKeyEdit" v-model="this.editKey">
|
id="enablePublicKeyEdit" v-model="this.editKey">
|
||||||
<label class="form-check-label" for="enablePublicKeyEdit">
|
<label class="form-check-label" for="enablePublicKeyEdit">
|
||||||
<small>Edit</small>
|
<small>
|
||||||
|
<LocaleText t="Use your own Private and Public Key"></LocaleText>
|
||||||
|
</small>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -12,10 +12,12 @@ import PersistentKeepAliveInput
|
|||||||
from "@/components/configurationComponents/newPeersComponents/persistentKeepAliveInput.vue";
|
from "@/components/configurationComponents/newPeersComponents/persistentKeepAliveInput.vue";
|
||||||
import {DashboardConfigurationStore} from "@/stores/DashboardConfigurationStore.js";
|
import {DashboardConfigurationStore} from "@/stores/DashboardConfigurationStore.js";
|
||||||
import BulkAdd from "@/components/configurationComponents/newPeersComponents/bulkAdd.vue";
|
import BulkAdd from "@/components/configurationComponents/newPeersComponents/bulkAdd.vue";
|
||||||
|
import LocaleText from "@/components/text/localeText.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "peerCreate",
|
name: "peerCreate",
|
||||||
components: {
|
components: {
|
||||||
|
LocaleText,
|
||||||
BulkAdd,
|
BulkAdd,
|
||||||
PersistentKeepAliveInput,
|
PersistentKeepAliveInput,
|
||||||
MtuInput,
|
MtuInput,
|
||||||
@ -107,7 +109,9 @@ export default {
|
|||||||
<h3 class="mb-0 text-body">
|
<h3 class="mb-0 text-body">
|
||||||
<i class="bi bi-chevron-left"></i>
|
<i class="bi bi-chevron-left"></i>
|
||||||
</h3>
|
</h3>
|
||||||
<h3 class="text-body mb-0">Add Peers</h3>
|
<h3 class="text-body mb-0">
|
||||||
|
<LocaleText t="Add Peers"></LocaleText>
|
||||||
|
</h3>
|
||||||
</RouterLink>
|
</RouterLink>
|
||||||
</div>
|
</div>
|
||||||
<div class="d-flex flex-column gap-2">
|
<div class="d-flex flex-column gap-2">
|
||||||
@ -137,8 +141,11 @@ export default {
|
|||||||
v-model="this.data.preshared_key_bulkAdd"
|
v-model="this.data.preshared_key_bulkAdd"
|
||||||
id="bullAdd_PresharedKey_Switch" checked>
|
id="bullAdd_PresharedKey_Switch" checked>
|
||||||
<label class="form-check-label" for="bullAdd_PresharedKey_Switch">
|
<label class="form-check-label" for="bullAdd_PresharedKey_Switch">
|
||||||
Pre-Share Key
|
<small class="fw-bold">
|
||||||
{{this.data.preshared_key_bulkAdd ? "Enabled":"Disabled"}}
|
<LocaleText t="Pre-Shared Key"></LocaleText>
|
||||||
|
<LocaleText t="Enabled" v-if="this.data.preshared_key_bulkAdd"></LocaleText>
|
||||||
|
<LocaleText t="Disabled" v-else></LocaleText>
|
||||||
|
</small>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -149,7 +156,8 @@ export default {
|
|||||||
@click="this.peerCreate()"
|
@click="this.peerCreate()"
|
||||||
>
|
>
|
||||||
<i class="bi bi-plus-circle-fill me-2" v-if="!this.saving"></i>
|
<i class="bi bi-plus-circle-fill me-2" v-if="!this.saving"></i>
|
||||||
{{this.saving ? 'Saving...': 'Add'}}
|
<LocaleText t="Adding..." v-if="this.saving"></LocaleText>
|
||||||
|
<LocaleText t="Add" v-else></LocaleText>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -176,8 +176,7 @@ export default {
|
|||||||
}, (res) => {
|
}, (res) => {
|
||||||
if (res.status){
|
if (res.status){
|
||||||
this.dashboardConfigurationStore.newMessage("Server",
|
this.dashboardConfigurationStore.newMessage("Server",
|
||||||
`${this.configurationInfo.Name} is
|
`${this.configurationInfo.Name} ${res.data ? 'is on':'is off'}`, "success")
|
||||||
${res.data ? 'is on':'is off'}`, "Success")
|
|
||||||
}else{
|
}else{
|
||||||
this.dashboardConfigurationStore.newMessage("Server",
|
this.dashboardConfigurationStore.newMessage("Server",
|
||||||
res.message, 'danger')
|
res.message, 'danger')
|
||||||
@ -427,8 +426,13 @@ export default {
|
|||||||
</small></p>
|
</small></p>
|
||||||
<div class="form-check form-switch ms-auto">
|
<div class="form-check form-switch ms-auto">
|
||||||
<label class="form-check-label" style="cursor: pointer" :for="'switch' + this.configurationInfo.id">
|
<label class="form-check-label" style="cursor: pointer" :for="'switch' + this.configurationInfo.id">
|
||||||
<LocaleText t="On" v-if="this.configurationInfo.Status"></LocaleText>
|
|
||||||
<LocaleText t="Off" v-else></LocaleText>
|
<LocaleText t="Turning Off..." v-if="!this.configurationInfo.Status && this.configurationToggling"></LocaleText>
|
||||||
|
<LocaleText t="Turning On..." v-else-if="this.configurationInfo.Status && this.configurationToggling"></LocaleText>
|
||||||
|
<LocaleText t="On" v-else-if="this.configurationInfo.Status && !this.configurationToggling"></LocaleText>
|
||||||
|
<LocaleText t="Off" v-else-if="!this.configurationInfo.Status && !this.configurationToggling"></LocaleText>
|
||||||
|
|
||||||
|
|
||||||
<span v-if="this.configurationToggling"
|
<span v-if="this.configurationToggling"
|
||||||
class="spinner-border spinner-border-sm ms-2" aria-hidden="true"></span>
|
class="spinner-border spinner-border-sm ms-2" aria-hidden="true"></span>
|
||||||
</label>
|
</label>
|
||||||
|
@ -122,7 +122,7 @@ export default {
|
|||||||
<a class="dropdown-item d-flex" role="button"
|
<a class="dropdown-item d-flex" role="button"
|
||||||
@click="this.$emit('jobs')"
|
@click="this.$emit('jobs')"
|
||||||
>
|
>
|
||||||
<i class="me-auto bi bi-app-indicator"></i> Schedule Jobs
|
<i class="me-auto bi bi-app-indicator"></i> <LocaleText t="Schedule Jobs"></LocaleText>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
@ -133,7 +133,10 @@ export default {
|
|||||||
@click="this.restrictPeer()"
|
@click="this.restrictPeer()"
|
||||||
:class="{disabled: this.restrictBtnDisabled}"
|
:class="{disabled: this.restrictBtnDisabled}"
|
||||||
role="button">
|
role="button">
|
||||||
<i class="me-auto bi bi-lock"></i> {{!this.restrictBtnDisabled ? "Restrict Access":"Restricting..."}}
|
<i class="me-auto bi bi-lock"></i>
|
||||||
|
<LocaleText t="Restrict Access" v-if="!this.restrictBtnDisabled"></LocaleText>
|
||||||
|
<LocaleText t="Restricting..." v-else></LocaleText>
|
||||||
|
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
@ -141,7 +144,9 @@ export default {
|
|||||||
@click="this.deletePeer()"
|
@click="this.deletePeer()"
|
||||||
:class="{disabled: this.deleteBtnDisabled}"
|
:class="{disabled: this.deleteBtnDisabled}"
|
||||||
role="button">
|
role="button">
|
||||||
<i class="me-auto bi bi-trash"></i> {{!this.deleteBtnDisabled ? "Delete":"Deleting..."}}
|
<i class="me-auto bi bi-trash"></i>
|
||||||
|
<LocaleText t="Delete" v-if="!this.deleteBtnDisabled"></LocaleText>
|
||||||
|
<LocaleText t="Deleting..." v-else></LocaleText>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
</template>
|
</template>
|
||||||
@ -149,10 +154,12 @@ export default {
|
|||||||
<li>
|
<li>
|
||||||
<a class="dropdown-item d-flex text-warning"
|
<a class="dropdown-item d-flex text-warning"
|
||||||
@click="this.allowAccessPeer()"
|
@click="this.allowAccessPeer()"
|
||||||
:class="{disabled: this.restrictBtnDisabled}"
|
:class="{disabled: this.allowAccessBtnDisabled}"
|
||||||
role="button">
|
role="button">
|
||||||
<i class="me-auto bi bi-unlock"></i>
|
<i class="me-auto bi bi-unlock"></i>
|
||||||
{{!this.allowAccessBtnDisabled ? "Allow Access":"Allowing..."}}
|
<LocaleText t="Allow Access" v-if="!this.allowAccessBtnDisabled"></LocaleText>
|
||||||
|
<LocaleText t="Allowing Access..." v-else></LocaleText>
|
||||||
|
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
</template>
|
</template>
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
<script>
|
<script>
|
||||||
import {fetchGet} from "@/utilities/fetch.js";
|
import {fetchGet} from "@/utilities/fetch.js";
|
||||||
import {DashboardConfigurationStore} from "@/stores/DashboardConfigurationStore.js";
|
import {DashboardConfigurationStore} from "@/stores/DashboardConfigurationStore.js";
|
||||||
|
import LocaleText from "@/components/text/localeText.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "configurationCard",
|
name: "configurationCard",
|
||||||
|
components: {LocaleText},
|
||||||
props: {
|
props: {
|
||||||
c: {
|
c: {
|
||||||
Name: String,
|
Name: String,
|
||||||
@ -63,22 +65,30 @@ export default {
|
|||||||
<i class="bi bi-arrow-up me-2"></i>{{c.DataUsage.Sent > 0 ? c.DataUsage.Sent.toFixed(4) : 0}} GB
|
<i class="bi bi-arrow-up me-2"></i>{{c.DataUsage.Sent > 0 ? c.DataUsage.Sent.toFixed(4) : 0}} GB
|
||||||
</small>
|
</small>
|
||||||
<small class="text-md-end col-6 col-md-3">
|
<small class="text-md-end col-6 col-md-3">
|
||||||
<span class="dot me-2" :class="{active: c.ConnectedPeers > 0}"></span>{{c.ConnectedPeers}} Peers
|
<span class="dot me-2" :class="{active: c.ConnectedPeers > 0}"></span>{{c.ConnectedPeers}}
|
||||||
|
<LocaleText t="Peers"></LocaleText>
|
||||||
</small>
|
</small>
|
||||||
</div>
|
</div>
|
||||||
<div class="d-flex align-items-center gap-2">
|
<div class="d-flex align-items-center gap-2">
|
||||||
<small class="text-muted">
|
<small class="text-muted">
|
||||||
<strong style="word-break: keep-all">Public Key</strong>
|
<strong style="word-break: keep-all">
|
||||||
|
<LocaleText t="Public Key"></LocaleText>
|
||||||
|
</strong>
|
||||||
</small>
|
</small>
|
||||||
<small class="mb-0 d-block d-lg-inline-block ">
|
<small class="mb-0 d-block d-lg-inline-block ">
|
||||||
<samp style="line-break: anywhere">{{c.PublicKey}}</samp>
|
<samp style="line-break: anywhere">{{c.PublicKey}}</samp>
|
||||||
</small>
|
</small>
|
||||||
<div class="form-check form-switch ms-auto">
|
<div class="form-check form-switch ms-auto">
|
||||||
<label class="form-check-label" style="cursor: pointer" :for="'switch' + c.PrivateKey">
|
<label class="form-check-label" style="cursor: pointer" :for="'switch' + c.PrivateKey">
|
||||||
{{this.configurationToggling ? 'Turning ':''}}
|
|
||||||
{{c.Status ? "On":"Off"}}
|
<LocaleText t="Turning Off..." v-if="!c.Status && this.configurationToggling"></LocaleText>
|
||||||
|
<LocaleText t="Turning On..." v-else-if="c.Status && this.configurationToggling"></LocaleText>
|
||||||
|
<LocaleText t="On" v-else-if="c.Status && !this.configurationToggling"></LocaleText>
|
||||||
|
<LocaleText t="Off" v-else-if="!c.Status && !this.configurationToggling"></LocaleText>
|
||||||
|
|
||||||
|
|
||||||
<span v-if="this.configurationToggling"
|
<span v-if="this.configurationToggling"
|
||||||
class="spinner-border spinner-border-sm" aria-hidden="true"></span>
|
class="spinner-border spinner-border-sm ms-2" aria-hidden="true"></span>
|
||||||
</label>
|
</label>
|
||||||
<input class="form-check-input"
|
<input class="form-check-input"
|
||||||
style="cursor: pointer"
|
style="cursor: pointer"
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
<script>
|
<script>
|
||||||
|
import LocaleText from "@/components/text/localeText.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "message",
|
name: "message",
|
||||||
|
components: {LocaleText},
|
||||||
props: {
|
props: {
|
||||||
message: Object
|
message: Object
|
||||||
},
|
},
|
||||||
@ -21,7 +24,9 @@ export default {
|
|||||||
:id="this.message.id"
|
:id="this.message.id"
|
||||||
style="width: 400px">
|
style="width: 400px">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<small class="fw-bold d-block" style="text-transform: uppercase">FROM {{this.message.from}}</small>
|
<small class="fw-bold d-block" style="text-transform: uppercase">
|
||||||
|
<LocaleText t="FROM "></LocaleText>
|
||||||
|
{{this.message.from}}</small>
|
||||||
{{this.message.content}}
|
{{this.message.content}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -4,6 +4,7 @@ import {WireguardConfigurationsStore} from "@/stores/WireguardConfigurationsStor
|
|||||||
import {DashboardConfigurationStore} from "@/stores/DashboardConfigurationStore.js";
|
import {DashboardConfigurationStore} from "@/stores/DashboardConfigurationStore.js";
|
||||||
import {fetchGet} from "@/utilities/fetch.js";
|
import {fetchGet} from "@/utilities/fetch.js";
|
||||||
import LocaleText from "@/components/text/localeText.vue";
|
import LocaleText from "@/components/text/localeText.vue";
|
||||||
|
import {GetLocale} from "@/utilities/locale.js";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "navbar",
|
name: "navbar",
|
||||||
@ -29,7 +30,7 @@ export default {
|
|||||||
}
|
}
|
||||||
this.updateMessage = res.message
|
this.updateMessage = res.message
|
||||||
}else{
|
}else{
|
||||||
this.updateMessage = "Failed to check available update"
|
this.updateMessage = GetLocale("Failed to check available update")
|
||||||
console.log(`Failed to get update: ${res.message}`)
|
console.log(`Failed to get update: ${res.message}`)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -95,14 +96,15 @@ export default {
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item" style="font-size: 0.8rem">
|
<li class="nav-item" style="font-size: 0.8rem">
|
||||||
<a :href="this.updateUrl" v-if="this.updateAvailable" class="text-decoration-none" target="_blank">
|
<a :href="this.updateUrl" v-if="this.updateAvailable" class="text-decoration-none rounded-3" target="_blank">
|
||||||
<small class="nav-link text-muted rounded-3" >
|
<small class="nav-link text-muted rounded-3" >
|
||||||
<LocaleText :t="this.updateMessage"></LocaleText>
|
<LocaleText :t="this.updateMessage"></LocaleText>
|
||||||
|
(<LocaleText t="Current Version:"></LocaleText> {{ dashboardConfigurationStore.Configuration.Server.version }})
|
||||||
</small>
|
</small>
|
||||||
</a>
|
</a>
|
||||||
<small class="nav-link text-muted" v-else>
|
<small class="nav-link text-muted rounded-3" v-else>
|
||||||
<LocaleText :t="this.updateMessage"></LocaleText>
|
<LocaleText :t="this.updateMessage"></LocaleText>
|
||||||
({{ dashboardConfigurationStore.Configuration.Server.version}})
|
({{ dashboardConfigurationStore.Configuration.Server.version }})
|
||||||
</small>
|
</small>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -2,9 +2,11 @@
|
|||||||
import {fetchGet, fetchPost} from "@/utilities/fetch.js";
|
import {fetchGet, fetchPost} from "@/utilities/fetch.js";
|
||||||
import QRCode from "qrcode";
|
import QRCode from "qrcode";
|
||||||
import {DashboardConfigurationStore} from "@/stores/DashboardConfigurationStore.js";
|
import {DashboardConfigurationStore} from "@/stores/DashboardConfigurationStore.js";
|
||||||
|
import LocaleText from "@/components/text/localeText.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "totp",
|
name: "totp",
|
||||||
|
components: {LocaleText},
|
||||||
async setup(){
|
async setup(){
|
||||||
const store = DashboardConfigurationStore();
|
const store = DashboardConfigurationStore();
|
||||||
let l = ""
|
let l = ""
|
||||||
@ -65,14 +67,25 @@ export default {
|
|||||||
<div class="m-auto text-body" style="width: 500px">
|
<div class="m-auto text-body" style="width: 500px">
|
||||||
<div class="d-flex flex-column">
|
<div class="d-flex flex-column">
|
||||||
<div>
|
<div>
|
||||||
<h1 class="dashboardLogo display-4">Multi-Factor Authentication</h1>
|
<h1 class="dashboardLogo display-4">
|
||||||
<p class="mb-2"><small class="text-muted">1. Please scan the following QR Code to generate TOTP</small></p>
|
<LocaleText t="Multi-Factor Authentication (MFA)"></LocaleText>
|
||||||
|
</h1>
|
||||||
|
<p class="mb-2"><small class="text-muted">
|
||||||
|
<LocaleText t="1. Please scan the following QR Code to generate TOTP with your choice of authenticator"></LocaleText>
|
||||||
|
</small></p>
|
||||||
<canvas id="qrcode" class="rounded-3 mb-2"></canvas>
|
<canvas id="qrcode" class="rounded-3 mb-2"></canvas>
|
||||||
<div class="p-3 bg-body-secondary rounded-3 border mb-3">
|
<div class="p-3 bg-body-secondary rounded-3 border mb-3">
|
||||||
<p class="text-muted mb-0"><small>Or you can click the link below:</small>
|
<p class="text-muted mb-0">
|
||||||
|
<small>
|
||||||
|
<LocaleText t="Or you can click the link below:"></LocaleText>
|
||||||
|
</small>
|
||||||
</p><a :href="this.l"><code style="line-break: anywhere">{{this.l}}</code></a>
|
</p><a :href="this.l"><code style="line-break: anywhere">{{this.l}}</code></a>
|
||||||
</div>
|
</div>
|
||||||
<label for="totp" class="mb-2"><small class="text-muted">2. Enter the TOTP generated by your authenticator to verify</small></label>
|
<label for="totp" class="mb-2">
|
||||||
|
<small class="text-muted">
|
||||||
|
<LocaleText t="2. Enter the TOTP generated by your authenticator to verify"></LocaleText>
|
||||||
|
</small>
|
||||||
|
</label>
|
||||||
<div class="form-group mb-2">
|
<div class="form-group mb-2">
|
||||||
<input class="form-control text-center totp"
|
<input class="form-control text-center totp"
|
||||||
id="totp" maxlength="6" type="text" inputmode="numeric" autocomplete="one-time-code"
|
id="totp" maxlength="6" type="text" inputmode="numeric" autocomplete="one-time-code"
|
||||||
@ -80,16 +93,12 @@ export default {
|
|||||||
:disabled="this.verified"
|
:disabled="this.verified"
|
||||||
>
|
>
|
||||||
<div class="invalid-feedback">
|
<div class="invalid-feedback">
|
||||||
{{this.totpInvalidMessage}}
|
<LocaleText :t="this.totpInvalidMessage"></LocaleText>
|
||||||
</div>
|
</div>
|
||||||
<div class="valid-feedback">
|
<div class="valid-feedback">
|
||||||
TOTP verified!
|
<LocaleText t="TOTP verified!"></LocaleText>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="alert alert-warning rounded-3">
|
|
||||||
<i class="bi bi-exclamation-triangle-fill me-2"></i> If you ever lost your TOTP and can't login, please follow instruction on
|
|
||||||
<a href="https://github.com/donaldzou/WGDashboard" target="_blank">readme.md</a> to reset.
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<hr>
|
<hr>
|
||||||
<div class="d-flex gap-3 mt-5 flex-column">
|
<div class="d-flex gap-3 mt-5 flex-column">
|
||||||
@ -99,12 +108,14 @@ export default {
|
|||||||
class="btn bg-secondary-subtle text-secondary-emphasis
|
class="btn bg-secondary-subtle text-secondary-emphasis
|
||||||
rounded-3
|
rounded-3
|
||||||
flex-grow-1 btn-lg border-1 border-secondary-subtle shadow d-flex">
|
flex-grow-1 btn-lg border-1 border-secondary-subtle shadow d-flex">
|
||||||
I don't need MFA <i class="bi bi-chevron-right ms-auto"></i>
|
<LocaleText t="I don't need MFA"></LocaleText>
|
||||||
|
<i class="bi bi-chevron-right ms-auto"></i>
|
||||||
</RouterLink>
|
</RouterLink>
|
||||||
<RouterLink
|
<RouterLink
|
||||||
to="/"
|
to="/"
|
||||||
v-else class="btn btn-dark btn-lg d-flex btn-brand shadow align-items-center flex-grow-1 rounded-3">
|
v-else class="btn btn-dark btn-lg d-flex btn-brand shadow align-items-center flex-grow-1 rounded-3">
|
||||||
Complete <i class="bi bi-chevron-right ms-auto"></i>
|
<LocaleText t="Complete"></LocaleText>
|
||||||
|
<i class="bi bi-chevron-right ms-auto"></i>
|
||||||
</RouterLink>
|
</RouterLink>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -9,7 +9,7 @@ export default {
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
getLocaleText(){
|
getLocaleText(){
|
||||||
return GetLocale(this.placeholder)
|
return GetLocale('OTP from your authenticator')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -19,7 +19,7 @@ export default {
|
|||||||
<input class="form-control totp"
|
<input class="form-control totp"
|
||||||
required
|
required
|
||||||
id="totp" maxlength="6" type="text" inputmode="numeric" autocomplete="one-time-code"
|
id="totp" maxlength="6" type="text" inputmode="numeric" autocomplete="one-time-code"
|
||||||
:placeholder="this.getLocaleText('OTP from your authenticator')"
|
:placeholder="this.getLocaleText"
|
||||||
v-model="this.data.totp"
|
v-model="this.data.totp"
|
||||||
>
|
>
|
||||||
</template>
|
</template>
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
<script>
|
<script>
|
||||||
import {DashboardConfigurationStore} from "@/stores/DashboardConfigurationStore.js";
|
import {DashboardConfigurationStore} from "@/stores/DashboardConfigurationStore.js";
|
||||||
import {fetchPost} from "@/utilities/fetch.js";
|
import {fetchPost} from "@/utilities/fetch.js";
|
||||||
|
import LocaleText from "@/components/text/localeText.vue";
|
||||||
export default {
|
export default {
|
||||||
name: "setup",
|
name: "setup",
|
||||||
components: {},
|
components: {LocaleText},
|
||||||
setup(){
|
setup(){
|
||||||
const store = DashboardConfigurationStore();
|
const store = DashboardConfigurationStore();
|
||||||
return {store}
|
return {store}
|
||||||
@ -57,37 +58,57 @@ export default {
|
|||||||
<div class="container-fluid login-container-fluid d-flex main pt-5 overflow-scroll"
|
<div class="container-fluid login-container-fluid d-flex main pt-5 overflow-scroll"
|
||||||
:data-bs-theme="this.store.Configuration.Server.dashboard_theme">
|
:data-bs-theme="this.store.Configuration.Server.dashboard_theme">
|
||||||
<div class="m-auto text-body" style="width: 500px">
|
<div class="m-auto text-body" style="width: 500px">
|
||||||
<span class="dashboardLogo display-4">Nice to meet you!</span>
|
<span class="dashboardLogo display-4">
|
||||||
<p class="mb-5">Please fill in the following fields to finish setup 😊</p>
|
<LocaleText t="Nice to meet you!"></LocaleText>
|
||||||
|
</span>
|
||||||
|
<p class="mb-5">
|
||||||
|
<LocaleText t="Please fill in the following fields to finish setup"></LocaleText>
|
||||||
|
😊</p>
|
||||||
<div>
|
<div>
|
||||||
<h3>Create an account</h3>
|
<h3>
|
||||||
|
<LocaleText t="Create an account"></LocaleText>
|
||||||
|
</h3>
|
||||||
<div class="alert alert-danger" v-if="this.errorMessage">
|
<div class="alert alert-danger" v-if="this.errorMessage">
|
||||||
{{this.errorMessage}}
|
{{this.errorMessage}}
|
||||||
</div>
|
</div>
|
||||||
<div class="d-flex flex-column gap-3">
|
<div class="d-flex flex-column gap-3">
|
||||||
<div id="createAccount" class="d-flex flex-column gap-2">
|
<form id="createAccount" class="d-flex flex-column gap-2">
|
||||||
<div class="form-group text-body">
|
<div class="form-group text-body">
|
||||||
<label for="username" class="mb-1 text-muted">
|
<label for="username" class="mb-1 text-muted">
|
||||||
<small>Pick an username you like</small></label>
|
<small>
|
||||||
|
<LocaleText t="Enter an username you like"></LocaleText>
|
||||||
|
</small></label>
|
||||||
<input type="text"
|
<input type="text"
|
||||||
|
autocomplete="username"
|
||||||
v-model="this.setup.username"
|
v-model="this.setup.username"
|
||||||
class="form-control" id="username" name="username" placeholder="Maybe something like 'wiredragon'?" required>
|
class="form-control" id="username" name="username" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group text-body">
|
<div class="form-group text-body">
|
||||||
<label for="password" class="mb-1 text-muted">
|
<label for="password" class="mb-1 text-muted">
|
||||||
<small>Create a password (at least 8 characters)</small></label>
|
<small>
|
||||||
|
<LocaleText t="Enter a password"></LocaleText>
|
||||||
|
<code>
|
||||||
|
<LocaleText t="(At least 8 characters and make sure is strong enough!)"></LocaleText>
|
||||||
|
</code>
|
||||||
|
</small>
|
||||||
|
</label>
|
||||||
<input type="password"
|
<input type="password"
|
||||||
|
autocomplete="new-password"
|
||||||
v-model="this.setup.newPassword"
|
v-model="this.setup.newPassword"
|
||||||
class="form-control" id="password" name="password" placeholder="Make sure is strong enough" required>
|
class="form-control" id="password" name="password" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group text-body">
|
<div class="form-group text-body">
|
||||||
<label for="confirmPassword" class="mb-1 text-muted">
|
<label for="confirmPassword" class="mb-1 text-muted">
|
||||||
<small>Confirm password</small></label>
|
<small>
|
||||||
|
<LocaleText t="Confirm password"></LocaleText>
|
||||||
|
</small>
|
||||||
|
</label>
|
||||||
<input type="password"
|
<input type="password"
|
||||||
|
autocomplete="confirm-new-password"
|
||||||
v-model="this.setup.repeatNewPassword"
|
v-model="this.setup.repeatNewPassword"
|
||||||
class="form-control" id="confirmPassword" name="confirmPassword" placeholder="and you can remember it :)" required>
|
class="form-control" id="confirmPassword" name="confirmPassword" required>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</form>
|
||||||
<!-- <div class="form-check form-switch">-->
|
<!-- <div class="form-check form-switch">-->
|
||||||
<!-- <input class="form-check-input" type="checkbox" role="switch" id="enable_totp" -->
|
<!-- <input class="form-check-input" type="checkbox" role="switch" id="enable_totp" -->
|
||||||
<!-- v-model="this.setup.enable_totp">-->
|
<!-- v-model="this.setup.enable_totp">-->
|
||||||
@ -104,9 +125,12 @@ export default {
|
|||||||
ref="signInBtn"
|
ref="signInBtn"
|
||||||
:disabled="!this.goodToSubmit || this.loading || this.done" @click="this.submit()">
|
:disabled="!this.goodToSubmit || this.loading || this.done" @click="this.submit()">
|
||||||
<span class="d-flex align-items-center w-100" v-if="!this.loading && !this.done">
|
<span class="d-flex align-items-center w-100" v-if="!this.loading && !this.done">
|
||||||
Next<i class="bi bi-chevron-right ms-auto"></i></span>
|
<LocaleText t="Next"></LocaleText>
|
||||||
|
|
||||||
|
<i class="bi bi-chevron-right ms-auto"></i></span>
|
||||||
<span class="d-flex align-items-center w-100" v-else>
|
<span class="d-flex align-items-center w-100" v-else>
|
||||||
Saving...<span class="spinner-border ms-auto spinner-border-sm" role="status">
|
<LocaleText t="Saving..."></LocaleText>
|
||||||
|
<span class="spinner-border ms-auto spinner-border-sm" role="status">
|
||||||
<span class="visually-hidden">Loading...</span>
|
<span class="visually-hidden">Loading...</span>
|
||||||
</span></span>
|
</span></span>
|
||||||
</button>
|
</button>
|
||||||
|
@ -4,15 +4,17 @@ import {DashboardConfigurationStore} from "@/stores/DashboardConfigurationStore.
|
|||||||
import {fetchGet} from "@/utilities/fetch.js";
|
import {fetchGet} from "@/utilities/fetch.js";
|
||||||
import {ref} from "vue";
|
import {ref} from "vue";
|
||||||
import QRCode from "qrcode";
|
import QRCode from "qrcode";
|
||||||
|
import LocaleText from "@/components/text/localeText.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "share",
|
name: "share",
|
||||||
|
components: {LocaleText},
|
||||||
async setup(){
|
async setup(){
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const loaded = ref(false)
|
const loaded = ref(false)
|
||||||
const store = DashboardConfigurationStore();
|
const store = DashboardConfigurationStore();
|
||||||
const theme = ref("");
|
const theme = ref("");
|
||||||
const peerConfiguration = ref("");
|
const peerConfiguration = ref(undefined);
|
||||||
const blob = ref(new Blob())
|
const blob = ref(new Blob())
|
||||||
await fetchGet("/api/getDashboardTheme", {}, (res) => {
|
await fetchGet("/api/getDashboardTheme", {}, (res) => {
|
||||||
theme.value = res.data
|
theme.value = res.data
|
||||||
@ -38,9 +40,11 @@ export default {
|
|||||||
return {store, theme, peerConfiguration, blob}
|
return {store, theme, peerConfiguration, blob}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
QRCode.toCanvas(document.querySelector("#qrcode"), this.peerConfiguration.file , (error) => {
|
if(this.peerConfiguration){
|
||||||
if (error) console.error(error)
|
QRCode.toCanvas(document.querySelector("#qrcode"), this.peerConfiguration.file, (error) => {
|
||||||
})
|
if (error) console.error(error)
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods:{
|
methods:{
|
||||||
download(){
|
download(){
|
||||||
@ -76,18 +80,23 @@ export default {
|
|||||||
<div class="position-absolute w-100 h-100 top-0 start-0 d-flex animate__animated animate__fadeInUp"
|
<div class="position-absolute w-100 h-100 top-0 start-0 d-flex animate__animated animate__fadeInUp"
|
||||||
style="animation-delay: 0.1s;"
|
style="animation-delay: 0.1s;"
|
||||||
>
|
>
|
||||||
<h3 class="m-auto">Oh no... This link is either expired or invalid.</h3>
|
<h3 class="m-auto">
|
||||||
|
<LocaleText t="Oh no... This link is either expired or invalid."></LocaleText>
|
||||||
|
</h3>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-else class="d-flex align-items-center flex-column gap-3">
|
<div v-else class="d-flex align-items-center flex-column gap-3">
|
||||||
<div class="h1 dashboardLogo text-center animate__animated animate__fadeInUp">
|
<div class="h1 dashboardLogo text-center animate__animated animate__fadeInUp">
|
||||||
<h6>WGDashboard</h6>
|
<h6>WGDashboard</h6>
|
||||||
Scan QR Code from the WireGuard App
|
<LocaleText t="Scan QR Code with the WireGuard App to add peer"></LocaleText>
|
||||||
</div>
|
</div>
|
||||||
<canvas id="qrcode" class="rounded-3 shadow animate__animated animate__fadeInUp mb-3" ref="qrcode"></canvas>
|
<canvas id="qrcode" class="rounded-3 shadow animate__animated animate__fadeInUp mb-3" ref="qrcode"></canvas>
|
||||||
<p class="text-muted animate__animated animate__fadeInUp mb-1"
|
<p class="text-muted animate__animated animate__fadeInUp mb-1"
|
||||||
style="animation-delay: 0.2s;"
|
style="animation-delay: 0.2s;">
|
||||||
>or click the button below to download the <samp>.conf</samp> file</p>
|
<LocaleText t="or click the button below to download the "></LocaleText>
|
||||||
|
<samp>.conf</samp>
|
||||||
|
<LocaleText t=" file"></LocaleText>
|
||||||
|
</p>
|
||||||
<a
|
<a
|
||||||
:download="this.peerConfiguration.fileName + '.conf'"
|
:download="this.peerConfiguration.fileName + '.conf'"
|
||||||
:href="getBlob"
|
:href="getBlob"
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
"Welcome to": "欢迎来到",
|
"Welcome to": "欢迎来到",
|
||||||
"Username": "用户名",
|
"Username": "用户名",
|
||||||
"Password": "密码",
|
"Password": "密码",
|
||||||
"OTP from your authenticator": "您双因素身份验证的一次性验证码",
|
"OTP from your authenticator": "您多重身份验证器的一次性验证码",
|
||||||
"Sign In": "登录",
|
"Sign In": "登录",
|
||||||
"Signing In\\.\\.\\.": "正在登录...",
|
"Signing In\\.\\.\\.": "正在登录...",
|
||||||
"Access Remote Server": "访问远程服务器",
|
"Access Remote Server": "访问远程服务器",
|
||||||
@ -35,7 +35,7 @@
|
|||||||
"New Password": "新密码",
|
"New Password": "新密码",
|
||||||
"Repeat New Password": "重复新密码",
|
"Repeat New Password": "重复新密码",
|
||||||
"Update Password": "更新密码",
|
"Update Password": "更新密码",
|
||||||
"Multi-Factor Authentication \\(MFA\\)": "多重身份验证(MFA)",
|
"Multi-Factor Authentication \\(MFA\\)": "多重身份验证 (MFA)",
|
||||||
"Reset": "重置",
|
"Reset": "重置",
|
||||||
"Setup": "设置",
|
"Setup": "设置",
|
||||||
"API Keys": "API 秘钥",
|
"API Keys": "API 秘钥",
|
||||||
@ -55,6 +55,8 @@
|
|||||||
"Status": "状态",
|
"Status": "状态",
|
||||||
"On": "已启用",
|
"On": "已启用",
|
||||||
"Off": "已停用",
|
"Off": "已停用",
|
||||||
|
"Turning On\\.\\.\\.": "启用中...",
|
||||||
|
"Turning Off\\.\\.\\.": "停用中...",
|
||||||
"Address": "网络地址",
|
"Address": "网络地址",
|
||||||
"Listen Port": "监听端口",
|
"Listen Port": "监听端口",
|
||||||
"Public Key": "公钥",
|
"Public Key": "公钥",
|
||||||
@ -66,13 +68,14 @@
|
|||||||
"Real Time Received Data Usage": "实时接收数据量",
|
"Real Time Received Data Usage": "实时接收数据量",
|
||||||
"Real Time Sent Data Usage": "实时发送数据量",
|
"Real Time Sent Data Usage": "实时发送数据量",
|
||||||
"Peer": "端点",
|
"Peer": "端点",
|
||||||
|
"Peers": "端点",
|
||||||
"Peer Settings": "端点设定",
|
"Peer Settings": "端点设定",
|
||||||
"Download All": "全部下载",
|
"Download All": "全部下载",
|
||||||
"Search Peers\\.\\.\\.": "搜索端点...",
|
"Search Peers\\.\\.\\.": "搜索端点...",
|
||||||
"Display": "显示设置",
|
"Display": "显示设置",
|
||||||
"Sort By": "排列方式",
|
"Sort By": "排列方式",
|
||||||
"Refresh Interval": "刷新间隔",
|
"Refresh Interval": "刷新间隔",
|
||||||
"Name": "名字",
|
"Name": "名称",
|
||||||
"Allowed IPs": "允许的 IP 地址",
|
"Allowed IPs": "允许的 IP 地址",
|
||||||
"Restricted": "已限制端点",
|
"Restricted": "已限制端点",
|
||||||
"(.*) Seconds": "$1 秒",
|
"(.*) Seconds": "$1 秒",
|
||||||
@ -112,6 +115,7 @@
|
|||||||
"Delete Peer": "删除端点",
|
"Delete Peer": "删除端点",
|
||||||
"Edit": "编辑",
|
"Edit": "编辑",
|
||||||
"Delete": "删除",
|
"Delete": "删除",
|
||||||
|
"Deleting...": "删除中...",
|
||||||
"Cancel": "取消",
|
"Cancel": "取消",
|
||||||
"Save": "保存",
|
"Save": "保存",
|
||||||
"No active job at the moment\\.": "没有未运行的任务",
|
"No active job at the moment\\.": "没有未运行的任务",
|
||||||
@ -130,5 +134,47 @@
|
|||||||
"Stop Sharing\\.\\.\\.": "停止分享中...",
|
"Stop Sharing\\.\\.\\.": "停止分享中...",
|
||||||
"Stop Sharing": "停止分享",
|
"Stop Sharing": "停止分享",
|
||||||
"Access Restricted": "已限制访问",
|
"Access Restricted": "已限制访问",
|
||||||
"Download \\& QR Code is not available due to no private key set for this peer": "下载以及二维码功能不可用,需要填写此端点的秘钥"
|
"Restrict Access": "限制访问",
|
||||||
|
"Restricting\\.\\.\\.": "限制访问中...",
|
||||||
|
"Allow Access": "解除限制访问",
|
||||||
|
"Allowing Access\\.\\.\\.": "解除限制访问中...",
|
||||||
|
"Download \\& QR Code is not available due to no private key set for this peer": "下载以及二维码功能不可用,需要填写此端点的秘钥",
|
||||||
|
"Add Peers": "创建端点",
|
||||||
|
"Bulk Add": "批量添加",
|
||||||
|
"By adding peers by bulk, each peer's name will be auto generated, and Allowed IP will be assign to the next available IP\\.": "如果选择批量添加端点,系统会自动生成每一个端点的名称,并且会自动安排可用的 IP 地址。",
|
||||||
|
"How many peers you want to add\\?": "您想添加多少个端点?",
|
||||||
|
"You can add up to (.*) peers": "您最多可以添加 $1 个端点",
|
||||||
|
"Use your own Private and Public Key": "使用您自己的秘钥和公钥",
|
||||||
|
"Enter IP Address/CIDR": "输入 IP 地址/前缀长度",
|
||||||
|
"or": "或",
|
||||||
|
"Pick Available IP": "选择可用的 IP 地址",
|
||||||
|
"No available IP containing": "没有可用的 IP 地址含有 ",
|
||||||
|
"Add": "创建",
|
||||||
|
"Adding\\.\\.\\.": "创建中...",
|
||||||
|
"Failed to check available update": "获取更新失败",
|
||||||
|
"Nice to meet you!": "很高兴见到您!",
|
||||||
|
"Please fill in the following fields to finish setup": "请填入以下信息来完成初始化设置",
|
||||||
|
"Create an account": "创建账户",
|
||||||
|
"Enter an username you like": "输入一个您喜欢的用户名",
|
||||||
|
"Enter a password": "输入密码",
|
||||||
|
"\\(At least 8 characters and make sure is strong enough!\\)": "(至少8个字符或以上并且确保它足够复杂哟!)",
|
||||||
|
"Confirm password": "确认密码",
|
||||||
|
"Next": "下一步",
|
||||||
|
"Saving\\.\\.\\.": "保存中...",
|
||||||
|
"1\\. Please scan the following QR Code to generate TOTP with your choice of authenticator": "1. 请使用您选择的验证器扫描以下二维码来生成一次性验证码",
|
||||||
|
"Or you can click the link below:": "或者您可以点击以下链接:",
|
||||||
|
"2\\. Enter the TOTP generated by your authenticator to verify": "2. 请输入验证器生成的一次性验证码进行验证",
|
||||||
|
"TOTP verified!": "一次性验证码验证成功!",
|
||||||
|
"I don't need MFA": "我不需要多重身份验证 (MFA)",
|
||||||
|
"Complete": "完成",
|
||||||
|
"(v[0-9.]{1,}) is now available for update!": "有新版本 $1 可更新!",
|
||||||
|
"Current Version:": "当前版本: ",
|
||||||
|
"Oh no\\.\\.\\. This link is either expired or invalid\\.": "噢不!此链接已过期或不正确。",
|
||||||
|
"Scan QR Code with the WireGuard App to add peer": "使用 WireGuard APP 扫描以下二维码来添加端点",
|
||||||
|
"or click the button below to download the ": "或点击下面的按钮下载 ",
|
||||||
|
" file": " 文件",
|
||||||
|
"FROM ": "来自 ",
|
||||||
|
"(.*) is on": "$1 已启用",
|
||||||
|
"(.*) is off": "$1 已停用",
|
||||||
|
"Allowed IPs is invalid": "允许的 IP 地址错误"
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user