@sailingrotevista/rotevista-dash 7.0.8 → 7.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +13 -20
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -45,26 +45,19 @@ module.exports = function (app) {
|
|
|
45
45
|
let futureForecast = null; // Memorizza la previsione futura { timestamp, tws, twd }
|
|
46
46
|
let lastForecast30mSlot = 0; // Orario dell'ultimo blocco orologio scaricato con successo (es. 15:30)
|
|
47
47
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
raw = {};
|
|
62
|
-
windRadarSlots = []; // Reset degli archi storici della bussola
|
|
63
|
-
lastFrozen30mSlot = 0; // Reset del monitor temporale della bussola
|
|
64
|
-
futureForecast = null; // Reset della previsione meteo futura
|
|
65
|
-
lastForecast30mSlot = 0; // Reset del monitor temporale di scaricamento meteo
|
|
66
|
-
|
|
67
|
-
// 2. Registra le rotte API solo la prima volta (Abilitate per CORS remoto)
|
|
48
|
+
/**
|
|
49
|
+
* plugin.start: Inizializza il plugin.
|
|
50
|
+
* Viene chiamato all'avvio e OGNI VOLTA che si salva nella configurazione.
|
|
51
|
+
*/
|
|
52
|
+
plugin.start = function (options) {
|
|
53
|
+
// 1. Aggiorna la configurazione in memoria
|
|
54
|
+
currentConfig = options;
|
|
55
|
+
app.debug(`${plugin.name} started/updated with new options`);
|
|
56
|
+
|
|
57
|
+
// Rimosso il reset distruttivo per garantire la conservazione dei dati in RAM
|
|
58
|
+
// durante il salvataggio dei parametri o il cambio delle calibrazioni delle scale.
|
|
59
|
+
|
|
60
|
+
// 2. Registra le rotte API solo la prima volta (Abilitate per CORS remoto)
|
|
68
61
|
if (!routeRegistered) {
|
|
69
62
|
app.get('/rotevista-config', (req, res) => {
|
|
70
63
|
res.header("Access-Control-Allow-Origin", "*"); // Sblocca la Dashboard locale su Mac
|