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
No related branches found
No related tags found
No related merge requests found
Pipeline #274956 passed with warnings
import TransactionService from './transaction.service'
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 = [
{ name: ref_obj_fq + '.list', old: old },
{
name: 'evlog.record.list',
old: {
log_fk: fk,
top_n_from_newest: true,
top_n: 50,
sorting_params_list: ['ta_timestamp desc']
}
},
join: { 0: null }
},
{ name: 'evlog.record_type.list' }
]
......
<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]">
<b-table :responsive="true" striped :items="records" :fields="table_fields">
<template v-slot:cell(type)="data">
......@@ -45,22 +46,28 @@ export default {
}
},
props: {
pk: {
required: true
},
title: {
required: true
},
modal_id: {
required: true
},
ref_obj_fq: {
required: true
},
refobj_id_field: {
required: true
},
refobj_id_value: {
required: true
}
},
methods: {
async fetchData() {
this.records = null
const res = await EVLogService.getByFK(this.$store.state.netdb_axios_config, this.pk)
this.records = res.data[0]
this.record_types = apiutil.dict_by_value_of_array(res.data[1], 'short_name')
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[1]
this.record_types = apiutil.dict_by_value_of_array(res.data[2], 'short_name')
}
}
}
......
......@@ -59,8 +59,8 @@
:object_title="db_editor_object_fq_name != null?db_editor_object_fq_name[db_editor_object_fq_name]:''"
:old_data="db_editor_old_data">
</DBEditor>
<EVLogViewer v-if="evlogGroup" modal_id="groups-evlog" :pk="evlogGroup.log_pk"
:title="'Gruppe: ' + evlogGroup.name"></EVLogViewer>
<EVLogViewer v-if="evlogGroup" modal_id="groups-evlog"
:title="'Gruppe: ' + evlogGroup.name" ref_obj_fq="cntl.group" refobj_id_field="name" :refobj_id_value="evlogGroup.name"></EVLogViewer>
</div>
</template>
......
......@@ -126,7 +126,8 @@
:presets="db_editor_presets"
:non_optionals_order="['ou_short_name', 'fqdn_value']"
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>
</div>
</template>
......
......@@ -311,7 +311,7 @@
:non_optionals_order="['value', 'description']">
</DBEditor>
<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>
</div>
</template>
......
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