hippofish/packages/client/src/pages/admin/queue.vue

58 lines
1.4 KiB
Vue
Raw Normal View History

<template>
<MkStickyContainer>
2023-04-05 07:59:41 +02:00
<template #header><MkPageHeader v-model:tab="tab" :actions="headerActions" :tabs="headerTabs" :display-back-button="true"/></template>
<MkSpacer :content-max="800">
2022-06-25 16:01:40 +02:00
<XQueue v-if="tab === 'deliver'" domain="deliver"/>
<XQueue v-else-if="tab === 'inbox'" domain="inbox"/>
</MkSpacer>
</MkStickyContainer>
</template>
<script lang="ts" setup>
import { markRaw, onMounted, onBeforeUnmount, nextTick } from 'vue';
import XQueue from './queue.chart.vue';
import MkButton from '@/components/MkButton.vue';
2021-11-11 18:02:25 +01:00
import * as os from '@/os';
2022-03-19 11:08:55 +01:00
import * as config from '@/config';
import { i18n } from '@/i18n';
import { definePageMetadata } from '@/scripts/page-metadata';
2022-06-25 16:01:40 +02:00
let tab = $ref('deliver');
function clear() {
os.confirm({
type: 'warning',
title: i18n.ts.clearQueueConfirmTitle,
text: i18n.ts.clearQueueConfirmText,
}).then(({ canceled }) => {
if (canceled) return;
os.apiWithDialog('admin/queue/clear');
});
}
const headerActions = $computed(() => [{
asFullButton: true,
2023-03-11 22:01:04 +01:00
icon: 'ph-arrow-square-up-right ph-bold ph-lg',
text: i18n.ts.dashboard,
handler: () => {
window.open(config.url + '/queue', '_blank');
},
}]);
2022-06-25 16:01:40 +02:00
const headerTabs = $computed(() => [{
key: 'deliver',
title: 'Deliver',
2023-03-29 21:47:25 +02:00
icon: 'ph-upload ph-bold ph-lg',
2022-06-25 16:01:40 +02:00
}, {
key: 'inbox',
title: 'Inbox',
2023-03-29 21:47:25 +02:00
icon: 'ph-download ph-bold ph-lg',
2022-06-25 16:01:40 +02:00
}]);
definePageMetadata({
title: i18n.ts.jobQueue,
2023-03-11 22:01:04 +01:00
icon: 'ph-clipboard-text ph-bold ph-lg',
});
</script>