Skip to content

Commit 16aab16

Browse files
authored
chore: add few last fixes (#306)
1 parent e9c7b6d commit 16aab16

File tree

1 file changed

+75
-32
lines changed
  • infrastructure/control-panel/src/routes/monitoring

1 file changed

+75
-32
lines changed

infrastructure/control-panel/src/routes/monitoring/+page.svelte

Lines changed: 75 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,48 @@
4646
const newNodes: Node[] = [];
4747
let nodeId = 1;
4848
49-
// Add eVaults in a column on the left (x: 200, y: starting from 150)
49+
// Add service nodes at the top (x: 400, 600, 800, y: 50)
50+
newNodes.push({
51+
id: 'registry',
52+
position: { x: 400, y: 50 },
53+
data: {
54+
label: 'Registry',
55+
subLabel: 'Service',
56+
type: 'service',
57+
selected: false
58+
},
59+
type: 'vault'
60+
});
61+
62+
newNodes.push({
63+
id: 'ontology',
64+
position: { x: 600, y: 50 },
65+
data: {
66+
label: 'Ontology Service',
67+
subLabel: 'Service',
68+
type: 'service',
69+
selected: false
70+
},
71+
type: 'vault'
72+
});
73+
74+
newNodes.push({
75+
id: 'provisioner',
76+
position: { x: 800, y: 50 },
77+
data: {
78+
label: 'eVault Provisioner',
79+
subLabel: 'Service',
80+
type: 'service',
81+
selected: false
82+
},
83+
type: 'vault'
84+
});
85+
86+
// Add eVaults in a column on the left (x: 200, y: starting from 500)
5087
selectedEVaults.forEach((evault, index) => {
5188
newNodes.push({
5289
id: `evault-${index + 1}`,
53-
position: { x: 200, y: 150 + index * 180 },
90+
position: { x: 200, y: 500 + index * 180 },
5491
data: {
5592
label: evault.evaultId || evault.name || 'eVault',
5693
subLabel: evault.serviceUrl || evault.ip || 'Unknown',
@@ -61,11 +98,11 @@
6198
});
6299
});
63100
64-
// Add platforms in a column on the right (x: 800, y: starting from 150)
101+
// Add platforms in a column on the right (x: 800, y: starting from 500)
65102
selectedPlatforms.forEach((platform, index) => {
66103
newNodes.push({
67104
id: `platform-${index + 1}`,
68-
position: { x: 800, y: 150 + index * 180 },
105+
position: { x: 800, y: 500 + index * 180 },
69106
data: {
70107
label: platform.name,
71108
subLabel: platform.url,
@@ -82,6 +119,13 @@
82119
83120
// Load SvelteFlow component
84121
loadSvelteFlow();
122+
123+
// Start subscription immediately on mount
124+
subscribeToEvents();
125+
126+
// Initialize sequence state to show we're ready
127+
sequenceStarted = true;
128+
currentFlowStep = 0;
85129
});
86130
87131
async function loadSvelteFlow() {
@@ -378,13 +422,10 @@
378422
// Don't clear flowMessages - keep old logs
379423
edges = [];
380424
381-
// Close existing connection if any
382-
if (eventSource) {
383-
eventSource.close();
425+
// Only start new SSE connection if one doesn't exist
426+
if (!eventSource) {
427+
subscribeToEvents();
384428
}
385-
386-
// Start new SSE connection
387-
subscribeToEvents();
388429
}
389430
390431
// Function to reset the sequence
@@ -435,7 +476,7 @@
435476

436477
<section class="flex h-full w-full">
437478
<div class="bg-gray flex h-screen w-screen flex-col">
438-
<div class="z-10 flex w-full items-center justify-between bg-white p-4 shadow-sm">
479+
<div class="z-10 flex w-full items-center justify-between bg-white p-4">
439480
<div>
440481
<h4 class="text-xl font-semibold text-gray-800">Live Monitoring</h4>
441482
<p class="mt-1 text-sm text-gray-600">
@@ -543,30 +584,25 @@
543584

544585
<!-- Flow Messages Panel -->
545586
<div
546-
class="flex h-full w-[40%] cursor-pointer flex-col bg-white p-4 shadow-sm transition-colors hover:bg-gray-50"
547-
onclick={!sequenceStarted || currentFlowStep >= 4 ? startSequence : undefined}
548-
class:cursor-pointer={!sequenceStarted || currentFlowStep >= 4}
549-
class:cursor-default={sequenceStarted && currentFlowStep < 4}
587+
class="flex h-full w-[40%] cursor-default flex-col bg-white p-4 transition-colors hover:bg-gray-50"
550588
>
551589
<div class="mb-4">
552590
<h3 class="text-lg font-semibold text-gray-800">Data Flow</h3>
553-
{#if sequenceStarted}
554-
<div class="mt-2 text-sm text-gray-600">
555-
Current Step: {currentFlowStep === 0
556-
? 'Waiting...'
557-
: currentFlowStep === 1
558-
? 'Platform creating entry locally'
559-
: currentFlowStep === 2
560-
? 'Syncing to eVault'
561-
: currentFlowStep === 3
562-
? 'eVault created metaenvelope'
563-
: currentFlowStep === 4
564-
? 'Awareness Protocol'
565-
: currentFlowStep === 5
566-
? 'All platforms notified'
567-
: 'Complete'}
568-
</div>
569-
{/if}
591+
<div class="mt-2 text-sm text-gray-600">
592+
Current Step: {currentFlowStep === 0
593+
? 'Waiting for events...'
594+
: currentFlowStep === 1
595+
? 'Platform creating entry locally'
596+
: currentFlowStep === 2
597+
? 'Syncing to eVault'
598+
: currentFlowStep === 3
599+
? 'eVault created metaenvelope'
600+
: currentFlowStep === 4
601+
? 'Awareness Protocol'
602+
: currentFlowStep === 5
603+
? 'All platforms notified'
604+
: 'Complete'}
605+
</div>
570606
</div>
571607

572608
<div class="flex-1 space-y-2 overflow-y-auto">
@@ -617,4 +653,11 @@
617653
:global(.svelte-flow__edge.default .svelte-flow__edge-path) {
618654
stroke-dasharray: none !important;
619655
}
656+
657+
/* Hide handles on service nodes */
658+
:global(.svelte-flow__node[data-id='registry'] .svelte-flow__handle),
659+
:global(.svelte-flow__node[data-id='ontology'] .svelte-flow__handle),
660+
:global(.svelte-flow__node[data-id='provisioner'] .svelte-flow__handle) {
661+
visibility: hidden !important;
662+
}
620663
</style>

0 commit comments

Comments
 (0)