Skip to content
Snippets Groups Projects
Commit c2d8dc95 authored by Sebastian Böckelmann's avatar Sebastian Böckelmann
Browse files

Use PaginatorTable for SiteList

parent fa325a16
No related branches found
No related tags found
No related merge requests found
......@@ -9,7 +9,7 @@
<div class="pagination_container">
<slot name="content_skeleton_item" v-if="!items || items.length === 0"></slot>
<b-table :filter="filterValue" :items="items" v-bind="$attrs" :current-page="current_page"
@filtered="onFiltered"
@filtered="onFiltered" :busy="isBusy"
:per-page="items_per_page">
<template v-for="(_, slot) of $scopedSlots" v-slot:[slot]="scope">
<slot :name="slot" v-bind="scope"/>
......@@ -116,6 +116,12 @@ export default {
default() {
return null
}
},
isBusy: {
type: Boolean,
default() {
return false
}
}
},
watch: {
......
<template>
<div>
<FilterInput v-model="filter"></FilterInput>
<b-pagination v-if="sites && sites.length > per_page && filter === ''" :total-rows="sites.length"
:per-page="per_page" v-model="current_page" align="center"></b-pagination>
<b-card no-body class="shadow">
<b-table responsive :filter="filter" :per-page="filter === '' ? per_page : null"
:current-page="filter === '' ? current_page : null" :fields="site_list_fields" :busy="sites === null"
:items="sites" :sort-by="sort_by">
<PaginatorTable :is-busy="sites === null" :hide-filter="sites.length < 10" :hide-top-pagination="sites.length < 25"
:fields="site_list_fields"
:items="sites" :sort-by="sort_by">
<template v-slot:cell(fq_name)="data">
<b-link class="nowrap" :to="'/netdoc/sites/'+data.value"><b>{{ data.value }}</b></b-link>
</template>
<template v-slot:cell(type)="data">
{{ $t_netdb(site_types[data.item.type].description) }}
</template>
</b-table>
</PaginatorTable>
<div v-if="sites && sites.length === 0" class="font-italic text-center mb-3">
{{ $t('components.bcd_list.no_sites_available') }}
</div>
......@@ -24,11 +21,11 @@
</template>
<script>
import FilterInput from '@/components/FilterInput'
import PaginatorTable from '@/components/PaginatorTable.vue'
export default {
name: 'SiteList',
components: { FilterInput },
components: { PaginatorTable },
watch: {
filter: {
immediate: true,
......@@ -52,7 +49,7 @@ export default {
},
computed: {
site_list_fields() {
const result = [
return [
{
label: this.$t('system.name'),
key: 'fq_name',
......@@ -69,7 +66,6 @@ export default {
sortable: true
},
]
return result
}
},
props: {
......
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