Skip to content

Commit dc18aa7

Browse files
committed
make publicdomainsuffix optional from ui and allow deleting NS records for zone
1 parent df5c3e6 commit dc18aa7

4 files changed

Lines changed: 6 additions & 15 deletions

File tree

ui/public/locales/en.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3573,7 +3573,6 @@
35733573
"message.error.remove.tungsten.routing.policy": "Removing Tungsten-Fabric Routing Policy from Network failed",
35743574
"message.error.remove.vm.schedule": "Removing Instance Schedule failed",
35753575
"message.error.required.input": "Please enter input",
3576-
"message.error.required.publicdomainsuffix": "Please enter the public domain suffix if the public server is enabled",
35773576
"message.error.reset.config": "Unable to reset config to default value",
35783577
"message.error.retrieve.kubeconfig": "Unable to retrieve Kubernetes Cluster config",
35793578
"message.error.routing.policy.term": "Community need to have the following format number:number",

ui/src/views/network/dns/AddDnsServer.vue

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ export default {
230230
nameservers: this.form.nameservers || [],
231231
ispublic: this.form.ispublic
232232
}
233-
if (this.form.ispublic) {
233+
if (this.form.publicdomainsuffix) {
234234
params.publicdomainsuffix = this.form.publicdomainsuffix?.toLowerCase().trim()
235235
}
236236
await postAPI('addDnsServer', params)
@@ -315,12 +315,9 @@ export default {
315315
return Promise.resolve()
316316
},
317317
validatePublicDomainSuffix (rule, value) {
318-
if (!this.form.ispublic) {
319-
return Promise.resolve()
320-
}
321318
const normalized = value?.toLowerCase().trim()
322319
if (!normalized) {
323-
return Promise.reject(new Error(this.$t('message.error.required.publicdomainsuffix')))
320+
return Promise.resolve()
324321
}
325322
if (!FQDN_REGEX.test(normalized)) {
326323
return Promise.reject(new Error('Invalid domain suffix'))

ui/src/views/network/dns/DnsRecordsTab.vue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
shape="round"
2323
style="float: right;margin-bottom: 10px; z-index: 8"
2424
@click="() => { showAddForm = true }">
25-
<!-- <template #icon><plus-outlined /></template> -->
2625
{{ $t('label.dns.create.record') }}
2726
<plus-outlined style="margin-left: 5px;" />
2827
</a-button>
@@ -44,7 +43,7 @@
4443
<template v-if="column.dataIndex === 'ttl'">
4544
{{ record.ttl }}
4645
</template>
47-
<template v-if="column.key === 'actions' && record.type !== 'NS'">
46+
<template v-if="column.key === 'actions'">
4847
<a-popconfirm
4948
:title="$t('message.confirm.delete.dns.record')"
5049
@confirm="handleDeleteRecord(record)"
@@ -189,7 +188,6 @@ export default {
189188
name: record.name,
190189
type: record.type
191190
}
192-
console.log('DeleteDnsRecord params', params)
193191
194192
postAPI('deleteDnsRecord', params).then(() => {
195193
this.$notification.success({

ui/src/views/network/dns/UpdateDnsServer.vue

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,8 @@ export default {
201201
if (dnsapikey) {
202202
params.dnsapikey = dnsapikey
203203
}
204-
if (this.form.ispublic) {
205-
params.publicdomainsuffix = this.form.publicdomainsuffix?.trim().toLowerCase()
204+
if (this.form.publicdomainsuffix) {
205+
params.publicdomainsuffix = this.form.publicdomainsuffix?.toLowerCase().trim()
206206
}
207207
await postAPI('updateDnsServer', params)
208208
this.$notification.success({
@@ -269,12 +269,9 @@ export default {
269269
return Promise.resolve()
270270
},
271271
validatePublicDomainSuffix (rule, value) {
272-
if (!this.form.ispublic) {
273-
return Promise.resolve()
274-
}
275272
const normalized = value?.toLowerCase().trim()
276273
if (!normalized) {
277-
return Promise.reject(new Error(this.$t('message.error.required.publicdomainsuffix')))
274+
return Promise.resolve()
278275
}
279276
if (!FQDN_REGEX.test(normalized)) {
280277
return Promise.reject(new Error('Invalid domain suffix'))

0 commit comments

Comments
 (0)