mizzkey/src/client/pages/instance/queue.vue
syuilo 11349561d6
Use FontAwesome as web font instead of vue component (#7469)
* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* Update yarn.lock

* wip

* wip
2021-04-20 23:22:59 +09:00

69 lines
1.4 KiB
Vue

<template>
<div>
<XQueue :connection="connection" domain="inbox">
<template #title><i class="fas fa-exchange-alt"></i> In</template>
</XQueue>
<XQueue :connection="connection" domain="deliver">
<template #title><i class="fas fa-exchange-alt"></i> Out</template>
</XQueue>
<section class="_section">
<div class="_content">
<MkButton @click="clear()"><i class="fas fa-trash-alt"></i> {{ $ts.clearQueue }}</MkButton>
</div>
</section>
</div>
</template>
<script lang="ts">
import { defineComponent } from 'vue';
import MkButton from '@client/components/ui/button.vue';
import XQueue from './queue.chart.vue';
import * as os from '@client/os';
import * as symbols from '@client/symbols';
export default defineComponent({
components: {
MkButton,
XQueue,
},
data() {
return {
[symbols.PAGE_INFO]: {
title: this.$ts.jobQueue,
icon: 'fas fa-exchange-alt',
},
connection: os.stream.useSharedConnection('queueStats'),
}
},
mounted() {
this.$nextTick(() => {
this.connection.send('requestLog', {
id: Math.random().toString().substr(2, 8),
length: 200
});
});
},
beforeUnmount() {
this.connection.dispose();
},
methods: {
clear() {
os.dialog({
type: 'warning',
title: this.$ts.clearQueueConfirmTitle,
text: this.$ts.clearQueueConfirmText,
showCancelButton: true
}).then(({ canceled }) => {
if (canceled) return;
os.apiWithDialog('admin/queue/clear', {});
});
}
}
});
</script>