summaryrefslogtreecommitdiffstats
path: root/webapp
diff options
context:
space:
mode:
authorUdo Walter2019-03-30 22:49:02 +0100
committerUdo Walter2019-03-30 22:49:02 +0100
commit8a4383885cb6bc19a2ce16bbad31ff0beada5ae2 (patch)
tree6d59120c2cea7c9d7e07d201af8f080d45a35945 /webapp
parent[webapp] fix bug in groups; remember filters in systemlog (diff)
downloadbas-8a4383885cb6bc19a2ce16bbad31ff0beada5ae2.tar.gz
bas-8a4383885cb6bc19a2ce16bbad31ff0beada5ae2.tar.xz
bas-8a4383885cb6bc19a2ce16bbad31ff0beada5ae2.zip
[server] configurator api -> ipxeconfigs and ipxeentries api; [webapp] ui polishing
Diffstat (limited to 'webapp')
-rw-r--r--webapp/src/components/ConfiguratorModule.vue14
-rw-r--r--webapp/src/components/ConfiguratorModuleAssign.vue7
-rw-r--r--webapp/src/components/ConfiguratorModuleConfig.vue4
-rw-r--r--webapp/src/components/ConfiguratorModuleDelete.vue2
-rw-r--r--webapp/src/components/ConfiguratorModuleEntry.vue2
-rw-r--r--webapp/src/components/RegistrationModule.vue39
-rw-r--r--webapp/src/components/RegistrationModuleEdit.vue2
-rw-r--r--webapp/src/store/configurator.js14
8 files changed, 56 insertions, 28 deletions
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 @@
<v-tab-item>
<v-subheader>{{ $t('configs') }}</v-subheader>
<v-card>
- <data-table v-model="selectedConfigs" :headers="configHeaders" :items="configs" min-width="600px" @dblclick="editConfig($event)">
+ <data-table v-model="selectedConfigs" :headers="configHeaders" :items="configs" min-width="800px" @dblclick="editConfig($event)">
<div slot="actions" slot-scope="row" style="text-align: right">
- <v-btn icon @click.stop="assignConfig(row.item)"><v-icon>device_hub</v-icon></v-btn>
- <v-btn icon @click.stop="editConfig(row.item)"><v-icon color="primary">edit</v-icon></v-btn>
+ <v-btn flat small @click.stop="assignConfig(row.item)">
+ <span class="mr-1">{{ row.item.groupCount }}</span><v-icon small>category</v-icon>
+ <span class="mx-1">/</span>
+ <span class="mr-1">{{ row.item.clientCount }}</span><v-icon small>computer</v-icon>
+ </v-btn>
+ <v-btn flat icon @click.stop="editConfig(row.item)"><v-icon color="primary">edit</v-icon></v-btn>
</div>
</data-table>
</v-card>
@@ -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 @@
<i18n>
{
"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"
}
}
</i18n>
@@ -22,19 +26,24 @@
</v-card>
<v-tabs-items v-model="tabs" style="padding-bottom: 20px">
<v-tab-item>
- <v-subheader>{{ $t('hooks') }}</v-subheader>
+ <v-subheader>{{ $t('hooksInOrder') }}</v-subheader>
<v-card v-if="hooks.length > 0">
<v-list two-line>
<draggable :value="hooks" @input="setHooks($event)" :options="{ handle:'.handle' }">
- <v-list-tile v-for="hook in hooks" :key="hook.id" @click.stop @dblclick="editHook(hook)">
+ <v-list-tile v-for="(hook, index) in hooks" :key="hook.id" @click.stop @dblclick="editHook(hook)">
<v-list-tile-action class="handle">
- <v-icon>drag_handle</v-icon>
+ <v-icon>drag_handle</v-icon>{{ index + 1 }}
</v-list-tile-action>
<v-list-tile-content>
<v-list-tile-title>{{ hook.name }}<small class="type">{{ hook.type }}</small></v-list-tile-title>
<v-list-tile-sub-title>{{ hook.description }}</v-list-tile-sub-title>
</v-list-tile-content>
- <v-icon v-if="hook.groups.length > 0">device_hub</v-icon>
+ <v-tooltip v-if="hook.groups.length > 0" top>
+ <template #activator="{ on }">
+ <v-icon v-on="on" small>category</v-icon>
+ </template>
+ <span>{{ $t('groupRestricted') }}</span>
+ </v-tooltip>
<v-list-tile-action>
<v-btn @click="editHook(hook)" icon><v-icon color="primary">edit</v-icon></v-btn>
</v-list-tile-action>
@@ -111,25 +120,37 @@ export default {
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
.handle {
- margin-left: 12px;
+ margin-left: 8px;
+ margin-right: 24px;
+ font-weight: bold;
+ font-size: 18px;
+ display: flex;
+ flex-direction: row;
+ align-items: center;
}
+
.delete {
margin-right: 12px;
}
+
.type {
margin-left: 24px;
}
+
.hook-info {
display: flex;
flex-direction: row;
width: 100%;
}
+
.hook-info > .hook-type {
min-width: 60px;
}
+
.hook-info > .hook-name {
white-space: nowrap;
}
+
.hook-info > .hook-description {
margin-left: 40px;
overflow: hidden;
diff --git a/webapp/src/components/RegistrationModuleEdit.vue b/webapp/src/components/RegistrationModuleEdit.vue
index 040acec..81b15fb 100644
--- a/webapp/src/components/RegistrationModuleEdit.vue
+++ b/webapp/src/components/RegistrationModuleEdit.vue
@@ -38,7 +38,7 @@
<v-textarea prepend-icon="description" rows="1" auto-grow :label="$t('description')" color="primary" v-model="description"></v-textarea>
</v-flex>
<v-flex xs12 md5 offset-md1>
- <select-box prepend-icon="device_hub" :label="$t('groups')" v-model="groups" :items="groupList"></select-box>
+ <select-box prepend-icon="category" :label="$t('groups')" v-model="groups" :items="groupList"></select-box>
</v-flex>
</v-layout>
<div class="body-1 script-heading"><v-icon>code</v-icon><span>{{ $t('script') }}</span></div>
diff --git a/webapp/src/store/configurator.js b/webapp/src/store/configurator.js
index 5624c41..276660a 100644
--- a/webapp/src/store/configurator.js
+++ b/webapp/src/store/configurator.js
@@ -21,13 +21,15 @@ export default {
}
},
actions: {
+ async loadConfigs (context) {
+ context.commit('setConfigs', (await axios.get('/api/ipxeconfigs')).data)
+ },
+ async loadEntries (context) {
+ context.commit('setEntries', (await axios.get('/api/ipxeentries')).data)
+ },
loadData (context) {
- axios.get('/api/configurator/configs').then(result => {
- context.commit('setConfigs', result.data)
- })
- axios.get('/api/configurator/entries').then(result => {
- context.commit('setEntries', result.data)
- })
+ context.dispatch('loadConfigs')
+ context.dispatch('loadEntries')
}
}
}