@sailingrotevista/rotevista-dash 1.0.17 → 1.0.18
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/package.json +1 -1
- package/test.html +71 -0
package/package.json
CHANGED
package/test.html
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
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>
|
|
71
|
+
---Fine Codice ---
|