Commit ba21d85c authored by Janis Streib's avatar Janis Streib 🦉
Browse files

ADD: prefill for rr-data on a/aaaa in bcd record view (closes #171)

parent 59251e8f
Pipeline #117264 passed with stages
in 5 minutes and 36 seconds
......@@ -298,7 +298,8 @@
object_function="update" object_fq_name="dns.fqdn" :old_data="db_editor_old_data"
:non_optionals_order="['value', 'description']">
</DBEditor>
<EVLogViewer v-if="range" modal_id="evlog_bcd" :title="'BCD \''+ range.name + '\''" :pk="range.log_pk"></EVLogViewer>
<EVLogViewer v-if="range" modal_id="evlog_bcd" :title="'BCD \''+ range.name + '\''"
:pk="range.log_pk"></EVLogViewer>
</Loading>
</div>
</template>
......@@ -311,6 +312,7 @@ import DBEditor from '../../components/DBEditor'
import transactionutil from '@/util/transactionutil'
import apiutil from '@/util/apiutil'
import EVLogViewer from '@/components/EVLogViewer'
import ipaddress from '@/util/ipaddress'
export default {
name: 'BCDRecords',
......@@ -450,6 +452,41 @@ export default {
target_is_singleton: recobj.target_is_singleton_dflt,
target_is_reverse_unique: recobj.target_is_reverse_unique_dflt
}
if (record_type === 'A') {
let sub = null
let multi = false
this.subnets.forEach((item) => {
if (item.type === '4') {
if (sub !== null) {
multi = true
}
sub = item
}
if (sub !== null && !multi) {
const first = ipaddress.ip_net_get_first(sub.cidr)
const last = ipaddress.ip_net_get_last(sub.cidr)
let index = 0
while (first.slice(0, index) === last.slice(0, index)) {
index++
}
this.db_editor_presets.data = first.slice(0, index)
}
})
} else if (record_type === 'AAAA') {
let sub = null
let multi = false
this.subnets.forEach((item) => {
if (item.type === '6') {
if (sub !== null) {
multi = true
}
sub = item
}
})
if (sub !== null && !multi) {
this.db_editor_presets.data = sub.cidr.split('/')[0]
}
}
this.create_record_reducer = {type: false}
this.$root.$emit('bv::show::modal', 'create_record')
},
......
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