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

ADD: minimalistic evlog viewer

parent eacef161
Pipeline #117165 failed with stages
in 22 minutes and 3 seconds
import TransactionService from './transaction.service'
export default {
getByFK(config, fk) {
const ta = [
{
name: 'evlog.record.list',
old: {
log_fk: fk,
top_n_from_newest: true,
top_n: 50
}
},
{ name: 'evlog.record_type.list' }
]
return TransactionService.execute(config, ta)
}
}
<template>
<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">
{{ record_types[data.item.type].action }}
</template>
</b-table>
</Loading>
</b-modal>
</template>
<script>
import EVLogService from '@/api-services/evlog.service'
import Loading from '@/components/Loading'
import apiutil from '@/util/apiutil'
export default {
name: 'EVLogViewer',
components: {Loading},
data() {
return {
records: null,
record_types: {},
table_fields: [
{
key: 'data',
label: 'Beschreibung'
},
{
key: 'type',
label: 'Aktionstyp'
},
{
key: 'ta_timestamp',
label: 'Zeit',
sortable: true
},
{
key: 'mgr_login_name',
label: 'Account',
sortable: true
}
]
}
},
props: {
pk: {
required: true
},
title: {
required: true
},
modal_id: {
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')
}
}
}
</script>
<style scoped>
</style>
......@@ -45,7 +45,8 @@ import {
faFileExport,
faRadiation,
faMapSigns,
faNetworkWired
faNetworkWired,
faHistory
} from '@fortawesome/free-solid-svg-icons'
import {
......@@ -111,5 +112,6 @@ library.add(
faFileExport,
faRadiation,
faMapSigns,
faNetworkWired
faNetworkWired,
faHistory
)
......@@ -3,11 +3,18 @@
<Loading :data="[range]">
<template v-if="range"> <!-- TODO: Fix Loading.. this shouldn't be necessary -->
<h1 class="my-4">
{{ range.name }} <small class="text-muted">Broadcastdomain</small></h1>
<b-button variant="outline-primary" @click="editBCD" style="margin-bottom: 1.5rem">
BCD Bearbeiten
<font-awesome-icon :icon="['far', 'edit']"></font-awesome-icon>
</b-button>
{{ range.name }} <small class="text-muted">Broadcastdomain</small>
</h1>
<div style="margin-bottom: 1.5rem">
<b-button variant="outline-primary" @click="editBCD" >
BCD Bearbeiten
<font-awesome-icon :icon="['far', 'edit']"></font-awesome-icon>
</b-button>
<b-button style="margin-left: 15px" variant="outline-secondary" @click="$bvModal.show('evlog_bcd')">
Eventlog
<font-awesome-icon icon="history"></font-awesome-icon>
</b-button>
</div>
<b-row>
<b-col cols="2" order="1" class="d-none d-lg-block bottom-space">
<Loading style="top:75px" class="shadow sticky-top" :data="[loaded]">
......@@ -288,6 +295,7 @@
object_function="update" object_fq_name="dns.fqdn" :old_data="db_editor_old_data"
:non_optionals_order="['value', 'description']">
</DBEditor>
<EVLogViewer modal_id="evlog_bcd" :title="'BCD \''+ range.name + '\''" :pk="range.log_pk"></EVLogViewer>
</Loading>
</div>
</template>
......@@ -299,10 +307,11 @@ import Loading from '../../components/Loading'
import DBEditor from '../../components/DBEditor'
import transactionutil from '@/util/transactionutil'
import apiutil from '@/util/apiutil'
import EVLogViewer from '@/components/EVLogViewer'
export default {
name: 'BCDRecords',
components: {Loading, DBEditor},
components: {EVLogViewer, Loading, DBEditor},
data() {
return {
fqdns: null,
......
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