Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| bf60b8b064 | |||
| b8498f47bb |
@@ -54,7 +54,7 @@ defineEmits<{
|
|||||||
<section class="modal-section">
|
<section class="modal-section">
|
||||||
<h3 class="section-label">Live Thinking</h3>
|
<h3 class="section-label">Live Thinking</h3>
|
||||||
<div class="thinking-panel">
|
<div class="thinking-panel">
|
||||||
<div class="thinking-stream" ref="thinkingStreamRef">
|
<div class="thinking-stream">
|
||||||
<div
|
<div
|
||||||
v-for="(msg, idx) in agent.thinkingStream"
|
v-for="(msg, idx) in agent.thinkingStream"
|
||||||
:key="idx"
|
:key="idx"
|
||||||
|
|||||||
@@ -0,0 +1,260 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { ref, computed } from 'vue'
|
||||||
|
import { ChevronLeft, ChevronRight, X } from '@lucide/vue'
|
||||||
|
import type { FeedEntry } from '../../composables/useDashboardData'
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
entries: FeedEntry[]
|
||||||
|
modelValue: boolean
|
||||||
|
}>()
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
'update:modelValue': [value: boolean]
|
||||||
|
}>()
|
||||||
|
|
||||||
|
const selectedDayOffset = ref(0) // 0 = today, -1 = yesterday, etc.
|
||||||
|
|
||||||
|
function close() {
|
||||||
|
emit('update:modelValue', false)
|
||||||
|
}
|
||||||
|
|
||||||
|
function dayLabel(offset: number): string {
|
||||||
|
if (offset === 0) return 'Heute'
|
||||||
|
if (offset === -1) return 'Gestern'
|
||||||
|
if (offset === -2) return 'Vorgestern'
|
||||||
|
const d = new Date()
|
||||||
|
d.setDate(d.getDate() + offset)
|
||||||
|
return d.toLocaleDateString('de-DE', { weekday: 'long', day: 'numeric', month: 'long' })
|
||||||
|
}
|
||||||
|
|
||||||
|
function navigateDay(dir: -1 | 1) {
|
||||||
|
const next = selectedDayOffset.value + dir
|
||||||
|
if (next >= -6 && next <= 0) {
|
||||||
|
selectedDayOffset.value = next
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const filteredEntries = computed(() => {
|
||||||
|
const targetDate = new Date()
|
||||||
|
targetDate.setDate(targetDate.getDate() + selectedDayOffset.value)
|
||||||
|
const targetStr = targetDate.toISOString().slice(0, 10)
|
||||||
|
return props.entries.filter(e => e.timestamp.slice(0, 10) === targetStr)
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<Teleport to="body">
|
||||||
|
<div class="feed-modal-overlay" @click.self="close">
|
||||||
|
<div class="feed-modal-card">
|
||||||
|
<div class="feed-modal-header">
|
||||||
|
<h2 class="feed-modal-title">Operations Log</h2>
|
||||||
|
<button class="feed-modal-close-btn" @click="close" aria-label="Close">
|
||||||
|
<X :size="16" />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="feed-modal-nav">
|
||||||
|
<button
|
||||||
|
class="feed-nav-btn"
|
||||||
|
:disabled="selectedDayOffset <= -6"
|
||||||
|
@click="navigateDay(-1)"
|
||||||
|
aria-label="Previous day"
|
||||||
|
>
|
||||||
|
<ChevronLeft :size="14" />
|
||||||
|
</button>
|
||||||
|
<span class="feed-nav-label">{{ dayLabel(selectedDayOffset) }}</span>
|
||||||
|
<button
|
||||||
|
class="feed-nav-btn"
|
||||||
|
:disabled="selectedDayOffset >= 0"
|
||||||
|
@click="navigateDay(1)"
|
||||||
|
aria-label="Next day"
|
||||||
|
>
|
||||||
|
<ChevronRight :size="14" />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="feed-modal-entries">
|
||||||
|
<div v-if="filteredEntries.length === 0" class="feed-modal-empty">
|
||||||
|
Keine Einträge für diesen Tag.
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
v-for="(entry, idx) in filteredEntries"
|
||||||
|
:key="entry.timestamp + '-' + idx"
|
||||||
|
class="feed-modal-entry"
|
||||||
|
>
|
||||||
|
<span class="feed-time">{{ entry.time }}</span>
|
||||||
|
<span class="feed-bullet">·</span>
|
||||||
|
<span class="feed-agent" :class="'agent-' + entry.agent.toLowerCase()">
|
||||||
|
{{ entry.agent }}
|
||||||
|
</span>
|
||||||
|
<span class="feed-action">{{ entry.action }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</Teleport>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.feed-modal-overlay {
|
||||||
|
position: fixed;
|
||||||
|
inset: 0;
|
||||||
|
z-index: 1000;
|
||||||
|
display: grid;
|
||||||
|
place-items: center;
|
||||||
|
background: rgba(0, 0, 0, 0.6);
|
||||||
|
backdrop-filter: blur(4px);
|
||||||
|
padding: 20px;
|
||||||
|
animation: feed-overlay-in 0.2s ease;
|
||||||
|
}
|
||||||
|
@keyframes feed-overlay-in {
|
||||||
|
from { opacity: 0; }
|
||||||
|
to { opacity: 1; }
|
||||||
|
}
|
||||||
|
|
||||||
|
.feed-modal-card {
|
||||||
|
background: #161b22;
|
||||||
|
border: 1px solid rgba(139, 124, 246, 0.15);
|
||||||
|
border-radius: 16px;
|
||||||
|
padding: 24px;
|
||||||
|
width: 100%;
|
||||||
|
max-width: 520px;
|
||||||
|
max-height: 80vh;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 16px;
|
||||||
|
box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
|
||||||
|
animation: feed-card-in 0.25s ease;
|
||||||
|
}
|
||||||
|
@keyframes feed-card-in {
|
||||||
|
from { opacity: 0; transform: translateY(12px) scale(0.98); }
|
||||||
|
to { opacity: 1; transform: translateY(0) scale(1); }
|
||||||
|
}
|
||||||
|
|
||||||
|
.feed-modal-header {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
gap: 12px;
|
||||||
|
}
|
||||||
|
.feed-modal-title {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 15px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #e8eaf0;
|
||||||
|
}
|
||||||
|
.feed-modal-close-btn {
|
||||||
|
display: grid;
|
||||||
|
place-items: center;
|
||||||
|
width: 28px;
|
||||||
|
height: 28px;
|
||||||
|
border: none;
|
||||||
|
background: rgba(255, 255, 255, 0.05);
|
||||||
|
border-radius: 6px;
|
||||||
|
color: #7e8799;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: all 0.15s;
|
||||||
|
}
|
||||||
|
.feed-modal-close-btn:hover {
|
||||||
|
background: rgba(255, 255, 255, 0.1);
|
||||||
|
color: #e8eaf0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.feed-modal-nav {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
gap: 12px;
|
||||||
|
}
|
||||||
|
.feed-nav-btn {
|
||||||
|
display: grid;
|
||||||
|
place-items: center;
|
||||||
|
width: 30px;
|
||||||
|
height: 30px;
|
||||||
|
border: 1px solid rgba(139, 124, 246, 0.15);
|
||||||
|
background: rgba(139, 124, 246, 0.08);
|
||||||
|
border-radius: 8px;
|
||||||
|
color: #a78bfa;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: all 0.15s;
|
||||||
|
}
|
||||||
|
.feed-nav-btn:hover:not(:disabled) {
|
||||||
|
background: rgba(139, 124, 246, 0.16);
|
||||||
|
border-color: rgba(139, 124, 246, 0.3);
|
||||||
|
}
|
||||||
|
.feed-nav-btn:disabled {
|
||||||
|
opacity: 0.3;
|
||||||
|
cursor: not-allowed;
|
||||||
|
}
|
||||||
|
.feed-nav-label {
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #d1d5db;
|
||||||
|
min-width: 100px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.feed-modal-entries {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 4px;
|
||||||
|
overflow-y: auto;
|
||||||
|
max-height: 50vh;
|
||||||
|
padding-right: 4px;
|
||||||
|
}
|
||||||
|
.feed-modal-empty {
|
||||||
|
text-align: center;
|
||||||
|
padding: 24px 0;
|
||||||
|
font-size: 11px;
|
||||||
|
color: #6b7385;
|
||||||
|
}
|
||||||
|
|
||||||
|
.feed-modal-entry {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 5px;
|
||||||
|
padding: 5px 6px;
|
||||||
|
border-radius: 6px;
|
||||||
|
font-size: 9.5px;
|
||||||
|
line-height: 1.3;
|
||||||
|
transition: background 0.15s;
|
||||||
|
}
|
||||||
|
.feed-modal-entry:hover {
|
||||||
|
background: rgba(255, 255, 255, 0.03);
|
||||||
|
}
|
||||||
|
|
||||||
|
.feed-time {
|
||||||
|
color: #6b7385;
|
||||||
|
flex-shrink: 0;
|
||||||
|
font-variant-numeric: tabular-nums;
|
||||||
|
width: 32px;
|
||||||
|
}
|
||||||
|
.feed-bullet {
|
||||||
|
color: #6b7385;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
.feed-agent {
|
||||||
|
font-weight: 600;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
.agent-iris {
|
||||||
|
color: #a78bfa;
|
||||||
|
}
|
||||||
|
.agent-developer {
|
||||||
|
color: #3b82f6;
|
||||||
|
}
|
||||||
|
.agent-devops {
|
||||||
|
color: #eab308;
|
||||||
|
}
|
||||||
|
.agent-researcher {
|
||||||
|
color: #22c55e;
|
||||||
|
}
|
||||||
|
.agent-reviewer {
|
||||||
|
color: #a855f7;
|
||||||
|
}
|
||||||
|
.feed-action {
|
||||||
|
color: #7e8799;
|
||||||
|
white-space: normal;
|
||||||
|
word-break: break-word;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,7 +1,8 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, computed } from 'vue'
|
import { ref, computed } from 'vue'
|
||||||
import { Activity, ChevronLeft, ChevronRight, X } from '@lucide/vue'
|
import { Activity } from '@lucide/vue'
|
||||||
import type { FeedEntry } from '../../composables/useDashboardData'
|
import type { FeedEntry } from '../../composables/useDashboardData'
|
||||||
|
import FeedDetailModal from './FeedDetailModal.vue'
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
entries: FeedEntry[]
|
entries: FeedEntry[]
|
||||||
@@ -12,41 +13,10 @@ const compactEntries = computed(() => props.entries.slice(0, 5))
|
|||||||
|
|
||||||
// ── Feed Detail Modal ──
|
// ── Feed Detail Modal ──
|
||||||
const showDetailModal = ref(false)
|
const showDetailModal = ref(false)
|
||||||
const selectedDayOffset = ref(0) // 0 = today, -1 = yesterday, etc.
|
|
||||||
|
|
||||||
function openDetailModal() {
|
function openDetailModal() {
|
||||||
selectedDayOffset.value = 0
|
|
||||||
showDetailModal.value = true
|
showDetailModal.value = true
|
||||||
}
|
}
|
||||||
|
|
||||||
function closeDetailModal() {
|
|
||||||
showDetailModal.value = false
|
|
||||||
}
|
|
||||||
|
|
||||||
function dayLabel(offset: number): string {
|
|
||||||
if (offset === 0) return 'Heute'
|
|
||||||
if (offset === -1) return 'Gestern'
|
|
||||||
if (offset === -2) return 'Vorgestern'
|
|
||||||
const d = new Date()
|
|
||||||
d.setDate(d.getDate() + offset)
|
|
||||||
return d.toLocaleDateString('de-DE', { weekday: 'long', day: 'numeric', month: 'long' })
|
|
||||||
}
|
|
||||||
|
|
||||||
function navigateDay(dir: -1 | 1) {
|
|
||||||
const next = selectedDayOffset.value + dir
|
|
||||||
if (next >= -6 && next <= 0) {
|
|
||||||
selectedDayOffset.value = next
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const filteredEntries = computed(() => {
|
|
||||||
const targetDate = new Date()
|
|
||||||
targetDate.setDate(targetDate.getDate() + selectedDayOffset.value)
|
|
||||||
const targetStr = targetDate.toISOString().slice(0, 10)
|
|
||||||
return props.entries.filter(e => e.timestamp.slice(0, 10) === targetStr)
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -81,55 +51,11 @@ const filteredEntries = computed(() => {
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- ── Feed Detail Modal ── -->
|
<FeedDetailModal
|
||||||
<Teleport to="body">
|
:entries="entries"
|
||||||
<div v-if="showDetailModal" class="modal-overlay" @click.self="closeDetailModal">
|
:model-value="showDetailModal"
|
||||||
<div class="modal-content">
|
@update:model-value="showDetailModal = $event"
|
||||||
<div class="modal-header">
|
/>
|
||||||
<h2 class="modal-title">Operations Log</h2>
|
|
||||||
<button class="modal-close-btn" @click="closeDetailModal">
|
|
||||||
<X :size="16" />
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="modal-nav">
|
|
||||||
<button
|
|
||||||
class="nav-btn"
|
|
||||||
:disabled="selectedDayOffset <= -6"
|
|
||||||
@click="navigateDay(-1)"
|
|
||||||
>
|
|
||||||
<ChevronLeft :size="14" />
|
|
||||||
</button>
|
|
||||||
<span class="nav-label">{{ dayLabel(selectedDayOffset) }}</span>
|
|
||||||
<button
|
|
||||||
class="nav-btn"
|
|
||||||
:disabled="selectedDayOffset >= 0"
|
|
||||||
@click="navigateDay(1)"
|
|
||||||
>
|
|
||||||
<ChevronRight :size="14" />
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="modal-entries">
|
|
||||||
<div v-if="filteredEntries.length === 0" class="modal-empty">
|
|
||||||
Keine Einträge für diesen Tag.
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
v-for="(entry, idx) in filteredEntries"
|
|
||||||
:key="entry.timestamp + '-' + idx"
|
|
||||||
class="feed-entry"
|
|
||||||
>
|
|
||||||
<span class="feed-time">{{ entry.time }}</span>
|
|
||||||
<span class="feed-bullet">·</span>
|
|
||||||
<span class="feed-agent" :class="'agent-' + entry.agent.toLowerCase()">
|
|
||||||
{{ entry.agent }}
|
|
||||||
</span>
|
|
||||||
<span class="feed-action">{{ entry.action }}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</Teleport>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -267,104 +193,4 @@ const filteredEntries = computed(() => {
|
|||||||
.feed-move {
|
.feed-move {
|
||||||
transition: transform 0.3s ease;
|
transition: transform 0.3s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ── Modal Overlay ── */
|
|
||||||
:global(.modal-overlay) {
|
|
||||||
position: fixed;
|
|
||||||
inset: 0;
|
|
||||||
z-index: 1000;
|
|
||||||
display: grid;
|
|
||||||
place-items: center;
|
|
||||||
background: rgba(0, 0, 0, 0.6);
|
|
||||||
backdrop-filter: blur(4px);
|
|
||||||
padding: 20px;
|
|
||||||
}
|
|
||||||
:global(.modal-content) {
|
|
||||||
background: #161b22;
|
|
||||||
border: 1px solid rgba(139, 124, 246, 0.15);
|
|
||||||
border-radius: 16px;
|
|
||||||
padding: 24px;
|
|
||||||
width: 100%;
|
|
||||||
max-width: 520px;
|
|
||||||
max-height: 80vh;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 16px;
|
|
||||||
box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
|
|
||||||
}
|
|
||||||
:global(.modal-header) {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
gap: 12px;
|
|
||||||
}
|
|
||||||
:global(.modal-title) {
|
|
||||||
margin: 0;
|
|
||||||
font-size: 15px;
|
|
||||||
font-weight: 600;
|
|
||||||
color: #e8eaf0;
|
|
||||||
}
|
|
||||||
:global(.modal-close-btn) {
|
|
||||||
display: grid;
|
|
||||||
place-items: center;
|
|
||||||
width: 28px;
|
|
||||||
height: 28px;
|
|
||||||
border: none;
|
|
||||||
background: rgba(255, 255, 255, 0.05);
|
|
||||||
border-radius: 6px;
|
|
||||||
color: #7e8799;
|
|
||||||
cursor: pointer;
|
|
||||||
transition: all 0.15s;
|
|
||||||
}
|
|
||||||
:global(.modal-close-btn:hover) {
|
|
||||||
background: rgba(255, 255, 255, 0.1);
|
|
||||||
color: #e8eaf0;
|
|
||||||
}
|
|
||||||
:global(.modal-nav) {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
gap: 12px;
|
|
||||||
}
|
|
||||||
:global(.nav-btn) {
|
|
||||||
display: grid;
|
|
||||||
place-items: center;
|
|
||||||
width: 30px;
|
|
||||||
height: 30px;
|
|
||||||
border: 1px solid rgba(139, 124, 246, 0.15);
|
|
||||||
background: rgba(139, 124, 246, 0.08);
|
|
||||||
border-radius: 8px;
|
|
||||||
color: #a78bfa;
|
|
||||||
cursor: pointer;
|
|
||||||
transition: all 0.15s;
|
|
||||||
}
|
|
||||||
:global(.nav-btn:hover:not(:disabled)) {
|
|
||||||
background: rgba(139, 124, 246, 0.16);
|
|
||||||
border-color: rgba(139, 124, 246, 0.3);
|
|
||||||
}
|
|
||||||
:global(.nav-btn:disabled) {
|
|
||||||
opacity: 0.3;
|
|
||||||
cursor: not-allowed;
|
|
||||||
}
|
|
||||||
:global(.nav-label) {
|
|
||||||
font-size: 12px;
|
|
||||||
font-weight: 600;
|
|
||||||
color: #d1d5db;
|
|
||||||
min-width: 100px;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
:global(.modal-entries) {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 4px;
|
|
||||||
overflow-y: auto;
|
|
||||||
max-height: 50vh;
|
|
||||||
padding-right: 4px;
|
|
||||||
}
|
|
||||||
:global(.modal-empty) {
|
|
||||||
text-align: center;
|
|
||||||
padding: 24px 0;
|
|
||||||
font-size: 11px;
|
|
||||||
color: #6b7385;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,23 +1,11 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted, onUnmounted, nextTick, computed } from 'vue'
|
import { ref, computed, toRef } from 'vue'
|
||||||
import { Bot, Code2, Server, Shield, Search, Terminal } from '@lucide/vue'
|
import { Bot, Code2, Server, Shield, Search, Terminal } from '@lucide/vue'
|
||||||
|
import type { AgentNodeData } from '../../composables/useDashboardData'
|
||||||
interface AgentData {
|
import { useTeamNetworkSvg } from '../../composables/useTeamNetworkSvg'
|
||||||
id: string
|
|
||||||
name: string
|
|
||||||
role: string
|
|
||||||
description: string
|
|
||||||
tags: string[]
|
|
||||||
color: string
|
|
||||||
icon: string
|
|
||||||
hero?: boolean
|
|
||||||
task?: string
|
|
||||||
runtime?: string
|
|
||||||
model?: string
|
|
||||||
}
|
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
agents: AgentData[]
|
agents: AgentNodeData[]
|
||||||
heroId?: string
|
heroId?: string
|
||||||
activeAgents?: string[]
|
activeAgents?: string[]
|
||||||
}>()
|
}>()
|
||||||
@@ -26,31 +14,27 @@ const emit = defineEmits<{
|
|||||||
select: [id: string]
|
select: [id: string]
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
// ── Layout refs ──
|
// ── Network ref ──
|
||||||
const networkRef = ref<HTMLDivElement | null>(null)
|
const networkRef = ref<HTMLDivElement | null>(null)
|
||||||
|
|
||||||
interface CardBox {
|
|
||||||
left: number
|
|
||||||
right: number
|
|
||||||
top: number
|
|
||||||
bottom: number
|
|
||||||
cx: number
|
|
||||||
cy: number
|
|
||||||
width: number
|
|
||||||
height: number
|
|
||||||
}
|
|
||||||
const cardPositions = ref<Record<string, CardBox>>({})
|
|
||||||
const svgWidth = ref(0)
|
|
||||||
const svgHeight = ref(0)
|
|
||||||
|
|
||||||
// ── Computed data ──
|
// ── Computed data ──
|
||||||
const hero = computed(() => props.agents.find(a => a.id === props.heroId) ?? props.agents[0])
|
const heroId = computed(() => props.heroId ?? props.agents[0]?.id ?? '')
|
||||||
const childAgents = computed(() => props.agents.filter(a => a.id !== props.heroId))
|
|
||||||
|
|
||||||
function isActive(id: string): boolean {
|
function isActive(id: string): boolean {
|
||||||
return props.activeAgents?.includes(id) ?? false
|
return props.activeAgents?.includes(id) ?? false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ── SVG composable ──
|
||||||
|
const {
|
||||||
|
svgWidth,
|
||||||
|
svgHeight,
|
||||||
|
childAgents,
|
||||||
|
connectionPaths,
|
||||||
|
storePathRef,
|
||||||
|
storePulseRef,
|
||||||
|
storePulseRef2,
|
||||||
|
} = useTeamNetworkSvg(networkRef, toRef(props, 'agents'), heroId, isActive)
|
||||||
|
|
||||||
// ── Icon resolver ──
|
// ── Icon resolver ──
|
||||||
function resolveIcon(iconName: string) {
|
function resolveIcon(iconName: string) {
|
||||||
switch (iconName) {
|
switch (iconName) {
|
||||||
@@ -64,225 +48,15 @@ function resolveIcon(iconName: string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ── Position measurement ──
|
// ── Runtime formatter ──
|
||||||
function updatePositions() {
|
function formatRuntime(seconds: number): string {
|
||||||
if (!networkRef.value) return
|
const m = Math.floor(seconds / 60)
|
||||||
const rect = networkRef.value.getBoundingClientRect()
|
const s = seconds % 60
|
||||||
svgWidth.value = rect.width
|
return `${String(m).padStart(2, '0')}:${String(s).padStart(2, '0')}`
|
||||||
svgHeight.value = rect.height
|
|
||||||
|
|
||||||
const cards = networkRef.value.querySelectorAll('[data-agent-id]')
|
|
||||||
const positions: Record<string, CardBox> = {}
|
|
||||||
cards.forEach(el => {
|
|
||||||
const id = el.getAttribute('data-agent-id')
|
|
||||||
if (!id) return
|
|
||||||
const r = el.getBoundingClientRect()
|
|
||||||
positions[id] = {
|
|
||||||
left: r.left - rect.left,
|
|
||||||
right: r.left + r.width - rect.left,
|
|
||||||
top: r.top - rect.top,
|
|
||||||
bottom: r.top + r.height - rect.top,
|
|
||||||
cx: r.left + r.width / 2 - rect.left,
|
|
||||||
cy: r.top + r.height / 2 - rect.top,
|
|
||||||
width: r.width,
|
|
||||||
height: r.height,
|
|
||||||
}
|
|
||||||
})
|
|
||||||
cardPositions.value = positions
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ── SVG path computation ──
|
// ── Hero computed ──
|
||||||
interface ConnectionPath {
|
const hero = computed(() => props.agents.find(a => a.id === heroId.value) ?? props.agents[0])
|
||||||
d: string
|
|
||||||
length: number
|
|
||||||
}
|
|
||||||
|
|
||||||
const connectionPaths = computed<Record<string, ConnectionPath | null>>(() => {
|
|
||||||
const result: Record<string, ConnectionPath | null> = {}
|
|
||||||
const pos = cardPositions.value
|
|
||||||
const heroEntry = props.agents.find(a => a.id === props.heroId)
|
|
||||||
const heroId = heroEntry?.id ?? ''
|
|
||||||
const iris = heroId ? pos[heroId] : undefined
|
|
||||||
if (!iris) return result
|
|
||||||
|
|
||||||
const children = childAgents.value
|
|
||||||
const total = children.length
|
|
||||||
if (total === 0) return result
|
|
||||||
|
|
||||||
for (let idx = 0; idx < total; idx++) {
|
|
||||||
const agent = children[idx]
|
|
||||||
const agentPos = pos[agent.id]
|
|
||||||
if (!agentPos) {
|
|
||||||
result[agent.id] = null
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
// Spread start points across Iris bottom edge (30%-70% range)
|
|
||||||
const t = total > 1 ? idx / (total - 1) : 0.5
|
|
||||||
const startX = iris.left + iris.width * (0.38 + t * 0.24)
|
|
||||||
const startY = iris.bottom - 1
|
|
||||||
|
|
||||||
// Determine column: left or right of Iris center
|
|
||||||
const isLeftColumn = agentPos.cx < iris.cx
|
|
||||||
|
|
||||||
// End point: approach from side, 8px before card edge
|
|
||||||
const endX = isLeftColumn ? agentPos.right - 8 : agentPos.left + 8
|
|
||||||
const endY = agentPos.cy
|
|
||||||
|
|
||||||
// Bézier control points
|
|
||||||
const cp1x = startX
|
|
||||||
const cp1y = startY + 70
|
|
||||||
const cp2x = endX + (isLeftColumn ? 35 : -35)
|
|
||||||
const cp2y = endY - 10
|
|
||||||
|
|
||||||
const d = `M ${startX} ${startY} C ${cp1x} ${cp1y}, ${cp2x} ${cp2y}, ${endX} ${endY}`
|
|
||||||
result[agent.id] = { d, length: 0 }
|
|
||||||
}
|
|
||||||
return result
|
|
||||||
})
|
|
||||||
|
|
||||||
// ── Pulse animation (JS-driven via requestAnimationFrame) ──
|
|
||||||
let animFrameId: number | null = null
|
|
||||||
let lastAnimTime = 0
|
|
||||||
|
|
||||||
const pathElements = ref<Record<string, SVGPathElement | null>>({})
|
|
||||||
const pulseElements = ref<Record<string, SVGPathElement | null>>({})
|
|
||||||
const pulseOffsets = ref<Record<string, number>>({})
|
|
||||||
|
|
||||||
function storePathRef(id: string) {
|
|
||||||
return (el: SVGPathElement | null) => {
|
|
||||||
pathElements.value[id] = el
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function storePulseRef(id: string) {
|
|
||||||
return (el: SVGPathElement | null) => {
|
|
||||||
pulseElements.value[id] = el
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function refreshPathLengths() {
|
|
||||||
for (const id of childAgents.value.map(a => a.id)) {
|
|
||||||
const pathEl = pathElements.value[id]
|
|
||||||
const pulseEl = pulseElements.value[id]
|
|
||||||
const p = connectionPaths.value[id]
|
|
||||||
if (pathEl && p) {
|
|
||||||
p.length = pathEl.getTotalLength()
|
|
||||||
}
|
|
||||||
if (pulseEl && p && p.length > 0) {
|
|
||||||
if (pulseOffsets.value[id] === undefined) {
|
|
||||||
pulseOffsets.value[id] = 0
|
|
||||||
}
|
|
||||||
pulseEl.setAttribute('stroke-dasharray', `40 ${p.length}`)
|
|
||||||
pulseEl.setAttribute('stroke-dashoffset', String(-pulseOffsets.value[id]))
|
|
||||||
}
|
|
||||||
const pulseEl2 = pulseElements2.value[id]
|
|
||||||
if (pulseEl2 && p && p.length > 0) {
|
|
||||||
if (pulseOffsets2.value[id] === undefined) {
|
|
||||||
pulseOffsets2.value[id] = 0
|
|
||||||
}
|
|
||||||
pulseEl2.setAttribute('stroke-dasharray', `40 ${p.length}`)
|
|
||||||
pulseEl2.setAttribute('stroke-dashoffset', String(-pulseOffsets2.value[id]))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function startPulseAnimation() {
|
|
||||||
const speeds: Record<string, number> = {}
|
|
||||||
|
|
||||||
refreshPathLengths()
|
|
||||||
|
|
||||||
for (const id of childAgents.value.map(a => a.id)) {
|
|
||||||
const p = connectionPaths.value[id]
|
|
||||||
if (p && p.length > 0) {
|
|
||||||
speeds[id] = p.length / 3000
|
|
||||||
if (pulseOffsets.value[id] === undefined) {
|
|
||||||
pulseOffsets.value[id] = 0
|
|
||||||
}
|
|
||||||
if (pulseOffsets2.value[id] === undefined) {
|
|
||||||
pulseOffsets2.value[id] = 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
lastAnimTime = performance.now()
|
|
||||||
|
|
||||||
function tick(now: number) {
|
|
||||||
const dt = now - lastAnimTime
|
|
||||||
lastAnimTime = now
|
|
||||||
|
|
||||||
const children = childAgents.value
|
|
||||||
for (let i = 0; i < children.length; i++) {
|
|
||||||
const id = children[i].id
|
|
||||||
const pathEl = pathElements.value[id]
|
|
||||||
const pulseEl = pulseElements.value[id]
|
|
||||||
const pulseEl2 = pulseElements2.value[id]
|
|
||||||
const p = connectionPaths.value[id]
|
|
||||||
if (!pathEl || !pulseEl || !p) continue
|
|
||||||
|
|
||||||
const len = p.length
|
|
||||||
if (len <= 0) continue
|
|
||||||
|
|
||||||
const speed = speeds[id] ?? len / 3000
|
|
||||||
const cycleLen = len + 40
|
|
||||||
|
|
||||||
// Pulse 1
|
|
||||||
const currentOffset = pulseOffsets.value[id] ?? 0
|
|
||||||
const newOffset = currentOffset + speed * dt
|
|
||||||
pulseOffsets.value[id] = newOffset > cycleLen ? newOffset % cycleLen : newOffset
|
|
||||||
pulseEl.setAttribute('stroke-dashoffset', String(-pulseOffsets.value[id]))
|
|
||||||
|
|
||||||
// Pulse 2 (offset by half cycle)
|
|
||||||
if (pulseEl2) {
|
|
||||||
const offset2 = (pulseOffsets.value[id] + cycleLen / 2) % cycleLen
|
|
||||||
pulseOffsets2.value[id] = offset2
|
|
||||||
pulseEl2.setAttribute('stroke-dashoffset', String(-offset2))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
animFrameId = requestAnimationFrame(tick)
|
|
||||||
}
|
|
||||||
|
|
||||||
animFrameId = requestAnimationFrame(tick)
|
|
||||||
}
|
|
||||||
|
|
||||||
function stopPulseAnimation() {
|
|
||||||
if (animFrameId !== null) {
|
|
||||||
cancelAnimationFrame(animFrameId)
|
|
||||||
animFrameId = null
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ── Lifecycle ──
|
|
||||||
let resizeObserver: ResizeObserver | null = null
|
|
||||||
|
|
||||||
onMounted(async () => {
|
|
||||||
await nextTick()
|
|
||||||
updatePositions()
|
|
||||||
|
|
||||||
// Wait for SVG to render so path refs are populated
|
|
||||||
await nextTick()
|
|
||||||
updatePositions()
|
|
||||||
refreshPathLengths()
|
|
||||||
|
|
||||||
startPulseAnimation()
|
|
||||||
|
|
||||||
resizeObserver = new ResizeObserver(() => {
|
|
||||||
updatePositions()
|
|
||||||
// Paths changed — recalculate lengths and dasharrays
|
|
||||||
requestAnimationFrame(() => {
|
|
||||||
refreshPathLengths()
|
|
||||||
})
|
|
||||||
})
|
|
||||||
if (networkRef.value) {
|
|
||||||
resizeObserver.observe(networkRef.value)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
onUnmounted(() => {
|
|
||||||
stopPulseAnimation()
|
|
||||||
resizeObserver?.disconnect()
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -391,12 +165,12 @@ onUnmounted(() => {
|
|||||||
<span class="card-role-tag" :style="{ background: `${hero.color}18`, color: hero.color, borderColor: `${hero.color}30` }">{{ hero.role }}</span>
|
<span class="card-role-tag" :style="{ background: `${hero.color}18`, color: hero.color, borderColor: `${hero.color}30` }">{{ hero.role }}</span>
|
||||||
</div>
|
</div>
|
||||||
<p class="card-desc">{{ hero.description }}</p>
|
<p class="card-desc">{{ hero.description }}</p>
|
||||||
<div v-if="hero.task" class="task-row">
|
<div v-if="hero.currentTask" class="task-row">
|
||||||
<span class="node-task">
|
<span class="node-task">
|
||||||
<span class="node-task-dot">●</span>
|
<span class="node-task-dot">●</span>
|
||||||
{{ hero.task }}
|
{{ hero.currentTask }}
|
||||||
</span>
|
</span>
|
||||||
<span v-if="hero.runtime" class="node-runtime">{{ hero.runtime }}</span>
|
<span class="node-runtime">{{ formatRuntime(hero.runtimeSeconds) }}</span>
|
||||||
<span v-if="hero.model" class="node-model">{{ hero.model }}</span>
|
<span v-if="hero.model" class="node-model">{{ hero.model }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-tags">
|
<div class="card-tags">
|
||||||
@@ -439,12 +213,12 @@ onUnmounted(() => {
|
|||||||
<span class="card-role-tag" :style="{ background: `${agent.color}18`, color: agent.color, borderColor: `${agent.color}30` }">{{ agent.role }}</span>
|
<span class="card-role-tag" :style="{ background: `${agent.color}18`, color: agent.color, borderColor: `${agent.color}30` }">{{ agent.role }}</span>
|
||||||
</div>
|
</div>
|
||||||
<p class="card-desc">{{ agent.description }}</p>
|
<p class="card-desc">{{ agent.description }}</p>
|
||||||
<div v-if="agent.task" class="task-row">
|
<div v-if="agent.currentTask" class="task-row">
|
||||||
<span class="node-task">
|
<span class="node-task">
|
||||||
<span class="node-task-dot">●</span>
|
<span class="node-task-dot">●</span>
|
||||||
{{ agent.task }}
|
{{ agent.currentTask }}
|
||||||
</span>
|
</span>
|
||||||
<span v-if="agent.runtime" class="node-runtime">{{ agent.runtime }}</span>
|
<span class="node-runtime">{{ formatRuntime(agent.runtimeSeconds) }}</span>
|
||||||
<span v-if="agent.model" class="node-model">{{ agent.model }}</span>
|
<span v-if="agent.model" class="node-model">{{ agent.model }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-tags">
|
<div class="card-tags">
|
||||||
@@ -506,7 +280,7 @@ onUnmounted(() => {
|
|||||||
transition: border-color 0.3s, box-shadow 0.3s;
|
transition: border-color 0.3s, box-shadow 0.3s;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ── Agent Card (inlined from old AgentCard.vue) ── */
|
/* ── Agent Card ── */
|
||||||
.agent-card {
|
.agent-card {
|
||||||
background: rgba(18, 22, 30, 0.45);
|
background: rgba(18, 22, 30, 0.45);
|
||||||
backdrop-filter: blur(12px);
|
backdrop-filter: blur(12px);
|
||||||
@@ -634,7 +408,7 @@ onUnmounted(() => {
|
|||||||
letter-spacing: 0.02em;
|
letter-spacing: 0.02em;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ── Hover Arrow (bottom-right) ── */
|
/* ── Hover Arrow ── */
|
||||||
.card-arrow {
|
.card-arrow {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 12px;
|
right: 12px;
|
||||||
|
|||||||
@@ -8,8 +8,6 @@ export interface AgentNodeData {
|
|||||||
tags: string[]
|
tags: string[]
|
||||||
color: string
|
color: string
|
||||||
icon: string
|
icon: string
|
||||||
task: string
|
|
||||||
runtime: string
|
|
||||||
model?: string
|
model?: string
|
||||||
hero?: boolean
|
hero?: boolean
|
||||||
currentTask: string
|
currentTask: string
|
||||||
@@ -112,8 +110,6 @@ export function useDashboardData() {
|
|||||||
color: '#8b7cf6',
|
color: '#8b7cf6',
|
||||||
icon: 'bot',
|
icon: 'bot',
|
||||||
hero: true,
|
hero: true,
|
||||||
task: 'Orchestrating Nexus Dashboard redesign',
|
|
||||||
runtime: '14:23',
|
|
||||||
currentTask: 'Orchestrating Nexus Dashboard redesign',
|
currentTask: 'Orchestrating Nexus Dashboard redesign',
|
||||||
goal: 'Complete Mission Control v3',
|
goal: 'Complete Mission Control v3',
|
||||||
progress: 85,
|
progress: 85,
|
||||||
@@ -141,8 +137,6 @@ export function useDashboardData() {
|
|||||||
tags: ['Coding', 'Development', 'Builds'],
|
tags: ['Coding', 'Development', 'Builds'],
|
||||||
color: '#3b82f6',
|
color: '#3b82f6',
|
||||||
icon: 'code',
|
icon: 'code',
|
||||||
task: 'Building Dungeon System API endpoints',
|
|
||||||
runtime: '01:00',
|
|
||||||
currentTask: 'Building Dungeon System API endpoints',
|
currentTask: 'Building Dungeon System API endpoints',
|
||||||
goal: 'Complete Dungeon CRUD + room generation',
|
goal: 'Complete Dungeon CRUD + room generation',
|
||||||
progress: 62,
|
progress: 62,
|
||||||
@@ -170,8 +164,6 @@ export function useDashboardData() {
|
|||||||
tags: ['Deployment', 'Docker', 'CI/CD'],
|
tags: ['Deployment', 'Docker', 'CI/CD'],
|
||||||
color: '#eab308',
|
color: '#eab308',
|
||||||
icon: 'server',
|
icon: 'server',
|
||||||
task: 'Optimizing Docker Compose caching',
|
|
||||||
runtime: '00:30',
|
|
||||||
currentTask: 'Optimizing Docker Compose caching',
|
currentTask: 'Optimizing Docker Compose caching',
|
||||||
goal: 'Reduce build times by 40%',
|
goal: 'Reduce build times by 40%',
|
||||||
progress: 45,
|
progress: 45,
|
||||||
@@ -199,8 +191,6 @@ export function useDashboardData() {
|
|||||||
tags: ['Research', 'Analysis', 'Docs'],
|
tags: ['Research', 'Analysis', 'Docs'],
|
||||||
color: '#22c55e',
|
color: '#22c55e',
|
||||||
icon: 'search',
|
icon: 'search',
|
||||||
task: 'Analyzing WebSocket alternatives',
|
|
||||||
runtime: '00:45',
|
|
||||||
currentTask: 'Analyzing WebSocket alternatives',
|
currentTask: 'Analyzing WebSocket alternatives',
|
||||||
goal: 'Recommend real-time communication strategy',
|
goal: 'Recommend real-time communication strategy',
|
||||||
progress: 30,
|
progress: 30,
|
||||||
@@ -227,8 +217,6 @@ export function useDashboardData() {
|
|||||||
tags: ['Code Review', 'Testing', 'Quality'],
|
tags: ['Code Review', 'Testing', 'Quality'],
|
||||||
color: '#a855f7',
|
color: '#a855f7',
|
||||||
icon: 'shield',
|
icon: 'shield',
|
||||||
task: 'Reviewing Dungeon System PR',
|
|
||||||
runtime: '00:15',
|
|
||||||
currentTask: 'Reviewing Dungeon System PR',
|
currentTask: 'Reviewing Dungeon System PR',
|
||||||
goal: 'Zero critical findings before merge',
|
goal: 'Zero critical findings before merge',
|
||||||
progress: 80,
|
progress: 80,
|
||||||
|
|||||||
@@ -0,0 +1,266 @@
|
|||||||
|
import { ref, computed, onMounted, onUnmounted, nextTick, type Ref } from 'vue'
|
||||||
|
import type { AgentNodeData } from './useDashboardData'
|
||||||
|
|
||||||
|
export interface CardBox {
|
||||||
|
left: number
|
||||||
|
right: number
|
||||||
|
top: number
|
||||||
|
bottom: number
|
||||||
|
cx: number
|
||||||
|
cy: number
|
||||||
|
width: number
|
||||||
|
height: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ConnectionPath {
|
||||||
|
d: string
|
||||||
|
length: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export function useTeamNetworkSvg(
|
||||||
|
networkRef: Ref<HTMLElement | null>,
|
||||||
|
agents: Ref<AgentNodeData[]>,
|
||||||
|
heroId: Ref<string>,
|
||||||
|
isActive: (id: string) => boolean,
|
||||||
|
) {
|
||||||
|
// ── Layout ──
|
||||||
|
const cardPositions = ref<Record<string, CardBox>>({})
|
||||||
|
const svgWidth = ref(0)
|
||||||
|
const svgHeight = ref(0)
|
||||||
|
|
||||||
|
const childAgents = computed(() => agents.value.filter(a => a.id !== heroId.value))
|
||||||
|
|
||||||
|
function updatePositions() {
|
||||||
|
const el = networkRef.value
|
||||||
|
if (!el) return
|
||||||
|
const rect = el.getBoundingClientRect()
|
||||||
|
svgWidth.value = rect.width
|
||||||
|
svgHeight.value = rect.height
|
||||||
|
|
||||||
|
const cards = el.querySelectorAll('[data-agent-id]')
|
||||||
|
const positions: Record<string, CardBox> = {}
|
||||||
|
cards.forEach(card => {
|
||||||
|
const id = card.getAttribute('data-agent-id')
|
||||||
|
if (!id) return
|
||||||
|
const r = card.getBoundingClientRect()
|
||||||
|
positions[id] = {
|
||||||
|
left: r.left - rect.left,
|
||||||
|
right: r.left + r.width - rect.left,
|
||||||
|
top: r.top - rect.top,
|
||||||
|
bottom: r.top + r.height - rect.top,
|
||||||
|
cx: r.left + r.width / 2 - rect.left,
|
||||||
|
cy: r.top + r.height / 2 - rect.top,
|
||||||
|
width: r.width,
|
||||||
|
height: r.height,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
cardPositions.value = positions
|
||||||
|
}
|
||||||
|
|
||||||
|
// ── Connection paths ──
|
||||||
|
const connectionPaths = computed<Record<string, ConnectionPath | null>>(() => {
|
||||||
|
const result: Record<string, ConnectionPath | null> = {}
|
||||||
|
const pos = cardPositions.value
|
||||||
|
const iris = pos[heroId.value]
|
||||||
|
if (!iris) return result
|
||||||
|
|
||||||
|
const children = childAgents.value
|
||||||
|
const total = children.length
|
||||||
|
if (total === 0) return result
|
||||||
|
|
||||||
|
for (let idx = 0; idx < total; idx++) {
|
||||||
|
const agent = children[idx]
|
||||||
|
const agentPos = pos[agent.id]
|
||||||
|
if (!agentPos) {
|
||||||
|
result[agent.id] = null
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
// Spread start points across Iris bottom edge (30%-70% range)
|
||||||
|
const t = total > 1 ? idx / (total - 1) : 0.5
|
||||||
|
const startX = iris.left + iris.width * (0.38 + t * 0.24)
|
||||||
|
const startY = iris.bottom - 1
|
||||||
|
|
||||||
|
// Determine column: left or right of Iris center
|
||||||
|
const isLeftColumn = agentPos.cx < iris.cx
|
||||||
|
|
||||||
|
// End point: approach from side, 8px before card edge
|
||||||
|
const endX = isLeftColumn ? agentPos.right - 8 : agentPos.left + 8
|
||||||
|
const endY = agentPos.cy
|
||||||
|
|
||||||
|
// Bézier control points
|
||||||
|
const cp1x = startX
|
||||||
|
const cp1y = startY + 70
|
||||||
|
const cp2x = endX + (isLeftColumn ? 35 : -35)
|
||||||
|
const cp2y = endY - 10
|
||||||
|
|
||||||
|
const d = `M ${startX} ${startY} C ${cp1x} ${cp1y}, ${cp2x} ${cp2y}, ${endX} ${endY}`
|
||||||
|
result[agent.id] = { d, length: 0 }
|
||||||
|
}
|
||||||
|
return result
|
||||||
|
})
|
||||||
|
|
||||||
|
// ── Path refs (template ref functions) ──
|
||||||
|
const pathElements = ref<Record<string, SVGPathElement | null>>({})
|
||||||
|
const pulseElements = ref<Record<string, SVGPathElement | null>>({})
|
||||||
|
const pulseElements2 = ref<Record<string, SVGPathElement | null>>({})
|
||||||
|
const pulseOffsets = ref<Record<string, number>>({})
|
||||||
|
const pulseOffsets2 = ref<Record<string, number>>({})
|
||||||
|
|
||||||
|
function storePathRef(id: string) {
|
||||||
|
return (el: SVGPathElement | null) => {
|
||||||
|
pathElements.value[id] = el
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function storePulseRef(id: string) {
|
||||||
|
return (el: SVGPathElement | null) => {
|
||||||
|
pulseElements.value[id] = el
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function storePulseRef2(id: string) {
|
||||||
|
return (el: SVGPathElement | null) => {
|
||||||
|
pulseElements2.value[id] = el
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ── Pulse animation ──
|
||||||
|
let animFrameId: number | null = null
|
||||||
|
let lastAnimTime = 0
|
||||||
|
const speeds: Record<string, number> = {}
|
||||||
|
|
||||||
|
function refreshPathLengths() {
|
||||||
|
for (const id of childAgents.value.map(a => a.id)) {
|
||||||
|
const pathEl = pathElements.value[id]
|
||||||
|
const pulseEl = pulseElements.value[id]
|
||||||
|
const p = connectionPaths.value[id]
|
||||||
|
if (pathEl && p) {
|
||||||
|
p.length = pathEl.getTotalLength()
|
||||||
|
}
|
||||||
|
if (pulseEl && p && p.length > 0) {
|
||||||
|
if (pulseOffsets.value[id] === undefined) {
|
||||||
|
pulseOffsets.value[id] = 0
|
||||||
|
}
|
||||||
|
pulseEl.setAttribute('stroke-dasharray', `40 ${p.length}`)
|
||||||
|
pulseEl.setAttribute('stroke-dashoffset', String(-pulseOffsets.value[id]))
|
||||||
|
}
|
||||||
|
const pulseEl2 = pulseElements2.value[id]
|
||||||
|
if (pulseEl2 && p && p.length > 0) {
|
||||||
|
if (pulseOffsets2.value[id] === undefined) {
|
||||||
|
pulseOffsets2.value[id] = 0
|
||||||
|
}
|
||||||
|
pulseEl2.setAttribute('stroke-dasharray', `40 ${p.length}`)
|
||||||
|
pulseEl2.setAttribute('stroke-dashoffset', String(-pulseOffsets2.value[id]))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function startPulseAnimation() {
|
||||||
|
refreshPathLengths()
|
||||||
|
|
||||||
|
for (const id of childAgents.value.map(a => a.id)) {
|
||||||
|
const p = connectionPaths.value[id]
|
||||||
|
if (p && p.length > 0) {
|
||||||
|
speeds[id] = p.length / 3000
|
||||||
|
if (pulseOffsets.value[id] === undefined) pulseOffsets.value[id] = 0
|
||||||
|
if (pulseOffsets2.value[id] === undefined) pulseOffsets2.value[id] = 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
lastAnimTime = performance.now()
|
||||||
|
|
||||||
|
function tick(now: number) {
|
||||||
|
const dt = now - lastAnimTime
|
||||||
|
lastAnimTime = now
|
||||||
|
|
||||||
|
const children = childAgents.value
|
||||||
|
for (let i = 0; i < children.length; i++) {
|
||||||
|
const id = children[i].id
|
||||||
|
const pathEl = pathElements.value[id]
|
||||||
|
const pulseEl = pulseElements.value[id]
|
||||||
|
const pulseEl2 = pulseElements2.value[id]
|
||||||
|
const p = connectionPaths.value[id]
|
||||||
|
if (!pathEl || !pulseEl || !p) continue
|
||||||
|
|
||||||
|
const len = p.length
|
||||||
|
if (len <= 0) continue
|
||||||
|
|
||||||
|
const speed = speeds[id] ?? len / 3000
|
||||||
|
const cycleLen = len + 40
|
||||||
|
|
||||||
|
// Pulse 1
|
||||||
|
const currentOffset = pulseOffsets.value[id] ?? 0
|
||||||
|
const newOffset = currentOffset + speed * dt
|
||||||
|
pulseOffsets.value[id] = newOffset > cycleLen ? newOffset % cycleLen : newOffset
|
||||||
|
pulseEl.setAttribute('stroke-dashoffset', String(-pulseOffsets.value[id]))
|
||||||
|
|
||||||
|
// Pulse 2 (offset by half cycle)
|
||||||
|
if (pulseEl2) {
|
||||||
|
const offset2 = (pulseOffsets.value[id] + cycleLen / 2) % cycleLen
|
||||||
|
pulseOffsets2.value[id] = offset2
|
||||||
|
pulseEl2.setAttribute('stroke-dashoffset', String(-offset2))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
animFrameId = requestAnimationFrame(tick)
|
||||||
|
}
|
||||||
|
|
||||||
|
animFrameId = requestAnimationFrame(tick)
|
||||||
|
}
|
||||||
|
|
||||||
|
function stopPulseAnimation() {
|
||||||
|
if (animFrameId !== null) {
|
||||||
|
cancelAnimationFrame(animFrameId)
|
||||||
|
animFrameId = null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ── Lifecycle ──
|
||||||
|
let resizeObserver: ResizeObserver | null = null
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
await nextTick()
|
||||||
|
updatePositions()
|
||||||
|
|
||||||
|
// Wait for SVG to render so path refs are populated
|
||||||
|
await nextTick()
|
||||||
|
updatePositions()
|
||||||
|
refreshPathLengths()
|
||||||
|
|
||||||
|
startPulseAnimation()
|
||||||
|
|
||||||
|
resizeObserver = new ResizeObserver(() => {
|
||||||
|
updatePositions()
|
||||||
|
requestAnimationFrame(() => {
|
||||||
|
refreshPathLengths()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
if (networkRef.value) {
|
||||||
|
resizeObserver.observe(networkRef.value)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
onUnmounted(() => {
|
||||||
|
stopPulseAnimation()
|
||||||
|
resizeObserver?.disconnect()
|
||||||
|
})
|
||||||
|
|
||||||
|
return {
|
||||||
|
cardPositions,
|
||||||
|
svgWidth,
|
||||||
|
svgHeight,
|
||||||
|
childAgents,
|
||||||
|
connectionPaths,
|
||||||
|
pathElements,
|
||||||
|
pulseElements,
|
||||||
|
pulseElements2,
|
||||||
|
pulseOffsets,
|
||||||
|
pulseOffsets2,
|
||||||
|
storePathRef,
|
||||||
|
storePulseRef,
|
||||||
|
storePulseRef2,
|
||||||
|
updatePositions,
|
||||||
|
refreshPathLengths,
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,17 +1,17 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { onMounted, onUnmounted, ref } from 'vue'
|
import { onMounted, onUnmounted, ref } from 'vue'
|
||||||
import TaskCard from '../components/dashboard/MissionCard.vue'
|
import TaskCard from '../components/dashboard/TaskCard.vue'
|
||||||
import OperationsFeed from '../components/dashboard/OperationsFeed.vue'
|
import OperationsFeed from '../components/dashboard/OperationsFeed.vue'
|
||||||
import TeamNetwork from '../components/dashboard/TeamNetwork.vue'
|
import TeamNetwork from '../components/dashboard/TeamNetwork.vue'
|
||||||
import ChatPanel from '../components/dashboard/ChatPanel.vue'
|
import ChatPanel from '../components/dashboard/ChatPanel.vue'
|
||||||
import QueuePanel from '../components/dashboard/QueuePanel.vue'
|
import QueuePanel from '../components/dashboard/QueuePanel.vue'
|
||||||
import AgentModal from '../components/dashboard/AgentModal.vue'
|
import AgentModal from '../components/dashboard/AgentModal.vue'
|
||||||
import { useDashboardData } from '../composables/useDashboardData'
|
import { useDashboardData } from '../composables/useDashboardData'
|
||||||
import type { AgentNodeData } from '../../composables/useDashboardData'
|
import type { AgentNodeData } from '../composables/useDashboardData'
|
||||||
|
|
||||||
const {
|
const {
|
||||||
agents, openTasks, feedEntries, chatMessages,
|
agents, openTasks, feedEntries, chatMessages,
|
||||||
irisBusy, irisFocus, irisRuntime, queue,
|
irisBusy, irisFocus, queue,
|
||||||
getAgentRuntime, startRuntime, stopRuntime,
|
getAgentRuntime, startRuntime, stopRuntime,
|
||||||
sendChat, removeQueueItem, moveQueueItem, changeQueuePriority,
|
sendChat, removeQueueItem, moveQueueItem, changeQueuePriority,
|
||||||
} = useDashboardData()
|
} = useDashboardData()
|
||||||
@@ -68,9 +68,6 @@ function onQueueExecuteNow(id: string): void {
|
|||||||
<TeamNetwork
|
<TeamNetwork
|
||||||
hero-id="iris"
|
hero-id="iris"
|
||||||
:agents="agents"
|
:agents="agents"
|
||||||
:iris-runtime="irisRuntime"
|
|
||||||
:get-agent-runtime="getAgentRuntime"
|
|
||||||
:iris-focus="irisFocus"
|
|
||||||
@select="onAgentSelect"
|
@select="onAgentSelect"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user