Skip to content
Snippets Groups Projects
Commit 89b44a86 authored by !! Julian Keck (old Account; do not use) !!'s avatar !! Julian Keck (old Account; do not use) !! :ghost:
Browse files

ADD EUI-64 for new generated AAAA records

parent f5aa41ad
No related branches found
No related tags found
No related merge requests found
Pipeline #275732 failed
......@@ -111,7 +111,7 @@
:title="$t('components.dns_record_type_card.address_is_reserved')">
{{ $t('components.dns_record_type_card.reserved') }}
</b-badge>
<b-badge href="#" @click="createRecord('AAAA', item.data, item.fqdn)"
<b-badge href="#" @click="createRecord('AAAA', item.data, item.fqdn, item.fqdn_description)"
v-if="bcd_has_v4 && bcd_has_v6 && record_type === 'A' && !fqdnHasAAAA(item.fqdn)"
variant="danger">{{ $t('components.dns_record_type_card.no_AAAA_record') }}
</b-badge>
......@@ -519,7 +519,7 @@ export default {
this.create_record_reducer.type = false
this.$root.$emit('bv::show::modal', `update_record-${this.record_type}`)
},
createRecord: function (record_type, data, fqdn) {
createRecord: function (record_type, data, fqdn, fqdn_description = undefined) {
this.db_editor_function = 'create'
this.db_editor_presets = {
type: record_type,
......@@ -527,6 +527,10 @@ export default {
fqdn: fqdn,
}
if (record_type === 'AAAA') {
let mac = null
if (fqdn_description) {
mac = fqdn_description.match('^((?:[0-9a-f]{2}:){5}[0-9a-f]{2})')[0]
}
let sub = null
let multi = false
this.subnets.forEach((item) => {
......@@ -542,6 +546,9 @@ export default {
this.db_editor_presets.data = split[0]
if (split[1] === '64') {
this.db_editor_presets.data += data
if (mac) {
this.db_editor_presets.data = ipaddress.mac_to_eui_ipv6(mac, sub.cidr)
}
}
} else if (multi) {
this.db_editor_presets.data = ''
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment