iobroker.agent-dvr 0.5.0 → 0.5.1

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.
@@ -21,7 +21,7 @@
21
21
  "cfgDashEnableRecordings": "Aufnahmen-Tab anzeigen",
22
22
  "cfgDashEnableRecordings_tt": "Den Aufnahmen-Tab in der Dashboard-Navigation anzeigen. Deaktivieren um den Tab vollständig auszublenden.",
23
23
  "cfgDashMaxRec": "Max. Aufnahmen gesamt",
24
- "cfgDashMaxRec_tt": "Maximale Gesamtanzahl Aufnahmen die das Dashboard über alle Kameras hinweg anzeigt (neueste zuerst).",
24
+ "cfgDashMaxRec_tt": "Maximale Gesamtanzahl der im Dashboard angezeigten Aufnahmen über alle Kameras (neueste zuerst).",
25
25
  "cfgDashGridCols": "Spaltenanzahl (0 = automatisch)",
26
26
  "cfgDashGridCols_tt": "Anzahl Kamera-Spalten fest vorgeben. 0 = optimale Anzahl wird automatisch berechnet.",
27
27
  "cfgDashRefreshSec": "Kameraliste neu laden alle (Sekunden)",
@@ -21,7 +21,7 @@
21
21
  "cfgDashEnableRecordings": "Mostrar pestaña de grabaciones",
22
22
  "cfgDashEnableRecordings_tt": "Muestra la pestaña de grabaciones en la navegación del panel. Desactivar para ocultar la pestaña por completo.",
23
23
  "cfgDashMaxRec": "Max. recordings total",
24
- "cfgDashMaxRec_tt": "Maximum total number of recordings shown in the dashboard across all cameras (newest first).",
24
+ "cfgDashMaxRec_tt": "Número máximo total de grabaciones mostradas en el panel en todas las cámaras (las más recientes primero).",
25
25
  "cfgDashGridCols": "Número de columnas (0 = automático)",
26
26
  "cfgDashGridCols_tt": "Forzar un número fijo de columnas de cámara. 0 = el número óptimo se calcula automáticamente.",
27
27
  "cfgDashRefreshSec": "Recargar lista de cámaras cada (segundos)",
@@ -21,7 +21,7 @@
21
21
  "cfgDashEnableRecordings": "Afficher l'onglet enregistrements",
22
22
  "cfgDashEnableRecordings_tt": "Afficher l'onglet enregistrements dans la navigation du tableau de bord. Désactiver pour masquer l'onglet complètement.",
23
23
  "cfgDashMaxRec": "Max. recordings total",
24
- "cfgDashMaxRec_tt": "Maximum total number of recordings shown in the dashboard across all cameras (newest first).",
24
+ "cfgDashMaxRec_tt": "Nombre maximum total d'enregistrements affichés dans le tableau de bord pour toutes les caméras (les plus récents en premier).",
25
25
  "cfgDashGridCols": "Nombre de colonnes (0 = automatique)",
26
26
  "cfgDashGridCols_tt": "Forcer un nombre fixe de colonnes de caméras. 0 = le nombre optimal est calculé automatiquement.",
27
27
  "cfgDashRefreshSec": "Recharger la liste des caméras toutes les (secondes)",
@@ -21,7 +21,7 @@
21
21
  "cfgDashEnableRecordings": "Mostra scheda registrazioni",
22
22
  "cfgDashEnableRecordings_tt": "Mostra la scheda registrazioni nella navigazione del pannello. Disattivare per nascondere completamente la scheda.",
23
23
  "cfgDashMaxRec": "Max. recordings total",
24
- "cfgDashMaxRec_tt": "Maximum total number of recordings shown in the dashboard across all cameras (newest first).",
24
+ "cfgDashMaxRec_tt": "Numero massimo totale di registrazioni visualizzate nel pannello per tutte le telecamere (le più recenti prima).",
25
25
  "cfgDashGridCols": "Numero colonne (0 = automatico)",
