@signalk/freeboard-sk 3.2.0-beta.0 → 3.2.0-beta.1
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 +14 -13
- package/plugin/alarms/alarms.js +59 -4
- package/plugin/lib/fetch.js +4 -4
- package/plugin/vitest.config.mjs +11 -0
- package/public/{chunk-RU2QXGZX.js → chunk-24TYZLHO.js} +1 -1
- package/public/{chunk-WXOWBQXR.js → chunk-2M5JDEPT.js} +1 -1
- package/public/chunk-3FOJW6X2.js +1 -0
- package/public/{chunk-PSRS6NXJ.js → chunk-4WQCRQTL.js} +1 -1
- package/public/{chunk-2RJKLB5L.js → chunk-5HE5CF34.js} +53 -53
- package/public/{chunk-7Z4ZZM32.js → chunk-ABEPBSQB.js} +1 -1
- package/public/chunk-BL2HZIKU.js +1 -0
- package/public/chunk-CJYO3MRU.js +1 -0
- package/public/{chunk-SOVFTS2B.js → chunk-FC62PK2U.js} +1 -1
- package/public/{chunk-7UXFP343.js → chunk-FMYAA5JW.js} +1 -1
- package/public/chunk-G4WOTWTM.js +1 -0
- package/public/chunk-K2CIRFN7.js +1709 -0
- package/public/{chunk-TVVJJZA5.js → chunk-K7PZKJJ7.js} +1 -1
- package/public/{chunk-Y5XX3LUA.js → chunk-KNJHWYQ3.js} +1 -1
- package/public/{chunk-JOTL4UUV.js → chunk-LCD5GM7L.js} +1 -1
- package/public/{chunk-OU4PGUT3.js → chunk-MFLH4RMF.js} +1 -1
- package/public/{chunk-TGPAYIRR.js → chunk-OGLYW4PJ.js} +1 -1
- package/public/{chunk-TEKC7VXV.js → chunk-RARRAKK5.js} +1 -1
- package/public/{chunk-PGHE7FOF.js → chunk-T5UYZVNA.js} +1 -1
- package/public/{chunk-NDDO5DKA.js → chunk-TTKT5FKY.js} +1 -1
- package/public/{chunk-VSWAOYSI.js → chunk-XTQIZ74A.js} +1 -1
- package/public/{chunk-L3MJOGJ2.js → chunk-Y35QBGKJ.js} +1 -1
- package/public/{chunk-TVMAD5AZ.js → chunk-YYA2RIPK.js} +1 -1
- package/public/index.html +1 -1
- package/public/{main-WYFYYBYG.js → main-IJVM3TNP.js} +6 -6
- package/public/polyfills-LVNOU2XZ.js +2 -0
- package/public/{worker-XSMNG74L.js → worker-CENPLZN6.js} +1 -1
- package/public/{worker-2AV5I4KP.js → worker-RRU2OVZW.js} +1 -1
- package/public/chunk-C6Q5GPY7.js +0 -1
- package/public/chunk-DDECKPFC.js +0 -1
- package/public/chunk-HB342AB6.js +0 -1
- package/public/chunk-JH5KSRZ6.js +0 -1709
- package/public/chunk-VYN2OBDD.js +0 -1
- package/public/polyfills-RV3JTMEC.js +0 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@signalk/freeboard-sk",
|
|
3
|
-
"version": "3.2.0-beta.
|
|
3
|
+
"version": "3.2.0-beta.1",
|
|
4
4
|
"description": "Openlayers chart plotter implementation for Signal K",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"signalk-webapp",
|
|
@@ -58,6 +58,7 @@
|
|
|
58
58
|
"prepack": "npm run build:all",
|
|
59
59
|
"test:ci": "node scripts/test-ci.mjs",
|
|
60
60
|
"test:tools": "vitest run --config dev-tools/changelog/vitest.config.mjs",
|
|
61
|
+
"test:helper": "vitest run --config helper/vitest.config.mts",
|
|
61
62
|
"version": "node dev-tools/changelog/index.mjs stamp && git add features/changelog.json"
|
|
62
63
|
},
|
|
63
64
|
"author": "AdrianP",
|
|
@@ -82,19 +83,19 @@
|
|
|
82
83
|
"uuid": "^14.0.1"
|
|
83
84
|
},
|
|
84
85
|
"devDependencies": {
|
|
85
|
-
"@angular/animations": "^21.2.
|
|
86
|
-
"@angular/build": "^21.2.
|
|
86
|
+
"@angular/animations": "^21.2.23",
|
|
87
|
+
"@angular/build": "^21.2.24",
|
|
87
88
|
"@angular/cdk": "^21.0.3",
|
|
88
|
-
"@angular/cli": "^21.2.
|
|
89
|
-
"@angular/common": "^21.2.
|
|
90
|
-
"@angular/compiler": "^21.2.
|
|
91
|
-
"@angular/compiler-cli": "^21.2.
|
|
92
|
-
"@angular/core": "^21.2.
|
|
93
|
-
"@angular/forms": "^21.2.
|
|
94
|
-
"@angular/language-service": "^21.2.
|
|
89
|
+
"@angular/cli": "^21.2.24",
|
|
90
|
+
"@angular/common": "^21.2.23",
|
|
91
|
+
"@angular/compiler": "^21.2.23",
|
|
92
|
+
"@angular/compiler-cli": "^21.2.23",
|
|
93
|
+
"@angular/core": "^21.2.23",
|
|
94
|
+
"@angular/forms": "^21.2.23",
|
|
95
|
+
"@angular/language-service": "^21.2.23",
|
|
95
96
|
"@angular/material": "^21.0.3",
|
|
96
|
-
"@angular/platform-browser": "^21.2.
|
|
97
|
-
"@angular/platform-browser-dynamic": "^21.2.
|
|
97
|
+
"@angular/platform-browser": "^21.2.23",
|
|
98
|
+
"@angular/platform-browser-dynamic": "^21.2.23",
|
|
98
99
|
"@eslint/js": "^10.0.1",
|
|
99
100
|
"@kolkov/angular-editor": "^3.0.5",
|
|
100
101
|
"@types/arcgis-rest-api": "^10.4.5",
|
|
@@ -119,7 +120,7 @@
|
|
|
119
120
|
"pmtiles": "^4.4.1",
|
|
120
121
|
"prettier": "^3.6.2",
|
|
121
122
|
"prettier-plugin-organize-attributes": "^1.0.0",
|
|
122
|
-
"proj4": "2.
|
|
123
|
+
"proj4": "2.22.0",
|
|
123
124
|
"remark": "^15.0.1",
|
|
124
125
|
"rxjs": "~7.8.2",
|
|
125
126
|
"semver": "^7.6.0",
|
package/plugin/alarms/alarms.js
CHANGED
|
@@ -126,6 +126,15 @@ let pluginId;
|
|
|
126
126
|
let unsubscribes = [];
|
|
127
127
|
const alarmAreas = new Map();
|
|
128
128
|
const alarmManager = new AreaAlarmManager();
|
|
129
|
+
// Initial region load: the resources provider may register after this plugin
|
|
130
|
+
// starts (slow hardware, many plugins, startup order), so a single fixed
|
|
131
|
+
// delay can miss it and leave on-disk hazard regions unloaded until one is
|
|
132
|
+
// edited (#746). Retry with a doubling delay, giving up after the last one.
|
|
133
|
+
const REGION_LOAD_DELAYS_MS = [5_000, 10_000, 20_000, 40_000, 60_000, 60_000];
|
|
134
|
+
let regionLoadTimer;
|
|
135
|
+
// Cleared by shutdownAlarms() so an attempt already in flight at shutdown
|
|
136
|
+
// cannot reschedule itself from its catch block.
|
|
137
|
+
let regionLoadActive = false;
|
|
129
138
|
const getSelfPathValue = (path) => {
|
|
130
139
|
return server.getSelfPath(path);
|
|
131
140
|
};
|
|
@@ -134,7 +143,8 @@ const initAlarms = (app, id) => {
|
|
|
134
143
|
pluginId = id;
|
|
135
144
|
server.debug(`** initAlarms() **`);
|
|
136
145
|
initAlarmEndpoints();
|
|
137
|
-
|
|
146
|
+
regionLoadActive = true;
|
|
147
|
+
scheduleRegionLoad(0);
|
|
138
148
|
// subscribe to deltas
|
|
139
149
|
const subCommand = {
|
|
140
150
|
context: 'vessels.self',
|
|
@@ -155,6 +165,11 @@ const initAlarms = (app, id) => {
|
|
|
155
165
|
};
|
|
156
166
|
exports.initAlarms = initAlarms;
|
|
157
167
|
const shutdownAlarms = () => {
|
|
168
|
+
regionLoadActive = false;
|
|
169
|
+
if (regionLoadTimer) {
|
|
170
|
+
clearTimeout(regionLoadTimer);
|
|
171
|
+
regionLoadTimer = undefined;
|
|
172
|
+
}
|
|
158
173
|
unsubscribes.forEach((s) => s());
|
|
159
174
|
unsubscribes = [];
|
|
160
175
|
};
|
|
@@ -424,11 +439,51 @@ const fetchRegion = async (id) => {
|
|
|
424
439
|
return reg;
|
|
425
440
|
};
|
|
426
441
|
/**
|
|
427
|
-
*
|
|
442
|
+
* Schedule attempt `attempt` of the initial region load.
|
|
443
|
+
* @param attempt Index into REGION_LOAD_DELAYS_MS
|
|
444
|
+
*/
|
|
445
|
+
const scheduleRegionLoad = (attempt) => {
|
|
446
|
+
if (!regionLoadActive) {
|
|
447
|
+
return;
|
|
448
|
+
}
|
|
449
|
+
regionLoadTimer = setTimeout(() => {
|
|
450
|
+
regionLoadTimer = undefined;
|
|
451
|
+
parseRegionList(attempt);
|
|
452
|
+
}, REGION_LOAD_DELAYS_MS[attempt]);
|
|
453
|
+
};
|
|
454
|
+
/**
|
|
455
|
+
* Fetch list of region resources and parse them to assign alarm area,
|
|
456
|
+
* rescheduling on failure until the retry delays are exhausted.
|
|
457
|
+
* @param attempt Which attempt this is (0-based)
|
|
428
458
|
* @returns void
|
|
429
459
|
*/
|
|
430
|
-
const parseRegionList = async () => {
|
|
431
|
-
|
|
460
|
+
const parseRegionList = async (attempt) => {
|
|
461
|
+
// Called from a fire-and-forget timer, so a rejection here has nothing to
|
|
462
|
+
// catch it and would escape as an unhandled rejection (#732). The usual
|
|
463
|
+
// cause is no provider registered for `regions` — either not yet (retry)
|
|
464
|
+
// or not at all (resources-provider disabled, or `regions` unticked in
|
|
465
|
+
// its config): recoverable, there are simply no region alarm areas to load.
|
|
466
|
+
let regList;
|
|
467
|
+
try {
|
|
468
|
+
regList = await server.resourcesApi.listResources('regions', undefined);
|
|
469
|
+
}
|
|
470
|
+
catch (err) {
|
|
471
|
+
if (!regionLoadActive) {
|
|
472
|
+
return; // plugin stopped while the request was in flight
|
|
473
|
+
}
|
|
474
|
+
const reason = err instanceof Error ? err.message : String(err);
|
|
475
|
+
if (attempt + 1 < REGION_LOAD_DELAYS_MS.length) {
|
|
476
|
+
server.debug(`** region alarm areas not loaded (${reason}), retry ${attempt + 2}/${REGION_LOAD_DELAYS_MS.length} in ${REGION_LOAD_DELAYS_MS[attempt + 1] / 1000}s`);
|
|
477
|
+
scheduleRegionLoad(attempt + 1);
|
|
478
|
+
}
|
|
479
|
+
else {
|
|
480
|
+
console.warn(`Freeboard-SK: unable to load region alarm areas after ${REGION_LOAD_DELAYS_MS.length} attempts: ${reason}`);
|
|
481
|
+
}
|
|
482
|
+
return;
|
|
483
|
+
}
|
|
484
|
+
if (!regionLoadActive) {
|
|
485
|
+
return; // plugin stopped while the request was in flight
|
|
486
|
+
}
|
|
432
487
|
Object.entries(regList).forEach((r) => processRegionUpdate(r[0], r[1]));
|
|
433
488
|
};
|
|
434
489
|
/**
|
package/plugin/lib/fetch.js
CHANGED
|
@@ -40,10 +40,10 @@ exports.fetch = fetch;
|
|
|
40
40
|
const post = (href, data) => {
|
|
41
41
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
42
42
|
const opt = url.parse(href);
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
opt.method = 'POST';
|
|
44
|
+
opt.headers = {
|
|
45
|
+
'Content-Type': 'application/json'
|
|
46
|
+
};
|
|
47
47
|
const req = href.indexOf('https') !== -1 ? https : http;
|
|
48
48
|
return new Promise((resolve, reject) => {
|
|
49
49
|
const postReq = req
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { defineConfig } from 'vitest/config';
|
|
2
|
+
// Standalone config for the helper plugin (the server-side code compiled by
|
|
3
|
+
// `build:helper` into plugin/). It is plain Node, not part of the Angular app,
|
|
4
|
+
// so `ng test` never sees it. Run via `npm run test:helper`.
|
|
5
|
+
export default defineConfig({
|
|
6
|
+
test: {
|
|
7
|
+
root: __dirname,
|
|
8
|
+
include: ['**/*.spec.ts'],
|
|
9
|
+
environment: 'node'
|
|
10
|
+
}
|
|
11
|
+
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as y,d as S,e as k,g as E,k as R,o as B}from"./chunk-
|
|
1
|
+
import{c as y,d as S,e as k,g as E,k as R,o as B}from"./chunk-4WQCRQTL.js";import"./chunk-T5UYZVNA.js";import"./chunk-FMYAA5JW.js";import{Dd as b,Ed as I,Gd as L,Hd as C,Ia as f,Id as w,Ja as u,Jd as P,La as e,Ma as a,R as s,S as g,Td as W,Ua as M,Wa as c,Wd as v,Ya as _,Yd as T,Zd as h,ja as l,lb as o,mb as D,nb as A,oa as r,ob as x,ra as p}from"./chunk-K2CIRFN7.js";import"./chunk-6H3I7D5M.js";var F=(n,i)=>i.extension+"/"+i.widget.id;function O(n,i){if(n&1){let t=M();e(0,"button",4),c("click",function(){let m=s(t).$implicit,j=_();return g(j.dialogRef.close(m))}),e(1,"span",5),o(2),a(),e(3,"span",6),o(4),a()()}if(n&2){let t=i.$implicit;l(2),D(t.widget.title),l(2),x("",t.extensionName," \xB7 ",t.widget.size)}}var N=class n{constructor(i,t){this.dialogRef=i;this.data=t;this.anchorLabel=B[t.anchor]}dialogRef;data;anchorLabel;static \u0275fac=function(t){return new(t||n)(r(b),r(I))};static \u0275cmp=p({type:n,selectors:[["fb-plotterext-add-widget"]],decls:12,vars:1,consts:[["mat-dialog-title","",1,"pe-add-title"],["mat-list-item",""],["align","end"],["mat-button","",3,"click"],["mat-list-item","",3,"click"],["matListItemTitle",""],["matListItemLine",""]],template:function(t,d){t&1&&(e(0,"div",0)(1,"mat-icon"),o(2,"widgets"),a(),e(3,"span"),o(4),a()(),e(5,"mat-dialog-content")(6,"mat-action-list"),f(7,O,5,3,"button",1,F),a()(),e(9,"mat-dialog-actions",2)(10,"button",3),c("click",function(){return d.dialogRef.close()}),o(11,"Cancel"),a()()),t&2&&(l(4),A("Add widget \u2014 ",d.anchorLabel),l(3),u(d.data.candidates))},dependencies:[P,L,w,C,v,W,h,T,R,k,E,S,y],styles:[".pe-add-title[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px}"]})};export{N as PlotterAddWidgetDialog};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as nt}from"./chunk-
|
|
1
|
+
import{a as nt}from"./chunk-OGLYW4PJ.js";import{b as at,i as it,j as ct,n as ot,o as rt}from"./chunk-ABEPBSQB.js";import{Da as K,Dd as j,Ea as O,Ed as N,Fa as z,Gd as Y,Ha as ae,Hc as se,Hd as V,I as De,Ia as ie,Ic as ke,Id as J,Ja as ce,Jc as Ue,Jd as q,K as Ae,Ka as g,Kc as Ge,L as we,La as o,M as X,Ma as c,Mb as je,N as T,Na as _,Nc as _e,Oa as ue,Od as We,P as r,Pa as pe,Qd as Ye,R as E,S,Sc as He,T as Ie,Td as w,U as Te,Ua as $,V as Q,Va as ze,W as Ee,Wa as b,Wb as re,Wc as Xe,Wd as R,Y as le,Ya as B,Yb as A,Yc as Qe,Yd as U,Z as te,Za as P,Zb as Ne,Zd as G,_ as Se,_a as x,_d as Je,aa as Be,ab as L,ae as et,bb as C,c as I,cb as M,da as ne,ga as he,gb as v,gd as Ze,i as Me,ib as D,ja as d,ka as be,kb as Pe,la as Re,lb as s,lc as Ve,mb as oe,md as Ke,nb as h,pc as qe,pe as tt,ra as p,sa as Z,ta as f,td as $e,va as Fe,vd as W,wa as Oe,wb as Le,xc as de}from"./chunk-K2CIRFN7.js";import{a as F}from"./chunk-6H3I7D5M.js";var Mt=["*"],Dt=[[["mat-card-title"],["mat-card-subtitle"],["","mat-card-title",""],["","mat-card-subtitle",""],["","matCardTitle",""],["","matCardSubtitle",""]],[["","mat-card-image",""],["","matCardImage",""],["","mat-card-sm-image",""],["","matCardImageSmall",""],["","mat-card-md-image",""],["","matCardImageMedium",""],["","mat-card-lg-image",""],["","matCardImageLarge",""],["","mat-card-xl-image",""],["","matCardImageXLarge",""]],"*"],At=[`mat-card-title, mat-card-subtitle,
|
|
2
2
|
[mat-card-title], [mat-card-subtitle],
|
|
3
3
|
[matCardTitle], [matCardSubtitle]`,`[mat-card-image], [matCardImage],
|
|
4
4
|
[mat-card-sm-image], [matCardImageSmall],
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{m as a,n as b,o as c,p as d,q as e,r as f}from"./chunk-2M5JDEPT.js";import"./chunk-OGLYW4PJ.js";import"./chunk-ABEPBSQB.js";import"./chunk-K2CIRFN7.js";import"./chunk-6H3I7D5M.js";export{d as AboutDialog,b as AlertDialog,c as ConfirmDialog,e as LoginDialog,f as MessageBarComponent,a as MsgBox};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as xt}from"./chunk-
|
|
1
|
+
import{b as xt}from"./chunk-T5UYZVNA.js";import{a as U}from"./chunk-FMYAA5JW.js";import{$a as S,Da as C,Ea as T,Fa as z,Gb as B,I as V,K as tt,Ka as f,La as l,M as E,Ma as _,Md as gt,N as R,Na as L,Nd as bt,P as c,Pc as dt,Qd as ut,Sd as ft,T as it,U as et,V as nt,Wa as D,Wb as W,Y as Q,Ya as v,Z as H,Za as I,_ as F,_a as r,_d as vt,a as Y,aa as at,ab as G,ac as st,ba as w,bb as d,c as $,cb as h,da as O,gb as M,hd as q,ib as x,id as ht,ja as p,lc as ct,na as ot,nc as rt,pc as lt,ra as g,rc as mt,rd as m,s as J,sa as P,ta as b,va as u,vd as pt,wa as y,wb as A,xc as j,xd as _t}from"./chunk-K2CIRFN7.js";var Ot=(()=>{class i{get vertical(){return this._vertical}set vertical(t){this._vertical=m(t)}_vertical=!1;get inset(){return this._inset}set inset(t){this._inset=m(t)}_inset=!1;static \u0275fac=function(e){return new(e||i)};static \u0275cmp=g({type:i,selectors:[["mat-divider"]],hostAttrs:["role","separator",1,"mat-divider"],hostVars:7,hostBindings:function(e,n){e&2&&(C("aria-orientation",n.vertical?"vertical":"horizontal"),x("mat-divider-vertical",n.vertical)("mat-divider-horizontal",!n.vertical)("mat-divider-inset",n.inset))},inputs:{vertical:"vertical",inset:"inset"},decls:0,vars:0,template:function(e,n){},styles:[`.mat-divider {
|
|
2
2
|
display: block;
|
|
3
3
|
margin: 0;
|
|
4
4
|
border-top-style: solid;
|