2020-01-30 04:37:25 +09:00
|
|
|
<template>
|
|
|
|
<div>
|
2020-03-29 10:17:23 +09:00
|
|
|
<portal to="icon"><fa :icon="faExchangeAlt"/></portal>
|
2020-07-25 01:56:52 +09:00
|
|
|
<portal to="title">{{ $t('jobQueue') }}</portal>
|
2020-03-29 10:17:23 +09:00
|
|
|
|
2020-01-30 04:37:25 +09:00
|
|
|
<x-queue :connection="connection" domain="inbox">
|
|
|
|
<template #title><fa :icon="faExchangeAlt"/> In</template>
|
|
|
|
</x-queue>
|
|
|
|
<x-queue :connection="connection" domain="deliver">
|
|
|
|
<template #title><fa :icon="faExchangeAlt"/> Out</template>
|
|
|
|
</x-queue>
|
2020-01-30 11:10:42 +09:00
|
|
|
<section class="_card">
|
2020-01-30 04:37:25 +09:00
|
|
|
<div class="_content">
|
|
|
|
<mk-button @click="clear()"><fa :icon="faTrashAlt"/> {{ $t('clearQueue') }}</mk-button>
|
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import Vue from 'vue';
|
|
|
|
import { faExchangeAlt } from '@fortawesome/free-solid-svg-icons';
|
|
|
|
import { faTrashAlt } from '@fortawesome/free-regular-svg-icons';
|
|
|
|
import MkButton from '../../components/ui/button.vue';
|
2020-08-09 15:51:02 +09:00
|
|
|
import XQueue from './queue.chart.vue';
|
2020-01-30 04:37:25 +09:00
|
|
|
|
|
|
|
export default Vue.extend({
|
|
|
|
metaInfo() {
|
|
|
|
return {
|
|
|
|
title: `${this.$t('jobQueue')} | ${this.$t('instance')}`
|
|
|
|
};
|
|
|
|
},
|
|
|
|
|
|
|
|
components: {
|
|
|
|
MkButton,
|
|
|
|
XQueue,
|
|
|
|
},
|
|
|
|
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
connection: this.$root.stream.useSharedConnection('queueStats'),
|
|
|
|
faExchangeAlt, faTrashAlt
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
mounted() {
|
|
|
|
this.$nextTick(() => {
|
|
|
|
this.connection.send('requestLog', {
|
|
|
|
id: Math.random().toString().substr(2, 8),
|
|
|
|
length: 200
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
|
|
|
|
beforeDestroy() {
|
|
|
|
this.connection.dispose();
|
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
clear() {
|
|
|
|
this.$root.dialog({
|
|
|
|
type: 'warning',
|
|
|
|
title: this.$t('clearQueueConfirmTitle'),
|
|
|
|
text: this.$t('clearQueueConfirmText'),
|
|
|
|
showCancelButton: true
|
|
|
|
}).then(({ canceled }) => {
|
|
|
|
if (canceled) return;
|
|
|
|
|
|
|
|
this.$root.api('admin/queue/clear', {}).then(() => {
|
|
|
|
this.$root.dialog({
|
|
|
|
type: 'success',
|
|
|
|
iconOnly: true, autoClose: true
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|