iobroker.staticsfilefolder 0.0.21 → 0.0.23

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/README.md CHANGED
@@ -64,6 +64,12 @@ Once configured and the instance is running (green status):
64
64
  Placeholder for the next version (at the beginning of the line):
65
65
  ### **WORK IN PROGRESS**
66
66
  -->
67
+ ### 0.0.23
68
+ * Added live rendering / auto-refresh in file explorer on file additions/deletions.
69
+
70
+ ### 0.0.22
71
+ * Fixed PDF print layout to prevent vertical page overflow, and fixed zoom/scale rendering issues in PDF viewer.
72
+
67
73
  ### 0.0.21
68
74
  * Upgraded Express to major version 5.x and updated tsconfig to target Node 22.
69
75
 
package/io-package.json CHANGED
@@ -1,20 +1,20 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "staticsfilefolder",
4
- "version": "0.0.21",
4
+ "version": "0.0.23",
5
5
  "news": {
6
- "0.0.21": {
7
- "en": "Upgraded Express to major version 5.x and updated tsconfig to target Node 22.",
8
- "de": "Express auf Major-Version 5.x aktualisiert und tsconfig auf Node 22 angepasst.",
9
- "ru": "Обновлен Express до мажорной версии 5.x и обновлен tsconfig для поддержки Node 22.",
10
- "pt": "Atualizado o Express para a versão principal 5.x e atualizado o tsconfig para o Node 22.",
11
- "nl": "Express geüpgraded naar hoofdversie 5.x en tsconfig bijgewerkt naar Node 22.",
12
- "fr": "Mise à niveau d'Express vers la version majeure 5.x et mise à jour de tsconfig pour cibler Node 22.",
13
- "it": "Aggiornato Express alla versione principale 5.x e aggiornato tsconfig per Node 22.",
14
- "es": "Se actualizó Express a la versión principal 5.x y se actualizó tsconfig para apuntar a Node 22.",
15
- "pl": "Uaktualniono Express do głównej wersji 5.x i zaktualizowano tsconfig dla Node 22.",
16
- "uk": "Оновлено Express до мажорної версії 5.x та оновлено tsconfig для підтримки Node 22.",
17
- "zh-cn": "将Express升级到主版本5.x并更新tsconfig以针对Node 22。"
6
+ "0.0.23": {
7
+ "en": "Added live rendering / auto-refresh in file explorer on file additions/deletions.",
8
+ "de": "Live-Rendering / automatische Aktualisierung im Datei-Explorer bei Hinzufügung/Löschung von Dateien hinzugefügt.",
9
+ "ru": "Добавлено живое отображение / автообновление в проводнике файлов при добавлении/удалении файлов.",
10
+ "pt": "Adicionada renderização ao vivo / atualização automática no explorador de arquivos ao adicionar/excluir arquivos.",
11
+ "nl": "Live rendering / auto-refresh toegevoegd in de bestandsbrowser bij toevoeging/verwijdering van bestanden.",
12
+ "fr": "Ajout du rendu en direct / de l'actualisation automatique dans l'explorateur de fichiers lors de l'ajout/suppression de fichiers.",
13
+ "it": "Aggiunto rendering live / aggiornamento automatico in Esplora file all'aggiunta/eliminazione di file.",
14
+ "es": "Se agregó renderizado en vivo / actualización automática en el explorador de archivos al agregar o eliminar archivos.",
15
+ "pl": "Dodano renderowanie na żywo / automatyczne odświeżanie w eksploratorze plików przy dodawaniu/usuwaniu plików.",
16
+ "uk": "Додано живе відображення / автооновлення в провіднику файлів при додаванні/вилученні файлів.",
17
+ "zh-cn": "在文件资源管理器中添加了在添加/删除文件时的实时渲染/自动刷新。"
18
18
  },
19
19
  "0.0.15": {
20
20
  "en": "Reverted minimum Node.js engine requirement to 20 to support GitHub Actions runners.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.staticsfilefolder",
3
- "version": "0.0.21",
3
+ "version": "0.0.23",
4
4
  "description": "Static Files Folder",
5
5
  "author": {
6
6
  "name": "gokturk413",
package/www/app.js CHANGED
@@ -7,6 +7,7 @@ let currentPath = '';
7
7
  let historyStack = [];
8
8
  let forwardStack = [];
9
9
  let currentItems = [];
10
+ let pollInterval = null;
10
11
 
11
12
  // DOM Elements
12
13
  const breadcrumbEl = document.getElementById('breadcrumb');
@@ -227,6 +228,7 @@ document.addEventListener('DOMContentLoaded', () => {
227
228
  initTheme();
228
229
  initLang();
229
230
  loadPath('');
231
+ startPolling();
230
232
 
231
233
  // Event Listeners
232
234
  btnBack.addEventListener('click', goBack);
@@ -281,6 +283,39 @@ async function loadPath(path) {
281
283
  }
282
284
  }
283
285
 
286
+ function startPolling() {
287
+ if (pollInterval) clearInterval(pollInterval);
288
+ pollInterval = setInterval(async () => {
289
+ if (document.hidden) return;
290
+ try {
291
+ const response = await fetch(`${API_URL}?path=${encodeURIComponent(currentPath)}`);
292
+ const data = await response.json();
293
+ if (data.success) {
294
+ const itemsChanged = JSON.stringify(data.items) !== JSON.stringify(currentItems);
295
+ if (itemsChanged) {
296
+ currentItems = data.items;
297
+ renderItems();
298
+
299
+ if (currentOpenItem) {
300
+ const fileStillExists = data.items.some(item => !item.isDirectory && item.name === currentOpenItem.name);
301
+ if (!fileStillExists) {
302
+ viewerModal.style.display = 'none';
303
+ viewerBody.innerHTML = '';
304
+ currentOpenItem = null;
305
+ currentPdfDoc = null;
306
+ currentPdfZoom = 1.5;
307
+ modalPdfZoom.value = '1.5';
308
+ modalPdfZoom.style.display = 'none';
309
+ }
310
+ }
311
+ }
312
+ }
313
+ } catch (e) {
314
+ console.warn('Polling error:', e);
315
+ }
316
+ }, 3000);
317
+ }
318
+
284
319
  function navigateTo(path) {
285
320
  if (path !== currentPath) {
286
321
  historyStack.push(currentPath);
@@ -507,10 +542,13 @@ function printModalContent() {
507
542
  color: black;
508
543
  }
509
544
  .pdf-page-img {
510
- width: 100%;
511
545
  max-width: 100%;
546
+ max-height: 100vh;
547
+ width: auto;
512
548
  height: auto;
513
549
  display: block;
550
+ margin: 0 auto;
551
+ page-break-inside: avoid;
514
552
  page-break-after: always;
515
553
  }
516
554
  .pdf-page-img:last-child {
@@ -582,9 +620,12 @@ async function renderPdfPages() {
582
620
  canvas.height = viewport.height;
583
621
  canvas.width = viewport.width;
584
622
 
623
+ canvas.style.width = `${viewport.width}px`;
624
+ canvas.style.height = `${viewport.height}px`;
625
+ canvas.style.maxWidth = 'none';
585
626
  canvas.style.display = 'block';
586
- canvas.style.margin = '10px auto';
587
- canvas.style.boxShadow = '0 4px 8px rgba(0,0,0,0.15)';
627
+ canvas.style.margin = '15px auto';
628
+ canvas.style.boxShadow = '0 4px 10px rgba(0,0,0,0.25)';
588
629
 
589
630
  viewerBody.appendChild(canvas);
590
631
 
package/www/style.css CHANGED
@@ -234,16 +234,15 @@ body {
234
234
  flex-grow: 1;
235
235
  overflow: auto;
236
236
  background: var(--hover-color);
237
- display: flex;
238
- justify-content: center;
237
+ display: block;
238
+ text-align: center;
239
239
  color: var(--text-color);
240
240
  }
241
241
 
242
242
  #viewer-body canvas {
243
- max-width: 100%;
244
- margin: 10px auto;
243
+ margin: 15px auto;
245
244
  display: block;
246
- box-shadow: 0 2px 5px rgba(0,0,0,0.3);
245
+ box-shadow: 0 4px 10px rgba(0,0,0,0.25);
247
246
  }
248
247
 
249
248
  /* Table styles for excel */