@7365admin1/layer-common 4.164.0 → 4.165.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,11 @@
1
1
  # @iservice365/layer-common
2
2
 
3
+ ## 4.165.0
4
+
5
+ ### Minor Changes
6
+
7
+ - d52ad00: CCTV Engine Live: "Combined" view - one live picture of the cameras with activity (the engine's birdseye stream). Live tiles take an optional title.
8
+
3
9
  ## 4.164.0
4
10
 
5
11
  ### Minor Changes
@@ -3754,11 +3760,11 @@ Monthly report: a month that had patrols opens the list of that month's patrol r
3754
3760
  `utils/console-tier.ts` + `composables/useConsoleTier.ts` mirror the server's
3755
3761
  own rule from two endpoints the console already calls, unprojected:
3756
3762
 
3757
- GET /api/members/user/:user/app/admin the Seven365 staff membership
3758
- GET /api/roles/id/:role that membership's role document
3763
+ GET /api/members/user/:user/app/admin the Seven365 staff membership
3764
+ GET /api/roles/id/:role that membership's role document
3759
3765
 
3760
- owner = member.type === "admin" && role.type === "admin" && role.default === true
3761
- staff = member.type === "admin" && role.type === "admin"
3766
+ owner = member.type === "admin" && role.type === "admin" && role.default === true
3767
+ staff = member.type === "admin" && role.type === "admin"
3762
3768
 
3763
3769
  `role.default` is the marker because it is the only property of a platform
3764
3770
  staff role no API caller can set - `role.controller.ts` validates create and
@@ -10,7 +10,7 @@
10
10
  <template v-if="engine">
11
11
  <div class="d-flex flex-wrap align-center ga-3 my-3">
12
12
  <v-select
13
- v-if="groups.length"
13
+ v-if="groups.length && !combined"
14
14
  :model-value="group"
15
15
  :items="groups"
16
16
  item-title="name"
@@ -24,10 +24,12 @@
24
24
  data-test="camera-group"
25
25
  @update:model-value="pickGroup"
26
26
  />
27
- <v-btn-toggle v-model="tiles" mandatory density="comfortable" divided color="primary" aria-label="Grid size">
27
+ <v-btn-toggle v-model="view" mandatory density="comfortable" divided color="primary" aria-label="Grid size">
28
28
  <v-btn v-for="l in GRID_LAYOUTS" :key="l.key" :value="l.key" size="small">{{ l.key === 1 ? "Single" : l.key }}</v-btn>
29
+ <v-btn :value="COMBINED" size="small" prepend-icon="mdi-view-dashboard-outline" data-test="combined-view">Combined</v-btn>
29
30
  </v-btn-toggle>
30
31
  <v-select
32
+ v-if="!combined"
31
33
  v-model="picked"
32
34
  :items="cameras"
33
35
  item-title="name"
@@ -43,12 +45,12 @@
43
45
  :max-width="smAndDown ? undefined : 420"
44
46
  @update:model-value="group = null"
45
47
  />
46
- <template v-if="canManage && cameras.length">
48
+ <template v-if="canManage && cameras.length && !combined">
47
49
  <v-btn size="small" variant="tonal" prepend-icon="mdi-content-save-outline" :disabled="!picked.length" @click="openSave">Save as group</v-btn>
48
50
  <v-btn v-if="group" size="small" variant="text" color="error" prepend-icon="mdi-delete-outline" @click="removeOpen = true">Delete group</v-btn>
49
51
  </template>
50
52
  </div>
51
- <p v-if="canManage && cameras.length && !groups.length" class="hero-muted mt-n1 mb-2">
53
+ <p v-if="canManage && cameras.length && !groups.length && !combined" class="hero-muted mt-n1 mb-2">
52
54
  Tip: pick the cameras you watch together, then press Save as group. Everyone on this site can then show them with one choice.
53
55
  </p>
54
56
 
@@ -59,6 +61,13 @@
59
61
  title="This engine has no cameras yet"
60
62
  body="Cameras are added to the engine itself. Once the engine reports them they appear here; if you just set it up, check it shows Online in Engines & health."
61
63
  />
64
+ <template v-else-if="combined">
65
+ <p class="hero-muted mt-n1 mb-2">
66
+ One picture with the cameras where people or vehicles are moving right now. It is empty while nothing is happening.
67
+ If it says the camera was not found, the combined view is not switched on for this engine.
68
+ </p>
69
+ <CctvEngineLiveTile :key="`${engine}/${COMBINED}`" :engine-id="engine" :camera="COMBINED" title="Combined view (cameras with activity)" big />
70
+ </template>
62
71
  <div v-else class="cctv-live__grid" :style="{ gridTemplateColumns: `repeat(${columns}, minmax(0, 1fr))` }">
63
72
  <CctvEngineLiveTile v-for="c in shown" :key="`${engine}/${c.name}`" :engine-id="engine" :camera="c.name" />
64
73
  </div>
@@ -121,7 +130,17 @@ const canManage = computed(() => props.access?.can(CCTV_PERMISSIONS.manageEngine
121
130
 
122
131
  const engine = ref("");
123
132
  const engines = ref<any[]>([]);
124
- const tiles = ref<number>(4);
133
+ /** The engine's combined live view (its stream name). */
134
+ const COMBINED = "birdseye";
135
+ const view = ref<number | string>(4);
136
+ const combined = computed(() => view.value === COMBINED);
137
+ const lastTiles = ref(4);
138
+ // The grid size; the combined view keeps the last one for when the user goes back.
139
+ const tiles = computed<number>({
140
+ get: () => (typeof view.value === "number" ? view.value : lastTiles.value),
141
+ set: (n) => (view.value = n),
142
+ });
143
+ watch(view, (v) => typeof v === "number" && (lastTiles.value = v));
125
144
  const picked = ref<string[]>([]);
126
145
  const group = ref<string | null>(null);
127
146
  const cameras = ref<{ name: string }[]>([]);
@@ -11,10 +11,10 @@
11
11
  data-test="cctv-tile"
12
12
  >
13
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)" />
14
+ <img v-if="mode === 'still' && still" :src="still" :alt="`Latest picture from ${label}`" class="cctv-tile__media" @load="fit($event)" />
15
15
 
16
16
  <div v-if="mode === 'connecting'" class="cctv-tile__msg" role="status">
17
- <v-progress-circular indeterminate size="22" /> <span>Connecting to {{ camera }}...</span>
17
+ <v-progress-circular indeterminate size="22" /> <span>Connecting to {{ label }}...</span>
18
18
  </div>
19
19
  <div v-else-if="mode === 'error'" class="cctv-tile__msg" role="alert">
20
20
  <strong>{{ notice.title }}</strong>
@@ -23,7 +23,7 @@
23
23
  </div>
24
24
 
25
25
  <div class="cctv-tile__bar">
26
- <span class="cctv-tile__name">{{ camera }}</span>
26
+ <span class="cctv-tile__name">{{ label }}</span>
27
27
  <v-chip v-if="mode === 'live'" size="x-small" color="success" label>Live</v-chip>
28
28
  <v-chip
29
29
  v-else-if="mode === 'still'"
@@ -43,7 +43,9 @@ import { computed, onBeforeUnmount, onMounted, ref, watch } from "vue";
43
43
  import { cctvNotice, STILL_REFRESH_MS } from "../../utils/cctv-engine";
44
44
 
45
45
  // natural: keep the camera's own shape (no 16:9 box) so drawings laid over the tile line up with the picture.
46
- const props = defineProps<{ engineId: string; camera: string; big?: boolean; natural?: boolean }>();
46
+ // title: shown instead of the camera name (e.g. the combined view, whose stream name is "birdseye").
47
+ const props = defineProps<{ engineId: string; camera: string; title?: string; big?: boolean; natural?: boolean }>();
48
+ const label = computed(() => props.title || props.camera);
47
49
 
48
50
  const { webrtcAnswer, latestImage } = useCctvEngine();
49
51
 
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.164.0",
5
+ "version": "4.165.0",
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.",