@signalk/freeboard-sk 2.18.2 → 2.19.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
CHANGED
package/plugin/index.js
CHANGED
|
@@ -2,83 +2,17 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const server_api_1 = require("@signalk/server-api");
|
|
4
4
|
const alarms_1 = require("./alarms/alarms");
|
|
5
|
-
/** @deprecated */
|
|
6
|
-
const weather_service_1 = require("./weather/weather-service");
|
|
7
5
|
const openapi = require("./openApi.json");
|
|
8
6
|
const defaultPollInterval = 60;
|
|
9
7
|
const CONFIG_SCHEMA = {
|
|
10
|
-
properties: {
|
|
11
|
-
/** @deprecated */
|
|
12
|
-
weather: {
|
|
13
|
-
type: 'object',
|
|
14
|
-
title: 'Weather API.',
|
|
15
|
-
description: 'OpenWeather service settings.',
|
|
16
|
-
properties: {
|
|
17
|
-
enable: {
|
|
18
|
-
type: 'boolean',
|
|
19
|
-
default: false,
|
|
20
|
-
title: 'Enable Weather',
|
|
21
|
-
description: ' '
|
|
22
|
-
},
|
|
23
|
-
apiVersion: {
|
|
24
|
-
type: 'number',
|
|
25
|
-
title: 'API Version',
|
|
26
|
-
default: 3,
|
|
27
|
-
enum: [3, 2],
|
|
28
|
-
description: 'Note: v2 API not supported after April 2024!'
|
|
29
|
-
},
|
|
30
|
-
apiKey: {
|
|
31
|
-
type: 'string',
|
|
32
|
-
title: 'API Key',
|
|
33
|
-
default: '',
|
|
34
|
-
description: 'Get your API key at https://openweathermap.org/home/sign_up'
|
|
35
|
-
},
|
|
36
|
-
pollInterval: {
|
|
37
|
-
type: 'number',
|
|
38
|
-
title: 'Polling Interval',
|
|
39
|
-
default: 60,
|
|
40
|
-
enum: weather_service_1.WEATHER_POLL_INTERVAL,
|
|
41
|
-
description: 'Select the interval at which the weather service is polled.'
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
const CONFIG_UISCHEMA = {
|
|
48
|
-
/** @deprecated */
|
|
49
|
-
weather: {
|
|
50
|
-
enable: {
|
|
51
|
-
'ui:widget': 'checkbox',
|
|
52
|
-
'ui:title': ' ',
|
|
53
|
-
'ui:help': ' '
|
|
54
|
-
},
|
|
55
|
-
apiVersion: {
|
|
56
|
-
'ui:widget': 'select',
|
|
57
|
-
'ui-help': ' '
|
|
58
|
-
},
|
|
59
|
-
apiKey: {
|
|
60
|
-
'ui:disabled': false,
|
|
61
|
-
'ui-help': ''
|
|
62
|
-
},
|
|
63
|
-
pollInterval: {
|
|
64
|
-
'ui:widget': 'select',
|
|
65
|
-
'ui:title': 'Polling Interval (mins)',
|
|
66
|
-
'ui:help': ' '
|
|
67
|
-
}
|
|
68
|
-
}
|
|
8
|
+
properties: {}
|
|
69
9
|
};
|
|
10
|
+
const CONFIG_UISCHEMA = {};
|
|
70
11
|
module.exports = (server) => {
|
|
71
12
|
// ** default configuration settings
|
|
72
13
|
let settings = {
|
|
73
14
|
alarms: {
|
|
74
15
|
enable: true
|
|
75
|
-
},
|
|
76
|
-
/** @deprecated */
|
|
77
|
-
weather: {
|
|
78
|
-
enable: false,
|
|
79
|
-
apiVersion: 3,
|
|
80
|
-
apiKey: '',
|
|
81
|
-
pollInterval: defaultPollInterval
|
|
82
16
|
}
|
|
83
17
|
};
|
|
84
18
|
// ******** REQUIRED PLUGIN DEFINITION *******
|
|
@@ -111,17 +45,6 @@ module.exports = (server) => {
|
|
|
111
45
|
* @todo remove after merge of https://github.com/SignalK/specification/pull/662
|
|
112
46
|
*/
|
|
113
47
|
emitMeteoMetas();
|
|
114
|
-
settings.weather = options.weather ?? {
|
|
115
|
-
enable: false,
|
|
116
|
-
apiVersion: 3,
|
|
117
|
-
apiKey: '',
|
|
118
|
-
pollInterval: defaultPollInterval
|
|
119
|
-
};
|
|
120
|
-
settings.weather.enable = options.weather.enable ?? false;
|
|
121
|
-
settings.weather.apiVersion = options.weather.apiVersion ?? 3;
|
|
122
|
-
settings.weather.apiKey = options.weather.apiKey ?? '';
|
|
123
|
-
settings.weather.pollInterval =
|
|
124
|
-
options.weather.pollInterval ?? defaultPollInterval;
|
|
125
48
|
settings.alarms = options.alarms ?? {
|
|
126
49
|
enable: true
|
|
127
50
|
};
|
|
@@ -130,12 +53,7 @@ module.exports = (server) => {
|
|
|
130
53
|
if (settings.alarms.enable) {
|
|
131
54
|
(0, alarms_1.initAlarms)(server, plugin.id);
|
|
132
55
|
}
|
|
133
|
-
|
|
134
|
-
if (settings.weather.enable) {
|
|
135
|
-
msg = `Started - Providing: weather`;
|
|
136
|
-
(0, weather_service_1.initWeather)(server, plugin.id, settings.weather);
|
|
137
|
-
}
|
|
138
|
-
server.setPluginStatus(msg);
|
|
56
|
+
server.setPluginStatus('Started');
|
|
139
57
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
140
58
|
}
|
|
141
59
|
catch (error) {
|
|
@@ -148,7 +66,6 @@ module.exports = (server) => {
|
|
|
148
66
|
};
|
|
149
67
|
const doShutdown = () => {
|
|
150
68
|
server.debug('** shutting down **');
|
|
151
|
-
(0, weather_service_1.stopWeather)();
|
|
152
69
|
server.debug('** Un-subscribing from events **');
|
|
153
70
|
const msg = 'Stopped';
|
|
154
71
|
server.setPluginStatus(msg);
|
|
@@ -161,7 +78,10 @@ module.exports = (server) => {
|
|
|
161
78
|
});
|
|
162
79
|
});
|
|
163
80
|
};
|
|
164
|
-
|
|
81
|
+
/**
|
|
82
|
+
* Ensure meta delta are emitted for environment paths
|
|
83
|
+
* @todo remove after merge of https://github.com/SignalK/specification/pull/662
|
|
84
|
+
*/
|
|
165
85
|
const emitMeteoMetas = () => {
|
|
166
86
|
const pathRoot = 'environment';
|
|
167
87
|
const metas = [];
|
|
@@ -662,20 +662,17 @@
|
|
|
662
662
|
<div class="panel" id="resources">
|
|
663
663
|
<h4><i class="material-icons">layers</i> Resources / Layers</h4>
|
|
664
664
|
|
|
665
|
-
Freeboard provides
|
|
666
|
-
|
|
665
|
+
Freeboard provides Create / Update / Delete (CrUD) functionality for
|
|
666
|
+
all in-built Signal K resource types:
|
|
667
|
+
<i>routes, waypoints, charts, notes and regions</i>.
|
|
667
668
|
<br />
|
|
668
|
-
Each resource type is
|
|
669
|
-
controlled from the
|
|
670
|
-
|
|
671
|
-
|
|
669
|
+
Each resource type is managed in a separate map layer which can be
|
|
670
|
+
controlled from the <i class="material-icons">layers</i> toolbar
|
|
671
|
+
button, which when clicked will contain options for the various
|
|
672
|
+
resource types.
|
|
672
673
|
<br />
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
additional available resource paths enabled in Settings.
|
|
676
|
-
<br />
|
|
677
|
-
Resource groups can also be defined which enables "one-click"
|
|
678
|
-
selection of resources to display on the screen.
|
|
674
|
+
Resources can be <i>grouped</i> which enables them to be displayed or
|
|
675
|
+
hidden with a single click.
|
|
679
676
|
<br />
|
|
680
677
|
Additionally resources can be exported to a GPX file by selecting the
|
|
681
678
|
<b><i class="material-icons">save</i> Export</b> menu.
|
|
@@ -683,32 +680,39 @@
|
|
|
683
680
|
<ul>
|
|
684
681
|
<li class="nobullet">
|
|
685
682
|
<i class="material-icons">category</i>
|
|
686
|
-
<b>Resource Groups
|
|
687
|
-
Displays a list of Resource Groups.
|
|
683
|
+
<b>Resource Groups</b>
|
|
688
684
|
</li>
|
|
689
685
|
</ul>
|
|
690
686
|
|
|
691
687
|
<div style="display: flex; flex-wrap: wrap">
|
|
692
688
|
<div style="padding-left: 15px">
|
|
693
689
|
Groups provide a means of defining a set of resources so they can
|
|
694
|
-
be easily
|
|
690
|
+
be easily displayed or hidden.
|
|
695
691
|
<br />
|
|
696
|
-
Selecting a Group will display
|
|
697
|
-
group and hide all other resources.
|
|
692
|
+
Selecting a Group will display all of the resources within the
|
|
693
|
+
group on the map and hide all other resources.
|
|
698
694
|
<br />
|
|
699
695
|
Resources can be added to groups directly from the specfic
|
|
700
|
-
resource list (e.g. Routes, Waypoints)
|
|
696
|
+
resource list <i>(e.g. Routes, Waypoints)</i> or when editing a
|
|
697
|
+
Group's properties.
|
|
701
698
|
<br />
|
|
702
|
-
|
|
699
|
+
<i
|
|
700
|
+
>Note: A resource can belong to more than one resource group.</i
|
|
701
|
+
>
|
|
703
702
|
<ul>
|
|
704
703
|
<li>
|
|
705
704
|
<i class="material-icons">add</i> <b>New Group:</b> Create a
|
|
706
|
-
new Group
|
|
705
|
+
new resource Group.
|
|
707
706
|
</li>
|
|
708
707
|
<li>
|
|
709
708
|
<i class="material-icons">edit</i>
|
|
710
|
-
<b>Update Group:</b>
|
|
711
|
-
to:
|
|
709
|
+
<b>Update Group:</b> Display / update a Group's properties.
|
|
710
|
+
Use this to:
|
|
711
|
+
<ul>
|
|
712
|
+
<li>Rename the group</li>
|
|
713
|
+
<li>Display the resourcces within the group</li>
|
|
714
|
+
<li>Add and Remove resources from the group</li>
|
|
715
|
+
</ul>
|
|
712
716
|
group.
|
|
713
717
|
</li>
|
|
714
718
|
<li>
|
|
@@ -723,10 +727,23 @@
|
|
|
723
727
|
<div style="display: flex; flex-wrap: wrap">
|
|
724
728
|
<div style="padding-left: 15px; background-color: orange">
|
|
725
729
|
<b>Enabling Resource Groups</b><br />
|
|
726
|
-
|
|
730
|
+
Freeboard will try to create a resource collection on the Signal K
|
|
731
|
+
server to store resource groups. <br />
|
|
732
|
+
<i
|
|
733
|
+
>Note: this requires that:
|
|
734
|
+
<ol>
|
|
735
|
+
<li>You are logged in to the Signal K server</li>
|
|
736
|
+
<li>
|
|
737
|
+
<b>resources-provider</b> plugin version 1.4.1 or greater is
|
|
738
|
+
installed on the server
|
|
739
|
+
</li>
|
|
740
|
+
</ol>
|
|
741
|
+
</i>
|
|
742
|
+
|
|
743
|
+
If Freeboard cannot create the store then you can configure a
|
|
727
744
|
<i>groups</i> resource endpoint on the Signal K server.
|
|
728
745
|
<br />
|
|
729
|
-
To
|
|
746
|
+
To do this:
|
|
730
747
|
<ul>
|
|
731
748
|
<li>
|
|
732
749
|
In the Signal K server Admin console select
|
|
@@ -740,8 +757,82 @@
|
|
|
740
757
|
</li>
|
|
741
758
|
<li>Click <b>Submit</b></li>
|
|
742
759
|
</ul>
|
|
743
|
-
|
|
744
|
-
|
|
760
|
+
<i
|
|
761
|
+
>Note: Freeboard-SK will need to be re-loaded to make the
|
|
762
|
+
Resource Groups menu item available.</i
|
|
763
|
+
>
|
|
764
|
+
</div>
|
|
765
|
+
</div>
|
|
766
|
+
|
|
767
|
+
<hr />
|
|
768
|
+
<ul>
|
|
769
|
+
<li class="nobullet">
|
|
770
|
+
<i class="material-icons">layers</i>
|
|
771
|
+
<b>Overlays</b>
|
|
772
|
+
</li>
|
|
773
|
+
</ul>
|
|
774
|
+
|
|
775
|
+
<div style="display: flex; flex-wrap: wrap">
|
|
776
|
+
<div style="padding-left: 15px">
|
|
777
|
+
Overlays allow information to be "overlaid" on charts as map
|
|
778
|
+
layers.
|
|
779
|
+
<br />
|
|
780
|
+
They can be configured to be refreshed at regular intervals to
|
|
781
|
+
update the displayed data from the source.
|
|
782
|
+
<br />
|
|
783
|
+
The opacity of the overlay can be configured to control the
|
|
784
|
+
visibility of the underlying chart layers.
|
|
785
|
+
<br />
|
|
786
|
+
<ul>
|
|
787
|
+
<li>
|
|
788
|
+
<i class="material-icons">add</i> <b>New Overlay:</b> Create a
|
|
789
|
+
new overlay from a WMS or WMTS source.
|
|
790
|
+
</li>
|
|
791
|
+
<li>
|
|
792
|
+
<i class="material-icons">delete</i>
|
|
793
|
+
<b>Delete Overlay:</b> Delete the overlay definition from the
|
|
794
|
+
server.
|
|
795
|
+
</li>
|
|
796
|
+
</ul>
|
|
797
|
+
</div>
|
|
798
|
+
</div>
|
|
799
|
+
<div style="display: flex; flex-wrap: wrap">
|
|
800
|
+
<div style="padding-left: 15px; background-color: orange">
|
|
801
|
+
<b>Enabling Overlays</b><br />
|
|
802
|
+
Freeboard will try to create a resource collection on the Signal K
|
|
803
|
+
server to store Overlays. <br />
|
|
804
|
+
<i
|
|
805
|
+
>Note: this requires that:
|
|
806
|
+
<ol>
|
|
807
|
+
<li>You are logged in to the Signal K server</li>
|
|
808
|
+
<li>
|
|
809
|
+
<b>resources-provider</b> plugin version 1.4.1 or greater is
|
|
810
|
+
installed on the server
|
|
811
|
+
</li>
|
|
812
|
+
</ol>
|
|
813
|
+
</i>
|
|
814
|
+
|
|
815
|
+
If Freeboard cannot create the store then you can configure a
|
|
816
|
+
<i>infolayers</i> resource endpoint on the Signal K server.
|
|
817
|
+
<br />
|
|
818
|
+
To do this:
|
|
819
|
+
<ul>
|
|
820
|
+
<li>
|
|
821
|
+
In the Signal K server Admin console select
|
|
822
|
+
<b>Server | Plugin Config</b>
|
|
823
|
+
</li>
|
|
824
|
+
<li>Select the <b>Resources Provider</b> plugin</li>
|
|
825
|
+
<li>
|
|
826
|
+
In the <b>Resources (Custom)</b> section, click
|
|
827
|
+
<i class="material-icons">add</i> and type
|
|
828
|
+
<i>infolayers</i> in the <b>Resource Type</b>
|
|
829
|
+
</li>
|
|
830
|
+
<li>Click <b>Submit</b></li>
|
|
831
|
+
</ul>
|
|
832
|
+
<i
|
|
833
|
+
>Note: Freeboard-SK will need to be re-loaded to make the
|
|
834
|
+
Overlays menu item available.</i
|
|
835
|
+
>
|
|
745
836
|
</div>
|
|
746
837
|
</div>
|
|
747
838
|
|
package/public/index.html
CHANGED
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
</div>
|
|
60
60
|
</div>
|
|
61
61
|
</app-root>
|
|
62
|
-
<script src="runtime.e598c35c8d15b7e2.js" type="module"></script><script src="polyfills.0823dc027f0a1d2e.js" type="module"></script><script src="main.
|
|
62
|
+
<script src="runtime.e598c35c8d15b7e2.js" type="module"></script><script src="polyfills.0823dc027f0a1d2e.js" type="module"></script><script src="main.30f0db8afdde9114.js" type="module"></script></body>
|
|
63
63
|
</html>
|