summaryrefslogtreecommitdiffstats
path: root/webapp/src/components/GroupModuleEditDialog.vue
diff options
context:
space:
mode:
authorUdo Walter2018-07-20 05:49:54 +0200
committerUdo Walter2018-07-20 05:49:54 +0200
commitbe1394e50b38f229260e267828cd880299b99393 (patch)
tree6deb141088fdf46d41cf48443a1b5e2478494326 /webapp/src/components/GroupModuleEditDialog.vue
parent[webapp/devserver] api port for the webpack dev server proxy must now be set ... (diff)
downloadbas-be1394e50b38f229260e267828cd880299b99393.tar.gz
bas-be1394e50b38f229260e267828cd880299b99393.tar.xz
bas-be1394e50b38f229260e267828cd880299b99393.zip
[webapp/settings] added switch to enable colored tab panels
Diffstat (limited to 'webapp/src/components/GroupModuleEditDialog.vue')
-rw-r--r--webapp/src/components/GroupModuleEditDialog.vue83
1 files changed, 83 insertions, 0 deletions
diff --git a/webapp/src/components/GroupModuleEditDialog.vue b/webapp/src/components/GroupModuleEditDialog.vue
new file mode 100644
index 0000000..8eab1e1
--- /dev/null
+++ b/webapp/src/components/GroupModuleEditDialog.vue
@@ -0,0 +1,83 @@
+<i18n>
+{
+ "en": {
+ },
+ "de": {
+ }
+}
+</i18n>
+
+<template>
+ <v-dialog :value="editDialog" @input="setEditDialog" max-width="600px">
+ <v-card>
+ <div class="input-fields">
+ <v-text-field v-model="name" label="Name" box color="primary"></v-text-field>
+ </div>
+ <div class="action-buttons text-xs-right">
+ <v-btn flat @click="$emit('close')">Cancel</v-btn>
+ <v-btn color="primary" @click="saveData">Save</v-btn>
+ </div>
+ </v-card>
+ </v-dialog>
+</template>
+
+<script>
+import { mapState, mapMutations } from 'vuex'
+
+export default {
+ name: 'GroupModuleEditDialog',
+ props: ['id', 'client'],
+ data () {
+ return {
+ name: ''
+ }
+ },
+ computed: {
+ ...mapState('groups', ['editDialog'])
+ },
+ methods: {
+ ...mapMutations('groups', ['setEditDialog']),
+ loadData () {
+ if (!this.id) return
+ if (this.client) {
+ // TODO
+ } else {
+ this.$http('/api/groups?action=getInfo&id=' + this.id).then(response => {
+ this.name = response.data.name
+ })
+ }
+ },
+ saveData () {
+ if (this.client) {
+ // TODO
+ } else {
+ this.$http.post('/api/groups', {
+ action: 'setInfo',
+ id: this.id,
+ name: this.name
+ }).then(response => {
+ console.log(response)
+ })
+ }
+ this.$emit('close')
+ this.$emit('reload')
+ }
+ },
+ created () {
+ this.loadData()
+ }
+}
+</script>
+
+<!-- Add "scoped" attribute to limit CSS to this component only -->
+<style scoped>
+.input-fields {
+ padding: 40px;
+ padding-bottom: 0;
+}
+
+.action-buttons {
+ padding: 10px;
+}
+
+</style>