2020-01-29 19:37:25 +00:00
|
|
|
<template>
|
2022-01-04 12:16:41 +00:00
|
|
|
<MkSpacer :content-max="800">
|
2020-10-17 11:12:00 +00:00
|
|
|
<XQueue :connection="connection" domain="inbox">
|
2021-04-22 13:29:33 +00:00
|
|
|
<template #title>In</template>
|
2020-10-17 11:12:00 +00:00
|
|
|
</XQueue>
|
|
|
|
<XQueue :connection="connection" domain="deliver">
|
2021-04-22 13:29:33 +00:00
|
|
|
<template #title>Out</template>
|
2020-10-17 11:12:00 +00:00
|
|
|
</XQueue>
|
2022-05-17 16:31:04 +00:00
|
|
|
<MkButton danger @click="clear()"><i class="fas fa-trash-alt"></i> {{ i18n.ts.clearQueue }}</MkButton>
|
2022-01-04 12:16:41 +00:00
|
|
|
</MkSpacer>
|
2020-01-29 19:37:25 +00:00
|
|
|
</template>
|
|
|
|
|
2022-05-17 16:31:04 +00:00
|
|
|
<script lang="ts" setup>
|
|
|
|
import { markRaw, onMounted, onBeforeUnmount, nextTick } from 'vue';
|
2021-11-11 17:02:25 +00:00
|
|
|
import MkButton from '@/components/ui/button.vue';
|
2020-08-09 06:51:02 +00:00
|
|
|
import XQueue from './queue.chart.vue';
|
2021-11-11 17:02:25 +00:00
|
|
|
import * as os from '@/os';
|
2021-12-29 13:13:09 +00:00
|
|
|
import { stream } from '@/stream';
|
2021-11-11 17:02:25 +00:00
|
|
|
import * as symbols from '@/symbols';
|
2022-03-19 10:08:55 +00:00
|
|
|
import * as config from '@/config';
|
2022-05-17 16:31:04 +00:00
|
|
|
import { i18n } from '@/i18n';
|
2020-01-29 19:37:25 +00:00
|
|
|
|
2022-06-10 05:36:55 +00:00
|
|
|
const connection = markRaw(stream.useChannel('queueStats'));
|
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
|
|
|
|
2022-05-17 16:31:04 +00:00
|
|
|
onMounted(() => {
|
|
|
|
nextTick(() => {
|
|
|
|
connection.send('requestLog', {
|
|
|
|
id: Math.random().toString().substr(2, 8),
|
|
|
|
length: 200
|
2020-01-29 19:37:25 +00:00
|
|
|
});
|
2022-05-17 16:31:04 +00:00
|
|
|
});
|
2022-06-10 05:36:55 +00:00
|
|
|
});
|
2020-01-29 19:37:25 +00:00
|
|
|
|
2022-05-17 16:31:04 +00:00
|
|
|
onBeforeUnmount(() => {
|
|
|
|
connection.dispose();
|
|
|
|
});
|
2020-01-29 19:37:25 +00:00
|
|
|
|
2022-05-17 16:31:04 +00:00
|
|
|
defineExpose({
|
|
|
|
[symbols.PAGE_INFO]: {
|
|
|
|
title: i18n.ts.jobQueue,
|
|
|
|
icon: 'fas fa-clipboard-list',
|
|
|
|
bg: 'var(--bg)',
|
|
|
|
actions: [{
|
|
|
|
asFullButton: true,
|
|
|
|
icon: 'fas fa-up-right-from-square',
|
|
|
|
text: i18n.ts.dashboard,
|
|
|
|
handler: () => {
|
|
|
|
window.open(config.url + '/queue', '_blank');
|
|
|
|
},
|
|
|
|
}],
|
2020-01-29 19:37:25 +00:00
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|