From 7331de0bcef74bde0789259830f98be2b063de57 Mon Sep 17 00:00:00 2001
From: CyberRex <hspwinx86@gmail.com>
Date: Wed, 22 Mar 2023 08:58:23 +0900
Subject: feat: queue force promote (#10370)

* feat: queue force promote

* Update CHANGELOG.md

* small fix
---
 packages/frontend/src/pages/admin/queue.vue | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

(limited to 'packages/frontend/src/pages/admin/queue.vue')

diff --git a/packages/frontend/src/pages/admin/queue.vue b/packages/frontend/src/pages/admin/queue.vue
index 80e97fed93..509d329eb1 100644
--- a/packages/frontend/src/pages/admin/queue.vue
+++ b/packages/frontend/src/pages/admin/queue.vue
@@ -4,6 +4,8 @@
 	<MkSpacer :content-max="800">
 		<XQueue v-if="tab === 'deliver'" domain="deliver"/>
 		<XQueue v-else-if="tab === 'inbox'" domain="inbox"/>
+		<br>
+		<MkButton @click="promoteAllQueues"><i class="ti ti-reload"></i> {{ i18n.ts.retryAllQueuesNow }}</MkButton>
 	</MkSpacer>
 </MkStickyContainer>
 </template>
@@ -15,6 +17,7 @@ import * as os from '@/os';
 import * as config from '@/config';
 import { i18n } from '@/i18n';
 import { definePageMetadata } from '@/scripts/page-metadata';
+import MkButton from '@/components/MkButton.vue';
 
 let tab = $ref('deliver');
 
@@ -30,6 +33,18 @@ function clear() {
 	});
 }
 
+function promoteAllQueues() {
+	os.confirm({
+		type: 'warning',
+		title: i18n.ts.retryAllQueuesConfirmTitle,
+		text: i18n.ts.retryAllQueuesConfirmText,
+	}).then(({ canceled }) => {
+		if (canceled) return;
+
+		os.apiWithDialog('admin/queue/promote', { type: tab });
+	});
+}
+
 const headerActions = $computed(() => [{
 	asFullButton: true,
 	icon: 'ti ti-external-link',
-- 
cgit v1.2.3-freya

