+
@@ -58,6 +60,7 @@ import i18n from '../../i18n';
import { version } from '../../config';
import XDashboard from "./dashboard.vue";
import XInstance from "./instance.vue";
+import XQueue from "./queue.vue";
import XModerators from "./moderators.vue";
import XEmoji from "./emoji.vue";
import XAnnouncements from "./announcements.vue";
@@ -65,7 +68,7 @@ import XHashtags from "./hashtags.vue";
import XUsers from "./users.vue";
import XDrive from "./drive.vue";
import XAbuse from "./abuse.vue";
-import { faHeadset, faArrowLeft, faShareAlt, faExclamationCircle } from '@fortawesome/free-solid-svg-icons';
+import { faHeadset, faArrowLeft, faShareAlt, faExclamationCircle, faTasks } from '@fortawesome/free-solid-svg-icons';
import { faGrin } from '@fortawesome/free-regular-svg-icons';
// Detect the user agent
@@ -77,6 +80,7 @@ export default Vue.extend({
components: {
XDashboard,
XInstance,
+ XQueue,
XModerators,
XEmoji,
XAnnouncements,
@@ -98,7 +102,8 @@ export default Vue.extend({
faArrowLeft,
faHeadset,
faShareAlt,
- faExclamationCircle
+ faExclamationCircle,
+ faTasks
};
},
methods: {
diff --git a/src/client/app/admin/views/queue.vue b/src/client/app/admin/views/queue.vue
new file mode 100644
index 0000000000..e26b86e3ef
--- /dev/null
+++ b/src/client/app/admin/views/queue.vue
@@ -0,0 +1,43 @@
+
+
+
+ {{ $t('operation') }}
+
+ {{ $t('remove-all-jobs') }}
+
+
+
+
+
+
diff --git a/src/queue/index.ts b/src/queue/index.ts
index 8105999b60..da1c178a00 100644
--- a/src/queue/index.ts
+++ b/src/queue/index.ts
@@ -87,3 +87,9 @@ export default function() {
return queue;
}
+
+export function destroy() {
+ queue.destroy().then(n => {
+ queueLogger.succ(`All job removed (${n} jobs)`);
+ });
+}
diff --git a/src/server/api/endpoints/admin/queue/clear.ts b/src/server/api/endpoints/admin/queue/clear.ts
new file mode 100644
index 0000000000..4da8d2c72d
--- /dev/null
+++ b/src/server/api/endpoints/admin/queue/clear.ts
@@ -0,0 +1,15 @@
+import define from '../../../define';
+import { destroy } from '../../../../../queue';
+
+export const meta = {
+ requireCredential: true,
+ requireModerator: true,
+
+ params: {}
+};
+
+export default define(meta, (ps) => new Promise(async (res, rej) => {
+ destroy();
+
+ res();
+}));