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