summaryrefslogtreecommitdiffstats
path: root/webapp/src/components/ConfiguratorModuleDelete.vue
diff options
context:
space:
mode:
authorUdo Walter2018-09-18 10:33:04 +0200
committerUdo Walter2018-09-18 10:33:04 +0200
commit1d07a975a2562b800fe183c6560f4a3b84ee307a (patch)
tree07f886f07047016af3d9a7565e4abedf497c4c2f /webapp/src/components/ConfiguratorModuleDelete.vue
parent[groups] small bugfixes (diff)
downloadbas-1d07a975a2562b800fe183c6560f4a3b84ee307a.tar.gz
bas-1d07a975a2562b800fe183c6560f4a3b84ee307a.tar.xz
bas-1d07a975a2562b800fe183c6560f4a3b84ee307a.zip
[configurator] add ipxe configurator
Diffstat (limited to 'webapp/src/components/ConfiguratorModuleDelete.vue')
-rw-r--r--webapp/src/components/ConfiguratorModuleDelete.vue65
1 files changed, 65 insertions, 0 deletions
diff --git a/webapp/src/components/ConfiguratorModuleDelete.vue b/webapp/src/components/ConfiguratorModuleDelete.vue
new file mode 100644
index 0000000..dc9fe72
--- /dev/null
+++ b/webapp/src/components/ConfiguratorModuleDelete.vue
@@ -0,0 +1,65 @@
+<i18n>
+{
+ "en": {
+ "title": "Delete this config? | Delete these {0} configs?"
+ },
+ "de": {
+ "title": "Diese Konfiguration löschen? | Diese {0} Konfigurationen löschen?"
+ }
+}
+</i18n>
+
+<template>
+ <v-card>
+ <v-card-title primary-title class="dialog-title elevation-3">
+ <div class="headline">{{ $tc('title', dialog.info.selected.length, [dialog.info.selected.length]) }}</div>
+ </v-card-title>
+ <v-card-text>
+ <div v-for="item in dialog.info.selected" class="grey--text" :key="item.id">[{{ item.id }}] {{ item.name }}</div>
+ </v-card-text>
+ <v-divider></v-divider>
+ <v-card-actions>
+ <v-spacer></v-spacer>
+ <v-btn flat="flat" @click="setDialog({ show: false })">{{ $t('cancel') }}</v-btn>
+ <v-btn color="error" @click="deleteItems">{{ $t('delete') }}</v-btn>
+ </v-card-actions>
+ </v-card>
+</template>
+
+<script>
+import axios from 'axios'
+import { mapState } from 'vuex'
+
+export default {
+ name: 'ConfiguratorModuleDelete',
+ data () {
+ return {
+ }
+ },
+ computed: {
+ ...mapState('configurator', ['dialog'])
+ },
+ methods: {
+ setDialog (data) {
+ this.$store.commit('configurator/setDialog', data)
+ },
+ async deleteItems () {
+ await axios.post('/api/configurator/delete/' + this.dialog.info.itemType, {
+ ids: this.dialog.info.selected.map(x => x.id)
+ })
+ this.$store.dispatch('configurator/loadData')
+ this.setDialog({ show: false })
+ }
+ }
+}
+</script>
+
+<!-- Add "scoped" attribute to limit CSS to this component only -->
+<style scoped>
+.dialog-title {
+ z-index: 1;
+}
+.selected-list {
+ padding: 30px;
+}
+</style>