diff --git a/dashboard/js/api.js b/dashboard/js/api.js index 20b0f1f..eb5c6d0 100644 --- a/dashboard/js/api.js +++ b/dashboard/js/api.js @@ -1,3 +1,14 @@ +// Échappe les valeurs serveur avant injection dans innerHTML +function esc(s) { + if (s == null) return '—'; + return String(s) + .replace(/&/g, '&') + .replace(//g, '>') + .replace(/"/g, '"') + .replace(/'/g, '''); +} + const API = (() => { const BASE = ''; // même origine, proxy Nginx vers le serveur Go diff --git a/dashboard/js/app.js b/dashboard/js/app.js index 1489009..4546ba4 100644 --- a/dashboard/js/app.js +++ b/dashboard/js/app.js @@ -1,6 +1,7 @@ const App = (() => { let _ws = null; let _reconnectDelay = 1000; + let _reconnectTimer = null; let _serverConfig = null; // Tooltip global position:fixed @@ -62,7 +63,8 @@ const App = (() => { }; _ws.onclose = () => { - setTimeout(connectWS, _reconnectDelay); + clearTimeout(_reconnectTimer); + _reconnectTimer = setTimeout(connectWS, _reconnectDelay); _reconnectDelay = Math.min(_reconnectDelay * 2, 30000); }; } diff --git a/dashboard/js/grid.js b/dashboard/js/grid.js index 649f11b..06dcf65 100644 --- a/dashboard/js/grid.js +++ b/dashboard/js/grid.js @@ -61,12 +61,12 @@ const Grid = (() => { `; - return `