summaryrefslogtreecommitdiffstats
path: root/webapp/src/store
diff options
context:
space:
mode:
authorUdo Walter2018-09-18 11:14:02 +0200
committerUdo Walter2018-09-18 11:14:02 +0200
commit7810e897d9f215c8c282aa88e041ee398b1acb35 (patch)
tree9737b81ab4aa3beb6d73bf7316c0dd03d63d7fd3 /webapp/src/store
parent[configurator] add ipxe configurator (diff)
downloadbas-7810e897d9f215c8c282aa88e041ee398b1acb35.tar.gz
bas-7810e897d9f215c8c282aa88e041ee398b1acb35.tar.xz
bas-7810e897d9f215c8c282aa88e041ee398b1acb35.zip
[groups] add ability to set a config for groups and clients
Diffstat (limited to 'webapp/src/store')
-rw-r--r--webapp/src/store/groups.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/webapp/src/store/groups.js b/webapp/src/store/groups.js
index 39875d1..03b351d 100644
--- a/webapp/src/store/groups.js
+++ b/webapp/src/store/groups.js
@@ -5,6 +5,8 @@ export default {
state: {
groupList: [],
clientList: [],
+ configList: [],
+ configNames: {},
tabChain: [],
activeTab: 0,
dialog: {
@@ -15,6 +17,14 @@ export default {
mutations: {
setGroupList: (state, list) => { state.groupList = list },
setClientList: (state, list) => { state.clientList = list },
+ setConfigList: (state, list) => {
+ state.configList = list
+ var names = {}
+ list.forEach(config => {
+ names[config.id] = config.name
+ })
+ state.configNames = names
+ },
setActiveTab: (state, index) => { state.activeTab = index },
setShowAll: (state, { index, value }) => { state.tabChain[index].tabShowAll = value },
deleteFromTabChain: (state, { index, count }) => { state.tabChain.splice(index, count) },
@@ -31,6 +41,9 @@ export default {
},
actions: {
loadLists (context) {
+ axios.get('/api/configurator/configs').then(result => {
+ context.commit('setConfigList', result.data.map(x => ({ id: x.id, name: x.name || x.id })))
+ })
Promise.all([axios.get('/api/groups/getList'), axios.get('/api/clients/getList')]).then(res => {
context.commit('setGroupList', res[0].data.map(x => ({ id: x.id, name: x.name || x.id })))
context.commit('setClientList', res[1].data.map(x => ({ id: x.id, name: x.name || x.id })))