added confirmation promt to delete Cache

This commit is contained in:
Timo Volkmann 2019-05-10 09:23:55 +02:00
parent d0c2852d4a
commit dc2d693562
3 changed files with 20 additions and 3 deletions

View File

@ -81,7 +81,8 @@ module.exports = function (ctx) {
// Quasar plugins // Quasar plugins
plugins: [ plugins: [
'Notify' 'Notify',
'Dialog'
] ]
// iconSet: 'ionicons-v4' // iconSet: 'ionicons-v4'

View File

@ -138,7 +138,7 @@
}, },
evalAuthentication: function () { evalAuthentication: function () {
this.$store.commit('auth/SET_AUTHENTICATED'); this.$store.commit('auth/SET_AUTHENTICATED');
this.$store.commit('auth/SET_USER'); // this.$store.commit('auth/SET_USER');
}, },
logout: function () { logout: function () {
console.log("logout()"); console.log("logout()");

View File

@ -45,7 +45,7 @@
<q-item class="q-pr-sm reverse q-gutter-x-sm"> <q-item class="q-pr-sm reverse q-gutter-x-sm">
<q-btn @click="startCache(cache.id)" unelevated color="positive" stack icon="arrow_forward" <q-btn @click="startCache(cache.id)" unelevated color="positive" stack icon="arrow_forward"
label="Starten" size="xs"/> label="Starten" size="xs"/>
<q-btn v-if="hasAdminState" @click="deleteCache(cache.id)" unelevated color="negative" stack <q-btn v-if="hasAdminState" @click="confirmDelete(cache.id)" unelevated color="negative" stack
icon="delete" label="Löschen" size="xs"/> icon="delete" label="Löschen" size="xs"/>
<q-btn disable v-if="hasAdminState" @click="editCache(cache.id)" unelevated color="primary" stack <q-btn disable v-if="hasAdminState" @click="editCache(cache.id)" unelevated color="primary" stack
icon="edit" label="Bearbeiten" size="xs"/> icon="edit" label="Bearbeiten" size="xs"/>
@ -154,6 +154,22 @@
this.$store.commit('dialog/NEW_MESSAGE_DIALOG', { message: message, title: header, }); this.$store.commit('dialog/NEW_MESSAGE_DIALOG', { message: message, title: header, });
}) })
}, },
confirmDelete(cacheID) {
this.$q.dialog({
title: 'Löschen...',
message: 'Willst du diesen Cache wirklich löschen?',
persistent: true,
cancel: true,
}).onOk(() => {
console.log('>>>> OK');
this.deleteCache(cacheID)
}).onCancel(() => {
console.log('>>>> Cancel')
}).onDismiss(() => {
})
},
addCache() { addCache() {
this.$router.push({path: `/cache`}) this.$router.push({path: `/cache`})
}, },