mirror of
https://github.com/hkalexling/Mango.git
synced 2025-08-03 11:25:29 -04:00
Confirmation before deleting subscriptions
This commit is contained in:
parent
acefa00b12
commit
95eb208901
@ -100,10 +100,21 @@ const component = () => {
|
|||||||
|
|
||||||
return `<td>${key}</td><td>${type}</td><td>${value}</td>`;
|
return `<td>${key}</td><td>${type}</td><td>${value}</td>`;
|
||||||
},
|
},
|
||||||
action(event, type) {
|
actionHandler(event, type) {
|
||||||
|
const id = $(event.currentTarget).closest("tr").attr("sid");
|
||||||
|
if (type !== 'delete') return this.action(id, type);
|
||||||
|
UIkit.modal.confirm('Are you sure you want to delete the subscription? This cannot be undone.', {
|
||||||
|
labels: {
|
||||||
|
ok: 'Yes, delete it',
|
||||||
|
cancel: 'Cancel'
|
||||||
|
}
|
||||||
|
}).then(() => {
|
||||||
|
this.action(id, type);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
action(id, type) {
|
||||||
if (this.loading) return;
|
if (this.loading) return;
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
const id = $(event.currentTarget).closest("tr").attr("sid");
|
|
||||||
fetch(
|
fetch(
|
||||||
`${base_url}api/admin/plugin/subscriptions${type === 'update' ? '/update' : ''}?${new URLSearchParams(
|
`${base_url}api/admin/plugin/subscriptions${type === 'update' ? '/update' : ''}?${new URLSearchParams(
|
||||||
{
|
{
|
||||||
|
@ -42,8 +42,8 @@
|
|||||||
<td x-html="renderDateCell(sub.created_at)"></td>
|
<td x-html="renderDateCell(sub.created_at)"></td>
|
||||||
<td x-html="renderDateCell(sub.last_checked)"></td>
|
<td x-html="renderDateCell(sub.last_checked)"></td>
|
||||||
<td>
|
<td>
|
||||||
<a @click.prevent.stop="action($event, 'delete')" uk-icon="trash" uk-tooltip="Delete" :disabled="loading"></a>
|
<a @click.prevent.stop="actionHandler($event, 'delete')" uk-icon="trash" uk-tooltip="Delete" :disabled="loading"></a>
|
||||||
<a @click.prevent.stop="action($event, 'update')" uk-icon="refresh" uk-tooltip="Check for updates" :disabled="loading"></a>
|
<a @click.prevent.stop="actionHandler($event, 'update')" uk-icon="refresh" uk-tooltip="Check for updates" :disabled="loading"></a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</template>
|
</template>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user