Skip to content

Commit

Permalink
Added coperStatus and ui refresh on error
Browse files Browse the repository at this point in the history
  • Loading branch information
xsicdt committed Jan 14, 2020
1 parent 2379609 commit 91c6734
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/resources/static/dashboard/data_manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,15 @@ class DataManager {
}).done(function(data) {
dataManager.copperValues = JSON.parse(data);
dataManager.copperStatus='OK';
window.document.body.style='border-top: 1px solid green; margin: 1px'
if (!this.editable) {
dataManager.refreshUI();
}
}).fail(function() {
dataManager.copperStatus='KO';
window.document.body.style='border-top: 10px solid red; margin: 0px'
console.log("ERROR: Copper values /ws/values read failed.");
if (!this.editable) {
dataManager.refreshUI(); // Refresh with old values but with copperStatus KO
}
});
}

Expand Down
1 change: 1 addition & 0 deletions src/main/resources/static/dashboard/widgets.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ class UIWidgetRunnable extends UIWidget {
return {"id":-1,"key":"UNKNOWN","value":"?","timestampFrom":"1980-01-01T00:00:00","timestampTo":"3000-12-31T01:00:00","nbValues":1};
}
var widget = this.widget;
var copperStatus = dataManager.copperStatus;

try {
return eval(expression);
Expand Down

0 comments on commit 91c6734

Please sign in to comment.