@7365admin1/layer-common 4.16.0 → 4.17.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,26 @@
1
1
  # @iservice365/layer-common
2
2
 
3
+ ## 4.17.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 7bc3f78: Camera wall: show the live view from the server's signed address when it sends one
8
+
9
+ The CCTV relay's live routes have no authentication today — anyone who knows a
10
+ channel number can watch a live camera. The relay is being closed behind a
11
+ signature the server mints per request and carries on the address as query
12
+ parameters.
13
+
14
+ The signature cannot be written onto `host`: that is the stored record, copied
15
+ into patrol-route documents and re-read by the server's own relay-URL check,
16
+ which rejects an address carrying a query. So the server hands the signed
17
+ address over beside it as `liveUrl`, and the wall now prefers it.
18
+
19
+ Additive and backward compatible. A camera whose relay is not configured gets no
20
+ `liveUrl` and still plays from `host`, exactly as before. The address is used
21
+ verbatim — never rebuilt from a host and a channel — so the signature survives
22
+ to the player.
23
+
3
24
  ## 4.16.0
4
25
 
5
26
  ### Minor Changes
@@ -1160,11 +1181,11 @@
1160
1181
  `utils/console-tier.ts` + `composables/useConsoleTier.ts` mirror the server's
1161
1182
  own rule from two endpoints the console already calls, unprojected:
1162
1183
 
1163
- GET /api/members/user/:user/app/admin the Seven365 staff membership
1164
- GET /api/roles/id/:role that membership's role document
1184
+ GET /api/members/user/:user/app/admin the Seven365 staff membership
1185
+ GET /api/roles/id/:role that membership's role document
1165
1186
 
1166
- owner = member.type === "admin" && role.type === "admin" && role.default === true
1167
- staff = member.type === "admin" && role.type === "admin"
1187
+ owner = member.type === "admin" && role.type === "admin" && role.default === true
1188
+ staff = member.type === "admin" && role.type === "admin"
1168
1189
 
1169
1190
  `role.default` is the marker because it is the only property of a platform
1170
1191
  staff role no API caller can set - `role.controller.ts` validates create and
@@ -26,8 +26,8 @@
26
26
  >
27
27
  <iframe
28
28
  ref="frameEl"
29
- :key="camera.host"
30
- :src="camera.host"
29
+ :key="liveSrc"
30
+ :src="liveSrc"
31
31
  class="vms-tile__frame"
32
32
  :title="`Live view of ${camera.name || 'camera'}`"
33
33
  allowfullscreen
@@ -154,6 +154,7 @@ import {
154
154
  clampPan,
155
155
  clampZoom,
156
156
  healthView,
157
+ liveSource,
157
158
  LIVE_CONNECT_TIMEOUT_MS,
158
159
  LIVE_FRAME_TIMEOUT_MS,
159
160
  playerOrigin,
@@ -222,6 +223,14 @@ const view = computed(() =>
222
223
  tileView(props.camera, { online: props.online, player: player.value })
223
224
  );
224
225
 
226
+ /**
227
+ * The address this tile is showing — the server's signed one when there is one,
228
+ * the stored one otherwise. Taken verbatim: `src`, the remount key, the origin
229
+ * a player message must come from and the reload watch all read THIS, so they
230
+ * cannot drift apart and start disagreeing about which address is on screen.
231
+ */
232
+ const liveSrc = computed(() => liveSource(props.camera));
233
+
225
234
  /* ------------------------------------------------------------------ health */
226
235
 
227
236
  const recorder = computed(() => healthView(props.health, props.now || Date.now()));
@@ -389,7 +398,7 @@ function onPlayerError() {
389
398
  * understand must never be able to turn a badge green.
390
399
  */
391
400
  function onPlayerMessage(event: MessageEvent) {
392
- const origin = playerOrigin(props.camera?.host);
401
+ const origin = playerOrigin(liveSrc.value);
393
402
  if (!origin || event.origin !== origin) return;
394
403
  if (frameEl.value && event.source !== frameEl.value.contentWindow) return;
395
404
 
@@ -441,7 +450,7 @@ function restartFrameClock() {
441
450
  * evidence, is the same mistake as declaring it live on a timer.
442
451
  */
443
452
  watch(
444
- () => props.camera?.host,
453
+ () => liveSrc.value,
445
454
  (host) => {
446
455
  clearTimer();
447
456
  clearFrameTimer();
@@ -23,14 +23,19 @@
23
23
  </template>
24
24
 
25
25
  <script setup lang="ts">
26
+ /** What the person can add from here. `whitelist-bulk` opens the sheet. */
27
+ type TVehicleAddChoice = TVehicleType | "seasonpass" | "whitelist-bulk";
28
+
26
29
  const prop = defineProps({
27
30
  });
28
31
 
29
32
  const emit = defineEmits(['cancel', 'select']);
30
33
 
31
- const selection = computed<{label: string, value: TVehicleType | 'seasonpass'}[]>(() => {
34
+ const selection = computed<{label: string, value: TVehicleAddChoice}[]>(() => {
32
35
  return [
33
36
  { label: "Whitelist", value: "whitelist" },
37
+ // Many whitelist vehicles at once, typed or pasted into a sheet.
38
+ { label: "Whitelist (Bulk)", value: "whitelist-bulk" },
34
39
  { label: "Season Pass", value: "seasonpass" },
35
40
  { label: "Blocklist", value: "blocklist" },
36
41
  ];
@@ -40,7 +45,7 @@ function cancel() {
40
45
  emit("cancel");
41
46
  }
42
47
 
43
- function select(value: TVehicleType | 'seasonpass') {
48
+ function select(value: TVehicleAddChoice) {
44
49
  emit("select", value);
45
50
  }
46
51
  </script>