@7365admin1/layer-common 4.163.0 → 4.163.3
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,23 @@
|
|
|
1
1
|
# @iservice365/layer-common
|
|
2
2
|
|
|
3
|
+
## 4.163.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 2b072df: CCTV Engine: live boxes take the camera's own shape so the picture fills them (no black side bars); Alerts How it works results line matches the notification switch.
|
|
8
|
+
|
|
9
|
+
## 4.163.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 836f08d: Vehicle Mgmt: a Records filter (Current / Deleted) on the toolbar, so deleted vehicles stay out of the list but can still be found and restored (IS-0864).
|
|
14
|
+
|
|
15
|
+
## 4.163.1
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- 26537ae: CCTV Engine alerts: wording matches what the server does (the switch sends phone notifications; empty roles = everyone who can see CCTV events).
|
|
20
|
+
|
|
3
21
|
## 4.163.0
|
|
4
22
|
|
|
5
23
|
### Minor Changes
|
|
@@ -3698,11 +3716,11 @@ Monthly report: a month that had patrols opens the list of that month's patrol r
|
|
|
3698
3716
|
`utils/console-tier.ts` + `composables/useConsoleTier.ts` mirror the server's
|
|
3699
3717
|
own rule from two endpoints the console already calls, unprojected:
|
|
3700
3718
|
|
|
3701
|
-
|
|
3702
|
-
|
|
3719
|
+
GET /api/members/user/:user/app/admin the Seven365 staff membership
|
|
3720
|
+
GET /api/roles/id/:role that membership's role document
|
|
3703
3721
|
|
|
3704
|
-
|
|
3705
|
-
|
|
3722
|
+
owner = member.type === "admin" && role.type === "admin" && role.default === true
|
|
3723
|
+
staff = member.type === "admin" && role.type === "admin"
|
|
3706
3724
|
|
|
3707
3725
|
`role.default` is the marker because it is the only property of a platform
|
|
3708
3726
|
staff role no API caller can set - `role.controller.ts` validates create and
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
<CctvEngineHowTo
|
|
9
9
|
id="alerts"
|
|
10
10
|
:steps="[
|
|
11
|
-
'
|
|
11
|
+
'Turn on Send phone notifications. Leave the roles empty to tell everyone who can see CCTV events at this site, or choose roles to tell only them.',
|
|
12
12
|
'Optional: type the objects that matter (e.g. person, car, rubbish) so not everything alerts. Empty means every object.',
|
|
13
13
|
'Optional: limit to zones or cameras, and set quiet hours. Then press Save alert settings.',
|
|
14
14
|
]"
|
|
15
|
-
results="Alerts appear in Events marked Alert
|
|
15
|
+
results="Alerts appear in Events marked Alert. With Send phone notifications on, people also get a notification with the picture."
|
|
16
16
|
results-section="events"
|
|
17
17
|
:results-query="{ severity: 'alert' }"
|
|
18
18
|
/>
|
|
@@ -34,18 +34,18 @@
|
|
|
34
34
|
:items="roles"
|
|
35
35
|
item-title="name"
|
|
36
36
|
item-value="_id"
|
|
37
|
-
label="
|
|
37
|
+
label="Only notify these roles (optional)"
|
|
38
38
|
multiple
|
|
39
39
|
chips
|
|
40
40
|
closable-chips
|
|
41
41
|
density="comfortable"
|
|
42
42
|
class="mt-3"
|
|
43
43
|
:loading="rolesLoading"
|
|
44
|
-
:hint="rolesProblem || '
|
|
44
|
+
:hint="rolesProblem || 'Empty = everyone who can see CCTV events at this site. Notifications are only sent when Send phone notifications is on.'"
|
|
45
45
|
persistent-hint
|
|
46
46
|
/>
|
|
47
47
|
|
|
48
|
-
<v-switch v-model="form.notifyGuards" color="primary" label="
|
|
48
|
+
<v-switch v-model="form.notifyGuards" color="primary" label="Send phone notifications (with the picture)" hide-details class="mt-2" />
|
|
49
49
|
<v-switch v-model="form.createIncident" color="primary" label="Create an incident report for each alert" hide-details />
|
|
50
50
|
|
|
51
51
|
<v-switch v-model="quiet" color="primary" label="Quiet hours (no notifications between these times)" hide-details />
|
|
@@ -133,7 +133,7 @@ async function save() {
|
|
|
133
133
|
notifyGuards: form.notifyGuards,
|
|
134
134
|
quietHours: quiet.value ? { start: form.quietStart, end: form.quietEnd } : null,
|
|
135
135
|
});
|
|
136
|
-
msg.value = "Saved.
|
|
136
|
+
msg.value = form.notifyGuards ? "Saved. Alerts appear in Events marked Alert, and a phone notification with the picture is sent." : "Saved. Alerts appear in Events marked Alert. Phone notifications are off.";
|
|
137
137
|
} catch (e) {
|
|
138
138
|
saveError.value = e;
|
|
139
139
|
} finally {
|
|
@@ -4,9 +4,14 @@
|
|
|
4
4
|
Offline engine / failures are shown on the tile in plain words with a Try again button.
|
|
5
5
|
-->
|
|
6
6
|
<template>
|
|
7
|
-
<div
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
<div
|
|
8
|
+
class="cctv-tile"
|
|
9
|
+
:class="{ 'cctv-tile--big': big, 'cctv-tile--natural': natural }"
|
|
10
|
+
:style="shape && !natural ? { aspectRatio: shape } : undefined"
|
|
11
|
+
data-test="cctv-tile"
|
|
12
|
+
>
|
|
13
|
+
<video v-show="mode === 'live'" ref="video" autoplay muted playsinline class="cctv-tile__media" @loadedmetadata="fit($event)" @resize="fit($event)" />
|
|
14
|
+
<img v-if="mode === 'still' && still" :src="still" :alt="`Latest picture from ${camera}`" class="cctv-tile__media" @load="fit($event)" />
|
|
10
15
|
|
|
11
16
|
<div v-if="mode === 'connecting'" class="cctv-tile__msg" role="status">
|
|
12
17
|
<v-progress-circular indeterminate size="22" /> <span>Connecting to {{ camera }}...</span>
|
|
@@ -47,6 +52,15 @@ const still = ref("");
|
|
|
47
52
|
const failure = ref<unknown>(null);
|
|
48
53
|
const video = ref<HTMLVideoElement | null>(null);
|
|
49
54
|
const notice = computed(() => cctvNotice(failure.value));
|
|
55
|
+
// The box takes the camera's own shape once the first picture arrives (many recorders send 4:3 or 704x480),
|
|
56
|
+
// so the picture fills it instead of sitting between black bars; 16:9 until then.
|
|
57
|
+
const shape = ref<string | null>(null);
|
|
58
|
+
function fit(e: Event) {
|
|
59
|
+
const el = e.target as HTMLVideoElement & HTMLImageElement;
|
|
60
|
+
const w = el.videoWidth || el.naturalWidth;
|
|
61
|
+
const h = el.videoHeight || el.naturalHeight;
|
|
62
|
+
if (w > 0 && h > 0) shape.value = `${w} / ${h}`;
|
|
63
|
+
}
|
|
50
64
|
|
|
51
65
|
let pc: RTCPeerConnection | null = null;
|
|
52
66
|
let timer: ReturnType<typeof setTimeout> | null = null;
|
|
@@ -40,7 +40,8 @@
|
|
|
40
40
|
</template>
|
|
41
41
|
|
|
42
42
|
<!-- Residents / Season Passes / Block Listed, on the toolbar row the way
|
|
43
|
-
the other screens draw their tabs.
|
|
43
|
+
the other screens draw their tabs. Deleted plates show only under the
|
|
44
|
+
Deleted filter. -->
|
|
44
45
|
<template #tabs>
|
|
45
46
|
<button v-for="tab in vehicleTabs" :key="tab.value" type="button" role="tab" class="app-tab"
|
|
46
47
|
:class="{ 'app-tab--active': activeTab === tab.value }" :aria-selected="activeTab === tab.value"
|
|
@@ -54,6 +55,9 @@
|
|
|
54
55
|
<v-select v-if="qrEnabled" v-model="qrStickerFilter" :items="qrStickerFilterItems" label="QR sticker"
|
|
55
56
|
density="compact" variant="outlined" hide-details class="vehicle-qr-filter" style="max-width: 190px"
|
|
56
57
|
data-test="vehicle-qr-filter" />
|
|
58
|
+
<v-select v-model="statusFilter" :items="statusFilterItems" label="Records"
|
|
59
|
+
density="compact" variant="outlined" hide-details class="vehicle-status-filter" style="max-width: 160px"
|
|
60
|
+
data-test="vehicle-status-filter" />
|
|
57
61
|
<AppField v-model="searchInput" search compact placeholder="Search" klass="app-toolbar__search" />
|
|
58
62
|
</template>
|
|
59
63
|
|
|
@@ -615,6 +619,14 @@ const qrStickerFilterItems = [
|
|
|
615
619
|
];
|
|
616
620
|
const qrStickersOn = computed(() => qrEnabled.value && props.canUpdateVehicle);
|
|
617
621
|
|
|
622
|
+
// Deleting is a soft delete and the list leaves deleted plates out unless asked
|
|
623
|
+
// for (IS-0864). "Deleted" is how one is found again - and Restored.
|
|
624
|
+
const statusFilter = ref("");
|
|
625
|
+
const statusFilterItems = [
|
|
626
|
+
{ title: "Current", value: "" },
|
|
627
|
+
{ title: "Deleted", value: "deleted" },
|
|
628
|
+
];
|
|
629
|
+
|
|
618
630
|
/**
|
|
619
631
|
* Re-issue / Undo / Link / Remove on one plate change that vehicle, so on a
|
|
620
632
|
* Block Listed plate they follow Manage Blocklist (owner, 2026-10-23) when the
|
|
@@ -983,6 +995,7 @@ const { data: getVehiclesReq, refresh: getVehiclesRefresh, pending: getVehiclesP
|
|
|
983
995
|
search: searchInput.value,
|
|
984
996
|
view: activeTab.value,
|
|
985
997
|
site: props.site,
|
|
998
|
+
status: statusFilter.value,
|
|
986
999
|
qrSticker: qrEnabled.value ? qrStickerFilter.value : "",
|
|
987
1000
|
}),
|
|
988
1001
|
{
|
|
@@ -1495,6 +1508,11 @@ watch(qrStickerFilter, () => {
|
|
|
1495
1508
|
getVehiclesRefresh();
|
|
1496
1509
|
})
|
|
1497
1510
|
|
|
1511
|
+
watch(statusFilter, () => {
|
|
1512
|
+
page.value = 1;
|
|
1513
|
+
getVehiclesRefresh();
|
|
1514
|
+
})
|
|
1515
|
+
|
|
1498
1516
|
// A new tab starts from its first page and loads straight away.
|
|
1499
1517
|
watch(activeTab, () => {
|
|
1500
1518
|
page.value = 1;
|
|
@@ -12,7 +12,8 @@ export default function useVehicle() {
|
|
|
12
12
|
qrSticker = "",
|
|
13
13
|
} = {}) {
|
|
14
14
|
// `view` is the screen's tab: residents, season-passes or block-listed.
|
|
15
|
-
//
|
|
15
|
+
// Deleted vehicles come back only with `status: "deleted"`; with no
|
|
16
|
+
// `status` every other status does.
|
|
16
17
|
return await useNuxtApp().$api<Record<string, any>>("/api/vehicles", {
|
|
17
18
|
method: "GET",
|
|
18
19
|
query: { search, page, limit, order, type, category, site, status, view, qrSticker },
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@7365admin1/layer-common",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "4.163.
|
|
5
|
+
"version": "4.163.3",
|
|
6
6
|
"author": "7365admin1",
|
|
7
7
|
"main": "./nuxt.config.ts",
|
|
8
8
|
"//files": "What a consumer extending this layer actually loads. Without this npm ships the whole working tree - the changesets, the CI workflows, the render harness in tools/ and any scratch directory that happened to exist at publish time. Nuxt resolves a layer by directory, so every runtime directory below has to stay listed; adding a new top-level runtime directory means adding it here too.",
|
package/utils/cctv-engine.ts
CHANGED
|
@@ -523,10 +523,11 @@ export function setupSteps(input: {
|
|
|
523
523
|
|
|
524
524
|
if (input.can(CCTV_PERMISSIONS.manageAlerts)) {
|
|
525
525
|
const a = input.alertSettings;
|
|
526
|
+
// Server rule (core onAlert / NotificationService.cctvAlert): the `notifyGuards` switch turns phone notifications on;
|
|
527
|
+
// they go to everyone at the site holding cctv-engine:view-events, or only to `notifyRoles` when some are chosen.
|
|
526
528
|
const roles = a?.notifyRoles?.length ?? 0;
|
|
527
|
-
const
|
|
528
|
-
const
|
|
529
|
-
const who = [roles ? plural(roles, "role", "roles") : "", guards ? "guards on duty" : ""].filter(Boolean).join(" and ");
|
|
529
|
+
const told = a?.notifyGuards === true;
|
|
530
|
+
const who = roles ? `People in ${plural(roles, "role", "roles")}` : "Everyone who can see CCTV events";
|
|
530
531
|
const every = told && !(a?.labels ?? []).length;
|
|
531
532
|
steps.push({
|
|
532
533
|
key: "alerts",
|
|
@@ -535,8 +536,8 @@ export function setupSteps(input: {
|
|
|
535
536
|
state: a === null || !told ? "attention" : "done",
|
|
536
537
|
now:
|
|
537
538
|
a === null ? unread
|
|
538
|
-
: !told ? "
|
|
539
|
-
: `${who} will
|
|
539
|
+
: !told ? "Phone notifications are off. Everything is still saved in Events."
|
|
540
|
+
: `${who} will get a phone notification${every ? " for every object seen (add objects to narrow it)" : ""}.`,
|
|
540
541
|
section: "alerts",
|
|
541
542
|
action: "Set up alerts",
|
|
542
543
|
});
|
|
@@ -601,7 +602,7 @@ export function setupSteps(input: {
|
|
|
601
602
|
/** Where each kind of result appears. `query` pre-fills the Events filters. */
|
|
602
603
|
export const RESULT_PLACES: { title: string; body: string; section: TCctvSection; query?: Record<string, string>; needs: TCctvPermission }[] = [
|
|
603
604
|
{ title: "Everything seen", body: "People, vehicles, plates, faces and smart detections, newest first, each with a photo.", section: "events", needs: CCTV_PERMISSIONS.viewEvents },
|
|
604
|
-
{ title: "Alerts only", body: "The events that raised an alert.
|
|
605
|
+
{ title: "Alerts only", body: "The events that raised an alert. With phone notifications on, people were also told on their phones.", section: "events", query: { severity: "alert" }, needs: CCTV_PERMISSIONS.viewEvents },
|
|
605
606
|
{ title: "Smart detection results", body: "What your smart detections saw (e.g. rubbish), with the photo and time.", section: "events", query: { kind: "classification" }, needs: CCTV_PERMISSIONS.viewEvents },
|
|
606
607
|
{ title: "Find a past moment", body: "Describe it in words, e.g. person in orange shirt, and pick the dates.", section: "search", needs: CCTV_PERMISSIONS.viewEvents },
|
|
607
608
|
{ title: "Watch now", body: "The cameras, live.", section: "live", needs: CCTV_PERMISSIONS.viewLive },
|