summaryrefslogtreecommitdiffstats
path: root/webapp/src/store
diff options
context:
space:
mode:
authorUdo Walter2018-08-02 02:45:41 +0200
committerUdo Walter2018-08-02 02:45:41 +0200
commita65c45e5962b6cddf2f6dbf2cb7366b389418b19 (patch)
tree362f131bcc91dd9ef79227bf2603fd9eeded3d75 /webapp/src/store
parent[groups] add create functionality (diff)
downloadbas-a65c45e5962b6cddf2f6dbf2cb7366b389418b19.tar.gz
bas-a65c45e5962b6cddf2f6dbf2cb7366b389418b19.tar.xz
bas-a65c45e5962b6cddf2f6dbf2cb7366b389418b19.zip
[groups] add ability to show all groups and clients
Diffstat (limited to 'webapp/src/store')
-rw-r--r--webapp/src/store/groups.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/webapp/src/store/groups.js b/webapp/src/store/groups.js
index aad77f4..137ae6a 100644
--- a/webapp/src/store/groups.js
+++ b/webapp/src/store/groups.js
@@ -13,6 +13,7 @@ export default {
setGroupList: (state, list) => { state.groupList = list },
setClientList: (state, list) => { state.clientList = list },
setActiveTab: (state, index) => { state.activeTab = index },
+ setShowAll: (state, value) => { state.showAll = value },
deleteFromTabChain: (state, { index, count }) => { state.tabChain.splice(index, count) },
setTab: (state, { index, item }) => {
if (state.tabChain.length > index + 1 && (state.tabChain[index].tabType !== item.tabType || state.tabChain[index].id !== item.id)) {
@@ -29,7 +30,8 @@ export default {
})
},
loadHome (context) {
- Promise.all([axios.get('/api/groups/getTopLevel'), axios.get('/api/clients/getTopLevel')]).then(res => {
+ var apiFunction = context.state.showAll ? 'getAll' : 'getTopLevel'
+ Promise.all([axios.get('/api/groups/' + apiFunction), axios.get('/api/clients/' + apiFunction)]).then(res => {
context.commit('setTab', { index: 0, item: { tabType: 'home', groups: res[0].data, clients: res[1].data } })
})
},