Commit 88b8a72d authored by Janis Streib's avatar Janis Streib 🦉

UPD: hide a/aaaa in singe-stack bcds

parent e053fa79
Pipeline #131971 passed with stages
in 4 minutes and 47 seconds
......@@ -4,8 +4,9 @@
<template v-if="range"> <!-- TODO: Fix Loading.. this shouldn't be necessary -->
<h1 class="my-4">
{{ range.name }} <small class="text-muted">Broadcastdomain
<b-badge variant="success" title="Der Broadcastdomain sind sowohl IPv4- als auch IPv6-Subnetze zugeteilt." pill
v-if="bcd_is_dual_stack">Dualstack
<b-badge variant="success" title="Der Broadcastdomain sind sowohl IPv4- als auch IPv6-Subnetze zugeteilt."
pill
v-if="has_v4 && has_v6">Dualstack
</b-badge>
</small>
</h1>
......@@ -319,7 +320,9 @@
</b-td>
<b-td>
<RRDataView :item="item"></RRDataView>
<b-badge href="#" @click="createItem('AAAA', '', item.fqdn)" v-if="bcd_is_dual_stack && record_type == 'A' && !(item.target_ipaddr in dhcp_ip_addrs) && !fqdnHasAAAA(item.fqdn)" variant="danger">Kein
<b-badge href="#" @click="createItem('AAAA', '', item.fqdn)"
v-if="has_v4 && has_v6 && record_type == 'A' && !(item.target_ipaddr in dhcp_ip_addrs) && !fqdnHasAAAA(item.fqdn)"
variant="danger">Kein
AAAA-Record!
</b-badge>
</b-td>
......@@ -459,11 +462,12 @@ export default {
reserved_addrs: null,
records: null,
records_by_fqdn: {},
bcd_is_dual_stack: false,
record_types: null,
record_types_by_name: null,
collapse_states: [true],
dhcp_ip_addrs: {},
has_v4: false,
has_v6: false,
reserved_addrs_list_fields: [
{
label: 'Adresse',
......@@ -713,16 +717,13 @@ export default {
this.parent_oe2mgr = apiutil.dict_of_lists_by_value_of_array(rangeResponse.data[14], 'ou_short_name')
this.parent_oe_mgr = apiutil.dict_by_value_of_array(rangeResponse.data[15], 'login_name')
this.vlans = rangeResponse.data[16]
let had_v4 = false
let had_v6 = false
for (const sub of this.subnets) {
if (sub.type === '4') {
had_v4 = true
this.has_v4 = true
} else {
had_v6 = true
this.has_v6 = true
}
}
this.bcd_is_dual_stack = had_v4 && had_v6
const recordQuery = await RangeService.getRecords(this.$store.state.netdb_axios_config, this.$route.params.name)
this.fqdns = apiutil.dict_by_value_of_array(recordQuery.data[1], 'value')
this.record_types_by_name = apiutil.dict_by_value_of_array(recordQuery.data[3], 'name')
......@@ -865,13 +866,13 @@ export default {
containing_blocks.push({
first: ipaddress.int_to_ip(last_chg_ip),
type: 'reserved',
space: hard_maximum + 1 - last_chg_ip
space: hard_maximum + 1 - (last_chg_ip)
})
} else {
containing_blocks.push({
first: ipaddress.int_to_ip(last_chg_ip),
type: 'free',
space: hard_maximum + 1 - last_chg_ip
space: hard_maximum + 1 - (last_chg_ip)
})
}
blk.containing_blocks = containing_blocks
......@@ -903,6 +904,16 @@ export default {
this.records[inttype.record_type] = []
}
this.record_types.sort()
const self = this
this.record_types = this.record_types.filter(t => (function (t) {
if (t === 'A' && !self.has_v4) {
return false
}
if (t === 'AAAA' && !self.has_v6) {
return false
}
return true
})(t))
this.loaded = true
},
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment