Skip to content

Commit

Permalink
Display a banner and disabled button/toggle if dns port are bound
Browse files Browse the repository at this point in the history
  • Loading branch information
stephdl committed Jul 31, 2024
1 parent c44c5c6 commit 34af8d2
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
4 changes: 3 additions & 1 deletion ui/public/i18n/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@
"dhcp-server_invalid_type": "Number required",
"dhcp-server_number_gte": "Enter a positive number",
"dns-server_format": "IPv4 format required",
"dns-server_number_one_of": "IPv4 or IPv6 required"
"dns-server_number_one_of": "IPv4 or IPv6 required",
"dns_server_is_running": "A DNS server is running",
"dns_server_is_running_description": "You cannot configure the dns feature if a DNS server is already running on this node. A module like samba may be using the DNS port."
},
"dns_records": {
"title": "DNS records",
Expand Down
25 changes: 24 additions & 1 deletion ui/src/views/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,28 @@
<div class="title-description mg-bottom-xlg">
{{ $t("settings.DNS_description") }}
</div>
<cv-row
v-if="are_dns_bound && !dnsEnableField && !is_dns_enabled"
>
<cv-column>
<NsInlineNotification
kind="info"
:title="$t('settings.dns_server_is_running')"
:description="
$t('settings.dns_server_is_running_description')
"
:showCloseButton="false"
/>
</cv-column>
</cv-row>
<NsToggle
:label="$t('settings.DNS_enable_label')"
v-model="dnsEnableField"
value="dnsEnableField"
formItem
:disabled="
are_dns_bound && !dnsEnableField && !is_dns_enabled
"
ref="dnsEnableField"
>
<template slot="text-left">{{
Expand Down Expand Up @@ -201,7 +218,9 @@
:icon="Save20"
:loading="loading.configureModule"
:disabled="
loading.getConfiguration || loading.configureModule
loading.getConfiguration ||
loading.configureModule ||
(are_dns_bound && !dnsEnableField && !is_dns_enabled)
"
>{{ $t("settings.save") }}</NsButton
>
Expand Down Expand Up @@ -250,6 +269,8 @@ export default {
dhcpStartField: "",
dhcpEndField: "",
dhcpLeaseField: 12,
are_dns_bound: false,
is_dns_enabled: false,
dnsEnableField: false,
dnsPrimaryField: "",
dnsSecondaryField: "",
Expand Down Expand Up @@ -406,6 +427,8 @@ export default {
this.dnsEnableField = dns_server["enabled"];
this.dnsPrimaryField = dns_server["primary-server"];
this.dnsSecondaryField = dns_server["secondary-server"];
this.are_dns_bound = config["are_dns_bound"];
this.is_dns_enabled = config["is_dns_enabled"];
},
validateConfigureModule() {
this.clearErrors(this);
Expand Down

0 comments on commit 34af8d2

Please sign in to comment.