Commit 605caf17 authored by Robert's avatar Robert 👽

UPD: Add top_n to Eventlog (#168)

parent 5749e3ee
Pipeline #130371 passed with stages
in 5 minutes and 37 seconds
import TransactionService from './transaction.service'
export default {
getByFK(config, ref_obj_fq, refobj_id_field, refobj_id_value) {
getByFK(config, ref_obj_fq, refobj_id_field, refobj_id_value, top_n) {
const old = {}
old[refobj_id_field] = refobj_id_value
const ta = [
......@@ -10,7 +10,7 @@ export default {
name: 'evlog.record.list',
old: {
top_n_from_newest: true,
top_n: 50,
top_n: top_n,
sorting_params_list: ['ta_timestamp desc']
},
join: { 0: null }
......
<template>
<b-modal size="xl" ok-title="Schließen" :title="'Eventlog: ' + title" :ok-only="true" :id="modal_id"
@show="fetchData()">
<b-input-group prepend="# Transaktionen">
<b-form-input type="number" v-model="top_n"/>
<b-input-group-append>
<b-button variant="success" @click="fetchData">Aktualisieren</b-button>
</b-input-group-append>
</b-input-group>
<Loading :data="[records]">
<b-table :responsive="true" striped :items="records" :fields="table_fields">
<template v-slot:cell(type)="data">
......@@ -23,6 +29,7 @@ export default {
return {
records: null,
record_types: {},
top_n: 25,
table_fields: [
{
key: 'data',
......@@ -65,7 +72,7 @@ export default {
methods: {
async fetchData() {
this.records = null
const res = await EVLogService.getByFK(this.$store.state.netdb_axios_config, this.ref_obj_fq, this.refobj_id_field, this.refobj_id_value)
const res = await EVLogService.getByFK(this.$store.state.netdb_axios_config, this.ref_obj_fq, this.refobj_id_field, this.refobj_id_value, parseInt(this.top_n))
this.records = res.data[1]
this.record_types = apiutil.dict_by_value_of_array(res.data[2], 'short_name')
}
......
......@@ -3,7 +3,8 @@
<hr>
<p class="pull-right d-print-none">
<a target="_blank"
:href="$sysinfo.host_oper_mode.is_prod?'https://www-net-doku.scc.kit.edu/':`https://www-net-${$sysinfo.host_oper_mode.mode}-doku.scc.kit.edu/`">
:href="$sysinfo.host_oper_mode.is_prod?'https://www-net-doku.scc.kit.edu/':`https://www-net-${$sysinfo.host_oper_mode.mode}-doku.scc.kit.edu/`"
@mouseover="hovering_help = true" @mouseout="hovering_help = false">
<font-awesome-icon :icon="['far', 'life-ring']"/>
Hilfe/Dokumentation</a> |
<b-link to="/swagger">
......@@ -32,15 +33,33 @@
<a target="_blank" :href="`${m.gitlab_url}/commit/${m.version}`">{{m.version}}</a></li>
</ul>
</b-modal>
<img alt="Clippy" src="@/assets/img/clippy.png" class="clippy" :class="{show: hovering_help}"/>
</footer>
</template>
<script>
export default {
name: 'Footer'
name: 'Footer',
data() {
return {
hovering_help: false
}
}
}
</script>
<style scoped>
.clippy {
height: 25vh;
position: fixed;
right: 0;
bottom: 0;
transform: translateY(200%);
transition: transform .5s;
}
.clippy.show {
transform: translateY(0);
transition: transform ease 5s;
}
</style>
Markdown is supported
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