26
26
  "cfgDashGridCols_tt": "Forza un numero fisso di colonne per le telecamere. 0 = il numero ottimale viene calcolato automaticamente.",
27
27
  "cfgDashRefreshSec": "Ricarica lista telecamere ogni (secondi)",
@@ -21,7 +21,7 @@
21
21
  "cfgDashEnableRecordings": "Opnamen-tabblad tonen",
22
22
  "cfgDashEnableRecordings_tt": "Toont het opnamen-tabblad in de dashboardnavigatie. Uitschakelen om het tabblad volledig te verbergen.",
23
23
  "cfgDashMaxRec": "Max. recordings total",
24
- "cfgDashMaxRec_tt": "Maximum total number of recordings shown in the dashboard across all cameras (newest first).",
24
+ "cfgDashMaxRec_tt": "Maximaal totaal aantal opnames dat in het dashboard wordt weergegeven voor alle camera's (nieuwste eerst).",
25
25
  "cfgDashGridCols": "Aantal kolommen (0 = automatisch)",
26
26
  "cfgDashGridCols_tt": "Forceer een vast aantal camerakolommen. 0 = optimaal aantal wordt automatisch berekend.",
27
27
  "cfgDashRefreshSec": "Cameralijst elke (seconden) herladen",
@@ -21,7 +21,7 @@
21
21
  "cfgDashEnableRecordings": "Pokaż zakładkę nagrań",
22
22
  "cfgDashEnableRecordings_tt": "Wyświetla zakładkę nagrań w nawigacji panelu. Wyłącz aby całkowicie ukryć zakładkę.",
23
23
  "cfgDashMaxRec": "Max. recordings total",
24
- "cfgDashMaxRec_tt": "Maximum total number of recordings shown in the dashboard across all cameras (newest first).",
24
+ "cfgDashMaxRec_tt": "Maksymalna łączna liczba nagrań wyświetlanych na pulpicie nawigacyjnym dla wszystkich kamer (najnowsze pierwsze).",
25
25
  "cfgDashGridCols": "Liczba kolumn (0 = automatycznie)",
26
26
  "cfgDashGridCols_tt": "Wymusza stałą liczbę kolumn kamer. 0 = optymalna liczba jest obliczana automatycznie.",
27
27
  "cfgDashRefreshSec": "Odświeżaj listę kamer co (sekundy)",
@@ -21,7 +21,7 @@
21
21
  "cfgDashEnableRecordings": "Mostrar aba de gravações",
22
22
  "cfgDashEnableRecordings_tt": "Mostra a aba de gravações na navegação do painel. Desativar para ocultar a aba completamente.",
23
23
  "cfgDashMaxRec": "Max. recordings total",
24
- "cfgDashMaxRec_tt": "Maximum total number of recordings shown in the dashboard across all cameras (newest first).",
24
+ "cfgDashMaxRec_tt": "Número máximo total de gravações exibidas no painel em todas as câmeras (as mais recentes primeiro).",
25
25
  "cfgDashGridCols": "Número de colunas (0 = automático)",
26
26
  "cfgDashGridCols_tt": "Força um número fixo de colunas de câmeras. 0 = o número ideal é calculado automaticamente.",
27
27
  "cfgDashRefreshSec": "Recarregar lista de câmeras a cada (segundos)",
@@ -21,7 +21,7 @@
21
21
  "cfgDashEnableRecordings": "Показывать вкладку записей",
22
22
  "cfgDashEnableRecordings_tt": "Отображает вкладку записей в навигации панели. Отключите чтобы полностью скрыть вкладку.",
23
23
  "cfgDashMaxRec": "Max. recordings total",
24
- "cfgDashMaxRec_tt": "Maximum total number of recordings shown in the dashboard across all cameras (newest first).",
24
+ "cfgDashMaxRec_tt": "Максимальное общее количество записей, отображаемых на панели для всех камер (сначала новейшие).",
25
25
  "cfgDashGridCols": "Количество столбцов (0 = авто)",
