From 7d9056b118173d042c16c208663ad7ed54403298 Mon Sep 17 00:00:00 2001 From: "Hahn Axel (hahn)" <axel.hahn@iml.unibe.ch> Date: Tue, 5 Jul 2022 14:35:56 +0200 Subject: [PATCH] add refresh button --- public_html/javascript/functions.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/public_html/javascript/functions.js b/public_html/javascript/functions.js index a6e97b8..e54ddf8 100644 --- a/public_html/javascript/functions.js +++ b/public_html/javascript/functions.js @@ -19,6 +19,7 @@ const AM_ICONS={ 'connect': '🔌', 'tag': '🏷️', 'delete': '❌', + 'refresh': '🪃' }; const OUT_ID_MAIN='header-section'; const OUT_ID_APPS='app-section'; @@ -186,6 +187,7 @@ function _getAllAppsStatus(aAllData){ +':'+_2digits(oDate.getMinutes()) +':'+_2digits(oDate.getSeconds()) +' (update every '+REFRESHTIME+' sec)' + +'<button onclick="oUbdApps.update(); return false;"> '+AM_ICONS['refresh']+' refresh now </button>' // +'</p>'; // let aAllData=JSON.parse(sData); var appOut=''; @@ -309,6 +311,8 @@ function initInstance(i){ } ); + oUbdTag.render('<h2><span>⏳</span></h2>'); + oUbdApps.render('<h2><span>⏳</span></h2>'); let sInstances=''; for (var j=0; j<AM_INSTANCES.length; j++){ @@ -325,8 +329,10 @@ function initInstance(i){ document.getElementById(OUT_ID_MAIN).innerHTML= sInstances; // fill in initial values ... and update based on given ttl - window.setTimeout("oUbdTag.update();", 50); - window.setTimeout("oUbdApps.update();", 400); + oUbdTag.update(); + oUbdApps.update(); + // window.setTimeout("oUbdTag.update();", 50); + // window.setTimeout("oUbdApps.update();", 40); } -- GitLab