speedandcurrent 2.3.0 → 2.3.2

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "speedandcurrent",
3
- "version": "2.3.0",
3
+ "version": "2.3.2",
4
4
  "description": "A plugin that automatically corrects boat speed and calculates current and leeway using sensor fusion.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -34,11 +34,14 @@
34
34
  "./docs/correctionTable.png",
35
35
  "./docs/STW_estimation.png",
36
36
  "./docs/learning.png"
37
+ ],
38
+ "recommends": [
39
+ "@meri-imperiumi/signalk-autostate"
37
40
  ]
38
41
  },
39
42
  "dependencies": {
40
43
  "kalman-filter": "^2.3.0",
41
- "signalkutilities": "^3.1.0"
44
+ "signalkutilities": "^3.1.1"
42
45
  },
43
46
  "files": [
44
47
  "icon.png",
package/public/app.js CHANGED
@@ -321,12 +321,6 @@ const paramMeta = {
321
321
  };
322
322
 
323
323
  // Settings groups for each UI section
324
- const INPUTS_SETTING_KEYS = [
325
- 'smootherClass',
326
- { key: 'smootherTau', showIf: cfg => cfg.smootherClass === 'ExponentialSmoother' },
327
- { key: 'smootherTimeSpan', showIf: cfg => (cfg.smootherClass || 'MovingAverageSmoother') === 'MovingAverageSmoother' },
328
- { key: 'smootherSteadyState', showIf: cfg => cfg.smootherClass === 'KalmanSmoother' },
329
- ];
330
324
  const ESTIMATION_SETTING_KEYS = ['sogFallback'];
331
325
  const LEARNING_SETTING_KEYS = ['stability', 'suspendLearningOnNavigationState', 'assumeCurrent', 'showStatistics'];
332
326
  const SMOOTHER_SETTING_KEYS = [
@@ -443,7 +437,6 @@ function renderSectionToggles() {
443
437
 
444
438
  function renderSettingsPanel() {
445
439
  if (!config) return;
446
- renderSettingsRows('inputs-settings-table', INPUTS_SETTING_KEYS);
447
440
  renderSettingsRows('estimation-settings-table', ESTIMATION_SETTING_KEYS);
448
441
  renderSettingsRows('smoother-settings-table', SMOOTHER_SETTING_KEYS);
449
442
  renderSettingsRows('learning-settings-table', LEARNING_SETTING_KEYS);
package/public/index.html CHANGED
@@ -13,22 +13,31 @@
13
13
  el.href = href;
14
14
  document.head.appendChild(el);
15
15
  };
16
+ let manifestFailure = 'manifest contained no CSS assets';
16
17
  try {
17
18
  const res = await fetch('/admin/.vite/manifest.json');
18
19
  if (res.ok) {
19
20
  const manifest = await res.json();
20
- let found = false;
21
+ const stylesheets = new Set();
21
22
  for (const entry of Object.values(manifest)) {
22
- if (!entry.isEntry) continue;
23
- for (const css of entry.css ?? []) {
24
- appendStylesheet('/admin/' + css);
25
- found = true;
23
+ if (entry.file?.endsWith('.css')) {
24
+ stylesheets.add(entry.file);
26
25
  }
26
+ if (entry.isEntry) {
27
+ for (const css of entry.css ?? []) {
28
+ stylesheets.add(css);
29
+ }
30
+ }
31
+ }
32
+ if (stylesheets.size > 0) {
33
+ for (const css of stylesheets) appendStylesheet('/admin/' + css);
34
+ return;
27
35
  }
28
- if (found) return;
36
+ } else {
37
+ manifestFailure = `manifest request returned ${res.status}`;
29
38
  }
30
39
  } catch (e) {
31
- // fall through to legacy scrape
40
+ manifestFailure = `manifest request failed: ${e.message}`;
32
41
  }
33
42
  try {
34
43
  const res = await fetch('/');
@@ -37,9 +46,11 @@
37
46
  const link = doc.querySelector('link[rel="stylesheet"]');
38
47
  if (link) {
39
48
  appendStylesheet(new URL(link.getAttribute('href'), res.url).href);
49
+ return;
40
50
  }
51
+ console.warn(`[webapp] Could not load SignalK admin stylesheet: ${manifestFailure}; legacy admin page contained no stylesheet link.`);
41
52
  } catch (e) {
42
- console.warn('[webapp] Could not load SignalK admin stylesheet:', e);
53
+ console.warn(`[webapp] Could not load SignalK admin stylesheet: ${manifestFailure}; legacy fallback failed: ${e.message}`);
43
54
  }
44
55
  })();
45
56
  </script>
@@ -91,11 +102,7 @@
91
102
  <div class="card">
92
103
  <div class="card-header fw-bold text-uppercase">Inputs</div>
93
104
  <div class="card-body">
94
- <h6 class="text-uppercase fw-bold text-muted border-bottom pb-1 mb-1 small">Settings</h6>
95
- <table class="table table-sm table-borderless mb-0" id="inputs-settings-table">
96
- <tbody></tbody>
97
- </table>
98
- <h6 class="text-uppercase fw-bold text-muted border-bottom pb-1 mt-3 mb-1 small">Live Values</h6>
105
+ <h6 class="text-uppercase fw-bold text-muted border-bottom pb-1 mb-1 small">Live Values</h6>
99
106
  <div id="inputs-values"></div>
100
107
  <div id="inputs-warnings"></div>
101
108
  </div>