Automatic refresh after change of settings

routes/api.js
   - check error on return from server

public/javascripts/global.js
   -  reload pages with new values after save at settings

public/javascripts/map.js
   - removed status.loaded=true after call to laodAll

public/javascripts/showcharts.js
   - also load live at loadAll
This commit is contained in:
rxf
2023-04-07 18:09:24 +02:00
parent 22a6b9ab2c
commit abc05f177b
4 changed files with 11 additions and 21 deletions
+2 -3
View File
@@ -13,7 +13,7 @@ let clickedcoords = {}
const colorscale = ['#d53e4f', '#fc8d59', '#fee08b', '#e6f598', '#99d594', '#3288bd', '#808080'];
const dba = [100, 80, 60, 40, 20, 0, -999];
export async function showMap(params, status) {
export async function showMap(params) {
utils.removeTabs()
if(map && map.remove) {
@@ -60,8 +60,7 @@ export async function showMap(params, status) {
bootstrap.Tab.getInstance(triggerEl).show() // Select tab by name
let ok = await showChart(params, 'live', 'dlive')
if (ok) {
loadAll(params)
status.loaded = true
await loadAll(params)
}
map.setView([clickedcoords.lat, clickedcoords.lng]);
})