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

ADD: default value for A record create (closes #228)

parent 0d02dca3
Pipeline #130090 passed with stages
in 6 minutes and 19 seconds
...@@ -496,6 +496,9 @@ export default { ...@@ -496,6 +496,9 @@ export default {
reverseIfDesc(rec_type, arr) { reverseIfDesc(rec_type, arr) {
return (this.sort_dir[rec_type] === 'ascending') ? arr : [...arr].reverse() return (this.sort_dir[rec_type] === 'ascending') ? arr : [...arr].reverse()
}, },
reverseIfAsc(rec_type, arr) {
return (this.sort_dir[rec_type] === 'descending') ? arr : [...arr].reverse()
},
upperIfAsc(rec_type) { upperIfAsc(rec_type) {
return (this.sort_dir[rec_type] === 'ascending') ? this.asc_v4_blocklist_by_upper : this.asc_v4_blocklist_by_lower return (this.sort_dir[rec_type] === 'ascending') ? this.asc_v4_blocklist_by_upper : this.asc_v4_blocklist_by_lower
}, },
...@@ -608,6 +611,20 @@ export default { ...@@ -608,6 +611,20 @@ export default {
this.db_editor_presets.data = sub.cidr.split('/')[0] this.db_editor_presets.data = sub.cidr.split('/')[0]
} }
} }
if (record_type === 'A') {
let res_ip = null
for (const bl of this.reverseIfAsc('A', this.asc_v4_blocklist)) {
for (const b of bl.containing_blocks) {
if (b.type === 'free') {
res_ip = b.first
break
}
}
}
if (res_ip !== null) {
this.db_editor_presets.data = res_ip
}
}
this.create_record_reducer = {type: false} this.create_record_reducer = {type: false}
this.$root.$emit('bv::show::modal', 'create_record') this.$root.$emit('bv::show::modal', 'create_record')
}, },
......
Supports Markdown
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