add current dns zone records

This commit is contained in:
axolotle 2021-09-19 03:47:29 +02:00
parent 4e04accf3a
commit d041ca1742
2 changed files with 27 additions and 0 deletions

View file

@ -140,6 +140,7 @@
"auto_config": "Automatic DNS records configuration",
"auto_config_ignored": "ignored, won't be changed by Yunohost unless you check the overwrite option",
"auto_config_ok": "Automatic configuration seems to be OK!",
"auto_config_zone": "Current DNS zone",
"edit": "Edit DNS configuration",
"info": "The automatic DNS records configuration is an experimental feature. <br>Consider saving your current DNS zone from your DNS registrar's interface before pushing records from here.",
"manual_config": "Suggested DNS records for manual configuration",

View file

@ -63,6 +63,20 @@
</template>
</card>
<!-- CURRENT DNS ZONE -->
<card
v-if="showAutoConfigCard && dnsZone && dnsZone.length"
:title="$t('domain.dns.auto_config_zone')" icon="globe" no-body
>
<div class="log">
<div v-for="({ name: record, spaces, content, type }, i) in dnsZone" :key="'zone-' + i" class="records">
{{ record }}
<span class="bg-dark text-light px-1 rounded">{{ type }}</span>{{ spaces }}
<span>{{ content }}</span>
</div>
</div>
</card>
<!-- MANUAL CONFIG CARD -->
<card
v-if="showManualConfigCard"
@ -99,6 +113,7 @@ export default {
dnsConfig: '',
dnsChanges: undefined,
dnsErrors: undefined,
dnsZone: undefined,
force: null
}
},
@ -140,6 +155,17 @@ export default {
}
})
const unchanged = dnsChanges.unchanged
if (unchanged) {
const longestName = getLongest(unchanged, 'name')
const longestType = getLongest(unchanged, 'type')
unchanged.forEach(record => {
record.name = record.name + ' '.repeat(longestName - record.name.length + 1)
record.spaces = ' '.repeat(longestType - record.type.length + 1)
})
this.dnsZone = unchanged
}
this.dnsChanges = changes.length > 0 ? changes : null
this.force = canForce ? false : null
this.loading = false