@7365admin1/layer-common 4.97.1-staging.643 → 4.97.1-staging.645

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.
@@ -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
 
@@ -1771,6 +1771,35 @@
1771
1771
  </v-card>
1772
1772
  </v-dialog>
1773
1773
 
1774
+ <!-- A visit holding nothing has no return step to stop at, so it asks here. -->
1775
+ <ConfirmDialog
1776
+ v-model="dialog.confirmCheckout"
1777
+ :loading="loading.checkingOut"
1778
+ >
1779
+ <template #title>Check Out Visitor</template>
1780
+ <template #description>
1781
+ Are you sure you want to check out {{ checkoutConfirmName }}?
1782
+ </template>
1783
+ <template #footer>
1784
+ <v-spacer />
1785
+ <v-btn
1786
+ class="text-capitalize"
1787
+ variant="text"
1788
+ text="Cancel"
1789
+ :disabled="loading.checkingOut"
1790
+ @click="dialog.confirmCheckout = false"
1791
+ />
1792
+ <v-btn
1793
+ class="text-capitalize font-weight-bold"
1794
+ color="red"
1795
+ variant="flat"
1796
+ text="Check Out"
1797
+ :loading="loading.checkingOut"
1798
+ @click="confirmCheckout"
1799
+ />
1800
+ </template>
1801
+ </ConfirmDialog>
1802
+
1774
1803
  <v-dialog v-model="hidQrDialog" max-width="440" persistent>
1775
1804
  <v-card>
1776
1805
  <v-toolbar color="transparent" density="comfortable" class="px-2">
@@ -2386,6 +2415,7 @@ const dialog = reactive({
2386
2415
  returnNfcCard: false,
2387
2416
  approveRejectVisitorDialog: false,
2388
2417
  blockVehicle: false,
2418
+ confirmCheckout: false,
2389
2419
  });
2390
2420
 
2391
2421
  /* ---- Block a visitor's vehicle ------------------------------------------ */
@@ -3928,8 +3958,8 @@ function showCheckOutButton(item: Record<string, any>) {
3928
3958
 
3929
3959
  /**
3930
3960
  * Check Out, in iSecure's order: a held pass or key goes to the return
3931
- * statuses first, an NFC card to the card return, and only a visit holding
3932
- * neither checks out straight away. Each path is an update of the visit.
3961
+ * statuses first, an NFC card to the card return, and a visit holding neither
3962
+ * asks for confirmation. Each path is an update of the visit.
3933
3963
  */
3934
3964
  function handleCheckout(userId: string, visitorObj?: Record<string, any>) {
3935
3965
  if (!userId) {
@@ -3957,7 +3987,15 @@ function handleCheckout(userId: string, visitorObj?: Record<string, any>) {
3957
3987
  openNfcDialog(visitor);
3958
3988
  return;
3959
3989
  }
3960
- proceedCheckout();
3990
+ checkoutConfirmName.value = visitor?.name || "this visitor";
3991
+ dialog.confirmCheckout = true;
3992
+ }
3993
+
3994
+ const checkoutConfirmName = ref("");
3995
+
3996
+ async function confirmCheckout() {
3997
+ await proceedCheckout();
3998
+ dialog.confirmCheckout = false;
3961
3999
  }
3962
4000
 
3963
4001
  /** A visit holding nothing: just the check-out. */
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.97.1-staging.643",
5
+ "version": "4.97.1-staging.645",
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.",