Add app link deletion button
This commit is contained in:
@@ -1,14 +1,19 @@
|
||||
<template>
|
||||
<Dialog ref="applinkDialog"
|
||||
:title="mode === 'edit' ? $t('app.editApplinkDialog.title') : $t('app.addApplinkDialog.title')"
|
||||
:alternate-label="mode === 'edit' ? 'Delete' : ''"
|
||||
alternate-style="danger"
|
||||
:reject-label="$t('main.dialog.cancel')"
|
||||
:confirm-label="$t('main.dialog.save')"
|
||||
confirm-style="success"
|
||||
:confirm-active="isValid"
|
||||
:confirm-busy="busy"
|
||||
@confirm="submit()"
|
||||
@confirm="onSubmit()"
|
||||
@alternate="onRemove()"
|
||||
>
|
||||
<form @submit="submit()" autocomplete="off">
|
||||
<InputDialog ref="inputDialog" />
|
||||
|
||||
<form @submit="onSubmit()" autocomplete="off">
|
||||
<fieldset :disabled="busy">
|
||||
<input style="display: none;" type="submit" :disabled="!isValid" />
|
||||
|
||||
@@ -66,7 +71,7 @@
|
||||
|
||||
<script>
|
||||
|
||||
import { Dialog, FormGroup, MultiSelect, Radiobutton, TagInput, TextInput } from 'pankow';
|
||||
import { Dialog, FormGroup, InputDialog, MultiSelect, Radiobutton, TagInput, TextInput } from 'pankow';
|
||||
|
||||
import ApplinksModel from '../models/ApplinksModel.js';
|
||||
import UsersModel from '../models/UsersModel.js';
|
||||
@@ -84,6 +89,7 @@ export default {
|
||||
components: {
|
||||
Dialog,
|
||||
FormGroup,
|
||||
InputDialog,
|
||||
MultiSelect,
|
||||
Radiobutton,
|
||||
TagInput,
|
||||
@@ -160,7 +166,7 @@ export default {
|
||||
|
||||
this.$refs.applinkDialog.open();
|
||||
},
|
||||
async submit() {
|
||||
async onSubmit() {
|
||||
this.busy = true;
|
||||
|
||||
const data = {
|
||||
@@ -196,6 +202,20 @@ export default {
|
||||
this.$emit('success');
|
||||
this.$refs.applinkDialog.close();
|
||||
},
|
||||
async onRemove() {
|
||||
const yes = await this.$refs.inputDialog.confirm({
|
||||
message: `Really remove applink?`,
|
||||
confirmStyle: 'danger',
|
||||
confirmLabel: this.$t('main.dialog.yes'),
|
||||
rejectLabel: this.$t('main.dialog.cancel')
|
||||
});
|
||||
|
||||
if (!yes) return;
|
||||
|
||||
console.log('remove', this.id)
|
||||
// await volumesModel.remove(volume.id);
|
||||
// await this.refresh();
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user