summaryrefslogtreecommitdiffstats
path: root/webapp/src/components/ConfiguratorModuleConfig.vue
diff options
context:
space:
mode:
authorUdo Walter2019-02-24 03:41:35 +0100
committerUdo Walter2019-02-24 03:41:35 +0100
commit40dc6c93cbb64ce85a5f56085772bcd44e2eebda (patch)
tree24f093e62d683cb6c4067b6fc649c68a0fb0442a /webapp/src/components/ConfiguratorModuleConfig.vue
parent[account] Add editable user info, change statuscodes, delete account (diff)
downloadbas-40dc6c93cbb64ce85a5f56085772bcd44e2eebda.tar.gz
bas-40dc6c93cbb64ce85a5f56085772bcd44e2eebda.tar.xz
bas-40dc6c93cbb64ce85a5f56085772bcd44e2eebda.zip
[webapp/configurator] switch from old table to the new data table
Diffstat (limited to 'webapp/src/components/ConfiguratorModuleConfig.vue')
-rw-r--r--webapp/src/components/ConfiguratorModuleConfig.vue44
1 files changed, 31 insertions, 13 deletions
diff --git a/webapp/src/components/ConfiguratorModuleConfig.vue b/webapp/src/components/ConfiguratorModuleConfig.vue
index a00f345..0cd31e4 100644
--- a/webapp/src/components/ConfiguratorModuleConfig.vue
+++ b/webapp/src/components/ConfiguratorModuleConfig.vue
@@ -73,10 +73,10 @@
<span>{{ $t('defaultEntry') }}</span></v-tooltip>
</v-list-tile-action>
<v-list-tile-content class="item-content">
- <v-select return-object style="max-width: 280px" item-text="name" menu-props="offsetY" :label="$t('entry')" color="primary" v-model="item.entry"
- :items="item.entry.id ? [item.entry, ...availableEntries] : availableEntries"></v-select>
- <v-text-field v-if="item.entry.id" class="custom-name-input" :label="$t('customName')" color="primary" v-model="item.customName"></v-text-field>
- <v-text-field v-if="item.entry.id" style="max-width: 60px" prepend-inner-icon="keyboard" color="primary" v-model="item.keyBind" maxlength="1"></v-text-field>
+ <v-select return-object class="entry-input" item-text="name" menu-props="offsetY" :label="$t('entry')" color="primary" v-model="item.entry"
+ :items="item.entry.id ? [item.entry, ...availableEntries] : availableEntries" hide-details single-line></v-select>
+ <v-text-field v-if="item.entry.id" class="custom-name-input" :label="$t('customName')" color="primary" v-model="item.customName" hide-details single-line></v-text-field>
+ <v-text-field v-if="item.entry.id" class="keybind-input" prepend-icon="keyboard" color="primary" v-model="item.keyBind" maxlength="1" hide-details single-line></v-text-field>
</v-list-tile-content>
<v-list-tile-action>
<v-btn @click="removeItem(item)" icon><v-icon>clear</v-icon></v-btn>
@@ -134,7 +134,7 @@ export default {
dialog: {
immediate: true,
deep: true,
- async handler (value) {
+ handler (value) {
if (value.type === 'config' && value.show) {
this.name = value.info.name || ''
this.description = value.info.description || ''
@@ -144,12 +144,17 @@ export default {
if (this.script) this.expertMode = true
else this.expertMode = false
this.items = []
- var result = await axios.get('/api/configurator/configs/' + value.info.id + '/entries')
- this.items = result.data.map(x => ({
- entry: { id: x.id, name: x.name, script: x.script },
- customName: x.config_x_entry.customName,
- keyBind: x.config_x_entry.keyBind
- }))
+ if (value.info.id) {
+ this.$http.get('/api/configurator/configs/' + 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,
+ keyBind: entry.config_x_entry.keyBind
+ }))
+ })
+ } else {
+ this.items = []
+ }
this.interval.id = setInterval(this.refreshEditor, 50)
this.interval.counter = 0
}
@@ -204,10 +209,23 @@ export default {
display: flex;
flex-direction: row;
justify-content: flex-start;
+ align-items: center;
}
.custom-name-input {
- margin-left: 20px;
- margin-right: 20px;
+ margin: 0 20px;
+ padding: 0;
+}
+
+.entry-input {
+ width: 280px;
+ margin: 0;
+ padding: 0;
+}
+
+.keybind-input {
+ width: 60px;
+ margin: 0;
+ padding: 0;
}
.script-heading {