From 26d604534a272b80cf9f74835ec4a1c96601b153 Mon Sep 17 00:00:00 2001 From: "mikep@034E8FF1ED4D1F6" Date: Sat, 20 Sep 2025 12:22:20 -0700 Subject: [PATCH] Form --- .vscode/dashkiosk.hurl | 6 +++-- .vscode/settings.json | 7 ++++++ index.html | 51 +++++++++++++++++++++++++++++++++++--- slideshow/css/index.css | 5 ++++ slideshow/index.html | 2 +- slideshow/scripts/index.js | 36 +++++++++++++++++++-------- 6 files changed, 90 insertions(+), 17 deletions(-) diff --git a/.vscode/dashkiosk.hurl b/.vscode/dashkiosk.hurl index 4585f1f..9efa390 100644 --- a/.vscode/dashkiosk.hurl +++ b/.vscode/dashkiosk.hurl @@ -1,9 +1,8 @@ -# "C:\Program Files\hurl\hurl.exe" basic.hurl - ### GET https://dashkiosk.phares.duckdns.org/api/display Accept: application/json + HTTP 200 [Asserts] header "Content-Type" == "application/json; charset=utf-8" @@ -12,6 +11,7 @@ header "Content-Type" == "application/json; charset=utf-8" GET https://dashkiosk.phares.duckdns.org/api/group Accept: application/json + HTTP 200 [Asserts] header "Content-Type" == "application/json; charset=utf-8" @@ -20,6 +20,7 @@ header "Content-Type" == "application/json; charset=utf-8" PUT https://dashkiosk.phares.duckdns.org/api/display/5NRH58/group/2 Accept: application/json + HTTP 200 [Asserts] header "Content-Type" == "application/json; charset=utf-8" @@ -28,6 +29,7 @@ header "Content-Type" == "application/json; charset=utf-8" PUT https://dashkiosk.phares.duckdns.org/api/display/5NRH58/group/1 Accept: application/json + HTTP 200 [Asserts] header "Content-Type" == "application/json; charset=utf-8" diff --git a/.vscode/settings.json b/.vscode/settings.json index 0b34175..aeaec99 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,4 +1,11 @@ { + "files.associations": { + "*.ffs_gui": "xml", + "*.hurl": "http", + "*.org": "ini", + "*.net": "ini", + "default": "ini" + }, "cSpell.words": [ "gitea", "Immich", diff --git a/index.html b/index.html index 8087572..e27944e 100644 --- a/index.html +++ b/index.html @@ -11,11 +11,54 @@ +
+
+ + + + + + + +
+ + +
+ + +
+
+ + +
+
+ + + +
+ +
-

Slideshow

-

Slideshow (Last)

-

Slideshow (Time)

-

Slideshow (Last-List)

+

Slideshow

+

Slideshow (Last)

+

Slideshow (Time)

+

Slideshow (Last-List)

+

Slideshow (Fixed-Date [09-07])

+

Slideshow (Image-Interval [5s])

+

Slideshow (Image-Interval [9s])

+

Slideshow (Image-Interval [15s])

diff --git a/slideshow/css/index.css b/slideshow/css/index.css index ea388f3..088433d 100644 --- a/slideshow/css/index.css +++ b/slideshow/css/index.css @@ -2,6 +2,11 @@ body { background-color: #191717; } +form { + color: white; + font-size: large; +} + #deviceReady div { top: 0; left: 0; diff --git a/slideshow/index.html b/slideshow/index.html index 1a6530e..50d9f8b 100644 --- a/slideshow/index.html +++ b/slideshow/index.html @@ -21,7 +21,7 @@ - + \ No newline at end of file diff --git a/slideshow/scripts/index.js b/slideshow/scripts/index.js index 7257af4..028e76d 100644 --- a/slideshow/scripts/index.js +++ b/slideshow/scripts/index.js @@ -18,11 +18,8 @@ var _DeviceReadyDiv = typeof document == 'undefined' ? undefined : $('#deviceReady div'); var _TimeElement = typeof document == 'undefined' ? undefined : document.createElement('time'); - function loadData() { - const currentDate = new Date(); - const dd = currentDate.getDate().toString().padStart(2, '0'); - const mm = (new Date().getMonth() + 1).toString().padStart(2, '0'); - const url = _UniformResourceLocator + '/slideshow/' + _DataDirectory + '/' + mm + '-' + dd + '.json?nocache=2025-08-10-15-12'; + function loadData(mm, dd) { + const url = _UniformResourceLocator + '/slideshow/' + _DataDirectory + '/' + mm + '-' + dd + '.json?nocache=2025-09-20-09-42'; console.log(url); fetch(url, { nocache: new Date().getTime() }) .then((res) => res.text()) @@ -47,7 +44,9 @@ if (currentHours === 0) { const currentMinutes = currentDate.getMinutes(); if (currentMinutes === 0) { - loadData(); + const dd = currentDate.getDate().toString().padStart(2, '0'); + const mm = (new Date().getMonth() + 1).toString().padStart(2, '0'); + loadData(mm, dd); } } } @@ -177,7 +176,9 @@ _hasLast = typeof window == 'undefined' ? false : window.location.href.indexOf('last') > 0; _hasList = typeof window == 'undefined' ? false : window.location.href.indexOf('list') > 0; _hasTime = typeof window == 'undefined' ? false : window.location.href.indexOf('time') > 0; - const url = uniformResourceLocator + '/slideshow/index.json?nocache=2025-08-10-15-12'; + const fixedDateSegments = typeof window == 'undefined' ? [] : window.location.href.split('fixed-date='); + const imageIntervalSegments = typeof window == 'undefined' ? [] : window.location.href.split('image-interval='); + const url = uniformResourceLocator + '/slideshow/index.json?nocache=2025-09-20-09-42'; console.log(url); fetch(url, { nocache: new Date().getTime() }) .then((res) => res.text()) @@ -197,10 +198,25 @@ if (_hasLast) { loadLog(); } - loadData(); + if (fixedDateSegments.length === 2) { + const fixedDateSegmentsB = fixedDateSegments[1].split('&')[0].split('-'); + loadData(fixedDateSegmentsB[0], fixedDateSegmentsB[1]); + } + else { + const currentDate = new Date(); + const dd = currentDate.getDate().toString().padStart(2, '0'); + const mm = (new Date().getMonth() + 1).toString().padStart(2, '0'); + loadData(mm, dd); + } if (!_hasList && _DeviceReadyDiv != undefined) { setInterval(onTickJSON, data.JsonInterval); - setInterval(onTickImage, data.ImageInterval); + if (imageIntervalSegments.length === 1) { + setInterval(onTickImage, data.ImageInterval); + } + else { + const imageInterval = imageIntervalSegments[1].split('&')[0]; + setInterval(onTickImage, imageInterval); + } } if (_hasList && _hasLast) { _TickLoadList = setInterval(onTickLoadList, 500); @@ -225,7 +241,7 @@ } function loadLog() { - const url = _UniformResourceLocator + '/log-nginx/access.log?nocache=2025-08-10-15-12'; + const url = _UniformResourceLocator + '/log-nginx/access.log?nocache=2025-09-20-09-42'; fetch(url, { nocache: new Date().getTime() }) .then((res) => res.text()) .then((text) => {