Skip to content
Snippets Groups Projects
Commit e1c490ff authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

fix timer

parent 5e0693ff
No related branches found
No related tags found
1 merge request!2fix timer
...@@ -289,7 +289,7 @@ var oUbdApps=new ubd( ...@@ -289,7 +289,7 @@ var oUbdApps=new ubd(
'url': _getUrlWithTags, // remark: this is a function 'url': _getUrlWithTags, // remark: this is a function
'header': { "headers": oHeaders }, 'header': { "headers": oHeaders },
'renderer': _getAllAppsStatus, 'renderer': _getAllAppsStatus,
'ttl': 0, 'ttl': REFRESHTIME,
} }
); );
...@@ -299,8 +299,5 @@ var oUbdApps=new ubd( ...@@ -299,8 +299,5 @@ var oUbdApps=new ubd(
oUbdTag.update(); oUbdTag.update();
oUbdApps.update(); oUbdApps.update();
// cyclic updates of the app status view
window.setInterval("oUbdApps.update();", REFRESHTIME*1000);
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
\ No newline at end of file
...@@ -147,7 +147,7 @@ var ubd = function(){ ...@@ -147,7 +147,7 @@ var ubd = function(){
// clearInterval(this._oTimer); // clearInterval(this._oTimer);
if(this._iTTL) { if(this._iTTL) {
let self = this; let self = this;
self._oTimer=window.setTimeout(self.update, this._iTTL*1000); self._oTimer=window.setTimeout( function(){ self.update() }, this._iTTL*1000);
// self._oTimer=window.setInterval(self.update, this._iTTL*1000); // self._oTimer=window.setInterval(self.update, this._iTTL*1000);
} }
}, },
...@@ -165,9 +165,9 @@ var ubd = function(){ ...@@ -165,9 +165,9 @@ var ubd = function(){
return 0; return 0;
} }
try{ try{
let response = await fetch(url, self._oHeader); let response = await fetch(url, this._oHeader);
if (response.ok) { if (response.ok) {
self._body=await response.json(); this._body=await response.json();
this.render(); this.render();
} else { } else {
...@@ -183,7 +183,7 @@ var ubd = function(){ ...@@ -183,7 +183,7 @@ var ubd = function(){
+'</div>'); +'</div>');
console.error(e); console.error(e);
} }
this.resetTimer();
} }
// ---------------------------------------------------------------------- // ----------------------------------------------------------------------
......
...@@ -64,7 +64,7 @@ td{vertical-align: top;} ...@@ -64,7 +64,7 @@ td{vertical-align: top;}
.app .url{font-size: 80%; font-weight: normal; margin-right: 2em;} .app .url{font-size: 80%; font-weight: normal; margin-right: 2em;}
.result0{background:#dfd !important; background: linear-gradient(#ded,#beb)!important; color:#383} .result0{background:#dfd !important; background: linear-gradient(#ded,#beb)!important; color:#383}
.result1{background:#eee !important; background: linear-gradient(#eee,#ddd)!important; color:#666;} .result1{background:#eee !important; background: linear-gradient(#ede,#dbd)!important; color:#666;}
.result2{background:#fff8d0 !important; background: linear-gradient(#fff0d0,#ffe0a0)!important; color:#870;} .result2{background:#fff8d0 !important; background: linear-gradient(#fff0d0,#ffe0a0)!important; color:#870;}
.result3{background:#fcd !important; background: linear-gradient(#fcd,#faa)!important; color:#800;} .result3{background:#fcd !important; background: linear-gradient(#fcd,#faa)!important; color:#800;}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment