Add button to clear pending tasks (#810)

This commit is contained in:
Chenlei Hu
2024-09-13 10:23:28 +09:00
committed by GitHub
parent 880ac4fa5a
commit d8d6fa86e4
3 changed files with 31 additions and 6 deletions

View File

@@ -31,6 +31,15 @@
class="toggle-expanded-button"
v-tooltip="$t('sideToolbar.queueTab.showFlatList')"
/>
<Button
v-if="queueStore.hasPendingTasks"
icon="pi pi-stop"
text
severity="danger"
@click="clearPendingTasks"
class="clear-pending-button"
v-tooltip="$t('sideToolbar.queueTab.clearPendingTasks')"
/>
<Button
icon="pi pi-trash"
text
@@ -221,6 +230,16 @@ const confirmRemoveAll = (event: Event) => {
})
}
const clearPendingTasks = async () => {
await queueStore.clear(['queue'])
toast.add({
severity: 'info',
summary: 'Confirmed',
detail: 'Pending tasks deleted',
life: 3000
})
}
const onStatus = async () => {
await queueStore.update()
updateVisibleTasks()