feat(v2): live sidebar counts, /dashboard = V2 default route, remove V1 dead code
CI - Build & Test / Backend (.NET) (push) Failing after 21s
CI - Build & Test / Frontend (Vue/TS) (push) Successful in 14s
CI - Build & Test / Security Check (push) Successful in 3s

This commit is contained in:
2026-06-12 01:01:50 +02:00
parent 676dbd7589
commit 9033ff2973
19 changed files with 54 additions and 4416 deletions
+44 -1
View File
@@ -2,11 +2,16 @@
import { computed } from 'vue'
import { useRouter } from 'vue-router'
import { useAuthStore } from '../../stores/auth'
import { useAgentStore } from '../../stores/agents'
import { useTaskStore } from '../../stores/tasks'
import { navigation, icons } from '../../composables/icons'
import type { NavGroupDef } from '../../composables/icons'
import NavGroup from './NavGroup.vue'
const auth = useAuthStore()
const router = useRouter()
const agentStore = useAgentStore()
const taskStore = useTaskStore()
const ownerInitials = computed(() =>
auth.user?.displayName?.split(' ').map(p => p[0]).join('').slice(0, 2).toUpperCase()
@@ -17,6 +22,44 @@ function logout() {
auth.logout()
router.replace('/login')
}
/**
* Dynamische Nav-Item-Counts aus den Stores.
* Überschreibt die hartcodierten `count`-Werte im navigation-Array.
*/
const dynamicNavigation = computed<NavGroupDef[]>(() => {
// Deep-clone: Jede Gruppe und jedes Item neu erstellen
return navigation.map(group => ({
...group,
items: group.items.map(item => {
let dynamicCount: string | undefined
switch (item.label) {
case 'Agenten':
case 'Hosts · OpenClaw':
dynamicCount = String(agentStore.agentList.length)
break
case 'Task Board':
dynamicCount = String(taskStore.taskList.length)
break
case 'Kosten & Tokens':
dynamicCount = agentStore.todayCost
break
case 'Docs & .md':
dynamicCount = '0'
break
case 'Incidents':
dynamicCount = '0'
break
}
return {
...item,
count: dynamicCount ?? item.count,
}
}),
}))
})
</script>
<template>
@@ -33,7 +76,7 @@ function logout() {
<!-- Navigation -->
<nav class="nav">
<NavGroup
v-for="(group, idx) in navigation"
v-for="(group, idx) in dynamicNavigation"
:key="idx"
:label="group.group"
:items="group.items"