mirror of https://github.com/apache/cloudstack.git
make publicdomainsuffix optional from ui and allow deleting NS records for zone
This commit is contained in:
parent
df5c3e6c68
commit
dc18aa7961
|
|
@ -3573,7 +3573,6 @@
|
|||
"message.error.remove.tungsten.routing.policy": "Removing Tungsten-Fabric Routing Policy from Network failed",
|
||||
"message.error.remove.vm.schedule": "Removing Instance Schedule failed",
|
||||
"message.error.required.input": "Please enter input",
|
||||
"message.error.required.publicdomainsuffix": "Please enter the public domain suffix if the public server is enabled",
|
||||
"message.error.reset.config": "Unable to reset config to default value",
|
||||
"message.error.retrieve.kubeconfig": "Unable to retrieve Kubernetes Cluster config",
|
||||
"message.error.routing.policy.term": "Community need to have the following format number:number",
|
||||
|
|
|
|||
|
|
@ -230,7 +230,7 @@ export default {
|
|||
nameservers: this.form.nameservers || [],
|
||||
ispublic: this.form.ispublic
|
||||
}
|
||||
if (this.form.ispublic) {
|
||||
if (this.form.publicdomainsuffix) {
|
||||
params.publicdomainsuffix = this.form.publicdomainsuffix?.toLowerCase().trim()
|
||||
}
|
||||
await postAPI('addDnsServer', params)
|
||||
|
|
@ -315,12 +315,9 @@ export default {
|
|||
return Promise.resolve()
|
||||
},
|
||||
validatePublicDomainSuffix (rule, value) {
|
||||
if (!this.form.ispublic) {
|
||||
return Promise.resolve()
|
||||
}
|
||||
const normalized = value?.toLowerCase().trim()
|
||||
if (!normalized) {
|
||||
return Promise.reject(new Error(this.$t('message.error.required.publicdomainsuffix')))
|
||||
return Promise.resolve()
|
||||
}
|
||||
if (!FQDN_REGEX.test(normalized)) {
|
||||
return Promise.reject(new Error('Invalid domain suffix'))
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@
|
|||
shape="round"
|
||||
style="float: right;margin-bottom: 10px; z-index: 8"
|
||||
@click="() => { showAddForm = true }">
|
||||
<!-- <template #icon><plus-outlined /></template> -->
|
||||
{{ $t('label.dns.create.record') }}
|
||||
<plus-outlined style="margin-left: 5px;" />
|
||||
</a-button>
|
||||
|
|
@ -44,7 +43,7 @@
|
|||
<template v-if="column.dataIndex === 'ttl'">
|
||||
{{ record.ttl }}
|
||||
</template>
|
||||
<template v-if="column.key === 'actions' && record.type !== 'NS'">
|
||||
<template v-if="column.key === 'actions'">
|
||||
<a-popconfirm
|
||||
:title="$t('message.confirm.delete.dns.record')"
|
||||
@confirm="handleDeleteRecord(record)"
|
||||
|
|
@ -189,7 +188,6 @@ export default {
|
|||
name: record.name,
|
||||
type: record.type
|
||||
}
|
||||
console.log('DeleteDnsRecord params', params)
|
||||
|
||||
postAPI('deleteDnsRecord', params).then(() => {
|
||||
this.$notification.success({
|
||||
|
|
|
|||
|
|
@ -201,8 +201,8 @@ export default {
|
|||
if (dnsapikey) {
|
||||
params.dnsapikey = dnsapikey
|
||||
}
|
||||
if (this.form.ispublic) {
|
||||
params.publicdomainsuffix = this.form.publicdomainsuffix?.trim().toLowerCase()
|
||||
if (this.form.publicdomainsuffix) {
|
||||
params.publicdomainsuffix = this.form.publicdomainsuffix?.toLowerCase().trim()
|
||||
}
|
||||
await postAPI('updateDnsServer', params)
|
||||
this.$notification.success({
|
||||
|
|
@ -269,12 +269,9 @@ export default {
|
|||
return Promise.resolve()
|
||||
},
|
||||
validatePublicDomainSuffix (rule, value) {
|
||||
if (!this.form.ispublic) {
|
||||
return Promise.resolve()
|
||||
}
|
||||
const normalized = value?.toLowerCase().trim()
|
||||
if (!normalized) {
|
||||
return Promise.reject(new Error(this.$t('message.error.required.publicdomainsuffix')))
|
||||
return Promise.resolve()
|
||||
}
|
||||
if (!FQDN_REGEX.test(normalized)) {
|
||||
return Promise.reject(new Error('Invalid domain suffix'))
|
||||
|
|
|
|||
Loading…
Reference in New Issue