feat: wire dashboard v2 to backend data
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
import { onMounted, onUnmounted } from 'vue'
|
||||
import { useAgentStore } from '../../stores/agents'
|
||||
import { useChatStore } from '../../stores/chat'
|
||||
import { useDashboardStore } from '../../stores/dashboard'
|
||||
import { useTaskStore } from '../../stores/tasks'
|
||||
import AlertBar from '../../components/dashboard/v2/AlertBar.vue'
|
||||
import FlowCanvas from '../../components/dashboard/v2/FlowCanvas.vue'
|
||||
@@ -26,6 +27,7 @@ import { useFlowBoardState } from '../../composables/useFlowBoardState'
|
||||
/* ── Stores ──────────────────────────────────────── */
|
||||
const agentStore = useAgentStore()
|
||||
const chatStore = useChatStore()
|
||||
const dashboardStore = useDashboardStore()
|
||||
const taskStore = useTaskStore()
|
||||
|
||||
const {
|
||||
@@ -44,16 +46,28 @@ function handleBlockerClick() {
|
||||
console.log('[FlowBoard] blocker clicked')
|
||||
}
|
||||
|
||||
function blockerLabel() {
|
||||
const blockedTask = taskStore.taskList.find(task => task.status === 'blocked')
|
||||
if (!blockedTask) return undefined
|
||||
return `${taskStore.taskList.filter(task => task.status === 'blocked').length} Blocker — ${blockedTask.title}`
|
||||
}
|
||||
|
||||
function blockerCount() {
|
||||
return taskStore.taskList.filter(task => task.status === 'blocked').length
|
||||
}
|
||||
|
||||
/* ── Lifecycle ────────────────────────────────────── */
|
||||
onMounted(() => {
|
||||
agentStore.startPolling()
|
||||
chatStore.startPolling()
|
||||
dashboardStore.startPolling()
|
||||
taskStore.startPolling()
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
agentStore.stopPolling()
|
||||
chatStore.stopPolling()
|
||||
dashboardStore.stopPolling()
|
||||
taskStore.stopPolling()
|
||||
})
|
||||
</script>
|
||||
@@ -68,9 +82,10 @@ onUnmounted(() => {
|
||||
:active-count="agentStore.activeCount"
|
||||
:think-count="agentStore.thinkCount"
|
||||
:idle-count="agentStore.idleCount"
|
||||
:blocker-count="agentStore.blockerCount"
|
||||
:blocker-count="blockerCount()"
|
||||
:today-cost="agentStore.todayCost"
|
||||
:today-tokens="agentStore.todayTokens"
|
||||
:blocker-label="blockerLabel()"
|
||||
@blocker-click="handleBlockerClick"
|
||||
/>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user