Skip to content
Snippets Groups Projects
Commit f3a66b0b authored by Janis Streib's avatar Janis Streib :owl:
Browse files

FIX: evlog join (closes #190)

parent eee23c2a
Branches
No related tags found
No related merge requests found
Pipeline #274956 passed with warnings
import TransactionService from './transaction.service' import TransactionService from './transaction.service'
export default { export default {
getByFK(config, fk) { getByFK(config, ref_obj_fq, refobj_id_field, refobj_id_value) {
const old = {}
old[refobj_id_field] = refobj_id_value
const ta = [ const ta = [
{ name: ref_obj_fq + '.list', old: old },
{ {
name: 'evlog.record.list', name: 'evlog.record.list',
old: { old: {
log_fk: fk,
top_n_from_newest: true, top_n_from_newest: true,
top_n: 50, top_n: 50,
sorting_params_list: ['ta_timestamp desc'] sorting_params_list: ['ta_timestamp desc']
} },
join: { 0: null }
}, },
{ name: 'evlog.record_type.list' } { name: 'evlog.record_type.list' }
] ]
......
<template> <template>
<b-modal size="xl" ok-title="Schließen" :title="'Eventlog: ' + title" :ok-only="true" :id="modal_id" @show="fetchData()"> <b-modal size="xl" ok-title="Schließen" :title="'Eventlog: ' + title" :ok-only="true" :id="modal_id"
@show="fetchData()">
<Loading :data="[records]"> <Loading :data="[records]">
<b-table :responsive="true" striped :items="records" :fields="table_fields"> <b-table :responsive="true" striped :items="records" :fields="table_fields">
<template v-slot:cell(type)="data"> <template v-slot:cell(type)="data">
...@@ -45,22 +46,28 @@ export default { ...@@ -45,22 +46,28 @@ export default {
} }
}, },
props: { props: {
pk: {
required: true
},
title: { title: {
required: true required: true
}, },
modal_id: { modal_id: {
required: true required: true
},
ref_obj_fq: {
required: true
},
refobj_id_field: {
required: true
},
refobj_id_value: {
required: true
} }
}, },
methods: { methods: {
async fetchData() { async fetchData() {
this.records = null this.records = null
const res = await EVLogService.getByFK(this.$store.state.netdb_axios_config, this.pk) const res = await EVLogService.getByFK(this.$store.state.netdb_axios_config, this.ref_obj_fq, this.refobj_id_field, this.refobj_id_value)
this.records = res.data[0] this.records = res.data[1]
this.record_types = apiutil.dict_by_value_of_array(res.data[1], 'short_name') this.record_types = apiutil.dict_by_value_of_array(res.data[2], 'short_name')
} }
} }
} }
......
...@@ -59,8 +59,8 @@ ...@@ -59,8 +59,8 @@
:object_title="db_editor_object_fq_name != null?db_editor_object_fq_name[db_editor_object_fq_name]:''" :object_title="db_editor_object_fq_name != null?db_editor_object_fq_name[db_editor_object_fq_name]:''"
:old_data="db_editor_old_data"> :old_data="db_editor_old_data">
</DBEditor> </DBEditor>
<EVLogViewer v-if="evlogGroup" modal_id="groups-evlog" :pk="evlogGroup.log_pk" <EVLogViewer v-if="evlogGroup" modal_id="groups-evlog"
:title="'Gruppe: ' + evlogGroup.name"></EVLogViewer> :title="'Gruppe: ' + evlogGroup.name" ref_obj_fq="cntl.group" refobj_id_field="name" :refobj_id_value="evlogGroup.name"></EVLogViewer>
</div> </div>
</template> </template>
......
...@@ -126,7 +126,8 @@ ...@@ -126,7 +126,8 @@
:presets="db_editor_presets" :presets="db_editor_presets"
:non_optionals_order="['ou_short_name', 'fqdn_value']" :non_optionals_order="['ou_short_name', 'fqdn_value']"
object_title="Domain-zu-Organisationseinheits-Zuordnung"></DBEditor> object_title="Domain-zu-Organisationseinheits-Zuordnung"></DBEditor>
<EVLogViewer v-if="evlogOu" modal_id="ou_evlog" :pk="evlogOu.log_pk" <EVLogViewer v-if="evlogOu" modal_id="ou_evlog" ref_obj_fq="org.unit" refobj_id_field="short_name"
:refobj_id_value="evlogOu.short_name"
:title="'Organisationseinheit: ' + evlogOu.name"></EVLogViewer> :title="'Organisationseinheit: ' + evlogOu.name"></EVLogViewer>
</div> </div>
</template> </template>
......
...@@ -311,7 +311,7 @@ ...@@ -311,7 +311,7 @@
:non_optionals_order="['value', 'description']"> :non_optionals_order="['value', 'description']">
</DBEditor> </DBEditor>
<EVLogViewer v-if="range" modal_id="evlog_bcd" :title="'BCD \''+ range.name + '\''" <EVLogViewer v-if="range" modal_id="evlog_bcd" :title="'BCD \''+ range.name + '\''"
:pk="range.log_pk"></EVLogViewer> ref_obj_fq="nd.bcd" refobj_id_field="name_list" :refobj_id_value="[range.name]"></EVLogViewer>
</Loading> </Loading>
</div> </div>
</template> </template>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment