@7365admin1/layer-common 4.21.1 → 4.21.4-staging.339

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.
Files changed (41) hide show
  1. package/CHANGELOG.md +45 -4
  2. package/components/AnprCameraBadge.vue +142 -0
  3. package/components/CameraWall.vue +3 -1
  4. package/components/DocumentForm.vue +407 -112
  5. package/components/DocumentManagement.vue +213 -12
  6. package/components/EntryPass/QrTemplatePreview.vue +21 -25
  7. package/components/EntryPassInformation.vue +119 -24
  8. package/components/Facility/BookingSetup.vue +63 -0
  9. package/components/HidAccessLogDashboard.vue +29 -5
  10. package/components/HidAccessPermissions.vue +424 -0
  11. package/components/HidIntercomManagement.vue +193 -43
  12. package/components/HidProfileQrCode.vue +323 -0
  13. package/components/HidReaderManagement.vue +26 -0
  14. package/components/HidReaderUserRoster.vue +32 -2
  15. package/components/HidUserEnrollment.vue +833 -152
  16. package/components/InvitationClientForm.vue +19 -1
  17. package/components/PlateNumberDisplay.vue +91 -1
  18. package/components/VehicleForm.vue +246 -2
  19. package/components/VehicleManagement.vue +302 -51
  20. package/components/VisitorManagement.vue +357 -5
  21. package/composables/useAccessManagement.ts +5 -0
  22. package/composables/useDocument.ts +7 -0
  23. package/composables/useFacility.ts +11 -0
  24. package/composables/useHidAmico.ts +97 -0
  25. package/composables/useHidNavigation.ts +25 -1
  26. package/composables/usePeople.ts +19 -0
  27. package/composables/useVehicle.ts +83 -1
  28. package/composables/useWebUsb.ts +14 -11
  29. package/package.json +1 -1
  30. package/pages/[org]/[site]/access-mgmt/administrator/index.vue +1 -1
  31. package/pages/[org]/[site]/access-mgmt/hid-cards/index.vue +1 -1
  32. package/pages/[org]/[site]/access-mgmt/hid-qr-code/index.vue +23 -0
  33. package/pages/[org]/[site]/access-mgmt/hid-readers/index.vue +1 -1
  34. package/types/document.d.ts +14 -0
  35. package/types/facility.d.ts +4 -0
  36. package/types/people.d.ts +5 -2
  37. package/types/vehicle.d.ts +57 -2
  38. package/utils/camera-wall.ts +15 -3
  39. package/utils/hid-permission-assignments.ts +190 -0
  40. package/utils/materialSymbols.ts +3 -0
  41. package/utils/vehicle-actions.ts +45 -17
package/CHANGELOG.md CHANGED
@@ -1,5 +1,46 @@
1
1
  # @iservice365/layer-common
2
2
 
3
+ ## 4.21.3
4
+
5
+ ### Patch Changes
6
+
7
+ - b57dfdc: CCTV wall: the grid now uses only the columns it has tiles for. One camera on a four- or nine-tile wall filled half (or a third) of the width and left the rest black; the layout button means "up to this many tiles", so the wall no longer keeps empty columns.
8
+
9
+ ## 4.21.2
10
+
11
+ ### Patch Changes
12
+
13
+ - 38b3421: HID Intercom: add a contact the way the reader documents it
14
+
15
+ The Add Contact dialog asked for a "SIP Number / Address" with the same
16
+ `7100 or user@example.com` hint on every reader. The Amico user guide (6.3
17
+ Intercom contacts) gives a contact two fields, Name and Address, and the
18
+ address means different things by operating mode: an extension number for
19
+ SIP Client, the contact's local IP address for Peer-to-Peer. The dialog now
20
+ labels the field Address, and its placeholder, hint and validation follow the
21
+ operating mode of the reader picked in the dialog. A Peer-to-Peer reader gets
22
+ an IPv4 check (optional port); a SIP Client reader keeps the extension / SIP
23
+ address check.
24
+
25
+ The API guide's `create_objects` answers `{ ids: [...] }`. The dialog now reads
26
+ it: when no id comes back the list is refreshed and a warning says the reader
27
+ did not confirm the contact, instead of reporting it saved. Request shape is
28
+ unchanged: `object: "contacts"`, `values: [{ name, number }]`.
29
+
30
+ Edit and Delete read the reader's answer the same way. `modify_objects` and
31
+ `destroy_objects` return `{ changes: n }`; zero now refreshes the list and
32
+ says the reader no longer has the contact, rather than reporting success. A
33
+ row without a reader id is refused with a message: before, Edit on such a row
34
+ fell through to a create (a duplicate on the reader) and Delete returned
35
+ silently.
36
+
37
+ The row menu on both tabs uses the layer's standard `screen-menu`, so View,
38
+ Edit and Delete carry their icons; three intercom icon names (SIP check, Dial
39
+ Code, Web call) gained Material Symbols entries instead of relying on Iconify's
40
+ runtime fetch. The contact row's reader status is the shared status chip, so
41
+ Connected is green. Dialog action bars no longer show Vuetify's 8px seam under
42
+ the buttons, and the view dialog's rows use the table-cell size.
43
+
3
44
  ## 4.21.1
