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

UPD use rr_chain_target_subnet_gpk_list

Closes #734
parent c334e0db
No related branches found
No related tags found
No related merge requests found
Pipeline #357971 passed with warnings
......@@ -15,10 +15,9 @@ export default {
{ idx: 'rec_fqdns', name: 'dns.fqdn.list', inner_join_ref: { record_list: 'default' } },
{ name: 'dnscfg.fqdn_type.list', old: { sorting_params_list: ['position'] } },
{ name: 'dnscfg.record_inttype.list', old: { is_own: true, sorting_params_list: ['record_type'] } },
{ name: 'dns.ip_addr.list', inner_join_ref: { record_list: 'default' } },
{
name: 'nd.ip_subnet.list',
inner_join_ref: { ip_addr_list: 'default' },
inner_join_ref: { record_list: 'api_func_dns_record_rr_chain_target_contains_subnet' },
old: { sorting_params_list: ['type ASC', 'cidr ASC'] }
}
]
......@@ -30,10 +29,9 @@ export default {
{ name: 'dns.record.list', old: { sorting_params_list: ['type', 'fqdn'], is_auth: true }, inner_join_ref: { fqdn_list: 'default' } },
{ name: 'dnscfg.fqdn_type.list', old: { sorting_params_list: ['position'] } },
{ name: 'dnscfg.record_inttype.list', old: { is_own: true, sorting_params_list: ['record_type'] } },
{ name: 'dns.ip_addr.list', inner_join_ref: { record_list: 'default' } },
{
name: 'nd.ip_subnet.list',
inner_join_ref: { ip_addr_list: 'default' },
inner_join_ref: { record_list: 'api_func_dns_record_rr_chain_target_contains_subnet' },
old: { sorting_params_list: ['type ASC', 'cidr ASC'] }
}
]
......
......@@ -3,7 +3,7 @@ import TransactionService from './transaction.service'
export default {
get_all(config, own) {
const ta = [
{ name: 'dns.record.list', old: { is_own: own, sorting_params_list: ['type', 'fqdn'], rr_chain_target_subnet_list: null, is_auth: true } },
{ name: 'dns.record.list', old: { is_own: own, sorting_params_list: ['type', 'fqdn'], rr_chain_target_subnet_gfk_list: null, is_auth: true } },
{ name: 'dns.fqdn.list', inner_join_ref: { record_list: 'default' } },
]
if (own === null) {
......
......@@ -216,7 +216,7 @@ export default {
return this.filtered_and_sorted_records.slice(this.per_page * (this.current_page - 1), this.per_page * this.current_page)
},
fqdn_list_fields() {
return [
let fields = [
{
label: this.$t('system.fqdn'),
key: 'fqdn',
......@@ -246,18 +246,25 @@ export default {
label: this.$t('system.ttl'),
key: 'ttl',
sortable: true
},
{
label: this.$tc('system.bcd', 2),
key: 'bcds',
sortable: false
},
}
]
if (this.subnets && this.subnets.length > 0) {
fields = fields.concat([
{
label: this.$tc('system.bcd', 2),
key: 'bcds',
sortable: false
}
])
}
fields = fields.concat([
{
label: this.$tc('system.action', 2),
key: 'actions',
sortable: false
}
]
])
return fields
},
subnets_by_cidr() {
return apiutil.dict_by_value_of_array(this.subnets, 'cidr')
......@@ -337,10 +344,10 @@ export default {
URL.revokeObjectURL(link.href)
},
get_bcd_for_record(record) {
if (!record.rr_chain_target_subnet_list) {
if (!record.rr_chain_target_subnet_gfk_list) {
return new Set()
}
return new Set(record.rr_chain_target_subnet_list.map(net => this.subnets_by_cidr[net]?.bcd || '').filter(net => net.length > 0))
return new Set(this.subnets.filter(net => record.rr_chain_target_subnet_gfk_list.includes(net.gpk)).map(net => net.bcd).filter(net => net.length > 0))
},
filterFunc(item, term) {
if (typeof term === 'string') {
......
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