@7365admin1/layer-common 4.29.0 → 4.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @iservice365/layer-common
2
2
 
3
+ ## 4.31.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 2cdc577: HERO robot fleet phase c: `RobotSiteScreen` (shared shell header + site fleet overview + robot detail) for Property Management, Hygiene, Security and the console drill-down, built from new `RobotSiteHeader`, `RobotSiteFleet`, `RobotMiniMap`, `RobotDetail`, `RobotLivePlan`, `RobotFloorPlan`, `RobotPatrolRoutes`, `RobotMark`. `siteStatesFeed` (estate-scoped 4 s poll); `useRobots` gains `getSiteFleet`, `getSiteSummary`, `getRobot`, `getPatrolRoutes` and the pause / resume / cancel / navigate / relocalize command kinds. Pure rules in `utils/robot-display.ts` (list paging - fixes the old fleet never paging past page 1 -, site summary, mini-map placement, patrol drawing and schedule rows, facts grid, optimistic command status, trail, spot points). `RobotTable` gains `paged-foot`; `notReportedLine` uses the handoff's words (battery, floor, spot clean, live position).
8
+
9
+ ## 4.30.0
10
+
11
+ ### Minor Changes
12
+
13
+ - e460aca: Robots: shared pieces for the HERO network view - Needs attention, Clients drill-down, Faults & alerts table, fault bell, live indicator, a feed-agnostic live-state store (`useRobotLive` with a 4 s polling feed, paused while the tab is hidden, swappable for a push feed), summary cells that show "—" for unmeasured values, and display helpers (split lines, since/ago text, Reconnecting instead of stale facts). Not used by any app until the org network page adopts them.
14
+
15
+ A robot with no interface now shows an UNKNOWN status chip (error tone); "No interface" appears only on the capability badge.
16
+
3
17
  ## 4.29.0
4
18
 
5
19
  ### Minor Changes
@@ -1355,11 +1369,11 @@
1355
1369
  `utils/console-tier.ts` + `composables/useConsoleTier.ts` mirror the server's
1356
1370
  own rule from two endpoints the console already calls, unprojected:
1357
1371
 
1358
- GET /api/members/user/:user/app/admin the Seven365 staff membership
1359
- GET /api/roles/id/:role that membership's role document
1372
+ GET /api/members/user/:user/app/admin the Seven365 staff membership
1373
+ GET /api/roles/id/:role that membership's role document
1360
1374
 
1361
- owner = member.type === "admin" && role.type === "admin" && role.default === true
1362
- staff = member.type === "admin" && role.type === "admin"
1375
+ owner = member.type === "admin" && role.type === "admin" && role.default === true
1376
+ staff = member.type === "admin" && role.type === "admin"
1363
1377
 
1364
1378
  `role.default` is the marker because it is the only property of a platform
1365
1379
  staff role no API caller can set - `role.controller.ts` validates create and
@@ -320,7 +320,10 @@
320
320
  display: grid;
321
321
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
322
322
  border-top: 2px solid var(--hero-divider);
323
+ border-left: 1px solid var(--hero-divider);
323
324
  }
325
+ /* The site fleet's strip: always six columns (README §2). */
326
+ .hero-summary--six { grid-template-columns: repeat(6, minmax(0, 1fr)); }
324
327
  .hero-cell {
325
328
  --hero-cell-color: var(--hero-text);
326
329
  position: relative;
@@ -428,6 +431,413 @@
428
431
  }
429
432
  .hero-toast__square { width: 8px; height: 8px; flex: none; background: var(--hero-accent); }
430
433
 
