summaryrefslogtreecommitdiffstats
path: root/webapp/src/store
diff options
context:
space:
mode:
authorUdo Walter2018-11-15 23:53:28 +0100
committerUdo Walter2018-11-15 23:53:28 +0100
commitca97f3e10dddd004808212c9bb5d446763050c80 (patch)
tree705e174451ee0ff8d6a421591464b8ff032a952d /webapp/src/store
parent[groups] API method getGroup: forgot to include clients with all=true (diff)
downloadbas-ca97f3e10dddd004808212c9bb5d446763050c80.tar.gz
bas-ca97f3e10dddd004808212c9bb5d446763050c80.tar.xz
bas-ca97f3e10dddd004808212c9bb5d446763050c80.zip
[webapp/groups] add loading indicator to the group and client tables
Diffstat (limited to 'webapp/src/store')
-rw-r--r--webapp/src/store/groups.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/webapp/src/store/groups.js b/webapp/src/store/groups.js
index 12eea4f..1bbded9 100644
--- a/webapp/src/store/groups.js
+++ b/webapp/src/store/groups.js
@@ -1,3 +1,4 @@
+import Vue from 'vue'
import axios from 'axios'
export default {
@@ -34,6 +35,9 @@ export default {
}
state.tabChain.splice(index, 1, item)
},
+ setTabLoading (state, index) {
+ if (state.tabChain.length > index) Vue.set(state.tabChain[index], 'loading', true)
+ },
setDialog (state, { show, info }) {
if (info !== undefined) state.dialog.info = info
if (show !== undefined) state.dialog.show = show
@@ -61,6 +65,7 @@ export default {
if (context.state.tabChain.length <= tabIndex || context.state.tabChain[tabIndex].id !== id) {
context.commit('setTab', { index: tabIndex, item: { id, name, tabType: 'group', tabShowAll: showAll, subgroups: [], clients: [] } })
}
+ context.commit('setTabLoading', tabIndex)
if (switchTab) context.commit('setActiveTab', tabIndex)
axios.get('/api/groups/getGroup?id=' + id + (showAll ? '&all=true' : '')).then(res => {
res.data.tabType = 'group'