9deebfa133
The icon+title v-card-title heading (d-flex align-center + gap + <v-icon size=small> + <span>) was hand-rolled identically in 13 cards/dialogs (15 heading instances). Consolidate to <CardHeading icon title> (components/common) with an iconColor prop (error headings) and a default slot for trailing content (spacer+actions, inline status chip). Adopted everywhere the pattern appears — all-or-nothing per the hardened DRY process. Over-DRY guard: plain text-only <v-card-title> one-liners are NOT this pattern and stay; DownloadDetailModal leads with a status CHIP (not an icon), a different concept, left alone. §8b: the only remaining d-flex align-center v-card-title is that intentional variant. Catalog updated. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
64 lines
1.4 KiB
Vue
64 lines
1.4 KiB
Vue
<template>
|
|
<v-card class="fc-activity-summary">
|
|
<CardHeading icon="mdi-pulse" title="System activity (last min)">
|
|
<v-spacer />
|
|
<v-btn
|
|
variant="text" size="small" rounded="pill"
|
|
@click="$emit('open-activity')"
|
|
>
|
|
View activity
|
|
<v-icon end size="small">mdi-arrow-right</v-icon>
|
|
</v-btn>
|
|
</CardHeading>
|
|
|
|
<v-card-text>
|
|
<v-alert
|
|
v-if="store.lastError"
|
|
type="warning" variant="tonal" density="compact" class="mb-3"
|
|
>
|
|
{{ store.lastError }}
|
|
</v-alert>
|
|
|
|
<QueuesTable
|
|
:queues="store.queues"
|
|
:workers="store.workers"
|
|
:recent-runs="store.recentRuns"
|
|
compact
|
|
/>
|
|
</v-card-text>
|
|
</v-card>
|
|
</template>
|
|
|
|
<script setup>
|
|
import { onMounted, onUnmounted } from 'vue'
|
|
|
|
import { useSystemActivityStore } from '../../stores/systemActivity.js'
|
|
import QueuesTable from './QueuesTable.vue'
|
|
import CardHeading from '../common/CardHeading.vue'
|
|
|
|
defineEmits(['open-activity'])
|
|
|
|
const store = useSystemActivityStore()
|
|
|
|
let pollId = null
|
|
|
|
function pollOnce() {
|
|
if (document.hidden) return
|
|
store.loadQueues()
|
|
store.loadWorkers()
|
|
store.loadRecentRuns()
|
|
}
|
|
|
|
onMounted(() => {
|
|
pollOnce()
|
|
pollId = setInterval(pollOnce, 5000)
|
|
})
|
|
onUnmounted(() => {
|
|
if (pollId) { clearInterval(pollId); pollId = null }
|
|
})
|
|
</script>
|
|
|
|
<style scoped>
|
|
.fc-activity-summary { border-radius: 8px; }
|
|
</style>
|