summaryrefslogtreecommitdiffstats
path: root/webapp/src/components/RegistrationModuleEdit.vue
diff options
context:
space:
mode:
authorUdo Walter2019-02-25 20:22:13 +0100
committerUdo Walter2019-02-25 20:22:13 +0100
commit000fed17d2c3a896085f5fef6de2f46a9b4cbc7f (patch)
tree99daccb52c9101aa6bc56aef8c39516a67ab4701 /webapp/src/components/RegistrationModuleEdit.vue
parent[webapp/datatable] fix bug caused by npm update (diff)
downloadbas-000fed17d2c3a896085f5fef6de2f46a9b4cbc7f.tar.gz
bas-000fed17d2c3a896085f5fef6de2f46a9b4cbc7f.tar.xz
bas-000fed17d2c3a896085f5fef6de2f46a9b4cbc7f.zip
[webapp/registration] switch to the new selctbox for groups selection
Diffstat (limited to 'webapp/src/components/RegistrationModuleEdit.vue')
-rw-r--r--webapp/src/components/RegistrationModuleEdit.vue40
1 files changed, 15 insertions, 25 deletions
diff --git a/webapp/src/components/RegistrationModuleEdit.vue b/webapp/src/components/RegistrationModuleEdit.vue
index f90295a..829a605 100644
--- a/webapp/src/components/RegistrationModuleEdit.vue
+++ b/webapp/src/components/RegistrationModuleEdit.vue
@@ -3,12 +3,11 @@
"en": {
"name": "Name",
"description": "Description",
- "type": "Script type",
+ "type": "Script Type",
"groups": "Groups",
"script": "Script",
- "titleNew": "Create hook",
- "titleExisting": "Edit hook",
- "groupRestricted": "Restrict to groups"
+ "titleNew": "Create Hook",
+ "titleExisting": "Edit Hook"
},
"de": {
"name": "Name",
@@ -17,8 +16,7 @@
"groups": "Gruppen",
"script": "Skript",
"titleNew": "Hook erstellen",
- "titleExisting": "Hook bearbeiten",
- "groupRestricted": "Auf Gruppen beschränken"
+ "titleExisting": "Hook bearbeiten"
}
}
</i18n>
@@ -30,27 +28,19 @@
</v-card-title>
<v-card-text style="height: 100%;">
<v-layout row wrap>
- <v-flex xs12 sm6>
+ <v-flex xs12 sm9>
<v-text-field prepend-icon="label" :label="$t('name')" color="primary" v-model="name"></v-text-field>
</v-flex>
- <v-flex xs12 sm2 offset-sm1 style="display: flex; justify-content: center">
- <v-tooltip top open-delay="800">
- <v-menu offset-y left :close-on-content-click="false" lazy slot="activator">
- <v-btn slot="activator" class="info-heading-button">
- <v-icon :left="groups.length > 0">device_hub</v-icon>{{ groups.length > 0 ? groups.length : '' }}
- </v-btn>
- <v-card>
- <data-table v-model="groups" :headers="headers" :items="groupList" slim :row-count="6"></data-table>
- </v-card>
- </v-menu>
- <span>{{ $t('groupRestricted') }}</span>
- </v-tooltip>
- </v-flex>
<v-flex xs12 sm2 offset-sm1>
- <v-select prepend-icon="label" color="primary" :items="types" :label="$t('type')" v-model="type" menu-props="offsetY"></v-select>
+ <v-select prepend-icon="file_copy" color="primary" :items="types" :label="$t('type')" v-model="type" menu-props="offsetY"></v-select>
+ </v-flex>
+ <v-flex xs12 md6>
+ <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>
</v-flex>
</v-layout>
- <v-textarea prepend-icon="description" rows="3" :label="$t('description')" color="primary" v-model="description"></v-textarea>
<div class="body-1 script-heading"><v-icon>code</v-icon><span>{{ $t('script') }}</span></div>
<codemirror class="script-editor" ref="editor" v-model="script"></codemirror>
</v-card-text>
@@ -64,13 +54,13 @@
</template>
<script>
-import DataTable from '@/components/DataTable'
+import SelectBox from '@/components/SelectBox'
import { mapState } from 'vuex'
export default {
name: 'RegistrationModuleEdit',
components: {
- DataTable
+ SelectBox
},
data () {
return {
@@ -103,7 +93,7 @@ export default {
this.name = value.info.name || ''
this.description = value.info.description || ''
this.type = value.info.type || 'BASH'
- this.groups = value.info.groups ? value.info.groups.map(x => x.id) : []
+ this.groups = value.info.groups ? value.info.groups : []
this.script = value.info.script || ''
this.interval.id = setInterval(this.refreshEditor, 50)
this.interval.counter = 0