From 4cae910b685e23f27d407f19eb79fab87120580c Mon Sep 17 00:00:00 2001 From: Donald Zou Date: Mon, 23 Sep 2024 03:07:48 +0800 Subject: [PATCH] Added some update :) --- src/static/app/src/views/newConfiguration.vue | 62 ++++++++++++------- src/static/locale/languages.json | 10 --- src/static/locale/zh-CN.json | 11 +++- src/static/locale/zh-HK.json | 11 +++- 4 files changed, 58 insertions(+), 36 deletions(-) delete mode 100644 src/static/locale/languages.json diff --git a/src/static/app/src/views/newConfiguration.vue b/src/static/app/src/views/newConfiguration.vue index c811b3b..2d149e3 100644 --- a/src/static/app/src/views/newConfiguration.vue +++ b/src/static/app/src/views/newConfiguration.vue @@ -3,9 +3,11 @@ import {parse} from "cidr-tools"; import '@/utilities/wireguard.js' import {WireguardConfigurationsStore} from "@/stores/WireguardConfigurationsStore.js"; import {fetchPost} from "@/utilities/fetch.js"; +import LocaleText from "@/components/text/localeText.vue"; export default { name: "newConfiguration", + components: {LocaleText}, setup(){ const store = WireguardConfigurationsStore() return {store} @@ -48,9 +50,7 @@ export default { if (res.status){ this.success = true await this.store.getConfigurations() - setTimeout(() => { - this.$router.push('/') - }, 1000) + this.$router.push(`/configuration/${this.newConfiguration.ConfigurationName}/peers`) }else{ this.error = true; this.errorMessage = res.message; @@ -131,7 +131,8 @@ export default {

- New Configuration + +

@@ -140,7 +141,9 @@ export default { @submit="(e) => {e.preventDefault(); this.saveNewConfiguration();}" >
-
Configuration Name
+
+ +
{{this.errorMessage}}
- Configuration name is invalid. Possible reasons: +
    -
  • Configuration name already exist.
  • -
  • Configuration name can only contain 15 lower/uppercase alphabet, numbers, "_"(underscore), "="(equal), "+"(plus), "."(period/dot), "-"(dash/hyphen)
  • +
  • + +
  • +
  • + +
@@ -160,10 +167,15 @@ export default {
-
Private Key / Public Key / Pre-Shared Key
+
+ & + +
- +
- + @@ -188,7 +202,9 @@ export default {
-
Listen Port
+
+ +
{{this.errorMessage}}
- Invalid port +
- IP Address & Range + {{ numberOfAvailableIPs }} Available IPs
@@ -218,7 +234,7 @@ export default {
{{this.errorMessage}}
- IP address & range is invalid. + IP Address/CIDR is invalid
@@ -229,7 +245,7 @@ export default {

- - - -