Commit d333dde5 authored by Janis Streib's avatar Janis Streib 🦉
Browse files

ADD: filter in bcd records (closes #178)

parent 2c3bc474
Pipeline #117644 passed with stages
in 5 minutes and 5 seconds
...@@ -215,10 +215,12 @@ ...@@ -215,10 +215,12 @@
</b-card-header> </b-card-header>
<b-card-body body-class="p-0"> <b-card-body body-class="p-0">
<b-collapse :id="'records-'+record_type+'-collapse'" v-model="collapse_states[2+index]"> <b-collapse :id="'records-'+record_type+'-collapse'" v-model="collapse_states[2+index]">
<b-pagination v-if="loaded && records[record_type].length > per_page" :per_page="per_page" <FilterInput v-model="filter[record_type]"></FilterInput>
<b-pagination v-if="(!(record_type in filter) || filter[record_type] === '')&& loaded && records[record_type].length > per_page" :per_page="per_page"
align="center" v-model="current_page[record_type]" align="center" v-model="current_page[record_type]"
:total-rows="records[record_type].length"></b-pagination> :total-rows="records[record_type].length"></b-pagination>
<b-table responsive :items="records[record_type]" :per-page="per_page" <b-table responsive :filter="filter[record_type]" :items="records[record_type]"
:per-page="(!(record_type in filter) || filter[record_type] === '') ? per_page : null"
:current-page="current_page[record_type]" :current-page="current_page[record_type]"
:fields="record_list_fields"> :fields="record_list_fields">
<template v-slot:cell(fqdn)="data"> <template v-slot:cell(fqdn)="data">
...@@ -283,7 +285,7 @@ ...@@ -283,7 +285,7 @@
</b-tooltip> </b-tooltip>
</template> </template>
</b-table> </b-table>
<b-pagination v-if="loaded && records[record_type].length > per_page" :per_page="per_page" <b-pagination v-if="(!(record_type in filter) || filter[record_type] === '') && loaded && records[record_type].length > per_page" :per_page="per_page"
align="center" v-model="current_page[record_type]" align="center" v-model="current_page[record_type]"
:total-rows="records[record_type].length"></b-pagination> :total-rows="records[record_type].length"></b-pagination>
</b-collapse> </b-collapse>
...@@ -323,12 +325,14 @@ import transactionutil from '@/util/transactionutil' ...@@ -323,12 +325,14 @@ import transactionutil from '@/util/transactionutil'
import apiutil from '@/util/apiutil' import apiutil from '@/util/apiutil'
import EVLogViewer from '@/components/EVLogViewer' import EVLogViewer from '@/components/EVLogViewer'
import ipaddress from '@/util/ipaddress' import ipaddress from '@/util/ipaddress'
import FilterInput from '@/components/FilterInput'
export default { export default {
name: 'BCDRecords', name: 'BCDRecords',
components: {EVLogViewer, Loading, DBEditor}, components: {FilterInput, EVLogViewer, Loading, DBEditor},
data() { data() {
return { return {
filter: {},
vlans: null, vlans: null,
fqdns: null, fqdns: null,
groups: null, groups: null,
......
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