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

Merge branch 'abstract_ubd_class' into 'master'

fix timer

See merge request !2
parents f33a69d4 e1c490ff
No related branches found
No related tags found
1 merge request!2fix timer
......@@ -289,7 +289,7 @@ var oUbdApps=new ubd(
'url': _getUrlWithTags, // remark: this is a function
'header': { "headers": oHeaders },
'renderer': _getAllAppsStatus,
'ttl': 0,
'ttl': REFRESHTIME,
}
);
......@@ -299,8 +299,5 @@ var oUbdApps=new ubd(
oUbdTag.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(){
// clearInterval(this._oTimer);
if(this._iTTL) {
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);
}
},
......@@ -165,9 +165,9 @@ var ubd = function(){
return 0;
}
try{
let response = await fetch(url, self._oHeader);
let response = await fetch(url, this._oHeader);
if (response.ok) {
self._body=await response.json();
this._body=await response.json();
this.render();
} else {
......@@ -183,7 +183,7 @@ var ubd = function(){
+'</div>');
console.error(e);
}
this.resetTimer();
}
// ----------------------------------------------------------------------
......
......@@ -64,7 +64,7 @@ td{vertical-align: top;}
.app .url{font-size: 80%; font-weight: normal; margin-right: 2em;}
.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;}
.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