|
42 | 42 | selectedPlatforms = JSON.parse(platformsData);
|
43 | 43 | }
|
44 | 44 |
|
45 |
| - // Check if any items are selected, if not redirect back to home |
| 45 | + // Check if any items are selected, if not show selection interface |
46 | 46 | if (
|
47 | 47 | (!selectedEVaults || selectedEVaults.length === 0) &&
|
48 | 48 | (!selectedPlatforms || selectedPlatforms.length === 0)
|
49 | 49 | ) {
|
50 |
| - goto('/'); |
51 | 50 | return;
|
52 | 51 | }
|
53 | 52 |
|
|
483 | 482 | }
|
484 | 483 | </script>
|
485 | 484 |
|
486 |
| -<section class="flex h-full w-full"> |
487 |
| - <div class="bg-gray flex h-screen w-screen flex-col"> |
488 |
| - <div class="z-10 flex w-full items-center justify-between bg-white p-4"> |
489 |
| - <div> |
490 |
| - <h4 class="text-xl font-semibold text-gray-800">Live Monitoring</h4> |
491 |
| - <p class="mt-1 text-sm text-gray-600"> |
492 |
| - Monitoring {selectedEVaults.length} eVault{selectedEVaults.length !== 1 |
493 |
| - ? 's' |
494 |
| - : ''} and {selectedPlatforms.length} platform{selectedPlatforms.length !== 1 |
495 |
| - ? 's' |
496 |
| - : ''} |
497 |
| - </p> |
498 |
| - {#if currentFlowStep > 0} |
499 |
| - <div class="mt-2 flex items-center gap-2"> |
500 |
| - <div class="h-3 w-3 animate-pulse rounded-full bg-green-500"></div> |
501 |
| - <span class="text-xs font-medium text-green-600"> |
502 |
| - {currentFlowStep === 1 |
503 |
| - ? 'Platform creating entry locally' |
504 |
| - : currentFlowStep === 2 |
505 |
| - ? 'Syncing to eVault' |
506 |
| - : currentFlowStep === 3 |
507 |
| - ? 'eVault created metaenvelope' |
508 |
| - : currentFlowStep === 4 |
509 |
| - ? 'Awareness Protocol' |
510 |
| - : currentFlowStep === 5 |
511 |
| - ? 'All platforms notified' |
512 |
| - : 'Complete'} |
513 |
| - </span> |
514 |
| - </div> |
515 |
| - {/if} |
516 |
| - </div> |
517 |
| - <div class="flex gap-2"> |
518 |
| - <button |
519 |
| - onclick={() => goto('/')} |
520 |
| - class="font-geist flex items-center gap-2 rounded-full border border-[#e5e5e5] bg-white px-4 py-2 text-base font-medium text-gray-700 shadow-md transition-colors hover:bg-gray-50" |
521 |
| - > |
522 |
| - ← Back to Control Panel |
523 |
| - </button> |
524 |
| - <button |
525 |
| - onclick={() => (isPaused = !isPaused)} |
526 |
| - class="font-geist flex items-center gap-2 rounded-full border border-[#e5e5e5] bg-white px-4 py-2 text-base font-medium text-gray-700 shadow-md transition-colors hover:bg-gray-50" |
527 |
| - > |
528 |
| - {#if isPaused} |
529 |
| - <HugeiconsIcon icon={PlayFreeIcons} size="20px" /> |
530 |
| - {:else} |
531 |
| - <HugeiconsIcon icon={PauseFreeIcons} size="20px" /> |
| 485 | +{#if (!selectedEVaults || selectedEVaults.length === 0) && (!selectedPlatforms || selectedPlatforms.length === 0)} |
| 486 | + <!-- No items selected - show selection interface --> |
| 487 | + <div class="flex h-full w-full items-center justify-center"> |
| 488 | + <div class="text-center"> |
| 489 | + <h2 class="mb-4 text-2xl font-bold text-gray-900">No Items Selected</h2> |
| 490 | + <p class="mb-6 text-gray-600"> |
| 491 | + Please select eVaults and/or platforms from the home page to start monitoring. |
| 492 | + </p> |
| 493 | + <button |
| 494 | + onclick={() => goto('/')} |
| 495 | + class="bg-primary hover:bg-primary-600 rounded-full px-8 py-3 text-lg font-semibold text-white transition-colors" |
| 496 | + > |
| 497 | + Back to Selection |
| 498 | + </button> |
| 499 | + </div> |
| 500 | + </div> |
| 501 | +{:else} |
| 502 | + <section class="flex h-full w-full"> |
| 503 | + <div class="bg-gray flex h-screen w-screen flex-col"> |
| 504 | + <div class="z-10 flex w-full items-center justify-between bg-white p-4"> |
| 505 | + <div> |
| 506 | + <h4 class="text-xl font-semibold text-gray-800">Live Monitoring</h4> |
| 507 | + <p class="mt-1 text-sm text-gray-600"> |
| 508 | + Monitoring {selectedEVaults.length} eVault{selectedEVaults.length !== 1 |
| 509 | + ? 's' |
| 510 | + : ''} and {selectedPlatforms.length} platform{selectedPlatforms.length !== |
| 511 | + 1 |
| 512 | + ? 's' |
| 513 | + : ''} |
| 514 | + </p> |
| 515 | + {#if currentFlowStep > 0} |
| 516 | + <div class="mt-2 flex items-center gap-2"> |
| 517 | + <div class="h-3 w-3 animate-pulse rounded-full bg-green-500"></div> |
| 518 | + <span class="text-xs font-medium text-green-600"> |
| 519 | + {currentFlowStep === 1 |
| 520 | + ? 'Platform creating entry locally' |
| 521 | + : currentFlowStep === 2 |
| 522 | + ? 'Syncing to eVault' |
| 523 | + : currentFlowStep === 3 |
| 524 | + ? 'eVault created metaenvelope' |
| 525 | + : currentFlowStep === 4 |
| 526 | + ? 'Awareness Protocol' |
| 527 | + : currentFlowStep === 5 |
| 528 | + ? 'All platforms notified' |
| 529 | + : 'Complete'} |
| 530 | + </span> |
| 531 | + </div> |
532 | 532 | {/if}
|
533 |
| - {isPaused ? 'Resume Live Feed' : 'Pause Live Feed'} |
534 |
| - </button> |
| 533 | + </div> |
| 534 | + <div class="flex gap-2"> |
| 535 | + <button |
| 536 | + onclick={() => goto('/')} |
| 537 | + class="font-geist flex items-center gap-2 rounded-full border border-[#e5e5e5] bg-white px-4 py-2 text-base font-medium text-gray-700 shadow-md transition-colors hover:bg-gray-50" |
| 538 | + > |
| 539 | + ← Back to Control Panel |
| 540 | + </button> |
| 541 | + <button |
| 542 | + onclick={() => (isPaused = !isPaused)} |
| 543 | + class="font-geist flex items-center gap-2 rounded-full border border-[#e5e5e5] bg-white px-4 py-2 text-base font-medium text-gray-700 shadow-md transition-colors hover:bg-gray-50" |
| 544 | + > |
| 545 | + {#if isPaused} |
| 546 | + <HugeiconsIcon icon={PlayFreeIcons} size="20px" /> |
| 547 | + {:else} |
| 548 | + <HugeiconsIcon icon={PauseFreeIcons} size="20px" /> |
| 549 | + {/if} |
| 550 | + {isPaused ? 'Resume Live Feed' : 'Pause Live Feed'} |
| 551 | + </button> |
| 552 | + </div> |
535 | 553 | </div>
|
536 |
| - </div> |
537 | 554 |
|
538 |
| - {#if SvelteFlowComponent} |
539 |
| - {#if selectedEVaults.length === 0 && selectedPlatforms.length === 0} |
540 |
| - <div class="flex flex-grow items-center justify-center"> |
541 |
| - <div class="text-center"> |
542 |
| - <h3 class="mb-2 text-xl font-semibold text-gray-700">No Items Selected</h3> |
543 |
| - <p class="text-gray-500"> |
544 |
| - Go back to the main page and select eVaults and platforms to monitor. |
545 |
| - </p> |
546 |
| - </div> |
547 |
| - </div> |
548 |
| - {:else} |
| 555 | + {#if SvelteFlowComponent} |
549 | 556 | <div class="flex-grow">
|
550 | 557 | <SvelteFlow
|
551 | 558 | bind:nodes
|
|
583 | 590 | </svg>
|
584 | 591 | </SvelteFlow>
|
585 | 592 | </div>
|
| 593 | + {:else} |
| 594 | + <div class="flex flex-grow items-center justify-center text-gray-700"> |
| 595 | + Loading flow chart... |
| 596 | + </div> |
586 | 597 | {/if}
|
587 |
| - {:else} |
588 |
| - <div class="flex flex-grow items-center justify-center text-gray-700"> |
589 |
| - Loading flow chart... |
590 |
| - </div> |
591 |
| - {/if} |
592 |
| - </div> |
593 |
| - |
594 |
| - <!-- Flow Messages Panel --> |
595 |
| - <div |
596 |
| - class="flex h-full w-[40%] cursor-default flex-col bg-white p-4 transition-colors hover:bg-gray-50" |
597 |
| - > |
598 |
| - <div class="mb-4"> |
599 |
| - <h3 class="text-lg font-semibold text-gray-800">Data Flow</h3> |
600 |
| - <div class="mt-2 text-sm text-gray-600"> |
601 |
| - Current Step: {currentFlowStep === 0 |
602 |
| - ? 'Waiting for events...' |
603 |
| - : currentFlowStep === 1 |
604 |
| - ? 'Platform creating entry locally' |
605 |
| - : currentFlowStep === 2 |
606 |
| - ? 'Syncing to eVault' |
607 |
| - : currentFlowStep === 3 |
608 |
| - ? 'eVault created metaenvelope' |
609 |
| - : currentFlowStep === 4 |
610 |
| - ? 'Awareness Protocol' |
611 |
| - : currentFlowStep === 5 |
612 |
| - ? 'All platforms notified' |
613 |
| - : 'Complete'} |
614 |
| - </div> |
615 | 598 | </div>
|
616 | 599 |
|
617 |
| - <div class="flex-1 space-y-2 overflow-y-auto"> |
618 |
| - {#each flowMessages as message, i} |
619 |
| - <div class="rounded bg-gray-50 p-2 font-mono text-sm"> |
620 |
| - {message} |
| 600 | + <!-- Flow Messages Panel --> |
| 601 | + <div |
| 602 | + class="flex h-full w-[40%] cursor-default flex-col bg-white p-4 transition-colors hover:bg-gray-50" |
| 603 | + > |
| 604 | + <div class="mb-4"> |
| 605 | + <h3 class="text-lg font-semibold text-gray-800">Data Flow</h3> |
| 606 | + <div class="mt-2 text-sm text-gray-600"> |
| 607 | + Current Step: {currentFlowStep === 0 |
| 608 | + ? 'Waiting for events...' |
| 609 | + : currentFlowStep === 1 |
| 610 | + ? 'Platform creating entry locally' |
| 611 | + : currentFlowStep === 2 |
| 612 | + ? 'Syncing to eVault' |
| 613 | + : currentFlowStep === 3 |
| 614 | + ? 'eVault created metaenvelope' |
| 615 | + : currentFlowStep === 4 |
| 616 | + ? 'Awareness Protocol' |
| 617 | + : currentFlowStep === 5 |
| 618 | + ? 'All platforms notified' |
| 619 | + : 'Complete'} |
621 | 620 | </div>
|
622 |
| - {/each} |
| 621 | + </div> |
| 622 | + |
| 623 | + <div class="flex-1 space-y-2 overflow-y-auto"> |
| 624 | + {#each flowMessages as message, i} |
| 625 | + <div class="rounded bg-gray-50 p-2 font-mono text-sm"> |
| 626 | + {message} |
| 627 | + </div> |
| 628 | + {/each} |
| 629 | + </div> |
623 | 630 | </div>
|
624 |
| - </div> |
625 |
| -</section> |
| 631 | + </section> |
| 632 | +{/if} |
626 | 633 |
|
627 | 634 | <style>
|
628 | 635 | /*
|
|
0 commit comments