Fix broken buttons on download manager page

This commit is contained in:
Alex Ling 2021-01-08 11:38:51 +00:00
parent da0ca665a6
commit 0cc5e1626b
2 changed files with 8 additions and 6 deletions

View File

@ -43,12 +43,14 @@ const component = () => {
this.loading = false;
});
},
jobAction(action, id) {
jobAction(action, event) {
let url = `${base_url}api/admin/mangadex/queue/${action}`;
if (id !== undefined)
url += '?' + $.param({
if (event) {
const id = event.currentTarget.closest('tr').id.split('-')[1];
url = `${url}?${$.param({
id: id
});
})}`;
}
console.log(url);
$.ajax({
type: 'POST',

View File

@ -51,9 +51,9 @@
<td x-text="`${job.plugin_id || ''}`"></td>
<td>
<a :onclick="`jobAction('delete', '${job.id}')`" uk-icon="trash"></a>
<a @click="jobAction('delete', $event)" uk-icon="trash"></a>
<template x-if="job.status_message.length > 0">
<a :onclick="`jobAction('retry', '${job.id}')`" uk-icon="refresh"></a>
<a @click="jobAction('retry', $event)" uk-icon="refresh"></a>
</template>
</td>
</tr>