From f5ce7c2ea51337520d5512b6f944f9d35e36bcd2 Mon Sep 17 00:00:00 2001 From: Daniel Lando Date: Wed, 4 Nov 2020 09:42:37 +0100 Subject: [PATCH] feat(ui): save items per page in local storage (#816) --- src/components/ControlPanel.vue | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/components/ControlPanel.vue b/src/components/ControlPanel.vue index 427bd71e..4a938214 100644 --- a/src/components/ControlPanel.vue +++ b/src/components/ControlPanel.vue @@ -81,6 +81,7 @@ :footer-props="{ itemsPerPageOptions: [10, 20, { text: 'All', value: -1 }] }" + :items-per-page.sync="nodeTableItems" item-key="node_id" class="elevation-1" > @@ -672,6 +673,9 @@ export default { } }, watch: { + nodeTableItems (val) { + localStorage.setItem('nodes_itemsPerPage', val) + }, dialogValue (val) { val || this.closeDialog() }, @@ -724,6 +728,7 @@ export default { debugActive: false, selectedScene: null, cnt_status: 'Unknown', + nodeTableItems: 10, newScene: '', scene_values: [], dialogValue: false, @@ -1359,6 +1364,10 @@ export default { mounted () { var self = this + const itemsPerPage = parseInt(localStorage.getItem('nodes_itemsPerPage')) + + this.nodeTableItems = !isNaN(itemsPerPage) ? itemsPerPage : 10 + this.socket.on(this.socketEvents.controller, data => { self.cnt_status = data.help })