434
+ /* ------------------------------------------- network view (phase b) */
435
+
436
+ /* A whole robot page inside an app layout's padded container. */
437
+ .hero-page {
438
+ display: flex;
439
+ flex-direction: column;
440
+ gap: 20px;
441
+ margin: -24px;
442
+ padding: 20px 24px 40px;
443
+ min-height: calc(100vh - 64px);
444
+ }
445
+
446
+ /* Page head: kicker + H2 left, actions right. */
447
+ .hero-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
448
+ .hero-head__spacer { flex: 1; }
449
+ .hero-head__actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
450
+
451
+ /* Header strip above the page: sub-views, live indicator, bell. */
452
+ .hero-bar {
453
+ position: relative;
454
+ display: flex;
455
+ align-items: center;
456
+ gap: 12px;
457
+ flex-wrap: wrap;
458
+ padding-bottom: 10px;
459
+ border-bottom: 2px solid var(--hero-divider);
460
+ /* the sweep travels past the right edge; clip it there, keep it on the rule */
461
+ overflow-x: clip;
462
+ overflow-y: visible;
463
+ }
464
+ .hero-bar__sweep {
465
+ position: absolute;
466
+ bottom: -2px;
467
+ height: 2px;
468
+ width: 20%;
469
+ background: linear-gradient(90deg, transparent, var(--hero-accent), transparent);
470
+ animation: heroSweep 5s linear infinite;
471
+ pointer-events: none;
472
+ }
473
+ .hero-bar__sweep--off { display: none; }
474
+ .hero-nav { display: flex; gap: 0; }
475
+ .hero-nav__item {
476
+ font: inherit;
477
+ font-size: 13px;
478
+ color: var(--hero-text);
479
+ background: transparent;
480
+ border: 0;
481
+ border-bottom: 3px solid transparent;
482
+ padding: 6px 14px;
483
+ cursor: pointer;
484
+ }
485
+ .hero-nav__item[aria-current="page"] { border-bottom-color: var(--hero-accent); font-weight: 700; background: var(--hero-surface); }
486
+ .hero-nav__item:hover { background: color-mix(in srgb, var(--hero-text) 5%, transparent); }
487
+
488
+ .hero-live { display: flex; align-items: center; gap: 8px; font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
489
+ .hero-live__dot { width: 8px; height: 8px; display: inline-block; background: var(--hero-accent); animation: heroPulse 2s ease-out infinite; }
490
+ .hero-live__dot--off { background: var(--hero-neutral-300); animation: none; }
491
+
492
+ .hero-bell.v-btn { gap: 8px; padding: 5px 10px; min-height: 0; height: auto; }
493
+ .hero-bell.v-btn .v-btn__content { gap: 8px; }
494
+ .hero-bell--on.v-btn { color: var(--hero-accent); border-color: var(--hero-accent); }
495
+
496
+ /* Two columns that stack below ~900px: main + aside. */
497
+ .hero-split { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
498
+ .hero-split__main { display: flex; flex-direction: column; gap: 12px; min-width: 0; flex: 999 1 560px; }
499
+ .hero-split__aside { display: flex; flex-direction: column; gap: 20px; min-width: 0; flex: 1 1 300px; }
500
+
501
+ /* Filters row: native controls, the handoff's look. */
502
+ .hero-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
503
+ .hero-filters .hero-input { width: auto; min-height: 32px; padding: 4px 8px; font-size: 13px; }
504
+ .hero-filters .hero-input--search { width: 220px; }
505
+ /* Vuetify's reset strips the native arrow; draw one in the text colour. */
506
+ .hero-filters select.hero-input {
507
+ appearance: none;
508
+ padding-right: 26px;
509
+ background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
510
+ background-position: calc(100% - 13px) 50%, calc(100% - 9px) 50%;
511
+ background-size: 4px 4px;
512
+ background-repeat: no-repeat;
513
+ cursor: pointer;
514
+ }
515
+ .hero-filters select.hero-input:disabled { opacity: 0.5; cursor: not-allowed; }
516
+ .hero-filters__spacer { flex: 1; }
517
+ .hero-filters__label { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.6; }
518
+ .hero-check { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; cursor: pointer; white-space: nowrap; }
519
+ .hero-check input { width: 14px; height: 14px; margin: 0; accent-color: var(--hero-accent); cursor: pointer; }
520
+
521
+ /* Asides: Needs attention, Clients drill down. */
522
+ .hero-aside__head {
523
+ display: flex;
524
+ align-items: baseline;
525
+ gap: 8px;
526
+ border-top: 2px solid var(--hero-divider);
527
+ padding-top: 8px;
528
+ margin-bottom: 8px;
529
+ }
530
+ .hero-aside__title { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; white-space: nowrap; font-weight: 600; }
531
+ .hero-aside__hint { opacity: 0.6; font-size: 11px; }
532
+ .hero-aside__count { margin-left: auto; font-size: 11px; padding: 1px 7px; background: var(--hero-accent); color: #fff; font-weight: 600; }
533
+ .hero-aside__empty { opacity: 0.6; padding: 10px 0; }
534
+ .hero-attn { display: flex; flex-direction: column; gap: 1px; background: var(--hero-divider); }
535
+ .hero-attn__item, .hero-attn__more {
536
+ display: grid;
537
+ grid-template-columns: 1fr auto;
538
+ gap: 2px 8px;
539
+ padding: 8px 10px;
540
+ font: inherit;
541
+ font-size: 12px;
542
+ text-align: left;
543
+ color: var(--hero-text);
544
+ background: var(--hero-surface);
545
+ border: 0;
546
+ cursor: pointer;
547
+ }
548
+ .hero-attn__item:hover, .hero-attn__more:hover { background: color-mix(in srgb, var(--hero-text) 5%, var(--hero-surface)); }
549
+ .hero-attn__code { color: var(--hero-accent); font-weight: 600; font-size: 11px; }
550
+ .hero-attn__msg { grid-column: 1 / -1; opacity: 0.75; }
551
+ .hero-attn__where { grid-column: 1 / -1; opacity: 0.55; font-size: 11px; }
552
+ .hero-attn__more { display: block; color: var(--hero-accent); font-weight: 600; }
553
+ .hero-drill { margin-bottom: 10px; }
554
+ .hero-drill__client { font-weight: 600; font-size: 12px; display: flex; gap: 8px; }
555
+ .hero-drill__n { opacity: 0.55; font-variant-numeric: tabular-nums; }
556
+ .hero-drill__site {
557
+ display: flex;
558
+ width: 100%;
559
+ gap: 8px;
560
+ align-items: center;
561
+ text-align: left;
562
+ border: 0;
563
+ border-bottom: 1px solid var(--hero-divider);
564
+ padding: 6px 0 6px 12px;
565
+ background: transparent;
566
+ color: var(--hero-text);
567
+ font: inherit;
568
+ font-size: 12px;
569
+ cursor: pointer;
570
+ }
571
+ .hero-drill__site:hover { background: color-mix(in srgb, var(--hero-text) 4%, transparent); }
572
+ .hero-drill__name { flex: 1; }
573
+ .hero-drill__faults { font-size: 10px; padding: 1px 6px; background: var(--hero-accent); color: #fff; font-weight: 600; }
574
+ .hero-drill__go, .hero-go { color: var(--hero-accent); }
575
+
576
+ .hero-back { font: inherit; font-size: 13px; color: var(--hero-accent); background: none; border: 0; padding: 0; cursor: pointer; }
577
+ .hero-alert__code { color: var(--hero-accent); font-weight: 700; }
578
+ .hero-dim { opacity: 0.75; }
579
+ .hero-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
580
+ .hero-note { font-size: 12px; opacity: 0.6; }
581
+
582
+ /* ---------------------------------------- site fleet + detail (phase c) */
583
+
584
+ /* The whole screen inside an app layout: header edge to edge, then main. */
585
+ .hero-screen {
586
+ display: flex;
587
+ flex-direction: column;
588
+ margin: -24px;
589
+ min-height: calc(100vh - 64px);
590
+ }
591
+ .hero-main { display: flex; flex-direction: column; gap: 20px; padding: 20px 24px 40px; min-width: 0; }
592
+
593
+ /* Shared shell header (README "Shared shell"): 62px, 2px rule, sweep line. */
594
+ .hero-header {
595
+ position: relative;
596
+ display: flex;
597
+ flex-wrap: wrap;
598
+ align-items: center;
599
+ gap: 12px 20px;
600
+ min-height: 62px;
601
+ padding: 10px 20px;
602
+ border-bottom: 2px solid var(--hero-divider);
603
+ box-sizing: border-box;
604
+ overflow: hidden;
605
+ }
606
+ .hero-brand { display: flex; align-items: center; gap: 10px; }
607
+ .hero-brand__name { font-family: var(--hero-font); font-weight: 800; font-size: 16px; letter-spacing: 0.06em; line-height: 1; }
608
+ .hero-brand__org { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.6; margin-top: 3px; white-space: nowrap; }
609
+ .hero-header__site { display: flex; align-items: center; gap: 8px; }
610
+ .hero-header__right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
611
+
612
+ /* Cleaning | Security: selected = accent fill, white text. */
613
+ .hero-switch { display: flex; border: 1px solid var(--hero-divider); }
614
+ .hero-switch__opt {
615
+ font: inherit;
616
+ font-size: 12px;
617
+ font-weight: 600;
618
+ padding: 6px 14px;
619
+ border: 0;
620
+ background: transparent;
621
+ color: var(--hero-text);
622
+ cursor: pointer;
623
+ }
624
+ .hero-switch__opt + .hero-switch__opt { border-left: 1px solid var(--hero-divider); }
625
+ .hero-switch__opt[aria-pressed="true"] { background: var(--hero-accent); color: #fff; }
626
+
627
+ /* A native select in the handoff's look, anywhere in the scope. */
628
+ .hero select.hero-select {
629
+ width: auto;
630
+ min-height: 32px;
631
+ padding: 4px 26px 4px 8px;
632
+ font-size: 13px;
633
+ appearance: none;
634
+ background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
635
+ background-position: calc(100% - 13px) 50%, calc(100% - 9px) 50%;
636
+ background-size: 4px 4px;
637
+ background-repeat: no-repeat;
638
+ cursor: pointer;
639
+ }
640
+ .hero select.hero-select--sm { min-height: 28px; padding: 2px 24px 2px 8px; font-size: 12px; }
641
+
642
+ .hero-back--sm { font-size: 12px; white-space: nowrap; margin-bottom: 4px; }
643
+ .hero-title { margin: 0 0 4px; text-wrap: balance; }
644
+
645
+ /* Site fleet: main + mini-map aside (stacks below ~900px). */
646
+ .hero-split__main--fleet { flex: 999 1 520px; }
647
+ .hero-split__aside--map { flex: 1 1 320px; max-width: 420px; gap: 10px; }
648
+ .hero-tag--xs { font-size: 10px; }
649
+
650
+ /* Icon button (full screen). */
651
+ .hero .v-btn.hero-iconbtn { padding: 4px 8px; }
652
+
653
+ /* The floor plan: mini-map and detail plan share it (4:3, grid, walls, dock, brackets). */
654
+ .hero-plan {
655
+ position: relative;
656
+ aspect-ratio: 4 / 3;
657
+ background-color: var(--hero-surface);
658
+ background-image: linear-gradient(var(--hero-divider) 1px, transparent 1px), linear-gradient(90deg, var(--hero-divider) 1px, transparent 1px);
659
+ background-size: 10% 10%;
660
+ border: 1px solid var(--hero-divider);
661
+ overflow: hidden;
662
+ }
663
+ .hero-plan--detail { max-height: 440px; }
664
+ .hero-plan--pick { cursor: crosshair; }
665
+ .hero-plan:fullscreen { background-color: var(--hero-bg); }
666
+ .hero-plan__corner { position: absolute; width: 14px; height: 14px; }
667
+ .hero-plan__corner--tl { left: -1px; top: -1px; border-top: 2px solid var(--hero-accent); border-left: 2px solid var(--hero-accent); }
668
+ .hero-plan__corner--tr { right: -1px; top: -1px; border-top: 2px solid var(--hero-accent); border-right: 2px solid var(--hero-accent); }
669
+ .hero-plan__corner--bl { left: -1px; bottom: -1px; border-bottom: 2px solid var(--hero-accent); border-left: 2px solid var(--hero-accent); }
670
+ .hero-plan__corner--br { right: -1px; bottom: -1px; border-bottom: 2px solid var(--hero-accent); border-right: 2px solid var(--hero-accent); }
671
+ .hero-plan__wall { position: absolute; border: 2px solid var(--hero-text); opacity: 0.6; }
672
+ .hero-plan__dock {
673
+ position: absolute;
674
+ right: 6%;
675
+ bottom: 8%;
676
+ width: 10%;
677
+ height: 14%;
678
+ background: color-mix(in srgb, var(--hero-accent) 30%, transparent);
679
+ border: 1px solid var(--hero-accent);
680
+ }
681
+ .hero-plan__dock-label { position: absolute; left: 0; top: -15px; font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.7; white-space: nowrap; }
682
+ .hero-plan__scan {
683
+ position: absolute;
684
+ inset: 0;
685
+ pointer-events: none;
686
+ background-image: linear-gradient(180deg, transparent, color-mix(in srgb, var(--hero-accent) 22%, transparent) 50%, transparent);
687
+ background-size: 100% 60px;
688
+ background-repeat: no-repeat;
689
+ animation: heroScan 4s linear infinite;
690
+ }
691
+ .hero-plan__svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
692
+ .hero-plan__route { fill: none; stroke: var(--hero-accent); stroke-width: 2; stroke-dasharray: 6 5; }
693
+ .hero-plan__route--anim { animation: heroDash 1.6s linear infinite; }
694
+
695
+ /* Mini-map robots: 14px squares in their status colour, heading tick, ping ring, name tag. */
696
+ .hero-bot { position: absolute; width: 0; height: 0; padding: 0; border: 0; background: none; cursor: pointer; color: inherit; font: inherit; }
697
+ .hero-bot__ping { position: absolute; left: -10px; top: -10px; width: 20px; height: 20px; border: 1.5px solid var(--hero-bot); animation: heroPing 2.4s ease-out infinite; box-sizing: border-box; }
698
+ .hero-bot__body { position: absolute; left: -7px; top: -7px; width: 14px; height: 14px; background: var(--hero-bot); outline: 2px solid var(--hero-bg); }
699
+ .hero-bot__tick { position: absolute; right: -5px; top: 5px; width: 5px; height: 4px; background: var(--hero-accent); }
700
+ .hero-bot__name { position: absolute; left: 10px; top: -18px; font-size: 10px; font-weight: 600; white-space: nowrap; background: var(--hero-bg); padding: 0 4px; line-height: 1.45; }
701
+
702
+ /* Patrol checkpoints and route tags. */
703
+ .hero-cp {
704
+ position: absolute;
705
+ width: 12px;
706
+ height: 12px;
707
+ margin: -6px;
708
+ border: 2px solid var(--hero-accent);
709
+ background: var(--hero-bg);
710
+ display: grid;
711
+ place-items: center;
712
+ font-size: 7px;
713
+ font-weight: 800;
714
+ color: var(--hero-accent);
715
+ box-sizing: border-box;
716
+ }
717
+ .hero-cp--lg { width: 14px; height: 14px; margin: -7px; font-size: 8px; }
718
+ .hero-cp--current { background: var(--hero-accent); color: #fff; }
719
+ .hero-cp__label { position: absolute; margin: -19px 0 0 -8px; font-size: 8px; letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; opacity: 0.7; }
720
+ .hero-cp__label--lg { margin: -22px 0 0 -10px; font-size: 9px; opacity: 0.75; }
721
+ .hero-routetag {
722
+ position: absolute;
723
+ margin: -34px 0 0 -6px;
724
+ font-size: 8px;
725
+ letter-spacing: 0.08em;
726
+ text-transform: uppercase;
727
+ white-space: nowrap;
728
+ font-weight: 800;
729
+ padding: 1px 5px;
730
+ background: var(--hero-accent);
731
+ color: #fff;
732
+ }
733
+ .hero-routetag--lg { margin: -38px 0 0 -8px; font-size: 9px; padding: 2px 6px; }
734
+
735
+ .hero-mini { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
736
+ .hero-seen { opacity: 0.65; }
737
+ .hero-mini__head { display: flex; align-items: center; gap: 8px; border-top: 2px solid var(--hero-divider); padding-top: 8px; }
738
+ .hero-mini__foot { font-size: 11px; opacity: 0.6; display: flex; gap: 12px; white-space: nowrap; }
739
+ .hero-mini__foot > span:first-child { overflow: hidden; text-overflow: ellipsis; }
740
+ .hero-mini__legend { display: inline-block; width: 12px; height: 0; border-top: 2px dashed var(--hero-accent); vertical-align: middle; margin-right: 5px; }
741
+ .hero-mini__count { margin-left: auto; font-variant-numeric: tabular-nums; }
742
+
743
+ /* Robot detail. */
744
+ .hero-detail__title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
745
+ .hero-detail__title h2 { white-space: nowrap; }
746
+ .hero-detail__where { opacity: 0.6; font-size: 12px; }
747
+ .hero .v-btn.hero-ghost { color: var(--hero-accent); padding-inline: 4px; }
748
+ .hero .v-btn.hero-ghost:hover { background: color-mix(in srgb, var(--hero-accent) 10%, transparent); }
749
+
750
+ .hero-faultbar { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 12px 14px; border: 2px solid var(--hero-accent); }
751
+ .hero-faultbar__code { font-family: var(--hero-font); font-weight: 800; color: var(--hero-accent); font-size: 18px; }
752
+ .hero-faultbar__msg { font-weight: 600; }
753
+ .hero-faultbar__since { opacity: 0.65; font-size: 12px; }
754
+ .hero-faultbar__badge { font-size: 11px; padding: 2px 8px; background: var(--hero-accent); color: #fff; font-weight: 600; }
755
+
756
+ .hero-facts {
757
+ display: grid;
758
+ grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
759
+ border-top: 2px solid var(--hero-divider);
760
+ border-left: 1px solid var(--hero-divider);
761
+ }
762
+ .hero-fact { padding: 10px 12px; border-right: 1px solid var(--hero-divider); border-bottom: 1px solid var(--hero-divider); }
763
+ .hero-fact__label { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.6; }
764
+ .hero-fact__value { font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 3px; }
765
+ .hero-fact__value--dim { opacity: 0.5; }
766
+ .hero-notreported { font-size: 12px; opacity: 0.7; }
767
+
768
+ .hero-section__title {
769
+ font-size: 10px;
770
+ letter-spacing: 0.12em;
771
+ text-transform: uppercase;
772
+ white-space: nowrap;
773
+ font-weight: 600;
774
+ border-top: 2px solid var(--hero-divider);
775
+ padding-top: 8px;
776
+ margin-bottom: 8px;
777
+ }
778
+ .hero-detail__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 24px; }
779
+ .hero-detail__grid .hero-aside__hint { opacity: 0.55; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
780
+
781
+ .hero-sched__empty { padding: 20px 0; opacity: 0.65; }
782
+ .hero-sched__row { display: grid; grid-template-columns: 90px 100px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--hero-divider); font-size: 12.5px; }
783
+ .hero-sched__row > span:nth-child(2) { font-variant-numeric: tabular-nums; }
784
+ .hero-sched__row > span:nth-child(3) { opacity: 0.8; }
785
+
786
+ /* Detail plan: trail, crosshair, readout, radar, robot, spot points. */
787
+ .hero-trail { position: absolute; width: 6px; height: 6px; margin: -3px; background: var(--hero-accent); }
788
+ .hero-cross { position: absolute; pointer-events: none; }
789
+ .hero-cross--h { left: 0; right: 0; border-top: 1px dashed color-mix(in srgb, var(--hero-accent) 55%, transparent); }
790
+ .hero-cross--v { top: 0; bottom: 0; border-left: 1px dashed color-mix(in srgb, var(--hero-accent) 55%, transparent); }
791
+ .hero-readout {
792
+ position: absolute;
793
+ left: 8px;
794
+ bottom: 6px;
795
+ font-size: 10px;
796
+ letter-spacing: 0.08em;
797
+ text-transform: uppercase;
798
+ font-variant-numeric: tabular-nums;
799
+ background: var(--hero-bg);
800
+ padding: 3px 8px;
801
+ border-left: 2px solid var(--hero-accent);
802
+ white-space: nowrap;
803
+ }
804
+ .hero-me { position: absolute; width: 0; height: 0; }
805
+ .hero-me__tag { position: absolute; left: 14px; top: -26px; white-space: nowrap; font-size: 11px; font-weight: 800; padding: 2px 6px; background: var(--hero-text); color: var(--hero-bg); line-height: 1.45; }
806
+ .hero-me__tag > span { font-weight: 400; opacity: 0.75; }
807
+ .hero-me__radar {
808
+ position: absolute;
809
+ left: -36px;
810
+ top: -36px;
811
+ width: 72px;
812
+ height: 72px;
813
+ background: conic-gradient(from 0deg, color-mix(in srgb, var(--hero-accent) 45%, transparent), transparent 70deg);
814
+ animation: heroSpin 3s linear infinite;
815
+ }
816
+ .hero-me__ping { position: absolute; left: -24px; top: -24px; width: 48px; height: 48px; border: 1px solid var(--hero-accent); animation: heroPing 2.4s ease-out infinite; box-sizing: border-box; }
817
+ .hero-me__body { position: absolute; left: -8px; top: -8px; width: 16px; height: 16px; background: var(--hero-text); outline: 2px solid var(--hero-bg); }
818
+ .hero-me__tick { position: absolute; right: -6px; top: 6px; width: 6px; height: 4px; background: var(--hero-accent); }
819
+ .hero-spot {
820
+ position: absolute;
821
+ width: 18px;
822
+ height: 18px;
823
+ margin: -9px;
824
+ border: 2px solid var(--hero-accent);
825
+ display: grid;
826
+ place-items: center;
827
+ font-size: 10px;
828
+ font-weight: 700;
829
+ color: var(--hero-accent);
830
+ background: var(--hero-bg);
831
+ box-sizing: border-box;
832
+ }
833
+ .hero-spotbar { display: flex; gap: 8px; margin-top: 8px; align-items: center; }
834
+
835
+ /* HERO dialog (remove). */
836
+ .hero-dialog { display: flex; flex-direction: column; gap: 12px; padding: 16px; background: var(--hero-surface); box-shadow: var(--hero-shadow-lg); }
837
+ .hero-dialog__title { font-family: var(--hero-font); font-weight: 800; font-size: 20px; }
838
+ .hero-dialog__body { font-size: 14px; opacity: 0.85; }
839
+ .hero-dialog__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
840
+
431
841
  /* ----------------------------------------------------------- animations */
432
842
 
433
843
  @keyframes heroScan { from { background-position: 0 -60px; } to { background-position: 0 120%; } }
@@ -0,0 +1,72 @@
1
+ <template>
2
+ <!--
3
+ Faults & alerts: every open fault (and robot not reporting), server-paged.
4
+ Code · Message · Robot · Site · Floor · Since. Floor comes from the robot's
5
+ live state when it is known; otherwise "Floor unknown" - never a guess.
6
+ -->
7
+ <RobotTable
8
+ :headers="headers"
9
+ :items="items"
10
+ :items-length="total"
11
+ :page="page"
12
+ :items-per-page="itemsPerPage"
13
+ :loading="loading"
14
+ noun="faults"
15
+ empty-title="No active faults"
16
+ empty-hint="Alerts appear here and as notifications the moment a robot reports one."
17
+ compact
18
+ hover
19
+ @update:page="emit('update:page', $event)"
20
+ @click:row="onRow"
21
+ >
22
+ <template #item.code="{ item }"><span class="hero-alert__code">{{ attentionText(item).code }}</span></template>
23
+ <template #item.message="{ item }">{{ attentionText(item).message }}</template>
24
+ <template #item.robot="{ item }"><span class="hero-table__name">{{ item.robot?.name }}</span></template>
25
+ <template #item.site="{ item }"><span class="hero-dim">{{ item.client?.name }} · {{ item.site?.name }}</span></template>
26
+ <template #item.floor="{ item }">
27
+ <RobotFloorLabel v-bind="floorOf(item)" />
28
+ </template>
29
+ <template #item.since="{ item }"><span class="hero-dim hero-num">{{ sinceText(item.since, now) }}</span></template>
30
+ <template #item.go><span class="hero-go" aria-hidden="true">›</span></template>
31
+ </RobotTable>
32
+ </template>
33
+
34
+ <script setup lang="ts">
35
+ import RobotFloorLabel from "./FloorLabel.vue";
36
+ import RobotTable from "./Table.vue";
37
+ import { attentionText, sinceText } from "../../utils/robot-display";
38
+
39
+ const props = withDefaults(
40
+ defineProps<{
41
+ /** Rows from `GET /robots/network/faults`. */
42
+ items?: any[];
43
+ total?: number;
44
+ page?: number;
45
+ itemsPerPage?: number;
46
+ loading?: boolean;
47
+ /** Live states by robot id (`useRobotLive`), for the Floor column. */
48
+ states?: Record<string, any>;
49
+ now?: number;
50
+ }>(),
51
+ { items: () => [], total: 0, page: 1, itemsPerPage: 25, loading: false, states: () => ({}), now: () => Date.now() },
52
+ );
53
+ const emit = defineEmits<{ "update:page": [page: number]; open: [item: any] }>();
54
+
55
+ function floorOf(item: any) {
56
+ const s = props.states[String(item?.robot?._id ?? "")];
57
+ return s?.ok ? { floorNo: s.floorNo, floorKnown: s.floorKnown === true } : { floorNo: null, floorKnown: false };
58
+ }
59
+ function onRow(_e: unknown, { item }: { item: any }) {
60
+ emit("open", item);
61
+ }
62
+
63
+ const headers = [
64
+ { title: "Code", key: "code", sortable: false },
65
+ { title: "Message", key: "message", sortable: false },
66
+ { title: "Robot", key: "robot", sortable: false },
67
+ { title: "Site", key: "site", sortable: false },
68
+ { title: "Floor", key: "floor", sortable: false },
69
+ { title: "Since", key: "since", sortable: false },
70
+ { title: "", key: "go", sortable: false, align: "end" as const },
71
+ ];
72
+ </script>
@@ -0,0 +1,21 @@
1
+ <template>
2
+ <!-- The header bell: open faults network-wide; accent while any are open. -->
3
+ <v-btn
4
+ variant="outlined"
5
+ class="hero-bell"
6
+ :class="{ 'hero-bell--on': count > 0 }"
7
+ :aria-label="`${count} open ${count === 1 ? 'fault' : 'faults'}`"
8
+ @click="emit('click')"
9
+ >
10
+ <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true">
11
+ <path d="M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9" />
12
+ <path d="M10.3 21a1.94 1.94 0 0 0 3.4 0" />
13
+ </svg>
14
+ <span>{{ count }}</span>
15
+ </v-btn>
16
+ </template>
17
+
18
+ <script setup lang="ts">
19
+ withDefaults(defineProps<{ count?: number }>(), { count: 0 });
20
+ const emit = defineEmits<{ click: [] }>();
21
+ </script>
@@ -0,0 +1,36 @@
1
+ <template>
2
+ <!-- Clients · drill down: each client, its sites, robots per site and robots with open faults. -->
3
+ <section class="hero-aside" aria-label="Clients drill down">
4
+ <div class="hero-aside__head"><span class="hero-aside__title">Clients · drill down</span></div>
5
+ <div v-for="c in clients" :key="c._id" class="hero-drill">
6
+ <div class="hero-drill__client">
7
+ <span>{{ c.name || "Unknown client" }}</span><span class="hero-drill__n">{{ c.count }}</span>
8
+ </div>
9
+ <button
10
+ v-for="s in c.sites"
11
+ :key="s._id"
12
+ type="button"
13
+ class="hero-drill__site"
14
+ @click="emit('open', { client: c, site: s })"
15
+ >
16
+ <span class="hero-drill__name">{{ s.name || "Unknown site" }}</span>
17
+ <span class="hero-drill__n">{{ s.count }} {{ s.count === 1 ? "robot" : "robots" }}</span>
18
+ <span v-if="(s.faults ?? 0) > 0" class="hero-drill__faults" :aria-label="`${s.faults} with faults`">{{ s.faults }}</span>
19
+ <span class="hero-drill__go" aria-hidden="true">›</span>
20
+ </button>
21
+ </div>
22
+ <div v-if="!clients.length" class="hero-aside__empty">No robots at any client yet.</div>
23
+ </section>
24
+ </template>
25
+
26
+ <script setup lang="ts">
27
+ type TSite = { _id: string; name: string; count: number; faults?: number };
28
+ withDefaults(
29
+ defineProps<{
30
+ /** `[{ _id, name, count, sites: [{ _id, name, count, faults }] }]` */
31
+ clients?: Array<{ _id: string; name: string; count: number; sites: TSite[] }>;
32
+ }>(),
33
+ { clients: () => [] },
34
+ );
35
+ const emit = defineEmits<{ open: [target: { client: any; site: any }] }>();
36
+ </script>