Form
This commit is contained in:
@ -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) => {
|
||||
|
Reference in New Issue
Block a user