summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUdo Walter2018-09-18 02:25:24 +0200
committerUdo Walter2018-09-18 02:25:24 +0200
commit5895dfed00a6317652bd398afe70dacb3aa8dd5d (patch)
tree603158916a0cf7da3441d83a20b7d246d0c6b664
parentadd ipxe config relation to groups and clients (diff)
downloadbas-5895dfed00a6317652bd398afe70dacb3aa8dd5d.tar.gz
bas-5895dfed00a6317652bd398afe70dacb3aa8dd5d.tar.xz
bas-5895dfed00a6317652bd398afe70dacb3aa8dd5d.zip
[groups] small bugfixes
-rw-r--r--webapp/package-lock.json4
-rw-r--r--webapp/src/components/ComponentSearchTable.vue2
-rw-r--r--webapp/src/components/GroupModuleDialog.vue10
-rw-r--r--webapp/src/components/GroupModuleGroupView.vue6
-rw-r--r--webapp/src/store/groups.js30
5 files changed, 32 insertions, 20 deletions
diff --git a/webapp/package-lock.json b/webapp/package-lock.json
index eed8e2b..87792b0 100644
--- a/webapp/package-lock.json
+++ b/webapp/package-lock.json
@@ -2265,7 +2265,7 @@
"dependencies": {
"minimist": {
"version": "1.2.0",
- "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
+ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
"dev": true
}
@@ -6134,7 +6134,7 @@
},
"minimist": {
"version": "1.2.0",
- "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
+ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
"dev": true
},
diff --git a/webapp/src/components/ComponentSearchTable.vue b/webapp/src/components/ComponentSearchTable.vue
index a22fa96..30c3600 100644
--- a/webapp/src/components/ComponentSearchTable.vue
+++ b/webapp/src/components/ComponentSearchTable.vue
@@ -108,7 +108,7 @@ export default {
},
rowsPerPageItems: {
type: Array,
- default: () => [10, 25, 50]
+ default: () => [10, 25, 50, 100]
}
},
data () {
diff --git a/webapp/src/components/GroupModuleDialog.vue b/webapp/src/components/GroupModuleDialog.vue
index 67cf2c9..7c0905d 100644
--- a/webapp/src/components/GroupModuleDialog.vue
+++ b/webapp/src/components/GroupModuleDialog.vue
@@ -19,7 +19,9 @@
"group": "Permanently delete group | Permanently delete groups",
"client": "Permanently delete client | Permanently delete clients"
},
- "new": "New"
+ "new": "New",
+ "id": "ID",
+ "name": "Name"
},
"de": {
"title": {
@@ -40,7 +42,9 @@
"group": "Gruppe dauerhaft löschen | Gruppen dauerhaft löschen",
"client": "Client dauerhaft löschen | Clienten dauerhaft löschen"
},
- "new": "Neu"
+ "new": "Neu",
+ "id": "ID",
+ "name": "Name"
}
}
</i18n>
@@ -49,7 +53,7 @@
<v-dialog
:value="dialog.show"
@input="setDialog({ show: $event })"
- :max-width="action === 'add' ? '700px' : '500px'"
+ :max-width="action === 'add' ? '1000px' : '500px'"
scrollable
:persistent="action === 'add'"
>
diff --git a/webapp/src/components/GroupModuleGroupView.vue b/webapp/src/components/GroupModuleGroupView.vue
index cf38ba4..9da9126 100644
--- a/webapp/src/components/GroupModuleGroupView.vue
+++ b/webapp/src/components/GroupModuleGroupView.vue
@@ -135,8 +135,10 @@ export default {
},
watch: {
group (newValue, oldValue) {
- if (!newValue.id) this.editInfo()
- else if (newValue.id !== oldValue.id) this.editMode = false
+ if (newValue.id === 'create') this.editInfo()
+ else if (newValue.id !== oldValue.id) {
+ this.editMode = false
+ }
}
},
methods: {
diff --git a/webapp/src/store/groups.js b/webapp/src/store/groups.js
index 524fdc4..4d206de 100644
--- a/webapp/src/store/groups.js
+++ b/webapp/src/store/groups.js
@@ -19,6 +19,7 @@ export default {
setShowAll: (state, { index, value }) => { state.tabChain[index].tabShowAll = value },
deleteFromTabChain: (state, { index, count }) => { state.tabChain.splice(index, count) },
setTab: (state, { index, item }) => {
+ console.log(item)
if (state.tabChain.length > index + 1 && (state.tabChain[index].tabType !== item.tabType || state.tabChain[index].id !== item.id)) {
state.tabChain = state.tabChain.slice(0, index + 1)
}
@@ -85,24 +86,29 @@ export default {
},
saveGroup (context, { id, info, parentIds, tabIndex, callback }) {
axios.post('/api/groups/save', { id, info, parentIds }).then(res => {
- if (callback) callback(res.data.id)
- if (!id) context.commit('setTab', { index: tabIndex, item: { id: res.data.id, name: info.name, tabType: 'group' } })
- if (parentIds && tabIndex > 1 && !parentIds.includes(context.state.tabChain[tabIndex - 1].id)) {
- context.commit('deleteFromTabChain', { index: 1, count: tabIndex - 1 })
- context.commit('setActiveTab', 1)
+ if (res.data.id) {
+ console.log(res.data.id)
+ if (callback) callback(res.data.id)
+ context.commit('setTab', { index: tabIndex, item: { id: res.data.id, name: info.name, tabType: 'group' } })
+ if (parentIds && tabIndex > 1 && !parentIds.includes(context.state.tabChain[tabIndex - 1].id)) {
+ context.commit('deleteFromTabChain', { index: 1, count: tabIndex - 1 })
+ context.commit('setActiveTab', 1)
+ }
+ context.dispatch('reload')
}
- context.dispatch('reload')
})
},
saveClient (context, { id, info, groupIds, tabIndex, callback }) {
axios.post('/api/clients/save', { id, info, groupIds }).then(res => {
- if (callback) callback(res.data.id)
- if (!id) context.commit('setTab', { index: tabIndex, item: { id: res.data.id, name: info.name, tabType: 'client' } })
- if (groupIds && tabIndex > 1 && !groupIds.includes(context.state.tabChain[tabIndex - 1].id)) {
- context.commit('deleteFromTabChain', { index: 1, count: tabIndex - 1 })
- context.commit('setActiveTab', 1)
+ if (res.data.id) {
+ if (callback) callback(res.data.id)
+ context.commit('setTab', { index: tabIndex, item: { id: res.data.id, name: info.name, tabType: 'client' } })
+ if (groupIds && tabIndex > 1 && !groupIds.includes(context.state.tabChain[tabIndex - 1].id)) {
+ context.commit('deleteFromTabChain', { index: 1, count: tabIndex - 1 })
+ context.commit('setActiveTab', 1)
+ }
+ context.dispatch('reload')
}
- context.dispatch('reload')
})
},
deleteGroups (context, { selected }) {