2023-07-27 05:31:52 +00:00
|
|
|
<!--
|
2024-02-13 15:50:11 +00:00
|
|
|
SPDX-FileCopyrightText: syuilo and other misskey contributors
|
2023-07-27 05:31:52 +00:00
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
-->
|
|
|
|
|
2020-01-29 19:37:25 +00:00
|
|
|
<template>
|
2022-06-20 08:38:49 +00:00
|
|
|
<MkStickyContainer>
|
2022-06-25 14:01:40 +00:00
|
|
|
<template #header><XHeader v-model:tab="tab" :actions="headerActions" :tabs="headerTabs"/></template>
|
2023-05-19 11:52:15 +00:00
|
|
|
<MkSpacer :contentMax="800">
|
2022-06-25 14:01:40 +00:00
|
|
|
<XQueue v-if="tab === 'deliver'" domain="deliver"/>
|
|
|
|
<XQueue v-else-if="tab === 'inbox'" domain="inbox"/>
|
2023-03-21 23:58:23 +00:00
|
|
|
<br>
|
|
|
|
<MkButton @click="promoteAllQueues"><i class="ti ti-reload"></i> {{ i18n.ts.retryAllQueuesNow }}</MkButton>
|
2022-06-20 08:38:49 +00:00
|
|
|
</MkSpacer>
|
|
|
|
</MkStickyContainer>
|
2020-01-29 19:37:25 +00:00
|
|
|
</template>
|
|
|
|
|
2022-05-17 16:31:04 +00:00
|
|
|
<script lang="ts" setup>
|
2023-12-07 05:42:09 +00:00
|
|
|
import { ref, computed } from 'vue';
|
2020-08-09 06:51:02 +00:00
|
|
|
import XQueue from './queue.chart.vue';
|
2022-06-20 08:38:49 +00:00
|
|
|
import XHeader from './_header_.vue';
|
2023-09-19 07:37:43 +00:00
|
|
|
import * as os from '@/os.js';
|
|
|
|
import * as config from '@/config.js';
|
|
|
|
import { i18n } from '@/i18n.js';
|
|
|
|
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
2023-03-21 23:58:23 +00:00
|
|
|
import MkButton from '@/components/MkButton.vue';
|
2020-01-29 19:37:25 +00:00
|
|
|
|
2023-12-07 05:42:09 +00:00
|
|
|
const tab = ref('deliver');
|
2020-01-29 19:37:25 +00:00
|
|
|
|
2022-05-17 16:31:04 +00:00
|
|
|
function clear() {
|
|
|
|
os.confirm({
|
|
|
|
type: 'warning',
|
|
|
|
title: i18n.ts.clearQueueConfirmTitle,
|
|
|
|
text: i18n.ts.clearQueueConfirmText,
|
|
|
|
}).then(({ canceled }) => {
|
|
|
|
if (canceled) return;
|
2021-04-22 13:29:33 +00:00
|
|
|
|
2022-05-17 16:31:04 +00:00
|
|
|
os.apiWithDialog('admin/queue/clear');
|
|
|
|
});
|
|
|
|
}
|
2020-01-29 19:37:25 +00:00
|
|
|
|
2023-03-21 23:58:23 +00:00
|
|
|
function promoteAllQueues() {
|
|
|
|
os.confirm({
|
|
|
|
type: 'warning',
|
|
|
|
title: i18n.ts.retryAllQueuesConfirmTitle,
|
|
|
|
text: i18n.ts.retryAllQueuesConfirmText,
|
|
|
|
}).then(({ canceled }) => {
|
|
|
|
if (canceled) return;
|
|
|
|
|
2023-12-07 05:42:09 +00:00
|
|
|
os.apiWithDialog('admin/queue/promote', { type: tab.value });
|
2023-03-21 23:58:23 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2023-12-07 05:42:09 +00:00
|
|
|
const headerActions = computed(() => [{
|
2022-06-20 08:38:49 +00:00
|
|
|
asFullButton: true,
|
2022-12-20 06:24:31 +00:00
|
|
|
icon: 'ti ti-external-link',
|
2022-06-20 08:38:49 +00:00
|
|
|
text: i18n.ts.dashboard,
|
|
|
|
handler: () => {
|
2023-12-08 08:48:18 +00:00
|
|
|
window.open(config.url + '/queue', '_blank', 'noopener');
|
2022-06-20 08:38:49 +00:00
|
|
|
},
|
|
|
|
}]);
|
|
|
|
|
2023-12-07 05:42:09 +00:00
|
|
|
const headerTabs = computed(() => [{
|
2022-06-25 14:01:40 +00:00
|
|
|
key: 'deliver',
|
|
|
|
title: 'Deliver',
|
|
|
|
}, {
|
|
|
|
key: 'inbox',
|
|
|
|
title: 'Inbox',
|
|
|
|
}]);
|
2022-06-20 08:38:49 +00:00
|
|
|
|
|
|
|
definePageMetadata({
|
|
|
|
title: i18n.ts.jobQueue,
|
2022-12-20 06:15:34 +00:00
|
|
|
icon: 'ti ti-clock-play',
|
2020-01-29 19:37:25 +00:00
|
|
|
});
|
|
|
|
</script>
|