26
26
  "cfgDashGridCols_tt": "Принудительно задать фиксированное количество столбцов камер. 0 = оптимальное количество вычисляется автоматически.",
27
27
  "cfgDashRefreshSec": "Обновлять список камер каждые (секунд)",
@@ -21,7 +21,7 @@
21
21
  "cfgDashEnableRecordings": "Показувати вкладку записів",
22
22
  "cfgDashEnableRecordings_tt": "Відображає вкладку записів у навігації панелі. Вимкніть щоб повністю приховати вкладку.",
23
23
  "cfgDashMaxRec": "Max. recordings total",
24
- "cfgDashMaxRec_tt": "Maximum total number of recordings shown in the dashboard across all cameras (newest first).",
24
+ "cfgDashMaxRec_tt": "Максимальна загальна кількість записів, що відображаються на панелі для всіх камер (спочатку найновіші).",
25
25
  "cfgDashGridCols": "Кількість стовпців (0 = авто)",
26
26
  "cfgDashGridCols_tt": "Примусово задати фіксовану кількість стовпців камер. 0 = оптимальна кількість обчислюється автоматично.",
27
27
  "cfgDashRefreshSec": "Оновлювати список камер кожні (секунд)",
@@ -21,7 +21,7 @@
21
21
  "cfgDashEnableRecordings": "显示录像标签页",
22
22
  "cfgDashEnableRecordings_tt": "在仪表板导航中显示录像标签页。禁用则完全隐藏该标签页。",
23
23
  "cfgDashMaxRec": "Max. recordings total",
24
- "cfgDashMaxRec_tt": "Maximum total number of recordings shown in the dashboard across all cameras (newest first).",
24
+ "cfgDashMaxRec_tt": "仪表板中所有摄像头显示的最大录像总数(最新的优先)。",
25
25
  "cfgDashGridCols": "列数(0 = 自动)",
26
26
  "cfgDashGridCols_tt": "强制设置固定的摄像头列数。0 = 自动计算最优数量。",
27
27
  "cfgDashRefreshSec": "每隔(秒)重新加载摄像头列表",
@@ -18,7 +18,7 @@
18
18
  };
19
19
  document.head.appendChild(script);
20
20
  </script>
21
- <script type="module" crossorigin src="./assets/index-D7mDAij8.js"></script>
21
+ <script type="module" crossorigin src="./assets/index-D01Axkcs.js"></script>
22
22
  </head>
23
23
  <body>
24
24
  <noscript>You need to enable JavaScript to run this app.</noscript>
package/build/main.js CHANGED
@@ -879,7 +879,14 @@ class AgentDvr extends utils.Adapter {
879
879
  await this.fetchSnapshotB64(d.oid, snapId);
880
880
  }
881
881
  }
882
+ if (!this.ensuredFolders.has(`${fid}._widgetMigrated`)) {
883
+ this.ensuredFolders.add(`${fid}._widgetMigrated`);
884
+ await this.delObjectAsync(`${fid}.widget`).catch(() => void 0);
885
+ }
882
886
  await this.updateCameraEvents(d, fid);
887
+ if (this.config.enableWidget && d.ot === 2) {
888
+ await this.updateLiveWidget(d, fid);
889
+ }
883
890
  }
884
891
  // ---- PTZ presets ----
