@sailingrotevista/rotevista-dash 7.0.38 → 7.0.40
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/app.js +8 -14
- package/charts.js +1 -17
- package/gauge.js +19 -19
- package/package.json +1 -1
- package/utils.js +7 -3
- package/weather-radar.js +5 -3
- package/debug_sample_radar.html +0 -887
- package/debug_signalk_connection.html +0 -70
- package/debug_weather_radar.html +0 -233
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="it">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8">
|
|
5
|
-
<title>SignalK Config Scanner</title>
|
|
6
|
-
<style>
|
|
7
|
-
body { background: #121212; color: #fff; font-family: monospace; padding: 20px; }
|
|
8
|
-
h1 { color: #2ecc71; }
|
|
9
|
-
.log-entry { margin-bottom: 10px; padding: 10px; border-left: 3px solid #444; background: #1e1e1e; }
|
|
10
|
-
.success { border-color: #2ecc71; color: #2ecc71; }
|
|
11
|
-
.error { border-color: #e74c3c; color: #e74c3c; }
|
|
12
|
-
.pending { border-color: #f1c40f; color: #f1c40f; }
|
|
13
|
-
pre { background: #000; padding: 10px; overflow-x: auto; color: #aaa; }
|
|
14
|
-
</style>
|
|
15
|
-
</head>
|
|
16
|
-
<body>
|
|
17
|
-
<h1>SignalK Plugin Configuration Scanner</h1>
|
|
18
|
-
<p>Questo test proverà a trovare l'indirizzo esatto dove SignalK salva le tue impostazioni.</p>
|
|
19
|
-
<button id="scan-btn" style="padding: 10px 20px; cursor:pointer;">INIZIA SCANSIONE</button>
|
|
20
|
-
<div id="results" style="margin-top: 20px;"></div>
|
|
21
|
-
|
|
22
|
-
<script>
|
|
23
|
-
const results = document.getElementById('results');
|
|
24
|
-
const btn = document.getElementById('scan-btn');
|
|
25
|
-
|
|
26
|
-
const urlsToTest = [
|
|
27
|
-
'/plugins/rotevista-dash/settings',
|
|
28
|
-
'/plugins/@sailingrotevista%2frotevista-dash/settings',
|
|
29
|
-
'/signalk/v1/api/plugins/rotevista-dash/settings',
|
|
30
|
-
'/signalk/v1/api/plugins/@sailingrotevista%2frotevista-dash/settings',
|
|
31
|
-
'/signalk/v1/applicationData/user/rotevista-dash/1.0/settings'
|
|
32
|
-
];
|
|
33
|
-
|
|
34
|
-
function log(msg, type = 'pending', data = null) {
|
|
35
|
-
const div = document.createElement('div');
|
|
36
|
-
div.className = `log-entry ${type}`;
|
|
37
|
-
div.innerHTML = `<strong>[TEST]</strong> ${msg}`;
|
|
38
|
-
if (data) {
|
|
39
|
-
const pre = document.createElement('pre');
|
|
40
|
-
pre.innerText = JSON.stringify(data, null, 2);
|
|
41
|
-
div.appendChild(pre);
|
|
42
|
-
}
|
|
43
|
-
results.appendChild(div);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
async function startScan() {
|
|
47
|
-
results.innerHTML = '';
|
|
48
|
-
log("Inizio scansione percorsi...");
|
|
49
|
-
|
|
50
|
-
for (let url of urlsToTest) {
|
|
51
|
-
log(`Provo URL: ${url}...`);
|
|
52
|
-
try {
|
|
53
|
-
const response = await fetch(url);
|
|
54
|
-
if (response.ok) {
|
|
55
|
-
const data = await response.json();
|
|
56
|
-
log(`TROVATO! Risposta OK da: ${url}`, 'success', data);
|
|
57
|
-
} else {
|
|
58
|
-
log(`FALLITO (${response.status}) su: ${url}`, 'error');
|
|
59
|
-
}
|
|
60
|
-
} catch (e) {
|
|
61
|
-
log(`ERRORE DI RETE su: ${url}`, 'error');
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
log("Scansione terminata.");
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
btn.onclick = startScan;
|
|
68
|
-
</script>
|
|
69
|
-
</body>
|
|
70
|
-
</html>
|
package/debug_weather_radar.html
DELETED
|
@@ -1,233 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
<!DOCTYPE html>
|
|
3
|
-
<html lang="it">
|
|
4
|
-
<head>
|
|
5
|
-
<meta charset="UTF-8">
|
|
6
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
|
-
<title>Signal K Wind Radar - Server RAM Diagnostic Panel</title>
|
|
8
|
-
<style>
|
|
9
|
-
body {
|
|
10
|
-
background-color: #0c0c0c;
|
|
11
|
-
color: #00ff66;
|
|
12
|
-
font-family: 'Courier New', Courier, monospace;
|
|
13
|
-
padding: 20px;
|
|
14
|
-
margin: 0;
|
|
15
|
-
box-sizing: border-box;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
h1 {
|
|
19
|
-
color: #ffffff;
|
|
20
|
-
font-size: 1.4rem;
|
|
21
|
-
border-bottom: 2px solid #00ff66;
|
|
22
|
-
padding-bottom: 10px;
|
|
23
|
-
margin-top: 0;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.controls {
|
|
27
|
-
background: #111;
|
|
28
|
-
border: 1px solid #333;
|
|
29
|
-
padding: 15px;
|
|
30
|
-
border-radius: 8px;
|
|
31
|
-
margin-bottom: 20px;
|
|
32
|
-
display: flex;
|
|
33
|
-
flex-wrap: wrap;
|
|
34
|
-
gap: 15px;
|
|
35
|
-
align-items: center;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
input[type="text"] {
|
|
39
|
-
background: #000;
|
|
40
|
-
color: #00ff66;
|
|
41
|
-
border: 1px solid #00ff66;
|
|
42
|
-
padding: 8px 12px;
|
|
43
|
-
font-family: monospace;
|
|
44
|
-
border-radius: 4px;
|
|
45
|
-
width: 250px;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
button {
|
|
49
|
-
background: #00ff66;
|
|
50
|
-
color: #000000;
|
|
51
|
-
border: none;
|
|
52
|
-
padding: 8px 15px;
|
|
53
|
-
font-weight: bold;
|
|
54
|
-
font-family: monospace;
|
|
55
|
-
cursor: pointer;
|
|
56
|
-
border-radius: 4px;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
button:hover {
|
|
60
|
-
background: #ffffff;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.status-box {
|
|
64
|
-
font-size: 13px;
|
|
65
|
-
line-height: 1.5;
|
|
66
|
-
margin-bottom: 20px;
|
|
67
|
-
padding: 15px;
|
|
68
|
-
background: #141414;
|
|
69
|
-
border: 1px solid #222;
|
|
70
|
-
border-radius: 8px;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
.grid {
|
|
74
|
-
display: grid;
|
|
75
|
-
grid-template-columns: repeat(auto-fit, minmax(45%, 1fr));
|
|
76
|
-
gap: 20px;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.panel {
|
|
80
|
-
background: #111;
|
|
81
|
-
border: 1px solid #333;
|
|
82
|
-
border-radius: 8px;
|
|
83
|
-
padding: 15px;
|
|
84
|
-
box-sizing: border-box;
|
|
85
|
-
display: flex;
|
|
86
|
-
flex-direction: column;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
.panel-title {
|
|
90
|
-
color: #ffffff;
|
|
91
|
-
font-weight: bold;
|
|
92
|
-
font-size: 1.1rem;
|
|
93
|
-
margin-bottom: 10px;
|
|
94
|
-
border-bottom: 1px solid #222;
|
|
95
|
-
padding-bottom: 5px;
|
|
96
|
-
text-transform: uppercase;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
pre {
|
|
100
|
-
background: #000000;
|
|
101
|
-
border: 1px solid #222;
|
|
102
|
-
padding: 10px;
|
|
103
|
-
border-radius: 4px;
|
|
104
|
-
overflow: auto;
|
|
105
|
-
max-height: 400px;
|
|
106
|
-
font-size: 11px;
|
|
107
|
-
color: #00ff66;
|
|
108
|
-
margin: 0;
|
|
109
|
-
box-sizing: border-box;
|
|
110
|
-
flex-grow: 1;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
.success { color: #00ff66; }
|
|
114
|
-
.danger { color: #ff3333; }
|
|
115
|
-
.warning { color: #ffcc00; }
|
|
116
|
-
</style>
|
|
117
|
-
</head>
|
|
118
|
-
<body>
|
|
119
|
-
|
|
120
|
-
<h1>Signal K Wind Radar - Server RAM Diagnostic Panel (v6.0)</h1>
|
|
121
|
-
|
|
122
|
-
<!-- PANNELLO DI CONTROLLO IP -->
|
|
123
|
-
<div class="controls">
|
|
124
|
-
<label>Indirizzo IP Server SK:</label>
|
|
125
|
-
<input type="text" id="server-ip" value="192.168.111.240:3000">
|
|
126
|
-
<button onclick="runManualDiagnostic()">Esegui Scansione Ora</button>
|
|
127
|
-
<span id="diagnostic-running" style="display: none; color: #ffcc00;">SCANSIONE IN CORSO...</span>
|
|
128
|
-
</div>
|
|
129
|
-
|
|
130
|
-
<!-- STATO DELLE RISPOSTE DEL SERVER -->
|
|
131
|
-
<div class="status-box">
|
|
132
|
-
<div style="font-weight: bold; font-size: 15px; margin-bottom: 8px; color: #fff;">Sintesi Connessione REST:</div>
|
|
133
|
-
<div>• Endpoint Configurazione (/rotevista-config): <span id="status-config" class="warning">IN ATTESA...</span></div>
|
|
134
|
-
<div>• Endpoint Storico RAM (/rotevista-history): <span id="status-history" class="warning">IN ATTESA...</span></div>
|
|
135
|
-
<div style="margin-top: 10px; border-top: 1px dashed #222; padding-top: 10px;">
|
|
136
|
-
• Picchi Vento in RAM (histories.tws): <span id="stat-tws" class="warning">--</span> |
|
|
137
|
-
• Direzioni Vento in RAM (histories.twd): <span id="stat-twd" class="warning">--</span> |
|
|
138
|
-
• Archi Bussola in RAM (windRadarSlots): <span id="stat-slots" class="warning">--</span>
|
|
139
|
-
</div>
|
|
140
|
-
</div>
|
|
141
|
-
|
|
142
|
-
<!-- GRIGLIA DUMP MEMORIA GREZZA -->
|
|
143
|
-
<div class="grid">
|
|
144
|
-
|
|
145
|
-
<!-- PANNELLO SINISTRO: DUMP CONFIG -->
|
|
146
|
-
<div class="panel">
|
|
147
|
-
<div class="panel-title">Raw Config Dump (/rotevista-config)</div>
|
|
148
|
-
<pre id="dump-config">In attesa di scansione...</pre>
|
|
149
|
-
</div>
|
|
150
|
-
|
|
151
|
-
<!-- PANNELLO DESTRO: DUMP COSTRUZIONE STORICO -->
|
|
152
|
-
<div class="panel">
|
|
153
|
-
<div class="panel-title">Raw History & Radar Dump (/rotevista-history)</div>
|
|
154
|
-
<pre id="dump-history">In attesa di scansione...</pre>
|
|
155
|
-
</div>
|
|
156
|
-
|
|
157
|
-
</div>
|
|
158
|
-
|
|
159
|
-
<script>
|
|
160
|
-
// Estrapola l'indirizzo dinamico dall'URL della barra indirizzi se caricato dal server
|
|
161
|
-
window.onload = function() {
|
|
162
|
-
let addr = window.location.host || "192.168.111.240:3000";
|
|
163
|
-
document.getElementById('server-ip').value = addr;
|
|
164
|
-
runManualDiagnostic();
|
|
165
|
-
// Esegue un poll diagnostico automatico ogni 5 secondi
|
|
166
|
-
setInterval(runManualDiagnostic, 5000);
|
|
167
|
-
};
|
|
168
|
-
|
|
169
|
-
function getTargetUrl(path) {
|
|
170
|
-
const ip = document.getElementById('server-ip').value;
|
|
171
|
-
return `http://${ip}${path}`;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
async function runManualDiagnostic() {
|
|
175
|
-
document.getElementById('diagnostic-running').style.display = 'inline';
|
|
176
|
-
|
|
177
|
-
const configPre = document.getElementById('dump-config');
|
|
178
|
-
const historyPre = document.getElementById('dump-history');
|
|
179
|
-
|
|
180
|
-
const statusConfig = document.getElementById('status-config');
|
|
181
|
-
const statusHistory = document.getElementById('status-history');
|
|
182
|
-
|
|
183
|
-
// 1. SCANSIONE /rotevista-config
|
|
184
|
-
try {
|
|
185
|
-
const resConfig = await fetch(getTargetUrl('/rotevista-config'));
|
|
186
|
-
if (resConfig.ok) {
|
|
187
|
-
const data = await resConfig.json();
|
|
188
|
-
configPre.innerText = JSON.stringify(data, null, 2);
|
|
189
|
-
statusConfig.innerHTML = `<span class="success">RISPOSTA OK (200) - Configurazione Caricata</span>`;
|
|
190
|
-
} else {
|
|
191
|
-
statusConfig.innerHTML = `<span class="danger">ERRORE SERVER (${resConfig.status})</span>`;
|
|
192
|
-
configPre.innerText = "Il server ha risposto con un codice di errore.";
|
|
193
|
-
}
|
|
194
|
-
} catch (err) {
|
|
195
|
-
statusConfig.innerHTML = `<span class="danger">ERRORE DI RETE (Impossibile raggiungere il server)</span>`;
|
|
196
|
-
configPre.innerText = `Errore di connessione:\n${err.message}\n\nConsiglio:\n1. Verifica che l'IP del Cerbo sia corretto.\n2. Verifica che il tablet sia connesso alla rete Wi-Fi della barca.`;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
// 2. SCANSIONE /rotevista-history
|
|
200
|
-
try {
|
|
201
|
-
const resHistory = await fetch(getTargetUrl('/rotevista-history'));
|
|
202
|
-
if (resHistory.ok) {
|
|
203
|
-
const data = await resHistory.json();
|
|
204
|
-
historyPre.innerText = JSON.stringify(data, null, 2);
|
|
205
|
-
statusHistory.innerHTML = `<span class="success">RISPOSTA OK (200) - Storico Caricato</span>`;
|
|
206
|
-
|
|
207
|
-
// Mostra statistiche dei record in RAM sul server
|
|
208
|
-
const countTws = data.tws ? data.tws.length : 0;
|
|
209
|
-
const countTwd = data.twd ? data.twd.length : 0;
|
|
210
|
-
const countSlots = data.windRadarSlots ? data.windRadarSlots.length : 0;
|
|
211
|
-
|
|
212
|
-
document.getElementById('stat-tws').innerHTML = `<span class="success">${countTws} punti</span>`;
|
|
213
|
-
document.getElementById('stat-twd').innerHTML = `<span class="success">${countTwd} punti</span>`;
|
|
214
|
-
document.getElementById('stat-slots').innerHTML = `<span class="success">${countSlots}/12 congelati</span>`;
|
|
215
|
-
|
|
216
|
-
} else {
|
|
217
|
-
statusHistory.innerHTML = `<span class="danger">ERRORE SERVER (${resHistory.status})</span>`;
|
|
218
|
-
historyPre.innerText = "Il server ha risposto con un codice di errore.";
|
|
219
|
-
}
|
|
220
|
-
} catch (err) {
|
|
221
|
-
statusHistory.innerHTML = `<span class="danger">ERRORE DI RETE (Impossibile raggiungere lo storico)</span>`;
|
|
222
|
-
historyPre.innerText = `Errore di connessione:\n${err.message}`;
|
|
223
|
-
|
|
224
|
-
document.getElementById('stat-tws').innerHTML = `<span class="danger">--</span>`;
|
|
225
|
-
document.getElementById('stat-twd').innerHTML = `<span class="danger">--</span>`;
|
|
226
|
-
document.getElementById('stat-slots').innerHTML = `<span class="danger">--</span>`;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
document.getElementById('diagnostic-running').style.display = 'none';
|
|
230
|
-
}
|
|
231
|
-
</script>
|
|
232
|
-
</body>
|
|
233
|
-
</html>
|