2020-01-30 04:37:25 +09:00
|
|
|
<template>
|
2021-04-22 22:29:33 +09:00
|
|
|
<FormBase>
|
2020-10-17 20:12:00 +09:00
|
|
|
<XQueue :connection="connection" domain="inbox">
|
2021-04-22 22:29:33 +09:00
|
|
|
<template #title>In</template>
|
2020-10-17 20:12:00 +09:00
|
|
|
</XQueue>
|
|
|
|
<XQueue :connection="connection" domain="deliver">
|
2021-04-22 22:29:33 +09:00
|
|
|
<template #title>Out</template>
|
2020-10-17 20:12:00 +09:00
|
|
|
</XQueue>
|
2021-04-22 22:29:33 +09:00
|
|
|
<FormButton @click="clear()" danger><i class="fas fa-trash-alt"></i> {{ $ts.clearQueue }}</FormButton>
|
|
|
|
</FormBase>
|
2020-01-30 04:37:25 +09:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2021-07-26 11:12:06 +09:00
|
|
|
import { defineComponent, markRaw } from 'vue';
|
2021-03-23 17:30:14 +09:00
|
|
|
import MkButton from '@client/components/ui/button.vue';
|
2020-08-09 15:51:02 +09:00
|
|
|
import XQueue from './queue.chart.vue';
|
2021-09-30 00:50:45 +09:00
|
|
|
import FormBase from '@client/components/debobigego/base.vue';
|
|
|
|
import FormButton from '@client/components/debobigego/button.vue';
|
2021-03-23 17:30:14 +09:00
|
|
|
import * as os from '@client/os';
|
2021-04-10 12:54:12 +09:00
|
|
|
import * as symbols from '@client/symbols';
|
2020-01-30 04:37:25 +09:00
|
|
|
|
2020-10-17 20:12:00 +09:00
|
|
|
export default defineComponent({
|
2020-01-30 04:37:25 +09:00
|
|
|
components: {
|
2021-04-22 22:29:33 +09:00
|
|
|
FormBase,
|
|
|
|
FormButton,
|
2020-01-30 04:37:25 +09:00
|
|
|
MkButton,
|
|
|
|
XQueue,
|
|
|
|
},
|
|
|
|
|
2021-04-22 22:29:33 +09:00
|
|
|
emits: ['info'],
|
|
|
|
|
2020-01-30 04:37:25 +09:00
|
|
|
data() {
|
|
|
|
return {
|
2021-04-10 12:54:12 +09:00
|
|
|
[symbols.PAGE_INFO]: {
|
2020-12-26 10:47:36 +09:00
|
|
|
title: this.$ts.jobQueue,
|
2021-04-22 22:29:33 +09:00
|
|
|
icon: 'fas fa-clipboard-list',
|
2021-10-10 15:19:16 +09:00
|
|
|
bg: 'var(--bg)',
|
2020-10-17 20:12:00 +09:00
|
|
|
},
|
2021-07-26 11:12:06 +09:00
|
|
|
connection: markRaw(os.stream.useChannel('queueStats')),
|
2020-01-30 04:37:25 +09:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
mounted() {
|
2021-04-22 22:29:33 +09:00
|
|
|
this.$emit('info', this[symbols.PAGE_INFO]);
|
|
|
|
|
2020-01-30 04:37:25 +09:00
|
|
|
this.$nextTick(() => {
|
|
|
|
this.connection.send('requestLog', {
|
|
|
|
id: Math.random().toString().substr(2, 8),
|
|
|
|
length: 200
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
|
2020-10-17 20:12:00 +09:00
|
|
|
beforeUnmount() {
|
2020-01-30 04:37:25 +09:00
|
|
|
this.connection.dispose();
|
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
clear() {
|
2020-10-17 20:12:00 +09:00
|
|
|
os.dialog({
|
2020-01-30 04:37:25 +09:00
|
|
|
type: 'warning',
|
2020-12-26 10:47:36 +09:00
|
|
|
title: this.$ts.clearQueueConfirmTitle,
|
|
|
|
text: this.$ts.clearQueueConfirmText,
|
2020-01-30 04:37:25 +09:00
|
|
|
showCancelButton: true
|
|
|
|
}).then(({ canceled }) => {
|
|
|
|
if (canceled) return;
|
|
|
|
|
2020-10-17 20:12:00 +09:00
|
|
|
os.apiWithDialog('admin/queue/clear', {});
|
2020-01-30 04:37:25 +09:00
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|