4
45
 
5
46
  ### Patch Changes
@@ -1211,11 +1252,11 @@
1211
1252
  `utils/console-tier.ts` + `composables/useConsoleTier.ts` mirror the server's
1212
1253
  own rule from two endpoints the console already calls, unprojected:
1213
1254
 
1214
- GET /api/members/user/:user/app/admin the Seven365 staff membership
1215
- GET /api/roles/id/:role that membership's role document
1255
+ GET /api/members/user/:user/app/admin the Seven365 staff membership
1256
+ GET /api/roles/id/:role that membership's role document
1216
1257
 
1217
- owner = member.type === "admin" && role.type === "admin" && role.default === true
1218
- staff = member.type === "admin" && role.type === "admin"
1258
+ owner = member.type === "admin" && role.type === "admin" && role.default === true
1259
+ staff = member.type === "admin" && role.type === "admin"
1219
1260
 
1220
1261
  `role.default` is the marker because it is the only property of a platform
1221
1262
  staff role no API caller can set - `role.controller.ts` validates create and
@@ -0,0 +1,142 @@
1
+ <!--
2
+ How many ANPR cameras a plate is on, as a small badge beside the vehicle
3
+ number. Clicking it lists those cameras - type and which list (Allowed or
4
+ Blocked) - as recorded by the vehicle's last camera change.
5
+
6
+ `@click.stop` because it sits inside table rows that open the Preview on
7
+ click.
8
+ -->
9
+ <template>
10
+ <!-- Only drawn when the plate is on at least one camera (inactive ones
11
+ included - a camera that went inactive still holds the plate). -->
12
+ <v-menu v-if="count > 0" location="bottom start" :close-on-content-click="false">
13
+ <template #activator="{ props: menuProps }">
14
+ <button
15
+ v-bind="menuProps"
16
+ type="button"
17
+ class="anpr-badge"
18
+ :class="{ 'anpr-badge--none': !count, 'anpr-badge--blocked': isBlocked }"
19
+ :aria-label="`On ${count} ANPR camera${count === 1 ? '' : 's'}`"
20
+ v-tooltip:top="'ANPR cameras'"
21
+ @click.stop
22
+ >
23
+ <v-icon icon="mdi-cctv" size="13" />
24
+ {{ count }}
25
+ </button>
26
+ </template>
27
+
28
+ <v-card class="anpr-badge__menu" min-width="260">
29
+ <div class="anpr-badge__head">
30
+ {{ plateNumber ? `${plateNumber} - ` : "" }}{{ count }} ANPR camera{{ count === 1 ? "" : "s" }}
31
+ </div>
32
+ <div v-if="!count" class="anpr-badge__empty">
33
+ Not on any ANPR camera.
34
+ </div>
35
+ <div v-for="cam in uniqueCameras" :key="cam.host || cam.camera || cam.name" class="anpr-badge__row">
36
+ <span class="anpr-badge__type">{{ directionLabel(cam.direction) }}</span>
37
+ <StatusChip
38
+ :tone="cam.list === 'blocked' ? 'err' : 'ok'"
39
+ :dot="false"
40
+ :label="cam.list === 'blocked' ? 'Blocked' : 'Allowed'"
41
+ />
42
+ </div>
43
+ </v-card>
44
+ </v-menu>
45
+ </template>
46
+
47
+ <script setup lang="ts">
48
+ const props = defineProps({
49
+ cameras: {
50
+ type: Array as PropType<TVehicleAnprCamera[]>,
51
+ default: () => [],
52
+ },
53
+ plateNumber: { type: String, default: "" },
54
+ });
55
+
56
+ const DIRECTION_LABELS: Record<string, string> = {
57
+ entry: "Entry",
58
+ exit: "Exit",
59
+ both: "Both Entry and Exit",
60
+ visitors: "Visitors",
61
+ residents: "Residents",
62
+ };
63
+
64
+ function directionLabel(direction: string) {
65
+ return DIRECTION_LABELS[direction] ?? direction ?? "";
66
+ }
67
+
68
+ /** One row per camera URL, even if an older record listed one twice. */
69
+ const uniqueCameras = computed(() => {
70
+ const seen = new Set<string>();
71
+ return (props.cameras ?? []).filter((cam) => {
72
+ const key = String(cam.host || cam.camera || `${cam.name}|${cam.direction}`)
73
+ .trim()
74
+ .toLowerCase()
75
+ .replace(/\/+$/, "");
76
+ if (seen.has(key)) return false;
77
+ seen.add(key);
78
+ return true;
79
+ });
80
+ });
81
+
82
+ const count = computed(() => uniqueCameras.value.length);
83
+ const isBlocked = computed(() => props.cameras?.some((c) => c.list === "blocked"));
84
+ </script>
85
+
86
+ <style scoped>
87
+ .anpr-badge {
88
+ display: inline-flex;
89
+ align-items: center;
90
+ gap: 3px;
91
+ padding: 1px 7px;
92
+ border-radius: 999px;
93
+ border: 1px solid var(--border);
94
+ background: var(--card);
95
+ color: var(--text);
96
+ font-size: 11px;
97
+ line-height: 18px;
98
+ cursor: pointer;
99
+ }
100
+
101
+ .anpr-badge--blocked {
102
+ color: var(--err);
103
+ }
104
+
105
+ .anpr-badge--none {
106
+ color: var(--muted);
107
+ }
108
+
109
+ .anpr-badge__menu {
110
+ padding: 8px 0;
111
+ background: var(--card);
112
+ border: 1px solid var(--border);
113
+ border-radius: var(--r-inner);
114
+ }
115
+
116
+ .anpr-badge__head {
117
+ padding: 4px 14px 8px;
118
+ font-size: var(--fs-cell);
119
+ font-weight: var(--fw-btn);
120
+ color: var(--text);
121
+ }
122
+
123
+ .anpr-badge__empty {
124
+ padding: 4px 14px;
125
+ font-size: var(--fs-cell);
126
+ color: var(--muted);
127
+ }
128
+
129
+ .anpr-badge__row {
130
+ display: grid;
131
+ grid-template-columns: 1fr auto;
132
+ align-items: center;
133
+ gap: 10px;
134
+ padding: 6px 14px;
135
+ border-top: 1px solid var(--border);
136
+ font-size: var(--fs-cell);
137
+ }
138
+
139
+ .anpr-badge__type {
140
+ color: var(--text);
141
+ }
142
+ </style>
@@ -516,7 +516,6 @@ const layout = computed(() => wallLayout(layoutKey.value));
516
516
  * `camera-wall.ts` (see `wallColumns`) so they stay testable there.
517
517
  */
518
518
  const { smAndDown } = useDisplay();
519
- const columns = computed(() => wallColumns(layoutKey.value, smAndDown.value));
520
519
  const dense = computed(() => isDenseLayout(layoutKey.value, smAndDown.value));
521
520
 
522
521
  const selectedIds = ref<string[]>([]);
@@ -531,6 +530,9 @@ const tiles = computed(() =>
531
530
  wallTiles(cameras.value, selectedIds.value, layoutKey.value, page.value)
532
531
  );
533
532
 
533
+ /** Declared after `tiles`: the columns follow how many tiles are actually shown. */
534
+ const columns = computed(() => wallColumns(layoutKey.value, smAndDown.value, tiles.value.length));
535
+
534
536
  /**
535
537
  * THE GRID PACKS TO WHAT IS ON IT.
536
538
  *