885
892
  async buildPtzPresets(d, fid) {
@@ -1064,6 +1071,47 @@ class AgentDvr extends utils.Adapter {
1064
1071
  const grid = tiles ? `<div class="advgrid">${tiles}</div>` : `<div class="advempty">No cameras</div>`;
1065
1072
  return `<style>${galleryCss(minCol, maxW)}</style>${grid}`;
1066
1073
  }
1074
+ buildSingleCamLiveHtml(d) {
1075
+ const minCol = this.config.widgetMinCol || 150;
1076
+ const maxW = this.config.widgetMaxModalWidth || 900;
1077
+ const PAUSE_ATTR = ` onchange="if(!this.checked){var m=this.nextElementSibling.nextElementSibling,v=m&&m.querySelector('video');if(v){v.pause();}}"`;
1078
+ const oid = d.oid;
1079
+ const id = `advlive${sanitize(oid)}`;
1080
+ const grab = `${this.baseUrl}/grab.jpg?oid=${oid}&ot=2&maintainAR=1`;
1081
+ const webm = `${this.baseUrl}/video.webm?oid=${oid}&ot=2`;
1082
+ const name = escHtml(d.name || `Camera ${oid}`);
1083
+ const arRaw = this.camAspect[oid] || this.config.widgetLiveAspect || "";
1084
+ const ar = arRaw ? String(arRaw).replace("/", " / ") : "";
1085
+ const fix = ar ? " advimgfix" : "";
1086
+ const arStyle = ar ? ` style="aspect-ratio:${ar}"` : "";
1087
+ const inner = `<span class="advimg${fix}"${arStyle}><img src="${grab}" loading="lazy" alt=""><span class="advtag" style="top:5px;left:5px">&#9679; ${escHtml(this.wt.live)}</span><span class="advplay"></span></span><span class="advcap">${name}</span>`;
1088
+ const tile = `<input class="advlb" type="checkbox" id="${id}"${PAUSE_ATTR}><label class="advcell advthumb" for="${id}">${inner}</label><div class="advmodal"><label class="advbackdrop" for="${id}"></label><div class="advbox"><label class="advclose" for="${id}">&#10005;</label><video class="advvideo" controls preload="none" playsinline src="${webm}"></video><div class="advinfo">${name} &middot; Live</div></div></div>`;
1089
+ return `<style>${galleryCss(minCol, maxW)}</style><div class="advgrid">${tile}</div>`;
1090
+ }
1091
+ async updateLiveWidget(d, fid) {
1092
+ const wId = `${fid}.widget_live`;
1093
+ if (!this.ensuredFolders.has(wId)) {
1094
+ await this.ensurePath(wId);
1095
+ await this.setObjectNotExistsAsync(wId, {
1096
+ type: "state",
1097
+ common: {
1098
+ name: "HTML live widget",
1099
+ type: "string",
1100
+ role: "html",
1101
+ read: true,
1102
+ write: false,
1103
+ def: ""
1104
+ },
1105
+ native: {}
1106
+ });
1107
+ this.ensuredFolders.add(wId);
1108
+ }
1109
+ const sig = `${d.name}|${this.camAspect[d.oid] || ""}`;
1110
+ if (this.widgetSig[wId] !== sig) {
1111
+ await this.setStateAsync(wId, { val: this.buildSingleCamLiveHtml(d), ack: true });
1112
+ this.widgetSig[wId] = sig;
1113
+ }
1114
+ }
1067
1115
  // ---- event data points ----
1068
1116
  async writeEventDps(d, fid, events) {
1069
1117
  var _a, _b, _c, _d, _e;
@@ -1184,13 +1232,13 @@ class AgentDvr extends utils.Adapter {
1184
1232
  await this.writeEventDps(d, fid, events);
1185
1233
  }
1186
1234
  if (this.config.enableWidget) {
1187
- const wId = `${fid}.widget`;
1235
+ const wId = `${fid}.widget_recordings`;
1188
1236
  if (!this.ensuredFolders.has(wId)) {
1189
1237
  await this.ensurePath(wId);
1190
1238
  await this.setObjectNotExistsAsync(wId, {
1191
1239
  type: "state",
1192
1240
  common: {
1193
- name: "HTML gallery widget",
1241
+ name: "HTML recordings widget",
1194
1242
  type: "string",
1195
1243
  role: "html",
1196
1244
  read: true,