diff --git a/ui/public/i18n/en/translation.json b/ui/public/i18n/en/translation.json index c1706ad..a6fe410 100644 --- a/ui/public/i18n/en/translation.json +++ b/ui/public/i18n/en/translation.json @@ -107,6 +107,8 @@ "loki_retention_min": "Logs retention must be greater than 1 day", "invalid_network": "Invalid network, it mus be a class C network like 192.168.200.0", "invalid_netmask": "Invalid netmask, it must be a valid netmask like 255.255.255.0", - "invalid_allowed_ips": "Invalid allowed IPs, each entry must be a and IP or CIDR network." + "invalid_allowed_ips": "Invalid allowed IPs, each entry must be a and IP or CIDR network.", + "tun_mtu_min": "TUN MTU must be at least 576", + "mssfix_min": "MSS Fix must be at least 0" } } diff --git a/ui/public/i18n/es/translation.json b/ui/public/i18n/es/translation.json index f688828..dec8a58 100644 --- a/ui/public/i18n/es/translation.json +++ b/ui/public/i18n/es/translation.json @@ -12,7 +12,9 @@ "404": "Recurso no encontrado", "invalid_user": "Nombre de usuario no válido: debe contener sólo letras y números", "network_error": "Error de red", - "validation_error": "Error de validación" + "validation_error": "Error de validación", + "tun_mtu_min": "TUN MTU debe ser al menos 576", + "mssfix_min": "MSS Fix debe ser al menos 0" }, "settings": { "user": "Usuario administrador", diff --git a/ui/public/i18n/it/translation.json b/ui/public/i18n/it/translation.json index 5b11311..8c9bc9e 100644 --- a/ui/public/i18n/it/translation.json +++ b/ui/public/i18n/it/translation.json @@ -12,7 +12,9 @@ "403": "Operazione non autorizzata", "invalid_cn": "Nome controller non valido: deve contenere solo lettere e numeri", "invalid_user": "Nome utente non valido: deve contenere solo lettere e numeri", - "invalid_host": "Nome host non valido: deve essere un FQDN valido" + "invalid_host": "Nome host non valido: deve essere un FQDN valido", + "tun_mtu_min": "TUN MTU deve essere almeno 576", + "mssfix_min": "MSS Fix deve essere almeno 0" }, "settings": { "title": "Impostazioni", diff --git a/ui/src/views/Settings.vue b/ui/src/views/Settings.vue index 7216e18..e83c489 100644 --- a/ui/src/views/Settings.vue +++ b/ui/src/views/Settings.vue @@ -589,14 +589,16 @@ export default { } // validate tun_mtu: minimum 576 - if (parseInt(this.tun_mtu) < 576) { + const tunMtuValue = parseInt(this.tun_mtu, 10); + if (isNaN(tunMtuValue) || tunMtuValue < 576) { this.error.tun_mtu = this.$t("error.tun_mtu_min"); this.focusElement("tun_mtu"); isValidationOk = false; } // validate mssfix: minimum 0 - if (parseInt(this.mssfix) < 0) { + const mssfixValue = parseInt(this.mssfix, 10); + if (isNaN(mssfixValue) || mssfixValue < 0) { this.error.mssfix = this.$t("error.mssfix_min"); this.focusElement("mssfix"); isValidationOk = false; @@ -699,11 +701,11 @@ export default { ovpn_netmask: this.netmask, ovpn_cn: this.cn, api_user: this.user, - loki_retention: parseInt(this.loki_retention), - prometheus_retention: parseInt(this.prometheus_retention), + loki_retention: parseInt(this.loki_retention, 180), + prometheus_retention: parseInt(this.prometheus_retention, 15), maxmind_license: this.maxmind_license, - tun_mtu: parseInt(this.tun_mtu), - mssfix: parseInt(this.mssfix), + tun_mtu: parseInt(this.tun_mtu, 1500), + mssfix: parseInt(this.mssfix, 1455), allowed_ips: this.allowed_ips .split("\n") .map((ip) => ip.trim())