Commit 88b8a72d authored by janis.streib's avatar janis.streib 🦉
Browse files

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 @@ ...@@ -4,8 +4,9 @@
<template v-if="range"> <!-- TODO: Fix Loading.. this shouldn't be necessary --> <template v-if="range"> <!-- TODO: Fix Loading.. this shouldn't be necessary -->
<h1 class="my-4"> <h1 class="my-4">
{{ range.name }} <small class="text-muted">Broadcastdomain {{ range.name }} <small class="text-muted">Broadcastdomain
<b-badge variant="success" title="Der Broadcastdomain sind sowohl IPv4- als auch IPv6-Subnetze zugeteilt." pill <b-badge variant="success" title="Der Broadcastdomain sind sowohl IPv4- als auch IPv6-Subnetze zugeteilt."
v-if="bcd_is_dual_stack">Dualstack pill
v-if="has_v4 && has_v6">Dualstack
</b-badge> </b-badge>
</small> </small>
</h1> </h1>
...@@ -319,7 +320,9 @@ ...@@ -319,7 +320,9 @@
</b-td> </b-td>
<b-td> <b-td>
<RRDataView :item="item"></RRDataView> <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! AAAA-Record!
</b-badge> </b-badge>
</b-td> </b-td>
...@@ -459,11 +462,12 @@ export default { ...@@ -459,11 +462,12 @@ export default {
reserved_addrs: null, reserved_addrs: null,
records: null, records: null,
records_by_fqdn: {}, records_by_fqdn: {},
bcd_is_dual_stack: false,
record_types: null, record_types: null,
record_types_by_name: null, record_types_by_name: null,
collapse_states: [true], collapse_states: [true],
dhcp_ip_addrs: {}, dhcp_ip_addrs: {},
has_v4: false,
has_v6: false,
reserved_addrs_list_fields: [ reserved_addrs_list_fields: [
{ {
label: 'Adresse', label: 'Adresse',
...@@ -713,16 +717,13 @@ export default { ...@@ -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_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.parent_oe_mgr = apiutil.dict_by_value_of_array(rangeResponse.data[15], 'login_name')
this.vlans = rangeResponse.data[16] this.vlans = rangeResponse.data[16]
let had_v4 = false
let had_v6 = false
for (const sub of this.subnets) { for (const sub of this.subnets) {
if (sub.type === '4') { if (sub.type === '4') {
had_v4 = true this.has_v4 = true
} else { } 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) 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.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') this.record_types_by_name = apiutil.dict_by_value_of_array(recordQuery.data[3], 'name')
...@@ -865,13 +866,13 @@ export default { ...@@ -865,13 +866,13 @@ export default {
containing_blocks.push({ containing_blocks.push({
first: ipaddress.int_to_ip(last_chg_ip), first: ipaddress.int_to_ip(last_chg_ip),
type: 'reserved', type: 'reserved',
space: hard_maximum + 1 - last_chg_ip space: hard_maximum + 1 - (last_chg_ip)
}) })
} else { } else {
containing_blocks.push({ containing_blocks.push({
first: ipaddress.int_to_ip(last_chg_ip), first: ipaddress.int_to_ip(last_chg_ip),
type: 'free', type: 'free',
space: hard_maximum + 1 - last_chg_ip space: hard_maximum + 1 - (last_chg_ip)
}) })
} }
blk.containing_blocks = containing_blocks blk.containing_blocks = containing_blocks
...@@ -903,6 +904,16 @@ export default { ...@@ -903,6 +904,16 @@ export default {
this.records[inttype.record_type] = [] this.records[inttype.record_type] = []
} }
this.record_types.sort() 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 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