diff --git a/src/main/resources/static/dashboard/data_manager.js b/src/main/resources/static/dashboard/data_manager.js index 889ac2a..7fe0fe8 100644 --- a/src/main/resources/static/dashboard/data_manager.js +++ b/src/main/resources/static/dashboard/data_manager.js @@ -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 + } }); } diff --git a/src/main/resources/static/dashboard/widgets.js b/src/main/resources/static/dashboard/widgets.js index 85276de..141c645 100644 --- a/src/main/resources/static/dashboard/widgets.js +++ b/src/main/resources/static/dashboard/widgets.js @@ -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);