From 8a4383885cb6bc19a2ce16bbad31ff0beada5ae2 Mon Sep 17 00:00:00 2001 From: Udo Walter Date: Sat, 30 Mar 2019 21:49:02 +0000 Subject: [server] configurator api -> ipxeconfigs and ipxeentries api; [webapp] ui polishing --- webapp/src/components/ConfiguratorModule.vue | 14 +++++--- webapp/src/components/ConfiguratorModuleAssign.vue | 7 ++-- webapp/src/components/ConfiguratorModuleConfig.vue | 4 +-- webapp/src/components/ConfiguratorModuleDelete.vue | 2 +- webapp/src/components/ConfiguratorModuleEntry.vue | 2 +- webapp/src/components/RegistrationModule.vue | 39 +++++++++++++++++----- webapp/src/components/RegistrationModuleEdit.vue | 2 +- webapp/src/store/configurator.js | 14 ++++---- 8 files changed, 56 insertions(+), 28 deletions(-) (limited to 'webapp') diff --git a/webapp/src/components/ConfiguratorModule.vue b/webapp/src/components/ConfiguratorModule.vue index edbe8f9..7562021 100644 --- a/webapp/src/components/ConfiguratorModule.vue +++ b/webapp/src/components/ConfiguratorModule.vue @@ -39,10 +39,14 @@ {{ $t('configs') }} - +
- device_hub - edit + + {{ row.item.groupCount }}category + / + {{ row.item.clientCount }}computer + + edit
@@ -125,9 +129,9 @@ export default { configHeaders () { return [ { key: 'id', text: this.$t('id'), width: '50px' }, - { key: 'name', text: this.$t('name') }, + { key: 'name', text: this.$t('name'), width: '220px' }, { key: 'description', text: this.$t('description') }, - { key: 'actions', width: '120px' } + { key: 'actions', width: '200px' } ] }, entryHeaders () { diff --git a/webapp/src/components/ConfiguratorModuleAssign.vue b/webapp/src/components/ConfiguratorModuleAssign.vue index af49d45..5a0d654 100644 --- a/webapp/src/components/ConfiguratorModuleAssign.vue +++ b/webapp/src/components/ConfiguratorModuleAssign.vue @@ -97,8 +97,8 @@ export default { this.selectedGroups = [] this.selectedClients = [] const [ groupsResponse, clientsResponse ] = await Promise.all([ - this.$http.get(`/api/configurator/configs/${value.info.id}/groups`), - this.$http.get(`/api/configurator/configs/${value.info.id}/clients`) + this.$http.get(`/api/ipxeconfigs/${value.info.id}/groups`), + this.$http.get(`/api/ipxeconfigs/${value.info.id}/clients`) ]) this.selectedGroups = groupsResponse.data this.selectedClients = clientsResponse.data @@ -111,13 +111,14 @@ export default { this.$store.commit('configurator/setDialog', data) }, async saveAssignment () { - let url = '/api/configurator/configs/' + this.dialog.info.id + let url = '/api/ipxeconfigs/' + this.dialog.info.id await Promise.all([ this.$http.put(url + '/groups', { ids: this.selectedGroups.map(x => x.id) }), this.$http.put(url + '/clients', { ids: this.selectedClients.map(x => x.id) }) ]) this.$snackbar({ color: 'success', text: this.$t('success') }) this.setDialog({ show: false }) + this.$store.dispatch('configurator/loadConfigs') } } } diff --git a/webapp/src/components/ConfiguratorModuleConfig.vue b/webapp/src/components/ConfiguratorModuleConfig.vue index 946492b..d61cce4 100644 --- a/webapp/src/components/ConfiguratorModuleConfig.vue +++ b/webapp/src/components/ConfiguratorModuleConfig.vue @@ -142,7 +142,7 @@ export default { else this.expertMode = false this.items = [] if (value.info.id) { - this.$http.get('/api/configurator/configs/' + value.info.id + '/entries').then(response => { + this.$http.get('/api/ipxeconfigs/' + value.info.id + '/entries').then(response => { this.items = response.data.map(entry => ({ entry: { id: entry.id, name: entry.name }, customName: entry.config_x_entry.customName, @@ -169,7 +169,7 @@ export default { this.items.splice(this.items.indexOf(item), 1) }, async saveConfig () { - let url = '/api/configurator/configs' + let url = '/api/ipxeconfigs' if (this.dialog.info.id !== undefined) url += '/' + this.dialog.info.id await this.$http.post(url, { data: { diff --git a/webapp/src/components/ConfiguratorModuleDelete.vue b/webapp/src/components/ConfiguratorModuleDelete.vue index 2d5a81d..2703e88 100644 --- a/webapp/src/components/ConfiguratorModuleDelete.vue +++ b/webapp/src/components/ConfiguratorModuleDelete.vue @@ -43,7 +43,7 @@ export default { this.$store.commit('configurator/setDialog', data) }, async deleteItems () { - await this.$http.post('/api/configurator/' + this.dialog.info.itemType + '/?delete', { + await this.$http.post('/api/ipxe' + this.dialog.info.itemType + '/?delete', { ids: this.dialog.info.selected.map(x => x.id) }) this.$store.dispatch('configurator/loadData') diff --git a/webapp/src/components/ConfiguratorModuleEntry.vue b/webapp/src/components/ConfiguratorModuleEntry.vue index 94bce00..6a284ca 100644 --- a/webapp/src/components/ConfiguratorModuleEntry.vue +++ b/webapp/src/components/ConfiguratorModuleEntry.vue @@ -71,7 +71,7 @@ export default { this.$store.commit('configurator/setDialog', data) }, async saveEntry () { - let url = '/api/configurator/entries' + let url = '/api/ipxeentries' if (this.dialog.info.id !== undefined) url += '/' + this.dialog.info.id await this.$http.post(url, { data: { diff --git a/webapp/src/components/RegistrationModule.vue b/webapp/src/components/RegistrationModule.vue index 8448dd4..c921e9c 100644 --- a/webapp/src/components/RegistrationModule.vue +++ b/webapp/src/components/RegistrationModule.vue @@ -1,12 +1,16 @@ { "en": { - "hooks": "Registration hooks", - "createHook": "Create hook" + "hooks": "Registration Hooks", + "hooksInOrder": "Registration Hooks (In Order of Execution)", + "createHook": "Create hook", + "groupRestricted": "Restriced to selected groups" }, "de": { - "hooks": "Registrierungs Hooks ", - "createHook": "Hook erstellen" + "hooks": "Registrierungs Hooks", + "hooksInOrder": "Registration Hooks (In Ausführungsreihenfolge)", + "createHook": "Hook erstellen", + "groupRestricted": "Auf ausgewählte Gruppen beschränkt" } } @@ -22,19 +26,24 @@ - {{ $t('hooks') }} + {{ $t('hooksInOrder') }} - + - drag_handle + drag_handle{{ index + 1 }} {{ hook.name }}{{ hook.type }} {{ hook.description }} - device_hub + + + {{ $t('groupRestricted') }} + edit @@ -111,25 +120,37 @@ export default {