Form
This commit is contained in:
6
.vscode/dashkiosk.hurl
vendored
6
.vscode/dashkiosk.hurl
vendored
@ -1,9 +1,8 @@
|
|||||||
# "C:\Program Files\hurl\hurl.exe" basic.hurl
|
|
||||||
|
|
||||||
###
|
###
|
||||||
|
|
||||||
GET https://dashkiosk.phares.duckdns.org/api/display
|
GET https://dashkiosk.phares.duckdns.org/api/display
|
||||||
Accept: application/json
|
Accept: application/json
|
||||||
|
|
||||||
HTTP 200
|
HTTP 200
|
||||||
[Asserts]
|
[Asserts]
|
||||||
header "Content-Type" == "application/json; charset=utf-8"
|
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
|
GET https://dashkiosk.phares.duckdns.org/api/group
|
||||||
Accept: application/json
|
Accept: application/json
|
||||||
|
|
||||||
HTTP 200
|
HTTP 200
|
||||||
[Asserts]
|
[Asserts]
|
||||||
header "Content-Type" == "application/json; charset=utf-8"
|
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
|
PUT https://dashkiosk.phares.duckdns.org/api/display/5NRH58/group/2
|
||||||
Accept: application/json
|
Accept: application/json
|
||||||
|
|
||||||
HTTP 200
|
HTTP 200
|
||||||
[Asserts]
|
[Asserts]
|
||||||
header "Content-Type" == "application/json; charset=utf-8"
|
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
|
PUT https://dashkiosk.phares.duckdns.org/api/display/5NRH58/group/1
|
||||||
Accept: application/json
|
Accept: application/json
|
||||||
|
|
||||||
HTTP 200
|
HTTP 200
|
||||||
[Asserts]
|
[Asserts]
|
||||||
header "Content-Type" == "application/json; charset=utf-8"
|
header "Content-Type" == "application/json; charset=utf-8"
|
||||||
|
7
.vscode/settings.json
vendored
7
.vscode/settings.json
vendored
@ -1,4 +1,11 @@
|
|||||||
{
|
{
|
||||||
|
"files.associations": {
|
||||||
|
"*.ffs_gui": "xml",
|
||||||
|
"*.hurl": "http",
|
||||||
|
"*.org": "ini",
|
||||||
|
"*.net": "ini",
|
||||||
|
"default": "ini"
|
||||||
|
},
|
||||||
"cSpell.words": [
|
"cSpell.words": [
|
||||||
"gitea",
|
"gitea",
|
||||||
"Immich",
|
"Immich",
|
||||||
|
51
index.html
51
index.html
@ -11,11 +11,54 @@
|
|||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
<form action="slideshow/index.html" method="get">
|
||||||
|
<div>
|
||||||
|
<label for="view">View</label>
|
||||||
|
<input type="radio" id="view-0" name="view" value="normal" required>
|
||||||
|
<label for="view-0">Normal</label>
|
||||||
|
<input type="radio" id="view-1" name="view" value="last" required>
|
||||||
|
<label for="view-1">Last</label>
|
||||||
|
<input type="radio" id="view-2" name="view" value="list" required>
|
||||||
|
<label for="view-2">List</label>
|
||||||
|
</div>
|
||||||
|
<!--
|
||||||
|
<div>
|
||||||
|
<label for="fixed-date">Use</label>
|
||||||
|
<input type="checkbox" id="fixed-date-0" name="fixed-date" value="option1">
|
||||||
|
<label for="fixed-date-0">Fixed Date</label>
|
||||||
|
</div>
|
||||||
|
-->
|
||||||
|
<!--
|
||||||
|
<div>
|
||||||
|
<label for="override-time-interval">Use</label>
|
||||||
|
<input type="checkbox" id="override-time-interval-0" name="override-time-interval" value="option1">
|
||||||
|
<label for="override-time-interval-0">Override Time Interval</label>
|
||||||
|
</div>
|
||||||
|
-->
|
||||||
|
<div>
|
||||||
|
<label for="fixed-date">Date (MM-dd)</label>
|
||||||
|
<input type="text" id="fixed-date" name="fixed-date" placeholder="09-07" required minlength="5" maxlength="5">
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label for="image-interval">Image Interval</label>
|
||||||
|
<input type="number" id="image-interval" name="image-interval" placeholder="15123" required min="1123" max="60123">
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label for="show">Show</label>
|
||||||
|
<input type="checkbox" id="show-0" name="show" value="time">
|
||||||
|
<label for="show-0">Time</label>
|
||||||
|
</div>
|
||||||
|
<button type="submit">Submit</button>
|
||||||
|
</form>
|
||||||
<div id="deviceReady">
|
<div id="deviceReady">
|
||||||
<p><h1><a href='slideshow/index.html?nocache=2025-08-10-15-12'>Slideshow</a></h1></p>
|
<p><h1><a href='slideshow/index.html?nocache=2025-09-20-09-42'>Slideshow</a></h1></p>
|
||||||
<p><h1><a href='slideshow/index.html?a=last&nocache=2025-08-10-15-12'>Slideshow (Last)</a></h1></p>
|
<p><h1><a href='slideshow/index.html?a=last&nocache=2025-09-20-09-42'>Slideshow (Last)</a></h1></p>
|
||||||
<p><h1><a href='slideshow/index.html?a=time&nocache=2025-08-10-15-12'>Slideshow (Time)</a></h1></p>
|
<p><h1><a href='slideshow/index.html?a=time&nocache=2025-09-20-09-42'>Slideshow (Time)</a></h1></p>
|
||||||
<p><h1><a href='slideshow/index.html?a=last-list&nocache=2025-08-10-15-12'>Slideshow (Last-List)</a></h1></p>
|
<p><h1><a href='slideshow/index.html?a=last-list&nocache=2025-09-20-09-42'>Slideshow (Last-List)</a></h1></p>
|
||||||
|
<p><h1><a href='slideshow/index.html?fixed-date=09-07&nocache=2025-09-20-09-42'>Slideshow (Fixed-Date [09-07])</a></h1></p>
|
||||||
|
<p><h1><a href='slideshow/index.html?image-interval=5123&nocache=2025-09-20-09-42'>Slideshow (Image-Interval [5s])</a></h1></p>
|
||||||
|
<p><h1><a href='slideshow/index.html?image-interval=9123&nocache=2025-09-20-09-42'>Slideshow (Image-Interval [9s])</a></h1></p>
|
||||||
|
<p><h1><a href='slideshow/index.html?image-interval=15123&nocache=2025-09-20-09-42'>Slideshow (Image-Interval [15s])</a></h1></p>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
@ -2,6 +2,11 @@ body {
|
|||||||
background-color: #191717;
|
background-color: #191717;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
form {
|
||||||
|
color: white;
|
||||||
|
font-size: large;
|
||||||
|
}
|
||||||
|
|
||||||
#deviceReady div {
|
#deviceReady div {
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
<script src="scripts/jquery-1.9.1.min.js"></script>
|
<script src="scripts/jquery-1.9.1.min.js"></script>
|
||||||
<script src="scripts/bootstrap.min.js"></script>
|
<script src="scripts/bootstrap.min.js"></script>
|
||||||
<script src="scripts/jquery.bgswitcher.js"></script>
|
<script src="scripts/jquery.bgswitcher.js"></script>
|
||||||
<script type="text/javascript" src="scripts/index.js?nocache=2025-08-10-15-12"></script>
|
<script type="text/javascript" src="scripts/index.js?nocache=2025-09-20-09-42"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
@ -18,11 +18,8 @@
|
|||||||
var _DeviceReadyDiv = typeof document == 'undefined' ? undefined : $('#deviceReady div');
|
var _DeviceReadyDiv = typeof document == 'undefined' ? undefined : $('#deviceReady div');
|
||||||
var _TimeElement = typeof document == 'undefined' ? undefined : document.createElement('time');
|
var _TimeElement = typeof document == 'undefined' ? undefined : document.createElement('time');
|
||||||
|
|
||||||
function loadData() {
|
function loadData(mm, dd) {
|
||||||
const currentDate = new Date();
|
const url = _UniformResourceLocator + '/slideshow/' + _DataDirectory + '/' + mm + '-' + dd + '.json?nocache=2025-09-20-09-42';
|
||||||
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';
|
|
||||||
console.log(url);
|
console.log(url);
|
||||||
fetch(url, { nocache: new Date().getTime() })
|
fetch(url, { nocache: new Date().getTime() })
|
||||||
.then((res) => res.text())
|
.then((res) => res.text())
|
||||||
@ -47,7 +44,9 @@
|
|||||||
if (currentHours === 0) {
|
if (currentHours === 0) {
|
||||||
const currentMinutes = currentDate.getMinutes();
|
const currentMinutes = currentDate.getMinutes();
|
||||||
if (currentMinutes === 0) {
|
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;
|
_hasLast = typeof window == 'undefined' ? false : window.location.href.indexOf('last') > 0;
|
||||||
_hasList = typeof window == 'undefined' ? false : window.location.href.indexOf('list') > 0;
|
_hasList = typeof window == 'undefined' ? false : window.location.href.indexOf('list') > 0;
|
||||||
_hasTime = typeof window == 'undefined' ? false : window.location.href.indexOf('time') > 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);
|
console.log(url);
|
||||||
fetch(url, { nocache: new Date().getTime() })
|
fetch(url, { nocache: new Date().getTime() })
|
||||||
.then((res) => res.text())
|
.then((res) => res.text())
|
||||||
@ -197,10 +198,25 @@
|
|||||||
if (_hasLast) {
|
if (_hasLast) {
|
||||||
loadLog();
|
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) {
|
if (!_hasList && _DeviceReadyDiv != undefined) {
|
||||||
setInterval(onTickJSON, data.JsonInterval);
|
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) {
|
if (_hasList && _hasLast) {
|
||||||
_TickLoadList = setInterval(onTickLoadList, 500);
|
_TickLoadList = setInterval(onTickLoadList, 500);
|
||||||
@ -225,7 +241,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function loadLog() {
|
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() })
|
fetch(url, { nocache: new Date().getTime() })
|
||||||
.then((res) => res.text())
|
.then((res) => res.text())
|
||||||
.then((text) => {
|
.then((text) => {
|
||||||
|
Reference in New Issue
Block a user