summaryrefslogtreecommitdiffstats
path: root/webapp/src/components/GroupModuleClientList.vue
diff options
context:
space:
mode:
authorUdo Walter2018-08-05 01:08:36 +0200
committerUdo Walter2018-08-05 01:08:36 +0200
commit480639c020f0fc5829d9aa9e1f138d908197cd44 (patch)
treed67e63122acb6cf6bd3fba446e301f4072d5cdad /webapp/src/components/GroupModuleClientList.vue
parentmerge (diff)
downloadbas-480639c020f0fc5829d9aa9e1f138d908197cd44.tar.gz
bas-480639c020f0fc5829d9aa9e1f138d908197cd44.tar.xz
bas-480639c020f0fc5829d9aa9e1f138d908197cd44.zip
[webapp/groups] add generic table actions component for search and pagination; added this to the groups module
Diffstat (limited to 'webapp/src/components/GroupModuleClientList.vue')
-rw-r--r--webapp/src/components/GroupModuleClientList.vue29
1 files changed, 10 insertions, 19 deletions
diff --git a/webapp/src/components/GroupModuleClientList.vue b/webapp/src/components/GroupModuleClientList.vue
index e8809d3..c491b63 100644
--- a/webapp/src/components/GroupModuleClientList.vue
+++ b/webapp/src/components/GroupModuleClientList.vue
@@ -6,7 +6,6 @@
"ip": "IP Address",
"mac": "MAC Address",
"uuid": "UUID",
- "search": "Search",
"removeClients": "Remove one client | Remove {0} clients",
"addClients": "Add clients",
"deleteClients": "Delete one client | Delete {0} clients",
@@ -18,7 +17,6 @@
"ip": "IP Adresse",
"mac": "MAC Adresse",
"uuid": "UUID",
- "search": "Suche",
"removeClients": "Entferne einen Clienten | Entferne {0} Clienten",
"addClients": "Füge Clienten hinzu",
"deleteClients": "Lösche einen Clienten | Lösche {0} Clienten",
@@ -30,10 +28,8 @@
<template>
<div>
<v-card>
- <v-card-title v-if="tabIndex === 0 && showAll" class="search-container">
- <div>
- <v-text-field class="search-field" :placeholder="$t('search')" v-model="search" hide-details prepend-inner-icon="search"></v-text-field>
- </div>
+ <v-card-title v-if="clients.length > 10">
+ <component-table-actions :pagination.sync="pagination" :search.sync="search" :item-count="clients.length" />
</v-card-title>
<v-divider></v-divider>
<v-data-table
@@ -41,9 +37,10 @@
:items="clients"
item-key="id"
select-all
- :hide-actions="tabIndex > 0 || !showAll"
+ hide-actions
v-model="selected"
:search="search"
+ :pagination.sync="pagination"
>
<template slot="items" slot-scope="props">
<tr @click.stop="props.selected = !props.selected" @dblclick="loadClient(props.item.id)">
@@ -84,15 +81,20 @@
</template>
<script>
+import ComponentTableActions from '@/components/ComponentTableActions'
import { mapState, mapMutations } from 'vuex'
export default {
name: 'GroupModuleClientList',
props: ['tabIndex', 'groupId', 'clients'],
+ components: {
+ ComponentTableActions
+ },
data () {
return {
selected: [],
- search: ''
+ search: '',
+ pagination: {}
}
},
computed: {
@@ -148,15 +150,4 @@ export default {
margin-left: 20px;
margin-right: -10px;
}
-
-.search-container {
- display: flex;
- justify-content: flex-end;
-}
-
-.search-field {
- margin-top: 0;
- margin-right: 10px;
- margin-bottom: 5px;
-}
</style>