signalk-onaplotter 0.0.0-stage → 0.1.0
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/LICENSE +21 -0
- package/README.md +52 -2
- package/index.js +310 -0
- package/package.json +28 -4
- package/public/OnaPlotter.styles.css +365 -0
- package/public/OnaPlotter.styles.css.br +0 -0
- package/public/OnaPlotter.styles.css.gz +0 -0
- package/public/_framework/Microsoft.AspNetCore.Components.Web.lzlha3sebn.wasm +0 -0
- package/public/_framework/Microsoft.AspNetCore.Components.Web.lzlha3sebn.wasm.br +0 -0
- package/public/_framework/Microsoft.AspNetCore.Components.Web.lzlha3sebn.wasm.gz +0 -0
- package/public/_framework/Microsoft.AspNetCore.Components.WebAssembly.hgb9kb1ko8.wasm +0 -0
- package/public/_framework/Microsoft.AspNetCore.Components.WebAssembly.hgb9kb1ko8.wasm.br +0 -0
- package/public/_framework/Microsoft.AspNetCore.Components.WebAssembly.hgb9kb1ko8.wasm.gz +0 -0
- package/public/_framework/Microsoft.AspNetCore.Components.ctlimky0ld.wasm +0 -0
- package/public/_framework/Microsoft.AspNetCore.Components.ctlimky0ld.wasm.br +0 -0
- package/public/_framework/Microsoft.AspNetCore.Components.ctlimky0ld.wasm.gz +0 -0
- package/public/_framework/Microsoft.Extensions.Configuration.Abstractions.ex1njydbd4.wasm +0 -0
- package/public/_framework/Microsoft.Extensions.Configuration.Abstractions.ex1njydbd4.wasm.br +0 -0
- package/public/_framework/Microsoft.Extensions.Configuration.Abstractions.ex1njydbd4.wasm.gz +0 -0
- package/public/_framework/Microsoft.Extensions.Configuration.EnvironmentVariables.dufoils7aa.wasm +0 -0
- package/public/_framework/Microsoft.Extensions.Configuration.EnvironmentVariables.dufoils7aa.wasm.br +0 -0
- package/public/_framework/Microsoft.Extensions.Configuration.EnvironmentVariables.dufoils7aa.wasm.gz +0 -0
- package/public/_framework/Microsoft.Extensions.Configuration.Json.2cwa6dgvjw.wasm +0 -0
- package/public/_framework/Microsoft.Extensions.Configuration.Json.2cwa6dgvjw.wasm.br +0 -0
- package/public/_framework/Microsoft.Extensions.Configuration.Json.2cwa6dgvjw.wasm.gz +0 -0
- package/public/_framework/Microsoft.Extensions.Configuration.tf0s85350j.wasm +0 -0
- package/public/_framework/Microsoft.Extensions.Configuration.tf0s85350j.wasm.br +0 -0
- package/public/_framework/Microsoft.Extensions.Configuration.tf0s85350j.wasm.gz +0 -0
- package/public/_framework/Microsoft.Extensions.DependencyInjection.Abstractions.ykrsa5qwvj.wasm +0 -0
- package/public/_framework/Microsoft.Extensions.DependencyInjection.Abstractions.ykrsa5qwvj.wasm.br +0 -0
- package/public/_framework/Microsoft.Extensions.DependencyInjection.Abstractions.ykrsa5qwvj.wasm.gz +0 -0
- package/public/_framework/Microsoft.Extensions.DependencyInjection.q4ogihpz4g.wasm +0 -0
- package/public/_framework/Microsoft.Extensions.DependencyInjection.q4ogihpz4g.wasm.br +0 -0
- package/public/_framework/Microsoft.Extensions.DependencyInjection.q4ogihpz4g.wasm.gz +0 -0
- package/public/_framework/Microsoft.Extensions.Diagnostics.Abstractions.w51v02shrt.wasm +0 -0
- package/public/_framework/Microsoft.Extensions.Diagnostics.Abstractions.w51v02shrt.wasm.br +0 -0
- package/public/_framework/Microsoft.Extensions.Diagnostics.Abstractions.w51v02shrt.wasm.gz +0 -0
- package/public/_framework/Microsoft.Extensions.Diagnostics.jdah25iecf.wasm +0 -0
- package/public/_framework/Microsoft.Extensions.Diagnostics.jdah25iecf.wasm.br +0 -0
- package/public/_framework/Microsoft.Extensions.Diagnostics.jdah25iecf.wasm.gz +0 -0
- package/public/_framework/Microsoft.Extensions.Hosting.Abstractions.2esolmyrj5.wasm +0 -0
- package/public/_framework/Microsoft.Extensions.Hosting.Abstractions.2esolmyrj5.wasm.br +0 -0
- package/public/_framework/Microsoft.Extensions.Hosting.Abstractions.2esolmyrj5.wasm.gz +0 -0
- package/public/_framework/Microsoft.Extensions.Logging.Abstractions.zwtdylwuov.wasm +0 -0
- package/public/_framework/Microsoft.Extensions.Logging.Abstractions.zwtdylwuov.wasm.br +0 -0
- package/public/_framework/Microsoft.Extensions.Logging.Abstractions.zwtdylwuov.wasm.gz +0 -0
- package/public/_framework/Microsoft.Extensions.Logging.xmx5eyc5ch.wasm +0 -0
- package/public/_framework/Microsoft.Extensions.Logging.xmx5eyc5ch.wasm.br +0 -0
- package/public/_framework/Microsoft.Extensions.Logging.xmx5eyc5ch.wasm.gz +0 -0
- package/public/_framework/Microsoft.Extensions.Options.bxcwufxpzd.wasm +0 -0
- package/public/_framework/Microsoft.Extensions.Options.bxcwufxpzd.wasm.br +0 -0
- package/public/_framework/Microsoft.Extensions.Options.bxcwufxpzd.wasm.gz +0 -0
- package/public/_framework/Microsoft.Extensions.Primitives.r28g7oh1t8.wasm +0 -0
- package/public/_framework/Microsoft.Extensions.Primitives.r28g7oh1t8.wasm.br +0 -0
- package/public/_framework/Microsoft.Extensions.Primitives.r28g7oh1t8.wasm.gz +0 -0
- package/public/_framework/Microsoft.JSInterop.WebAssembly.kthmj8ue8z.wasm +0 -0
- package/public/_framework/Microsoft.JSInterop.WebAssembly.kthmj8ue8z.wasm.br +0 -0
- package/public/_framework/Microsoft.JSInterop.WebAssembly.kthmj8ue8z.wasm.gz +0 -0
- package/public/_framework/Microsoft.JSInterop.z69euz7ekt.wasm +0 -0
- package/public/_framework/Microsoft.JSInterop.z69euz7ekt.wasm.br +0 -0
- package/public/_framework/Microsoft.JSInterop.z69euz7ekt.wasm.gz +0 -0
- package/public/_framework/OnaPlotter.g1oyk97tth.wasm +0 -0
- package/public/_framework/OnaPlotter.g1oyk97tth.wasm.br +0 -0
- package/public/_framework/OnaPlotter.g1oyk97tth.wasm.gz +0 -0
- package/public/_framework/System.Collections.0y3lxq9yiz.wasm +0 -0
- package/public/_framework/System.Collections.0y3lxq9yiz.wasm.br +0 -0
- package/public/_framework/System.Collections.0y3lxq9yiz.wasm.gz +0 -0
- package/public/_framework/System.Collections.Concurrent.y1gijyulzg.wasm +0 -0
- package/public/_framework/System.Collections.Concurrent.y1gijyulzg.wasm.br +0 -0
- package/public/_framework/System.Collections.Concurrent.y1gijyulzg.wasm.gz +0 -0
- package/public/_framework/System.Collections.Immutable.bv8sm0hn96.wasm +0 -0
- package/public/_framework/System.Collections.Immutable.bv8sm0hn96.wasm.br +0 -0
- package/public/_framework/System.Collections.Immutable.bv8sm0hn96.wasm.gz +0 -0
- package/public/_framework/System.Collections.NonGeneric.demk1o8khk.wasm +0 -0
- package/public/_framework/System.Collections.NonGeneric.demk1o8khk.wasm.br +0 -0
- package/public/_framework/System.Collections.NonGeneric.demk1o8khk.wasm.gz +0 -0
- package/public/_framework/System.Collections.Specialized.ybmtdn8n9q.wasm +0 -0
- package/public/_framework/System.Collections.Specialized.ybmtdn8n9q.wasm.br +0 -0
- package/public/_framework/System.Collections.Specialized.ybmtdn8n9q.wasm.gz +0 -0
- package/public/_framework/System.ComponentModel.Primitives.hdixdh1geb.wasm +0 -0
- package/public/_framework/System.ComponentModel.Primitives.hdixdh1geb.wasm.br +0 -0
- package/public/_framework/System.ComponentModel.Primitives.hdixdh1geb.wasm.gz +0 -0
- package/public/_framework/System.ComponentModel.TypeConverter.80a5fdjdf1.wasm +0 -0
- package/public/_framework/System.ComponentModel.TypeConverter.80a5fdjdf1.wasm.br +0 -0
- package/public/_framework/System.ComponentModel.TypeConverter.80a5fdjdf1.wasm.gz +0 -0
- package/public/_framework/System.ComponentModel.er3kikotc9.wasm +0 -0
- package/public/_framework/System.ComponentModel.er3kikotc9.wasm.br +0 -0
- package/public/_framework/System.ComponentModel.er3kikotc9.wasm.gz +0 -0
- package/public/_framework/System.Console.ztyrgmguq9.wasm +0 -0
- package/public/_framework/System.Console.ztyrgmguq9.wasm.br +0 -0
- package/public/_framework/System.Console.ztyrgmguq9.wasm.gz +0 -0
- package/public/_framework/System.Diagnostics.DiagnosticSource.8ovi6htwue.wasm +0 -0
- package/public/_framework/System.Diagnostics.DiagnosticSource.8ovi6htwue.wasm.br +0 -0
- package/public/_framework/System.Diagnostics.DiagnosticSource.8ovi6htwue.wasm.gz +0 -0
- package/public/_framework/System.IO.Pipelines.ehyowalz06.wasm +0 -0
- package/public/_framework/System.IO.Pipelines.ehyowalz06.wasm.br +0 -0
- package/public/_framework/System.IO.Pipelines.ehyowalz06.wasm.gz +0 -0
- package/public/_framework/System.Linq.77nzpgno3g.wasm +0 -0
- package/public/_framework/System.Linq.77nzpgno3g.wasm.br +0 -0
- package/public/_framework/System.Linq.77nzpgno3g.wasm.gz +0 -0
- package/public/_framework/System.Memory.96u3edrscq.wasm +0 -0
- package/public/_framework/System.Memory.96u3edrscq.wasm.br +0 -0
- package/public/_framework/System.Memory.96u3edrscq.wasm.gz +0 -0
- package/public/_framework/System.Net.Http.04zi0q3bww.wasm +0 -0
- package/public/_framework/System.Net.Http.04zi0q3bww.wasm.br +0 -0
- package/public/_framework/System.Net.Http.04zi0q3bww.wasm.gz +0 -0
- package/public/_framework/System.Net.Http.Json.dfsls33yd0.wasm +0 -0
- package/public/_framework/System.Net.Http.Json.dfsls33yd0.wasm.br +0 -0
- package/public/_framework/System.Net.Http.Json.dfsls33yd0.wasm.gz +0 -0
- package/public/_framework/System.Net.Primitives.3bql0h4h9x.wasm +0 -0
- package/public/_framework/System.Net.Primitives.3bql0h4h9x.wasm.br +0 -0
- package/public/_framework/System.Net.Primitives.3bql0h4h9x.wasm.gz +0 -0
- package/public/_framework/System.Net.WebSockets.Client.yabl5yso4d.wasm +0 -0
- package/public/_framework/System.Net.WebSockets.Client.yabl5yso4d.wasm.br +0 -0
- package/public/_framework/System.Net.WebSockets.Client.yabl5yso4d.wasm.gz +0 -0
- package/public/_framework/System.Net.WebSockets.btb8u9bs63.wasm +0 -0
- package/public/_framework/System.Net.WebSockets.btb8u9bs63.wasm.br +0 -0
- package/public/_framework/System.Net.WebSockets.btb8u9bs63.wasm.gz +0 -0
- package/public/_framework/System.ObjectModel.y2vjd96rm0.wasm +0 -0
- package/public/_framework/System.ObjectModel.y2vjd96rm0.wasm.br +0 -0
- package/public/_framework/System.ObjectModel.y2vjd96rm0.wasm.gz +0 -0
- package/public/_framework/System.Private.CoreLib.18u2ssdtkz.wasm +0 -0
- package/public/_framework/System.Private.CoreLib.18u2ssdtkz.wasm.br +0 -0
- package/public/_framework/System.Private.CoreLib.18u2ssdtkz.wasm.gz +0 -0
- package/public/_framework/System.Private.Uri.lipib74a1x.wasm +0 -0
- package/public/_framework/System.Private.Uri.lipib74a1x.wasm.br +0 -0
- package/public/_framework/System.Private.Uri.lipib74a1x.wasm.gz +0 -0
- package/public/_framework/System.Private.Xml.Linq.01wrv6yr49.wasm +0 -0
- package/public/_framework/System.Private.Xml.Linq.01wrv6yr49.wasm.br +0 -0
- package/public/_framework/System.Private.Xml.Linq.01wrv6yr49.wasm.gz +0 -0
- package/public/_framework/System.Private.Xml.h7x38gg1kw.wasm +0 -0
- package/public/_framework/System.Private.Xml.h7x38gg1kw.wasm.br +0 -0
- package/public/_framework/System.Private.Xml.h7x38gg1kw.wasm.gz +0 -0
- package/public/_framework/System.Runtime.InteropServices.JavaScript.fymien2tnc.wasm +0 -0
- package/public/_framework/System.Runtime.InteropServices.JavaScript.fymien2tnc.wasm.br +0 -0
- package/public/_framework/System.Runtime.InteropServices.JavaScript.fymien2tnc.wasm.gz +0 -0
- package/public/_framework/System.Runtime.InteropServices.h45u78t9gg.wasm +0 -0
- package/public/_framework/System.Runtime.InteropServices.h45u78t9gg.wasm.br +0 -0
- package/public/_framework/System.Runtime.InteropServices.h45u78t9gg.wasm.gz +0 -0
- package/public/_framework/System.Runtime.nqxxfenwc0.wasm +0 -0
- package/public/_framework/System.Runtime.nqxxfenwc0.wasm.br +0 -0
- package/public/_framework/System.Runtime.nqxxfenwc0.wasm.gz +0 -0
- package/public/_framework/System.Security.Cryptography.r8xdxuwcik.wasm +0 -0
- package/public/_framework/System.Security.Cryptography.r8xdxuwcik.wasm.br +0 -0
- package/public/_framework/System.Security.Cryptography.r8xdxuwcik.wasm.gz +0 -0
- package/public/_framework/System.Text.Encodings.Web.8tv8c2qml7.wasm +0 -0
- package/public/_framework/System.Text.Encodings.Web.8tv8c2qml7.wasm.br +0 -0
- package/public/_framework/System.Text.Encodings.Web.8tv8c2qml7.wasm.gz +0 -0
- package/public/_framework/System.Text.Json.vlj0ri24nf.wasm +0 -0
- package/public/_framework/System.Text.Json.vlj0ri24nf.wasm.br +0 -0
- package/public/_framework/System.Text.Json.vlj0ri24nf.wasm.gz +0 -0
- package/public/_framework/System.Text.RegularExpressions.syst47d0hk.wasm +0 -0
- package/public/_framework/System.Text.RegularExpressions.syst47d0hk.wasm.br +0 -0
- package/public/_framework/System.Text.RegularExpressions.syst47d0hk.wasm.gz +0 -0
- package/public/_framework/System.Threading.3w9td3odjb.wasm +0 -0
- package/public/_framework/System.Threading.3w9td3odjb.wasm.br +0 -0
- package/public/_framework/System.Threading.3w9td3odjb.wasm.gz +0 -0
- package/public/_framework/System.Web.HttpUtility.s6p043ak0k.wasm +0 -0
- package/public/_framework/System.Web.HttpUtility.s6p043ak0k.wasm.br +0 -0
- package/public/_framework/System.Web.HttpUtility.s6p043ak0k.wasm.gz +0 -0
- package/public/_framework/System.Xml.Linq.6jrwceho2h.wasm +0 -0
- package/public/_framework/System.Xml.Linq.6jrwceho2h.wasm.br +0 -0
- package/public/_framework/System.Xml.Linq.6jrwceho2h.wasm.gz +0 -0
- package/public/_framework/System.Xml.ReaderWriter.au2hkgm2hw.wasm +0 -0
- package/public/_framework/System.Xml.ReaderWriter.au2hkgm2hw.wasm.br +0 -0
- package/public/_framework/System.Xml.ReaderWriter.au2hkgm2hw.wasm.gz +0 -0
- package/public/_framework/System.Xml.XDocument.pllf66tpew.wasm +0 -0
- package/public/_framework/System.Xml.XDocument.pllf66tpew.wasm.br +0 -0
- package/public/_framework/System.Xml.XDocument.pllf66tpew.wasm.gz +0 -0
- package/public/_framework/System.n1lgwvdeih.wasm +0 -0
- package/public/_framework/System.n1lgwvdeih.wasm.br +0 -0
- package/public/_framework/System.n1lgwvdeih.wasm.gz +0 -0
- package/public/_framework/blazor.webassembly.js +2 -0
- package/public/_framework/blazor.webassembly.js.br +0 -0
- package/public/_framework/blazor.webassembly.js.gz +0 -0
- package/public/_framework/blazor.webassembly.js.map +1 -0
- package/public/_framework/blazor.webassembly.js.map.br +0 -0
- package/public/_framework/blazor.webassembly.js.map.gz +0 -0
- package/public/_framework/dotnet.js +462 -0
- package/public/_framework/dotnet.js.br +0 -0
- package/public/_framework/dotnet.js.gz +0 -0
- package/public/_framework/dotnet.native.0yslzj0e9x.wasm +0 -0
- package/public/_framework/dotnet.native.0yslzj0e9x.wasm.br +0 -0
- package/public/_framework/dotnet.native.0yslzj0e9x.wasm.gz +0 -0
- package/public/_framework/dotnet.native.ijy01f6viz.js +5502 -0
- package/public/_framework/dotnet.native.ijy01f6viz.js.br +0 -0
- package/public/_framework/dotnet.native.ijy01f6viz.js.gz +0 -0
- package/public/_framework/dotnet.runtime.uyfhwbfd13.js +4 -0
- package/public/_framework/dotnet.runtime.uyfhwbfd13.js.br +0 -0
- package/public/_framework/dotnet.runtime.uyfhwbfd13.js.gz +0 -0
- package/public/apple-touch-icon-180.png +0 -0
- package/public/appsettings.json +1 -0
- package/public/css/app.css +1 -0
- package/public/css/app.css.br +0 -0
- package/public/css/app.css.gz +0 -0
- package/public/css/bootstrap/bootstrap.min.css +5 -0
- package/public/css/bootstrap/bootstrap.min.css.br +0 -0
- package/public/css/bootstrap/bootstrap.min.css.gz +0 -0
- package/public/favicon.svg +19 -0
- package/public/favicon.svg.br +0 -0
- package/public/favicon.svg.gz +0 -0
- package/public/fonts/InterVariable.woff2 +0 -0
- package/public/icon-192.png +0 -0
- package/public/icon-512.png +0 -0
- package/public/index.html +208 -0
- package/public/js/activeRouteLayer.js +10 -0
- package/public/js/activeRouteLayer.js.br +0 -0
- package/public/js/activeRouteLayer.js.gz +0 -0
- package/public/js/aisLayer.js +12 -0
- package/public/js/aisLayer.js.br +0 -0
- package/public/js/aisLayer.js.gz +0 -0
- package/public/js/anchorLayer.js +1 -0
- package/public/js/anchorLayer.js.br +0 -0
- package/public/js/anchorLayer.js.gz +0 -0
- package/public/js/atonLayer.js +24 -0
- package/public/js/atonLayer.js.br +0 -0
- package/public/js/atonLayer.js.gz +0 -0
- package/public/js/boatIcons.js +1 -0
- package/public/js/boatIcons.js.br +0 -0
- package/public/js/boatIcons.js.gz +0 -0
- package/public/js/chartDownshift.js +1 -0
- package/public/js/chartDownshift.js.br +0 -0
- package/public/js/chartDownshift.js.gz +0 -0
- package/public/js/courseLineLayer.js +1 -0
- package/public/js/courseLineLayer.js.br +0 -0
- package/public/js/courseLineLayer.js.gz +0 -0
- package/public/js/deadman.js +1 -0
- package/public/js/deadman.js.br +0 -0
- package/public/js/deadman.js.gz +0 -0
- package/public/js/dragGhost.js +1 -0
- package/public/js/dragGhost.js.br +0 -0
- package/public/js/dragGhost.js.gz +0 -0
- package/public/js/errorRelayBoot.js +2 -0
- package/public/js/errorRelayBoot.js.br +0 -0
- package/public/js/errorRelayBoot.js.gz +0 -0
- package/public/js/format.js +1 -0
- package/public/js/format.js.br +0 -0
- package/public/js/format.js.gz +0 -0
- package/public/js/geoMath.js +1 -0
- package/public/js/geoMath.js.br +0 -0
- package/public/js/geoMath.js.gz +0 -0
- package/public/js/geomPixels.js +1 -0
- package/public/js/geomPixels.js.br +0 -0
- package/public/js/geomPixels.js.gz +0 -0
- package/public/js/historyMapLayer.js +1 -0
- package/public/js/historyMapLayer.js.br +0 -0
- package/public/js/historyMapLayer.js.gz +0 -0
- package/public/js/keyboardShortcuts.js +1 -0
- package/public/js/keyboardShortcuts.js.br +0 -0
- package/public/js/keyboardShortcuts.js.gz +0 -0
- package/public/js/laylineLayer.js +1 -0
- package/public/js/laylineLayer.js.br +0 -0
- package/public/js/laylineLayer.js.gz +0 -0
- package/public/js/leafletInterop.XG3NAVS4.js +170 -0
- package/public/js/leafletInterop.XG3NAVS4.js.br +0 -0
- package/public/js/leafletInterop.XG3NAVS4.js.gz +0 -0
- package/public/js/leafletInterop.js +1 -0
- package/public/js/mapRotation.js +1 -0
- package/public/js/mapRotation.js.br +0 -0
- package/public/js/mapRotation.js.gz +0 -0
- package/public/js/marinePoiLayer.js +35 -0
- package/public/js/marinePoiLayer.js.br +0 -0
- package/public/js/marinePoiLayer.js.gz +0 -0
- package/public/js/markerLayer.js +1 -0
- package/public/js/markerLayer.js.br +0 -0
- package/public/js/markerLayer.js.gz +0 -0
- package/public/js/measureLayer.js +1 -0
- package/public/js/measureLayer.js.br +0 -0
- package/public/js/measureLayer.js.gz +0 -0
- package/public/js/noteLayer.js +32 -0
- package/public/js/noteLayer.js.br +0 -0
- package/public/js/noteLayer.js.gz +0 -0
- package/public/js/overzoomLayer.js +1 -0
- package/public/js/overzoomLayer.js.br +0 -0
- package/public/js/overzoomLayer.js.gz +0 -0
- package/public/js/ownBoatPopup.js +1 -0
- package/public/js/ownBoatPopup.js.br +1 -0
- package/public/js/ownBoatPopup.js.gz +0 -0
- package/public/js/platform/audioAlert.js +1 -0
- package/public/js/platform/audioAlert.js.br +0 -0
- package/public/js/platform/audioAlert.js.gz +0 -0
- package/public/js/platform/fileTransfer.js +1 -0
- package/public/js/platform/fileTransfer.js.br +0 -0
- package/public/js/platform/fileTransfer.js.gz +0 -0
- package/public/js/platform/fullscreen.js +1 -0
- package/public/js/platform/fullscreen.js.br +0 -0
- package/public/js/platform/fullscreen.js.gz +0 -0
- package/public/js/platform/themeApply.js +1 -0
- package/public/js/platform/themeApply.js.br +0 -0
- package/public/js/platform/themeApply.js.gz +0 -0
- package/public/js/platform/viewport.js +1 -0
- package/public/js/platform/viewport.js.br +0 -0
- package/public/js/platform/viewport.js.gz +0 -0
- package/public/js/platform/wakeLock.js +1 -0
- package/public/js/platform/wakeLock.js.br +0 -0
- package/public/js/platform/wakeLock.js.gz +0 -0
- package/public/js/polygonEditLayer.js +1 -0
- package/public/js/polygonEditLayer.js.br +0 -0
- package/public/js/polygonEditLayer.js.gz +0 -0
- package/public/js/popupHelpers.js +1 -0
- package/public/js/popupHelpers.js.br +0 -0
- package/public/js/popupHelpers.js.gz +0 -0
- package/public/js/radarLayer.js +1 -0
- package/public/js/radarLayer.js.br +0 -0
- package/public/js/radarLayer.js.gz +0 -0
- package/public/js/radarProtobuf.js +1 -0
- package/public/js/radarProtobuf.js.br +0 -0
- package/public/js/radarProtobuf.js.gz +0 -0
- package/public/js/rangeScale.js +1 -0
- package/public/js/rangeScale.js.br +0 -0
- package/public/js/rangeScale.js.gz +0 -0
- package/public/js/regionLayer.js +10 -0
- package/public/js/regionLayer.js.br +0 -0
- package/public/js/regionLayer.js.gz +0 -0
- package/public/js/routeEditLayer.js +1 -0
- package/public/js/routeEditLayer.js.br +0 -0
- package/public/js/routeEditLayer.js.gz +0 -0
- package/public/js/routeLayer.js +10 -0
- package/public/js/routeLayer.js.br +0 -0
- package/public/js/routeLayer.js.gz +0 -0
- package/public/js/searchBoxJs.js +1 -0
- package/public/js/searchBoxJs.js.br +0 -0
- package/public/js/trackRuns.js +1 -0
- package/public/js/trackRuns.js.br +0 -0
- package/public/js/trackRuns.js.gz +0 -0
- package/public/js/version.g.js +1 -0
- package/public/js/visibility.js +1 -0
- package/public/js/visibility.js.br +0 -0
- package/public/js/visibility.js.gz +0 -0
- package/public/js/waypointLayer.js +44 -0
- package/public/js/waypointLayer.js.br +0 -0
- package/public/js/waypointLayer.js.gz +0 -0
- package/public/js/weatherLayer.js +1 -0
- package/public/js/weatherLayer.js.br +0 -0
- package/public/js/weatherLayer.js.gz +0 -0
- package/public/lib/bootstrap/dist/css/bootstrap-grid.css +4085 -0
- package/public/lib/bootstrap/dist/css/bootstrap-grid.css.br +0 -0
- package/public/lib/bootstrap/dist/css/bootstrap-grid.css.gz +0 -0
- package/public/lib/bootstrap/dist/css/bootstrap-grid.css.map +1 -0
- package/public/lib/bootstrap/dist/css/bootstrap-grid.css.map.br +0 -0
- package/public/lib/bootstrap/dist/css/bootstrap-grid.css.map.gz +0 -0
- package/public/lib/bootstrap/dist/css/bootstrap-grid.min.css +6 -0
- package/public/lib/bootstrap/dist/css/bootstrap-grid.min.css.br +0 -0
- package/public/lib/bootstrap/dist/css/bootstrap-grid.min.css.gz +0 -0
- package/public/lib/bootstrap/dist/css/bootstrap-grid.min.css.map +1 -0
- package/public/lib/bootstrap/dist/css/bootstrap-grid.min.css.map.br +0 -0
- package/public/lib/bootstrap/dist/css/bootstrap-grid.min.css.map.gz +0 -0
- package/public/lib/bootstrap/dist/css/bootstrap-grid.rtl.css +4084 -0
- package/public/lib/bootstrap/dist/css/bootstrap-grid.rtl.css.br +0 -0
- package/public/lib/bootstrap/dist/css/bootstrap-grid.rtl.css.gz +0 -0
- package/public/lib/bootstrap/dist/css/bootstrap-grid.rtl.css.map +1 -0
- package/public/lib/bootstrap/dist/css/bootstrap-grid.rtl.css.map.br +0 -0
- package/public/lib/bootstrap/dist/css/bootstrap-grid.rtl.css.map.gz +0 -0
- package/public/lib/bootstrap/dist/css/bootstrap-grid.rtl.min.css +6 -0
- package/public/lib/bootstrap/dist/css/bootstrap-grid.rtl.min.css.br +0 -0
- package/public/lib/bootstrap/dist/css/bootstrap-grid.rtl.min.css.gz +0 -0
- package/public/lib/bootstrap/dist/css/bootstrap-grid.rtl.min.css.map +1 -0
- package/public/lib/bootstrap/dist/css/bootstrap-grid.rtl.min.css.map.br +0 -0
- package/public/lib/bootstrap/dist/css/bootstrap-grid.rtl.min.css.map.gz +0 -0
- package/public/lib/bootstrap/dist/css/bootstrap-reboot.css +597 -0
- package/public/lib/bootstrap/dist/css/bootstrap-reboot.css.br +0 -0
- package/public/lib/bootstrap/dist/css/bootstrap-reboot.css.gz +0 -0
- package/public/lib/bootstrap/dist/css/bootstrap-reboot.css.map +1 -0
- package/public/lib/bootstrap/dist/css/bootstrap-reboot.css.map.br +0 -0
- package/public/lib/bootstrap/dist/css/bootstrap-reboot.css.map.gz +0 -0
- package/public/lib/bootstrap/dist/css/bootstrap-reboot.min.css +6 -0
- package/public/lib/bootstrap/dist/css/bootstrap-reboot.min.css.br +0 -0
- package/public/lib/bootstrap/dist/css/bootstrap-reboot.min.css.gz +0 -0
- package/public/lib/bootstrap/dist/css/bootstrap-reboot.min.css.map +1 -0
- package/public/lib/bootstrap/dist/css/bootstrap-reboot.min.css.map.br +0 -0
- package/public/lib/bootstrap/dist/css/bootstrap-reboot.min.css.map.gz +0 -0
- package/public/lib/bootstrap/dist/css/bootstrap-reboot.rtl.css +594 -0
- package/public/lib/bootstrap/dist/css/bootstrap-reboot.rtl.css.br +0 -0
- package/public/lib/bootstrap/dist/css/bootstrap-reboot.rtl.css.gz +0 -0
- package/public/lib/bootstrap/dist/css/bootstrap-reboot.rtl.css.map +1 -0
- package/public/lib/bootstrap/dist/css/bootstrap-reboot.rtl.css.map.br +0 -0
- package/public/lib/bootstrap/dist/css/bootstrap-reboot.rtl.css.map.gz +0 -0
- package/public/lib/bootstrap/dist/css/bootstrap-reboot.rtl.min.css +6 -0
- package/public/lib/bootstrap/dist/css/bootstrap-reboot.rtl.min.css.br +0 -0
- package/public/lib/bootstrap/dist/css/bootstrap-reboot.rtl.min.css.gz +0 -0
- package/public/lib/bootstrap/dist/css/bootstrap-reboot.rtl.min.css.map +1 -0
- package/public/lib/bootstrap/dist/css/bootstrap-reboot.rtl.min.css.map.br +0 -0
- package/public/lib/bootstrap/dist/css/bootstrap-reboot.rtl.min.css.map.gz +0 -0
- package/public/lib/bootstrap/dist/css/bootstrap-utilities.css +5402 -0
- package/public/lib/bootstrap/dist/css/bootstrap-utilities.css.br +0 -0
- package/public/lib/bootstrap/dist/css/bootstrap-utilities.css.gz +0 -0
- package/public/lib/bootstrap/dist/css/bootstrap-utilities.css.map +1 -0
- package/public/lib/bootstrap/dist/css/bootstrap-utilities.css.map.br +0 -0
- package/public/lib/bootstrap/dist/css/bootstrap-utilities.css.map.gz +0 -0
- package/public/lib/bootstrap/dist/css/bootstrap-utilities.min.css +6 -0
- package/public/lib/bootstrap/dist/css/bootstrap-utilities.min.css.br +0 -0
- package/public/lib/bootstrap/dist/css/bootstrap-utilities.min.css.gz +0 -0
- package/public/lib/bootstrap/dist/css/bootstrap-utilities.min.css.map +1 -0
- package/public/lib/bootstrap/dist/css/bootstrap-utilities.min.css.map.br +0 -0
- package/public/lib/bootstrap/dist/css/bootstrap-utilities.min.css.map.gz +0 -0
- package/public/lib/bootstrap/dist/css/bootstrap-utilities.rtl.css +5393 -0
- package/public/lib/bootstrap/dist/css/bootstrap-utilities.rtl.css.br +0 -0
- package/public/lib/bootstrap/dist/css/bootstrap-utilities.rtl.css.gz +0 -0
- package/public/lib/bootstrap/dist/css/bootstrap-utilities.rtl.css.map +1 -0
- package/public/lib/bootstrap/dist/css/bootstrap-utilities.rtl.css.map.br +0 -0
- package/public/lib/bootstrap/dist/css/bootstrap-utilities.rtl.css.map.gz +0 -0
- package/public/lib/bootstrap/dist/css/bootstrap-utilities.rtl.min.css +6 -0
- package/public/lib/bootstrap/dist/css/bootstrap-utilities.rtl.min.css.br +0 -0
- package/public/lib/bootstrap/dist/css/bootstrap-utilities.rtl.min.css.gz +0 -0
- package/public/lib/bootstrap/dist/css/bootstrap-utilities.rtl.min.css.map +1 -0
- package/public/lib/bootstrap/dist/css/bootstrap-utilities.rtl.min.css.map.br +0 -0
- package/public/lib/bootstrap/dist/css/bootstrap-utilities.rtl.min.css.map.gz +0 -0
- package/public/lib/bootstrap/dist/css/bootstrap.css +12057 -0
- package/public/lib/bootstrap/dist/css/bootstrap.css.br +0 -0
- package/public/lib/bootstrap/dist/css/bootstrap.css.gz +0 -0
- package/public/lib/bootstrap/dist/css/bootstrap.css.map +1 -0
- package/public/lib/bootstrap/dist/css/bootstrap.css.map.br +0 -0
- package/public/lib/bootstrap/dist/css/bootstrap.css.map.gz +0 -0
- package/public/lib/bootstrap/dist/css/bootstrap.min.css +6 -0
- package/public/lib/bootstrap/dist/css/bootstrap.min.css.br +0 -0
- package/public/lib/bootstrap/dist/css/bootstrap.min.css.gz +0 -0
- package/public/lib/bootstrap/dist/css/bootstrap.min.css.map +1 -0
- package/public/lib/bootstrap/dist/css/bootstrap.min.css.map.br +0 -0
- package/public/lib/bootstrap/dist/css/bootstrap.min.css.map.gz +0 -0
- package/public/lib/bootstrap/dist/css/bootstrap.rtl.css +12030 -0
- package/public/lib/bootstrap/dist/css/bootstrap.rtl.css.br +0 -0
- package/public/lib/bootstrap/dist/css/bootstrap.rtl.css.gz +0 -0
- package/public/lib/bootstrap/dist/css/bootstrap.rtl.css.map +1 -0
- package/public/lib/bootstrap/dist/css/bootstrap.rtl.css.map.br +0 -0
- package/public/lib/bootstrap/dist/css/bootstrap.rtl.css.map.gz +0 -0
- package/public/lib/bootstrap/dist/css/bootstrap.rtl.min.css +6 -0
- package/public/lib/bootstrap/dist/css/bootstrap.rtl.min.css.br +0 -0
- package/public/lib/bootstrap/dist/css/bootstrap.rtl.min.css.gz +0 -0
- package/public/lib/bootstrap/dist/css/bootstrap.rtl.min.css.map +1 -0
- package/public/lib/bootstrap/dist/css/bootstrap.rtl.min.css.map.br +0 -0
- package/public/lib/bootstrap/dist/css/bootstrap.rtl.min.css.map.gz +0 -0
- package/public/lib/bootstrap/dist/js/bootstrap.bundle.js +6314 -0
- package/public/lib/bootstrap/dist/js/bootstrap.bundle.js.br +0 -0
- package/public/lib/bootstrap/dist/js/bootstrap.bundle.js.gz +0 -0
- package/public/lib/bootstrap/dist/js/bootstrap.bundle.js.map +1 -0
- package/public/lib/bootstrap/dist/js/bootstrap.bundle.js.map.br +0 -0
- package/public/lib/bootstrap/dist/js/bootstrap.bundle.js.map.gz +0 -0
- package/public/lib/bootstrap/dist/js/bootstrap.bundle.min.js +7 -0
- package/public/lib/bootstrap/dist/js/bootstrap.bundle.min.js.br +0 -0
- package/public/lib/bootstrap/dist/js/bootstrap.bundle.min.js.gz +0 -0
- package/public/lib/bootstrap/dist/js/bootstrap.bundle.min.js.map +1 -0
- package/public/lib/bootstrap/dist/js/bootstrap.bundle.min.js.map.br +0 -0
- package/public/lib/bootstrap/dist/js/bootstrap.bundle.min.js.map.gz +0 -0
- package/public/lib/bootstrap/dist/js/bootstrap.esm.js +4447 -0
- package/public/lib/bootstrap/dist/js/bootstrap.esm.js.br +0 -0
- package/public/lib/bootstrap/dist/js/bootstrap.esm.js.gz +0 -0
- package/public/lib/bootstrap/dist/js/bootstrap.esm.js.map +1 -0
- package/public/lib/bootstrap/dist/js/bootstrap.esm.js.map.br +0 -0
- package/public/lib/bootstrap/dist/js/bootstrap.esm.js.map.gz +0 -0
- package/public/lib/bootstrap/dist/js/bootstrap.esm.min.js +7 -0
- package/public/lib/bootstrap/dist/js/bootstrap.esm.min.js.br +0 -0
- package/public/lib/bootstrap/dist/js/bootstrap.esm.min.js.gz +0 -0
- package/public/lib/bootstrap/dist/js/bootstrap.esm.min.js.map +1 -0
- package/public/lib/bootstrap/dist/js/bootstrap.esm.min.js.map.br +0 -0
- package/public/lib/bootstrap/dist/js/bootstrap.esm.min.js.map.gz +0 -0
- package/public/lib/bootstrap/dist/js/bootstrap.js +4494 -0
- package/public/lib/bootstrap/dist/js/bootstrap.js.br +0 -0
- package/public/lib/bootstrap/dist/js/bootstrap.js.gz +0 -0
- package/public/lib/bootstrap/dist/js/bootstrap.js.map +1 -0
- package/public/lib/bootstrap/dist/js/bootstrap.js.map.br +0 -0
- package/public/lib/bootstrap/dist/js/bootstrap.js.map.gz +0 -0
- package/public/lib/bootstrap/dist/js/bootstrap.min.js +7 -0
- package/public/lib/bootstrap/dist/js/bootstrap.min.js.br +0 -0
- package/public/lib/bootstrap/dist/js/bootstrap.min.js.gz +0 -0
- package/public/lib/bootstrap/dist/js/bootstrap.min.js.map +1 -0
- package/public/lib/bootstrap/dist/js/bootstrap.min.js.map.br +0 -0
- package/public/lib/bootstrap/dist/js/bootstrap.min.js.map.gz +0 -0
- package/public/lib/leaflet/dist/images/layers-2x.png +0 -0
- package/public/lib/leaflet/dist/images/layers.png +0 -0
- package/public/lib/leaflet/dist/images/marker-icon-2x.png +0 -0
- package/public/lib/leaflet/dist/images/marker-icon.png +0 -0
- package/public/lib/leaflet/dist/images/marker-shadow.png +0 -0
- package/public/lib/leaflet/dist/leaflet.css +661 -0
- package/public/lib/leaflet/dist/leaflet.css.br +0 -0
- package/public/lib/leaflet/dist/leaflet.css.gz +0 -0
- package/public/lib/leaflet/dist/leaflet.js +6 -0
- package/public/lib/leaflet/dist/leaflet.js.br +0 -0
- package/public/lib/leaflet/dist/leaflet.js.gz +0 -0
- package/public/manifest.json +30 -0
- package/public/manifest.json.br +0 -0
- package/public/manifest.json.gz +0 -0
- package/public/service-worker.js +1741 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 msallin
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,53 @@
|
|
|
1
|
-
#
|
|
1
|
+
# OnaPlotter
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A touch-first chartplotter webapp for [SignalK](https://signalk.org/).
|
|
4
|
+
One app for a helm touchscreen with keyboard and mouse, a tablet in the
|
|
5
|
+
cockpit, or a phone in a jacket pocket: same data, responsive layout,
|
|
6
|
+
large tap targets.
|
|
7
|
+
|
|
8
|
+
## Features
|
|
9
|
+
|
|
10
|
+
- **Charts** from any tile source your SignalK server exposes, plus OSM,
|
|
11
|
+
OpenSeaMap seamarks and rain radar.
|
|
12
|
+
- **AIS** with COG vectors, trails and CPA/TCPA collision alarms with
|
|
13
|
+
COLREGS crossing classification.
|
|
14
|
+
- **Anchor watch**, **MOB** and SART/EPIRB handling.
|
|
15
|
+
- **Routes, waypoints, notes and regions**, stored as standard SignalK
|
|
16
|
+
resources so other SignalK apps see them too. GPX import/export.
|
|
17
|
+
- **Instruments**: dashboard, gauges, SailSteer, wind rose, track history
|
|
18
|
+
replay, passage stats.
|
|
19
|
+
- **Alarms** for depth, CPA, wind shift, anchor drag, deadman and
|
|
20
|
+
waypoint approach, merged with server-side SignalK notifications.
|
|
21
|
+
- **Night modes** (soft, amber, red).
|
|
22
|
+
|
|
23
|
+
## Install
|
|
24
|
+
|
|
25
|
+
Install **OnaPlotter** from the App Store in the SignalK server admin UI,
|
|
26
|
+
or from the server's directory:
|
|
27
|
+
|
|
28
|
+
```sh
|
|
29
|
+
npm install signalk-onaplotter
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Restart the server and open `http://<your-server>:3000/signalk-onaplotter/`.
|
|
33
|
+
It also appears under *Webapps* in the admin UI.
|
|
34
|
+
|
|
35
|
+
## Works better with
|
|
36
|
+
|
|
37
|
+
Each of these lights up extra UI when installed; OnaPlotter works without
|
|
38
|
+
them.
|
|
39
|
+
|
|
40
|
+
- [signalk-anchoralarm-plugin](https://github.com/sbender9/signalk-anchoralarm-plugin) v2.0.0+: anchor watch
|
|
41
|
+
- [signalk-tides-api](https://github.com/sbender9/signalk-tides-api): tide card and anchor-tide alarm
|
|
42
|
+
- [signalk-buddylist-plugin](https://github.com/sbender9/signalk-buddylist-plugin): buddy boats
|
|
43
|
+
- [Mayara](https://github.com/MarineYachtRadar/mayara-server): radar targets
|
|
44
|
+
- [signalk-flags](https://github.com/SignalK/signalk-flags): country flags in AIS popups
|
|
45
|
+
|
|
46
|
+
## Links
|
|
47
|
+
|
|
48
|
+
- Documentation: https://msallin.github.io/ona-plotter/
|
|
49
|
+
- Source and issues: https://github.com/msallin/ona-plotter
|
|
50
|
+
|
|
51
|
+
## License
|
|
52
|
+
|
|
53
|
+
MIT
|
package/index.js
ADDED
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
// OnaPlotter SignalK plugin shim (deployed alongside the webapp
|
|
2
|
+
// bundle). The package.json carries both the `signalk-webapp` and
|
|
3
|
+
// `signalk-node-server-plugin` keywords:
|
|
4
|
+
//
|
|
5
|
+
// * signalk-webapp: mounts public/ at /<package-name>/
|
|
6
|
+
// via express.static.
|
|
7
|
+
// * signalk-node-server-plugin: loads this file as a plugin so we
|
|
8
|
+
// can register additional routes.
|
|
9
|
+
//
|
|
10
|
+
// The webapp half serves static files; Blazor WASM uses
|
|
11
|
+
// client-side routing, so deep URLs like /signalk-onaplotter/map
|
|
12
|
+
// or /signalk-onaplotter/settings don't map to any file and
|
|
13
|
+
// return 404 on reload. The plugin half adds an SPA fallback:
|
|
14
|
+
// any GET under /<package-name>/ that the static mount didn't
|
|
15
|
+
// handle falls through to this route and we return public/index.html
|
|
16
|
+
// so the Blazor router takes over in the browser.
|
|
17
|
+
//
|
|
18
|
+
// Registration order: signalk-server's webapp interface mounts
|
|
19
|
+
// express.static BEFORE it starts plugins, so real static files
|
|
20
|
+
// still win and only genuine "no such file" misses reach this
|
|
21
|
+
// fallback. The regex excludes paths containing a '.' so a
|
|
22
|
+
// missing .wasm / .css / .js still returns a proper 404 instead
|
|
23
|
+
// of pretending to be HTML.
|
|
24
|
+
//
|
|
25
|
+
// The plugin also registers POST /log as a client-side error sink.
|
|
26
|
+
// Blazor's "An unhandled error has occurred" banner is opaque on
|
|
27
|
+
// iPad, and SSH-tailing the SignalK server log is the practical
|
|
28
|
+
// debug path at the helm - so the Blazor host installs window
|
|
29
|
+
// error listeners that POST to this endpoint. We forward each
|
|
30
|
+
// payload through app.error() so the entry appears in the
|
|
31
|
+
// standard SignalK log (journalctl -u signalk / /var/log/signalk).
|
|
32
|
+
// Throttled on the client to 1 Hz; the server-side is stateless.
|
|
33
|
+
//
|
|
34
|
+
// Finally the plugin serves precompressed .br / .gz siblings for
|
|
35
|
+
// _framework/, js/, css/ and lib/. express.static only ever sends the
|
|
36
|
+
// identity bytes, so without this a cold load pulls the full-size WASM
|
|
37
|
+
// runtime, assemblies and scripts over the boat's wifi. _framework/
|
|
38
|
+
// siblings come from the SDK (fingerprinted, never rewritten after
|
|
39
|
+
// publish); js/, css/ and lib/ siblings are regenerated by the Release
|
|
40
|
+
// publish after minifying and bundling (scripts/precompress.mjs), so
|
|
41
|
+
// they match the bytes on disk. index.html (base href patched at
|
|
42
|
+
// staging), service-worker.js and appsettings.json are not negotiated:
|
|
43
|
+
// they change after the SDK compressed them.
|
|
44
|
+
//
|
|
45
|
+
// signalk-server calls start() on every enable and settings save and
|
|
46
|
+
// stop() on disable, but Express can't remove a route. Routes are
|
|
47
|
+
// therefore registered once per app and fall through (next()) while
|
|
48
|
+
// the plugin is stopped.
|
|
49
|
+
|
|
50
|
+
const path = require('path');
|
|
51
|
+
const fs = require('fs');
|
|
52
|
+
|
|
53
|
+
/** Precompressed sibling suffix per Content-Encoding, in preference order. */
|
|
54
|
+
const ENCODING_SUFFIX = { br: '.br', gzip: '.gz' };
|
|
55
|
+
const ENCODING_PREFERENCE = ['br', 'gzip'];
|
|
56
|
+
|
|
57
|
+
const CONTENT_TYPES = {
|
|
58
|
+
'.wasm': 'application/wasm',
|
|
59
|
+
'.js': 'text/javascript; charset=utf-8',
|
|
60
|
+
'.mjs': 'text/javascript; charset=utf-8',
|
|
61
|
+
'.json': 'application/json; charset=utf-8',
|
|
62
|
+
'.css': 'text/css; charset=utf-8',
|
|
63
|
+
'.html': 'text/html; charset=utf-8',
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Encodings from ENCODING_PREFERENCE the client accepts, best first:
|
|
68
|
+
* higher q wins, ties keep br before gzip. A wildcard covers any
|
|
69
|
+
* encoding the header does not name.
|
|
70
|
+
* "gzip, deflate, br" -> ['br', 'gzip']
|
|
71
|
+
* "gzip;q=1.0, br;q=0.5" -> ['gzip', 'br']
|
|
72
|
+
* "br;q=0, *" -> ['gzip']
|
|
73
|
+
* "" / undefined / "identity" -> []
|
|
74
|
+
*/
|
|
75
|
+
function acceptableEncodings(acceptEncoding) {
|
|
76
|
+
const q = new Map();
|
|
77
|
+
for (const part of String(acceptEncoding || '').split(',')) {
|
|
78
|
+
const [rawName, ...params] = part.trim().split(';');
|
|
79
|
+
const name = rawName.trim().toLowerCase();
|
|
80
|
+
if (!name) continue;
|
|
81
|
+
let weight = 1;
|
|
82
|
+
for (const p of params) {
|
|
83
|
+
const m = /^\s*q\s*=\s*([0-9.]+)\s*$/i.exec(p);
|
|
84
|
+
if (m) weight = Number(m[1]);
|
|
85
|
+
}
|
|
86
|
+
if (Number.isFinite(weight)) q.set(name, weight);
|
|
87
|
+
}
|
|
88
|
+
const wildcard = q.has('*') ? q.get('*') : 0;
|
|
89
|
+
return ENCODING_PREFERENCE
|
|
90
|
+
.map((enc, order) => ({ enc, order, weight: q.has(enc) ? q.get(enc) : wildcard }))
|
|
91
|
+
.filter((e) => e.weight > 0)
|
|
92
|
+
.sort((a, b) => b.weight - a.weight || a.order - b.order)
|
|
93
|
+
.map((e) => e.enc);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/** Content-Type for the uncompressed file the client asked for. */
|
|
97
|
+
function contentTypeFor(filePath) {
|
|
98
|
+
return CONTENT_TYPES[path.extname(filePath).toLowerCase()] || 'application/octet-stream';
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Map a request path relative to the _framework mount onto a file
|
|
103
|
+
* inside frameworkDir, or null when it is malformed or escapes it.
|
|
104
|
+
* "/dotnet.native.8f1c.wasm" -> "<frameworkDir>/dotnet.native.8f1c.wasm"
|
|
105
|
+
* "/../index.html" -> "<frameworkDir>/index.html" (clamped to the root)
|
|
106
|
+
* "/..%5C..%5Cindex.html" -> null on Windows (backslash escape)
|
|
107
|
+
*/
|
|
108
|
+
function resolveFrameworkFile(frameworkDir, relPath) {
|
|
109
|
+
let decoded;
|
|
110
|
+
try { decoded = decodeURIComponent(relPath || ''); }
|
|
111
|
+
catch { return null; }
|
|
112
|
+
if (!decoded || decoded.includes('\0') || decoded.endsWith('/')) return null;
|
|
113
|
+
const root = path.resolve(frameworkDir);
|
|
114
|
+
const full = path.resolve(root, '.' + path.posix.normalize('/' + decoded));
|
|
115
|
+
return full.startsWith(root + path.sep) ? full : null;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Express middleware for the _framework mount: when the client accepts
|
|
120
|
+
* br or gzip and a precompressed sibling exists, send it with the
|
|
121
|
+
* original Content-Type plus Content-Encoding; otherwise fall through
|
|
122
|
+
* to express.static. Vary is set either way so a shared cache never
|
|
123
|
+
* hands br bytes to a client that did not ask for them.
|
|
124
|
+
*/
|
|
125
|
+
function createPrecompressedMiddleware(frameworkDir, exists = fs.existsSync) {
|
|
126
|
+
return function onaPrecompressed(req, res, next) {
|
|
127
|
+
if (req.method !== 'GET' && req.method !== 'HEAD') return next();
|
|
128
|
+
const file = resolveFrameworkFile(frameworkDir, req.path);
|
|
129
|
+
if (!file || !exists(file)) return next();
|
|
130
|
+
res.append('Vary', 'Accept-Encoding');
|
|
131
|
+
for (const enc of acceptableEncodings(req.headers['accept-encoding'])) {
|
|
132
|
+
const compressed = file + ENCODING_SUFFIX[enc];
|
|
133
|
+
if (!exists(compressed)) continue;
|
|
134
|
+
res.setHeader('Content-Encoding', enc);
|
|
135
|
+
res.setHeader('Content-Type', contentTypeFor(file));
|
|
136
|
+
return res.sendFile(compressed, (err) => {
|
|
137
|
+
if (!err || res.headersSent) return;
|
|
138
|
+
res.removeHeader('Content-Encoding');
|
|
139
|
+
res.removeHeader('Content-Type');
|
|
140
|
+
next();
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
return next();
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Register middleware on mountPath so it runs BEFORE the webapp's
|
|
149
|
+
* express.static layer for the same path. signalk-server mounts webapp
|
|
150
|
+
* statics before it starts plugins, so a plain app.use would only ever
|
|
151
|
+
* see requests static had already answered. Moves our layer directly in
|
|
152
|
+
* front of the matching serveStatic layer (keeping any earlier auth
|
|
153
|
+
* middleware ahead of both). Returns false and leaves the layer where
|
|
154
|
+
* app.use put it when the router internals are not recognised; identity
|
|
155
|
+
* serving then continues unchanged.
|
|
156
|
+
*/
|
|
157
|
+
function useBeforeStatic(app, mountPath, middleware, probePath) {
|
|
158
|
+
app.use(mountPath, middleware);
|
|
159
|
+
const router = app._router || app.router;
|
|
160
|
+
const stack = router && router.stack;
|
|
161
|
+
if (!Array.isArray(stack)) return false;
|
|
162
|
+
const oursIdx = stack.findIndex((l) => l && l.handle === middleware);
|
|
163
|
+
if (oursIdx < 0) return false;
|
|
164
|
+
const staticIdx = stack.findIndex((l, i) => i !== oursIdx && l && l.name === 'serveStatic'
|
|
165
|
+
&& typeof l.match === 'function' && l.match(probePath));
|
|
166
|
+
if (staticIdx < 0 || staticIdx > oursIdx) return staticIdx > oursIdx;
|
|
167
|
+
const [ours] = stack.splice(oursIdx, 1);
|
|
168
|
+
stack.splice(staticIdx, 0, ours);
|
|
169
|
+
return true;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/** Static directories under public/ served with precompressed siblings. */
|
|
173
|
+
const PRECOMPRESSED_DIRS = ['_framework', 'js', 'css', 'lib'];
|
|
174
|
+
|
|
175
|
+
/** Per-app registration state, shared by every plugin instance on it. */
|
|
176
|
+
const appStates = new WeakMap();
|
|
177
|
+
|
|
178
|
+
function stateFor(app) {
|
|
179
|
+
let state = appStates.get(app);
|
|
180
|
+
if (!state) {
|
|
181
|
+
state = { running: false, registered: false };
|
|
182
|
+
appStates.set(app, state);
|
|
183
|
+
}
|
|
184
|
+
return state;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/** Wraps an Express handler so it only acts while the plugin runs. */
|
|
188
|
+
function whileRunning(state, handler) {
|
|
189
|
+
return function onaWhileRunning(req, res, next) {
|
|
190
|
+
if (!state.running) return next();
|
|
191
|
+
return handler(req, res, next);
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
module.exports = function (app) {
|
|
196
|
+
return createPlugin(app, __dirname);
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* Builds the plugin object. baseDir holds public/ (the deployed webapp
|
|
201
|
+
* bundle); its folder name is the package name, so the shim stays
|
|
202
|
+
* portable across scoped / renamed installs.
|
|
203
|
+
*/
|
|
204
|
+
function createPlugin(app, baseDir) {
|
|
205
|
+
const PACKAGE_NAME = path.basename(baseDir);
|
|
206
|
+
const INDEX_HTML = path.join(baseDir, 'public', 'index.html');
|
|
207
|
+
const ROUTE_PREFIX = '/' + PACKAGE_NAME;
|
|
208
|
+
const state = stateFor(app);
|
|
209
|
+
|
|
210
|
+
const plugin = {
|
|
211
|
+
id: PACKAGE_NAME,
|
|
212
|
+
name: 'OnaPlotter (SPA fallback)',
|
|
213
|
+
description:
|
|
214
|
+
'Serves public/index.html for any Blazor client-routed path under ' +
|
|
215
|
+
ROUTE_PREFIX + ' so reload / direct link / back button return the ' +
|
|
216
|
+
'app instead of a bare 404.',
|
|
217
|
+
|
|
218
|
+
schema: () => ({ type: 'object', properties: {} }),
|
|
219
|
+
|
|
220
|
+
start: () => {
|
|
221
|
+
if (!fs.existsSync(INDEX_HTML)) {
|
|
222
|
+
state.running = false;
|
|
223
|
+
app.setPluginError(
|
|
224
|
+
'public/index.html missing; SPA fallback disabled'
|
|
225
|
+
);
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
state.running = true;
|
|
229
|
+
if (!state.registered) {
|
|
230
|
+
registerRoutes();
|
|
231
|
+
state.registered = true;
|
|
232
|
+
}
|
|
233
|
+
app.setPluginStatus(
|
|
234
|
+
'SPA fallback, error relay and br/gzip static serving registered at ' +
|
|
235
|
+
ROUTE_PREFIX + '/*'
|
|
236
|
+
);
|
|
237
|
+
},
|
|
238
|
+
|
|
239
|
+
stop: () => {
|
|
240
|
+
state.running = false;
|
|
241
|
+
app.setPluginStatus('Stopped');
|
|
242
|
+
},
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
function registerRoutes() {
|
|
246
|
+
// Error relay: POST /<pkg>/log. Accepts JSON bodies of the
|
|
247
|
+
// shape { message, stack?, url?, userAgent?, ts? } and
|
|
248
|
+
// forwards to the SignalK server log. We cap the payload
|
|
249
|
+
// size so a misbehaving client can't flood the log with
|
|
250
|
+
// a minified stack the size of the world.
|
|
251
|
+
//
|
|
252
|
+
// SignalK's webapp HTTP surface already applies the admin
|
|
253
|
+
// auth middleware before our handlers run, so only an
|
|
254
|
+
// authenticated user can reach this endpoint. No CORS
|
|
255
|
+
// needed because the Blazor client is same-origin.
|
|
256
|
+
const MAX_BYTES = 8 * 1024;
|
|
257
|
+
app.post(ROUTE_PREFIX + '/log', whileRunning(state, (req, res) => {
|
|
258
|
+
try {
|
|
259
|
+
const body = req.body || {};
|
|
260
|
+
const message = String(body.message || 'no message').slice(0, 800);
|
|
261
|
+
const stack = String(body.stack || '').slice(0, MAX_BYTES);
|
|
262
|
+
const url = String(body.url || '').slice(0, 400);
|
|
263
|
+
const ua = String(body.userAgent || '').slice(0, 200);
|
|
264
|
+
const ts = String(body.ts || new Date().toISOString());
|
|
265
|
+
app.error(
|
|
266
|
+
'[onaplotter] client-error ' + ts + ' ' + ua + ' | ' +
|
|
267
|
+
message + (stack ? ' | ' + stack : '') +
|
|
268
|
+
(url ? ' | at ' + url : '')
|
|
269
|
+
);
|
|
270
|
+
res.json({ ok: true });
|
|
271
|
+
} catch (e) {
|
|
272
|
+
res.status(400).json({ ok: false, error: String(e) });
|
|
273
|
+
}
|
|
274
|
+
}));
|
|
275
|
+
|
|
276
|
+
for (const dir of PRECOMPRESSED_DIRS) {
|
|
277
|
+
const mount = ROUTE_PREFIX + '/' + dir;
|
|
278
|
+
const ahead = useBeforeStatic(app, mount,
|
|
279
|
+
whileRunning(state, createPrecompressedMiddleware(
|
|
280
|
+
path.join(baseDir, 'public', dir))),
|
|
281
|
+
mount + '/probe.js');
|
|
282
|
+
if (!ahead) {
|
|
283
|
+
app.debug('precompressed ' + dir + '/ serving registered behind ' +
|
|
284
|
+
'express.static; clients receive identity-encoded files');
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
// Match any GET under the webapp prefix that doesn't
|
|
289
|
+
// contain a '.' (i.e. not a file extension). Real assets
|
|
290
|
+
// like /<pkg>/_framework/foo.wasm keep flowing through
|
|
291
|
+
// express.static; only client routes (/<pkg>/map etc.)
|
|
292
|
+
// land here.
|
|
293
|
+
const fallback = new RegExp('^' + ROUTE_PREFIX + '/[^.]+$');
|
|
294
|
+
app.get(fallback, whileRunning(state, (req, res) => {
|
|
295
|
+
res.sendFile(INDEX_HTML);
|
|
296
|
+
}));
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
return plugin;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
// Exposed for deploy/index.test.js; signalk-server only calls the factory.
|
|
303
|
+
module.exports.internals = {
|
|
304
|
+
createPlugin,
|
|
305
|
+
acceptableEncodings,
|
|
306
|
+
contentTypeFor,
|
|
307
|
+
resolveFrameworkFile,
|
|
308
|
+
createPrecompressedMiddleware,
|
|
309
|
+
useBeforeStatic,
|
|
310
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "signalk-onaplotter",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Touch-first chartplotter webapp for SignalK: charts, AIS with CPA/TCPA alarms, anchor watch, MOB, routes and waypoints on helm screen, tablet and phone.",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"signalk-webapp",
|
|
8
|
+
"signalk-node-server-plugin",
|
|
9
|
+
"signalk-category-chart-plotters",
|
|
10
|
+
"signalk",
|
|
11
|
+
"chartplotter",
|
|
12
|
+
"marine",
|
|
13
|
+
"ais"
|
|
14
|
+
],
|
|
15
|
+
"author": "msallin (https://github.com/msallin)",
|
|
16
|
+
"license": "MIT",
|
|
17
|
+
"homepage": "https://msallin.github.io/ona-plotter/",
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "git+https://github.com/msallin/ona-plotter.git"
|
|
21
|
+
},
|
|
22
|
+
"bugs": {
|
|
23
|
+
"url": "https://github.com/msallin/ona-plotter/issues"
|
|
24
|
+
},
|
|
25
|
+
"signalk-plugin-enabled-by-default": true,
|
|
26
|
+
"signalk": {
|
|
27
|
+
"appIcon": "favicon.svg",
|
|
28
|
+
"displayName": "OnaPlotter"
|
|
29
|
+
}
|
|
30
|
+
}
|