@mxtommy/kip 1.3.0 → 2.0.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/CHANGELOG.md +38 -3
- package/CONTRIBUTORS.md +4 -4
- package/KipGaugeSample3-1024x508.png +0 -0
- package/LICENSE +21 -0
- package/README.md +80 -42
- package/package.json +52 -46
- package/public/3rdpartylicenses.txt +47 -419
- package/public/assets/NoSleep.min.js +2 -2
- package/public/assets/icon-64x64.png +0 -0
- package/public/assets/icon-72x72.png +0 -0
- package/public/index.html +3 -3
- package/public/main.f3d15cc777474f5f.js +1 -0
- package/public/manifest.json +9 -4
- package/public/polyfills.64db6be9cdc8f808.js +1 -0
- package/public/runtime.e75056c32c37f59d.js +1 -0
- package/public/styles.6b1c2c92be18a2cc.css +1 -0
- package/.angulardoc.json +0 -4
- package/angular.json +0 -162
- package/e2e/app.e2e-spec.ts +0 -14
- package/e2e/app.po.ts +0 -11
- package/e2e/tsconfig.e2e.json +0 -14
- package/karma.conf.js +0 -31
- package/protractor.conf.js +0 -28
- package/public/assets/svg-autopilot-inkscape-plain.svg +0 -983
- package/public/assets/svg-wind-inkscape.svg +0 -1358
- package/public/main-es2018.98175eb4c61ccaf7eb17.js +0 -1
- package/public/main-es5.98175eb4c61ccaf7eb17.js +0 -1
- package/public/polyfills-es2018.3a61665863c173cd6ba3.js +0 -1
- package/public/polyfills-es5.44827ae4ff4e41de51fb.js +0 -1
- package/public/runtime-es2018.baedb88c6d2abacae2b8.js +0 -1
- package/public/runtime-es5.baedb88c6d2abacae2b8.js +0 -1
- package/public/styles.b92ae2c466c89712209d.css +0 -5
- package/src/app/alarm-menu/alarm-menu.component.html +0 -55
- package/src/app/alarm-menu/alarm-menu.component.scss +0 -52
- package/src/app/alarm-menu/alarm-menu.component.spec.ts +0 -25
- package/src/app/alarm-menu/alarm-menu.component.ts +0 -186
- package/src/app/app-help/app-help.component.css +0 -4
- package/src/app/app-help/app-help.component.html +0 -135
- package/src/app/app-help/app-help.component.ts +0 -45
- package/src/app/app-settings.service.spec.ts +0 -15
- package/src/app/app-settings.service.ts +0 -478
- package/src/app/app.component.css +0 -39
- package/src/app/app.component.html +0 -93
- package/src/app/app.component.scss +0 -79
- package/src/app/app.component.spec.ts +0 -32
- package/src/app/app.component.ts +0 -191
- package/src/app/app.module.ts +0 -200
- package/src/app/config.blank.const.ts +0 -52
- package/src/app/config.blank.notification.const.ts +0 -19
- package/src/app/config.blank.units.const.ts +0 -23
- package/src/app/config.demo.const.ts +0 -384
- package/src/app/data-browser/data-browser.component.css +0 -29
- package/src/app/data-browser/data-browser.component.html +0 -44
- package/src/app/data-browser/data-browser.component.spec.ts +0 -25
- package/src/app/data-browser/data-browser.component.ts +0 -91
- package/src/app/data-browser-row/data-browser-row-unit-modal.html +0 -17
- package/src/app/data-browser-row/data-browser-row.component.css +0 -10
- package/src/app/data-browser-row/data-browser-row.component.html +0 -5
- package/src/app/data-browser-row/data-browser-row.component.ts +0 -79
- package/src/app/data-set.service.spec.ts +0 -15
- package/src/app/data-set.service.ts +0 -273
- package/src/app/dynamic-widget.directive.spec.ts +0 -8
- package/src/app/dynamic-widget.directive.ts +0 -11
- package/src/app/filter-self.pipe.spec.ts +0 -8
- package/src/app/filter-self.pipe.ts +0 -14
- package/src/app/fit-text.directive.spec.ts +0 -8
- package/src/app/fit-text.directive.ts +0 -61
- package/src/app/gauge-steel/gauge-steel.component.css +0 -5
- package/src/app/gauge-steel/gauge-steel.component.html +0 -4
- package/src/app/gauge-steel/gauge-steel.component.spec.ts +0 -25
- package/src/app/gauge-steel/gauge-steel.component.ts +0 -282
- package/src/app/gauges-module/base-gauge.ts +0 -301
- package/src/app/gauges-module/gauges.module.ts +0 -17
- package/src/app/gauges-module/linear-gauge.ts +0 -50
- package/src/app/gauges-module/radial-gauge.ts +0 -48
- package/src/app/layout-split/layout-split.component.html +0 -30
- package/src/app/layout-split/layout-split.component.scss +0 -33
- package/src/app/layout-split/layout-split.component.spec.ts +0 -25
- package/src/app/layout-split/layout-split.component.ts +0 -59
- package/src/app/layout-splits.service.spec.ts +0 -15
- package/src/app/layout-splits.service.ts +0 -284
- package/src/app/modal-path-selector/modal-path-selector.component.html +0 -62
- package/src/app/modal-path-selector/modal-path-selector.component.scss +0 -39
- package/src/app/modal-path-selector/modal-path-selector.component.spec.ts +0 -25
- package/src/app/modal-path-selector/modal-path-selector.component.ts +0 -132
- package/src/app/modal-widget/modal-widget.component.css +0 -33
- package/src/app/modal-widget/modal-widget.component.html +0 -341
- package/src/app/modal-widget/modal-widget.component.spec.ts +0 -25
- package/src/app/modal-widget/modal-widget.component.ts +0 -84
- package/src/app/notifications.service.spec.ts +0 -12
- package/src/app/notifications.service.ts +0 -392
- package/src/app/object-keys.pipe.spec.ts +0 -8
- package/src/app/object-keys.pipe.ts +0 -13
- package/src/app/reset-config/reset-config.component.css +0 -0
- package/src/app/reset-config/reset-config.component.html +0 -3
- package/src/app/reset-config/reset-config.component.spec.ts +0 -25
- package/src/app/reset-config/reset-config.component.ts +0 -31
- package/src/app/root-display/root-display.component.css +0 -0
- package/src/app/root-display/root-display.component.html +0 -4
- package/src/app/root-display/root-display.component.spec.ts +0 -25
- package/src/app/root-display/root-display.component.ts +0 -57
- package/src/app/safe.pipe.ts +0 -16
- package/src/app/settings/settings.component.css +0 -9
- package/src/app/settings/settings.component.html +0 -25
- package/src/app/settings/settings.component.spec.ts +0 -25
- package/src/app/settings/settings.component.ts +0 -22
- package/src/app/settings-config/settings-config.component.css +0 -39
- package/src/app/settings-config/settings-config.component.html +0 -118
- package/src/app/settings-config/settings-config.component.spec.ts +0 -25
- package/src/app/settings-config/settings-config.component.ts +0 -161
- package/src/app/settings-datasets/settings-datasets.component.html +0 -43
- package/src/app/settings-datasets/settings-datasets.component.scss +0 -39
- package/src/app/settings-datasets/settings-datasets.component.spec.ts +0 -25
- package/src/app/settings-datasets/settings-datasets.component.ts +0 -98
- package/src/app/settings-datasets/settings-datasets.modal.html +0 -54
- package/src/app/settings-notifications/settings-notifications.component.css +0 -0
- package/src/app/settings-notifications/settings-notifications.component.html +0 -65
- package/src/app/settings-notifications/settings-notifications.component.spec.ts +0 -25
- package/src/app/settings-notifications/settings-notifications.component.ts +0 -29
- package/src/app/settings-signalk/settings-signalk.component.css +0 -3
- package/src/app/settings-signalk/settings-signalk.component.html +0 -89
- package/src/app/settings-signalk/settings-signalk.component.spec.ts +0 -25
- package/src/app/settings-signalk/settings-signalk.component.ts +0 -174
- package/src/app/settings-units/settings-units.component.css +0 -4
- package/src/app/settings-units/settings-units.component.html +0 -19
- package/src/app/settings-units/settings-units.component.spec.ts +0 -25
- package/src/app/settings-units/settings-units.component.ts +0 -62
- package/src/app/settings-zones/settings-zones.component.css +0 -22
- package/src/app/settings-zones/settings-zones.component.html +0 -70
- package/src/app/settings-zones/settings-zones.component.ts +0 -154
- package/src/app/settings-zones/settings-zones.modal.css +0 -14
- package/src/app/settings-zones/settings-zones.modal.html +0 -39
- package/src/app/signalk-connection.service.ts +0 -344
- package/src/app/signalk-delta.service.spec.ts +0 -15
- package/src/app/signalk-delta.service.ts +0 -97
- package/src/app/signalk-full.service.spec.ts +0 -15
- package/src/app/signalk-full.service.ts +0 -99
- package/src/app/signalk-interfaces.ts +0 -129
- package/src/app/signalk-requests.service.spec.ts +0 -12
- package/src/app/signalk-requests.service.ts +0 -180
- package/src/app/signalk.service.spec.ts +0 -15
- package/src/app/signalk.service.ts +0 -428
- package/src/app/svg-autopilot/svg-autopilot.component.html +0 -1036
- package/src/app/svg-autopilot/svg-autopilot.component.spec.ts +0 -25
- package/src/app/svg-autopilot/svg-autopilot.component.ts +0 -174
- package/src/app/svg-simple-linear-gauge/svg-simple-linear-gauge.component.html +0 -119
- package/src/app/svg-simple-linear-gauge/svg-simple-linear-gauge.component.scss +0 -0
- package/src/app/svg-simple-linear-gauge/svg-simple-linear-gauge.component.spec.ts +0 -25
- package/src/app/svg-simple-linear-gauge/svg-simple-linear-gauge.component.ts +0 -49
- package/src/app/svg-wind/svg-wind.component.css +0 -0
- package/src/app/svg-wind/svg-wind.component.html +0 -969
- package/src/app/svg-wind/svg-wind.component.scss +0 -76
- package/src/app/svg-wind/svg-wind.component.spec.ts +0 -25
- package/src/app/svg-wind/svg-wind.component.ts +0 -280
- package/src/app/unit-window/unit-window.component.css +0 -37
- package/src/app/unit-window/unit-window.component.html +0 -8
- package/src/app/unit-window/unit-window.component.spec.ts +0 -25
- package/src/app/unit-window/unit-window.component.ts +0 -134
- package/src/app/unit-window/unit-window.modal.html +0 -25
- package/src/app/units.service.ts +0 -300
- package/src/app/widget-autopilot/widget-autopilot.component.html +0 -78
- package/src/app/widget-autopilot/widget-autopilot.component.scss +0 -191
- package/src/app/widget-autopilot/widget-autopilot.component.spec.ts +0 -25
- package/src/app/widget-autopilot/widget-autopilot.component.ts +0 -774
- package/src/app/widget-blank/widget-blank.component.html +0 -5
- package/src/app/widget-blank/widget-blank.component.scss +0 -21
- package/src/app/widget-blank/widget-blank.component.spec.ts +0 -25
- package/src/app/widget-blank/widget-blank.component.ts +0 -17
- package/src/app/widget-gauge/widget-gauge.component.css +0 -26
- package/src/app/widget-gauge/widget-gauge.component.html +0 -29
- package/src/app/widget-gauge/widget-gauge.component.spec.ts +0 -25
- package/src/app/widget-gauge/widget-gauge.component.ts +0 -120
- package/src/app/widget-gauge-ng-linear/widget-gauge-ng-linear.component.html +0 -126
- package/src/app/widget-gauge-ng-linear/widget-gauge-ng-linear.component.scss +0 -94
- package/src/app/widget-gauge-ng-linear/widget-gauge-ng-linear.component.spec.ts +0 -25
- package/src/app/widget-gauge-ng-linear/widget-gauge-ng-linear.component.ts +0 -424
- package/src/app/widget-gauge-ng-radial/widget-gauge-ng-radial.component.html +0 -122
- package/src/app/widget-gauge-ng-radial/widget-gauge-ng-radial.component.scss +0 -69
- package/src/app/widget-gauge-ng-radial/widget-gauge-ng-radial.component.spec.ts +0 -25
- package/src/app/widget-gauge-ng-radial/widget-gauge-ng-radial.component.ts +0 -553
- package/src/app/widget-historical/widget-historical.component.css +0 -31
- package/src/app/widget-historical/widget-historical.component.html +0 -14
- package/src/app/widget-historical/widget-historical.component.scss +0 -0
- package/src/app/widget-historical/widget-historical.component.spec.ts +0 -25
- package/src/app/widget-historical/widget-historical.component.ts +0 -306
- package/src/app/widget-iframe/widget-iframe.component.css +0 -12
- package/src/app/widget-iframe/widget-iframe.component.html +0 -21
- package/src/app/widget-iframe/widget-iframe.component.spec.ts +0 -25
- package/src/app/widget-iframe/widget-iframe.component.ts +0 -63
- package/src/app/widget-list.service.spec.ts +0 -15
- package/src/app/widget-list.service.ts +0 -135
- package/src/app/widget-manager.service.spec.ts +0 -15
- package/src/app/widget-manager.service.ts +0 -141
- package/src/app/widget-numeric/widget-numeric.component.html +0 -13
- package/src/app/widget-numeric/widget-numeric.component.scss +0 -52
- package/src/app/widget-numeric/widget-numeric.component.spec.ts +0 -25
- package/src/app/widget-numeric/widget-numeric.component.ts +0 -457
- package/src/app/widget-simple-linear/widget-simple-linear.component.html +0 -28
- package/src/app/widget-simple-linear/widget-simple-linear.component.scss +0 -64
- package/src/app/widget-simple-linear/widget-simple-linear.component.spec.ts +0 -25
- package/src/app/widget-simple-linear/widget-simple-linear.component.ts +0 -199
- package/src/app/widget-state/widget-state.component.html +0 -27
- package/src/app/widget-state/widget-state.component.scss +0 -68
- package/src/app/widget-state/widget-state.component.spec.ts +0 -25
- package/src/app/widget-state/widget-state.component.ts +0 -178
- package/src/app/widget-switch/widget-switch.component.css +0 -70
- package/src/app/widget-switch/widget-switch.component.html +0 -17
- package/src/app/widget-switch/widget-switch.component.spec.ts +0 -25
- package/src/app/widget-switch/widget-switch.component.ts +0 -134
- package/src/app/widget-text-generic/widget-text-generic.component.css +0 -55
- package/src/app/widget-text-generic/widget-text-generic.component.html +0 -9
- package/src/app/widget-text-generic/widget-text-generic.component.spec.ts +0 -25
- package/src/app/widget-text-generic/widget-text-generic.component.ts +0 -253
- package/src/app/widget-tutorial/widget-tutorial.component.css +0 -0
- package/src/app/widget-tutorial/widget-tutorial.component.html +0 -34
- package/src/app/widget-tutorial/widget-tutorial.component.spec.ts +0 -25
- package/src/app/widget-tutorial/widget-tutorial.component.ts +0 -18
- package/src/app/widget-unknown/widget-unknown.component.css +0 -0
- package/src/app/widget-unknown/widget-unknown.component.html +0 -3
- package/src/app/widget-unknown/widget-unknown.component.spec.ts +0 -25
- package/src/app/widget-unknown/widget-unknown.component.ts +0 -15
- package/src/app/widget-wind/widget-wind.component.css +0 -24
- package/src/app/widget-wind/widget-wind.component.html +0 -20
- package/src/app/widget-wind/widget-wind.component.spec.ts +0 -25
- package/src/app/widget-wind/widget-wind.component.ts +0 -369
- package/src/assets/.gitkeep +0 -0
- package/src/assets/NoSleep.min.js +0 -2
- package/src/assets/alarm.mp3 +0 -0
- package/src/assets/alert.mp3 +0 -0
- package/src/assets/alertl.old.mp3 +0 -0
- package/src/assets/emergency.mp3 +0 -0
- package/src/assets/fontawesome6/css/all.min.css +0 -6
- package/src/assets/fontawesome6/webfonts/fa-brands-400.ttf +0 -0
- package/src/assets/fontawesome6/webfonts/fa-brands-400.woff2 +0 -0
- package/src/assets/fontawesome6/webfonts/fa-regular-400.ttf +0 -0
- package/src/assets/fontawesome6/webfonts/fa-regular-400.woff2 +0 -0
- package/src/assets/fontawesome6/webfonts/fa-solid-900.ttf +0 -0
- package/src/assets/fontawesome6/webfonts/fa-solid-900.woff2 +0 -0
- package/src/assets/fontawesome6/webfonts/fa-v4compatibility.ttf +0 -0
- package/src/assets/fontawesome6/webfonts/fa-v4compatibility.woff2 +0 -0
- package/src/assets/icon-192x192.png +0 -0
- package/src/assets/icon-256x256.png +0 -0
- package/src/assets/icon-384x384.png +0 -0
- package/src/assets/icon-512x512.png +0 -0
- package/src/assets/notification.mp3 +0 -0
- package/src/assets/steelseries-min.js +0 -25
- package/src/assets/steelseries-min.js.map +0 -8
- package/src/assets/steelseries.js +0 -15834
- package/src/assets/svg-autopilot-inkscape-plain.svg +0 -983
- package/src/assets/svg-wind-inkscape.svg +0 -1358
- package/src/assets/tween-min.js +0 -1
- package/src/assets/tween.js +0 -381
- package/src/assets/warn.mp3 +0 -0
- package/src/environments/environment.prod.ts +0 -3
- package/src/environments/environment.ts +0 -8
- package/src/favicon.ico +0 -0
- package/src/index.html +0 -20
- package/src/main.ts +0 -11
- package/src/manifest.json +0 -33
- package/src/polyfills.ts +0 -80
- package/src/styles.css +0 -47
- package/src/styles.scss +0 -157
- package/src/test.ts +0 -32
- package/src/themes/darkBlueTheme.scss +0 -117
- package/src/themes/defaultTheme.scss +0 -50
- package/src/themes/highContrastTheme.scss +0 -47
- package/src/themes/modernTheme.scss +0 -143
- package/src/themes/nightMode.scss +0 -185
- package/src/themes/platypusTheme.scss +0 -80
- package/src/themes/signalkTheme.scss +0 -112
- package/src/tsconfig.app.json +0 -15
- package/src/tsconfig.spec.json +0 -20
- package/src/typings.d.ts +0 -5
- package/tsconfig.json +0 -24
- package/tslint.json +0 -143
- /package/{KipGaugeSample-1-1024x545.png → KipGaugeSample1-1024x545.png} +0 -0
- /package/{KipMonitor-1024x488.png → KipGaugeSample2-1024x488.png} +0 -0
|
@@ -1,478 +0,0 @@
|
|
|
1
|
-
import { Injectable } from '@angular/core';
|
|
2
|
-
import { BehaviorSubject } from 'rxjs';
|
|
3
|
-
import { Router } from '@angular/router';
|
|
4
|
-
|
|
5
|
-
import { IDataSet } from './data-set.service';
|
|
6
|
-
import { ISplitSet } from './layout-splits.service';
|
|
7
|
-
import { IWidget } from './widget-manager.service';
|
|
8
|
-
import { IUnitDefaults } from './units.service';
|
|
9
|
-
|
|
10
|
-
import { DefaultAppConfig, DefaultWidgetConfig, DefaultLayoutConfig, DefaultThemeConfig } from './config.blank.const';
|
|
11
|
-
import { DefaultUnitsConfig } from './config.blank.units.const'
|
|
12
|
-
import { DefaultNotificationConfig } from './config.blank.notification.const';
|
|
13
|
-
import { DemoAppConfig, DemoWidgetConfig, DemoLayoutConfig, DemoThemeConfig } from './config.demo.const';
|
|
14
|
-
import { isNumber } from 'util';
|
|
15
|
-
|
|
16
|
-
const defaultSignalKUrl: SignalKUrl = { url: 'http://demo.signalk.org/signalk', new: true };
|
|
17
|
-
const defaultTheme = 'modern-dark';
|
|
18
|
-
const configVersion = 6; // used to invalidate old configs.
|
|
19
|
-
|
|
20
|
-
export interface IAppConfig {
|
|
21
|
-
configVersion: number;
|
|
22
|
-
kipUUID: string;
|
|
23
|
-
signalKUrl: string;
|
|
24
|
-
signalKToken: string;
|
|
25
|
-
dataSets: IDataSet[];
|
|
26
|
-
unitDefaults: IUnitDefaults;
|
|
27
|
-
notificationConfig: INotificationConfig;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export interface IThemeConfig {
|
|
31
|
-
themeName: string;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export interface IWidgetConfig {
|
|
35
|
-
widgets: Array<IWidget>;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export interface ILayoutConfig {
|
|
39
|
-
splitSets: ISplitSet[];
|
|
40
|
-
rootSplits: string[];
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export interface INotificationConfig {
|
|
44
|
-
disableNotifications: boolean;
|
|
45
|
-
menuGrouping: boolean;
|
|
46
|
-
security: {
|
|
47
|
-
disableSecurity: boolean;
|
|
48
|
-
},
|
|
49
|
-
devices: {
|
|
50
|
-
disableDevices: boolean;
|
|
51
|
-
showNormalState: boolean;
|
|
52
|
-
},
|
|
53
|
-
sound: {
|
|
54
|
-
disableSound: boolean;
|
|
55
|
-
muteNormal: boolean;
|
|
56
|
-
muteWarning: boolean;
|
|
57
|
-
muteAlert: boolean;
|
|
58
|
-
muteAlarm: boolean;
|
|
59
|
-
muteEmergency: boolean;
|
|
60
|
-
},
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export enum ZoneState {
|
|
64
|
-
normal = 0,
|
|
65
|
-
warning = 1,
|
|
66
|
-
alarm = 2,
|
|
67
|
-
}
|
|
68
|
-
export interface IZone {
|
|
69
|
-
uuid: string;
|
|
70
|
-
path: string;
|
|
71
|
-
unit: string;
|
|
72
|
-
upper: number;
|
|
73
|
-
lower: number;
|
|
74
|
-
state: ZoneState;
|
|
75
|
-
}
|
|
76
|
-
export interface IZonesConfig {
|
|
77
|
-
zones: Array<IZone>;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
export interface SignalKUrl {
|
|
81
|
-
url: string;
|
|
82
|
-
new: boolean;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
export interface SignalKToken {
|
|
86
|
-
token: string;
|
|
87
|
-
new: boolean;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
@Injectable()
|
|
92
|
-
export class AppSettingsService {
|
|
93
|
-
signalKUrl: BehaviorSubject<SignalKUrl> = new BehaviorSubject<SignalKUrl>(defaultSignalKUrl); // this should be overwritten right away when loading settings, but you need to give something...
|
|
94
|
-
unlockStatus: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false);
|
|
95
|
-
unitDefaults: BehaviorSubject<IUnitDefaults> = new BehaviorSubject<IUnitDefaults>({});
|
|
96
|
-
themeName: BehaviorSubject<string> = new BehaviorSubject<string>(defaultTheme);
|
|
97
|
-
signalKToken: BehaviorSubject<SignalKToken>;
|
|
98
|
-
kipKNotificationConfig: BehaviorSubject<INotificationConfig>;
|
|
99
|
-
kipUUID: string;
|
|
100
|
-
|
|
101
|
-
widgets: Array<IWidget>;
|
|
102
|
-
splitSets: ISplitSet[] = [];
|
|
103
|
-
rootSplits: string[] = [];
|
|
104
|
-
dataSets: IDataSet[] = [];
|
|
105
|
-
zones: BehaviorSubject<Array<IZone>> = new BehaviorSubject<Array<IZone>>([]);
|
|
106
|
-
root
|
|
107
|
-
|
|
108
|
-
constructor(private router: Router) {
|
|
109
|
-
let appConfig: IAppConfig;
|
|
110
|
-
let widgetConfig: IWidgetConfig;
|
|
111
|
-
let layoutConfig: ILayoutConfig;
|
|
112
|
-
let themeConfig: IThemeConfig;
|
|
113
|
-
let zonesConfig: IZonesConfig;
|
|
114
|
-
|
|
115
|
-
if (window.localStorage) {
|
|
116
|
-
// localStorage supported
|
|
117
|
-
|
|
118
|
-
appConfig = JSON.parse(localStorage.getItem("appConfig"));
|
|
119
|
-
|
|
120
|
-
if (appConfig == null) {
|
|
121
|
-
console.log("Error loading App config. resetting and loading all default.");
|
|
122
|
-
localStorage.clear();
|
|
123
|
-
appConfig = this.getDefaultAppConfig();
|
|
124
|
-
widgetConfig = this.getDefaultWidgetConfig();
|
|
125
|
-
layoutConfig = this.getDefaultLayoutConfig();
|
|
126
|
-
themeConfig = this.getDefaultThemeConfig();
|
|
127
|
-
zonesConfig = { zones: [] };
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
if (!isNumber(appConfig.configVersion) || (appConfig.configVersion != configVersion)) {
|
|
131
|
-
console.error("Invalid config version, resetting and loading all default.");
|
|
132
|
-
localStorage.clear();
|
|
133
|
-
appConfig = this.getDefaultAppConfig();
|
|
134
|
-
widgetConfig = this.getDefaultWidgetConfig();
|
|
135
|
-
layoutConfig = this.getDefaultLayoutConfig();
|
|
136
|
-
themeConfig = this.getDefaultThemeConfig();
|
|
137
|
-
zonesConfig = { zones: [] };
|
|
138
|
-
} else {
|
|
139
|
-
widgetConfig = this.loadLocalStorageConfig("widgetConfig");
|
|
140
|
-
layoutConfig = this.loadLocalStorageConfig("layoutConfig");
|
|
141
|
-
themeConfig = this.loadLocalStorageConfig("themeConfig");
|
|
142
|
-
zonesConfig = this.loadLocalStorageConfig("zonesConfig");
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
this.pushSettings(appConfig, widgetConfig, layoutConfig, themeConfig, zonesConfig);
|
|
146
|
-
} else {
|
|
147
|
-
console.log("***** LocalStorage NOT SUPPORTED by browser *****\nThis is required by Kip...");
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
loadLocalStorageConfig(type: string) {
|
|
152
|
-
// we don't support AppConfig here. It needs a version check and full config invalidation.
|
|
153
|
-
let config;
|
|
154
|
-
config = JSON.parse(localStorage.getItem(type));
|
|
155
|
-
|
|
156
|
-
if (config == null) {
|
|
157
|
-
console.log("Error loading " + type + " config. Force loading " + type + " defaults.");
|
|
158
|
-
switch (type) {
|
|
159
|
-
case "widgetConfig":
|
|
160
|
-
config = this.getDefaultWidgetConfig();
|
|
161
|
-
break;
|
|
162
|
-
|
|
163
|
-
case "layoutConfig":
|
|
164
|
-
config = this.getDefaultLayoutConfig();
|
|
165
|
-
break;
|
|
166
|
-
|
|
167
|
-
case "themeConfig":
|
|
168
|
-
config = this.getDefaultThemeConfig();
|
|
169
|
-
break;
|
|
170
|
-
|
|
171
|
-
case "zonesConfig":
|
|
172
|
-
config = { zones: [] };
|
|
173
|
-
break;
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
return config;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
private pushSettings(appConfig: IAppConfig, widgetConfig: IWidgetConfig, layoutConfig: ILayoutConfig, themeConfig: IThemeConfig, zonesConfig: IZonesConfig) {
|
|
180
|
-
this.themeName.next(themeConfig['themeName']);
|
|
181
|
-
|
|
182
|
-
let skUrl: SignalKUrl = {url: appConfig.signalKUrl, new: false};
|
|
183
|
-
let skToken: SignalKToken = {token: appConfig.signalKToken, new: false};
|
|
184
|
-
this.signalKUrl.next(skUrl);
|
|
185
|
-
this.signalKToken = new BehaviorSubject<SignalKToken>(skToken);
|
|
186
|
-
this.dataSets = appConfig.dataSets;
|
|
187
|
-
this.unitDefaults.next(appConfig.unitDefaults);
|
|
188
|
-
this.kipKNotificationConfig = new BehaviorSubject<INotificationConfig>(appConfig.notificationConfig);
|
|
189
|
-
this.kipUUID = appConfig.kipUUID;
|
|
190
|
-
this.widgets = widgetConfig.widgets;
|
|
191
|
-
this.zones.next(zonesConfig.zones);
|
|
192
|
-
|
|
193
|
-
this.splitSets = layoutConfig.splitSets;
|
|
194
|
-
this.rootSplits = layoutConfig.rootSplits;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
//UnitDefaults
|
|
198
|
-
public getDefaultUnitsAsO() {
|
|
199
|
-
return this.unitDefaults.asObservable();
|
|
200
|
-
}
|
|
201
|
-
public getDefaultUnits() {
|
|
202
|
-
return this.unitDefaults.getValue();
|
|
203
|
-
}
|
|
204
|
-
public setDefaultUnits(newDefaults: IUnitDefaults) {
|
|
205
|
-
this.unitDefaults.next(newDefaults);
|
|
206
|
-
this.saveAppConfigToLocalStorage();
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
// App config - use by Settings Config Component
|
|
210
|
-
public getAppConfig(): IAppConfig {
|
|
211
|
-
return this.buildAppStorageObject();
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
public getWidgetConfig(): IWidgetConfig {
|
|
215
|
-
return this.buildWidgetStorageObject();
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
public getLayoutConfig(): ILayoutConfig {
|
|
219
|
-
return this.buildLayoutStorageObject();
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
public getThemeConfig(): IThemeConfig {
|
|
223
|
-
return this.buildThemeStorageObject();
|
|
224
|
-
}
|
|
225
|
-
public getZonesConfig(): IZonesConfig {
|
|
226
|
-
return this.buildZonesStorageObject()
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
public getKipUUID() {
|
|
230
|
-
return this.kipUUID;
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
// SignalKURL
|
|
234
|
-
public getSignalKURLAsO() {
|
|
235
|
-
return this.signalKUrl.asObservable();
|
|
236
|
-
}
|
|
237
|
-
public getSignalKURL() {
|
|
238
|
-
return this.signalKUrl.getValue();
|
|
239
|
-
}
|
|
240
|
-
public setSignalKURL(value: SignalKUrl) {
|
|
241
|
-
this.signalKUrl.next(value);
|
|
242
|
-
this.saveAppConfigToLocalStorage();
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
// SignalKToken
|
|
246
|
-
public getSignalKTokenAsO() {
|
|
247
|
-
return this.signalKToken.asObservable();
|
|
248
|
-
}
|
|
249
|
-
public getSignalKToken() {
|
|
250
|
-
return this.signalKToken.getValue();
|
|
251
|
-
}
|
|
252
|
-
public setSignalKToken(value: SignalKToken) {
|
|
253
|
-
this.signalKToken.next(value);
|
|
254
|
-
this.saveAppConfigToLocalStorage();
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
// UnlockStatus
|
|
258
|
-
public getUnlockStatusAsO() {
|
|
259
|
-
return this.unlockStatus.asObservable();
|
|
260
|
-
}
|
|
261
|
-
public setUnlockStatus(value) {
|
|
262
|
-
this.unlockStatus.next(value);
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
// Themes
|
|
266
|
-
public getThemeNameAsO() {
|
|
267
|
-
return this.themeName.asObservable();
|
|
268
|
-
}
|
|
269
|
-
public setThemName(newTheme: string) {
|
|
270
|
-
this.themeName.next(newTheme);
|
|
271
|
-
if (newTheme != "nightMode") { // don't save NightMode, only temporary
|
|
272
|
-
this.saveThemeConfigToLocalStorage();
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
public getThemeName(): string {
|
|
276
|
-
let config: IThemeConfig = JSON.parse(localStorage.getItem('themeConfig'));;
|
|
277
|
-
return config.themeName;
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
// Widgets
|
|
281
|
-
public getWidgets() {
|
|
282
|
-
return this.widgets;
|
|
283
|
-
}
|
|
284
|
-
public saveWidgets(widgets: Array<IWidget>) {
|
|
285
|
-
this.widgets = widgets;
|
|
286
|
-
this.saveWidgetConfigToLocalStorage();
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
// Layout SplitSets
|
|
290
|
-
public getSplitSets() {
|
|
291
|
-
return this.splitSets;
|
|
292
|
-
}
|
|
293
|
-
public getRootSplits() {
|
|
294
|
-
return this.rootSplits;
|
|
295
|
-
}
|
|
296
|
-
public saveSplitSets(splitSets) {
|
|
297
|
-
this.splitSets = splitSets;
|
|
298
|
-
this.saveLayoutConfigToLocalStorage();
|
|
299
|
-
}
|
|
300
|
-
public saveRootUUIDs(rootUUIDs) {
|
|
301
|
-
this.rootSplits = rootUUIDs;
|
|
302
|
-
this.saveLayoutConfigToLocalStorage();
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
// DataSets
|
|
306
|
-
public saveDataSets(dataSets) {
|
|
307
|
-
this.dataSets = dataSets;
|
|
308
|
-
this.saveAppConfigToLocalStorage();
|
|
309
|
-
}
|
|
310
|
-
public getDataSets() {
|
|
311
|
-
return this.dataSets;
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
// Zones
|
|
315
|
-
public saveZones(zones: Array<IZone>) {
|
|
316
|
-
this.zones.next(zones);
|
|
317
|
-
this.saveZonesConfigToLocalStorage();
|
|
318
|
-
}
|
|
319
|
-
public getZonesAsO() {
|
|
320
|
-
return this.zones.asObservable();
|
|
321
|
-
}
|
|
322
|
-
public getZones() {
|
|
323
|
-
return this.zones.getValue();
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
// Notification Service Setting
|
|
327
|
-
public getNotificationConfigService() {
|
|
328
|
-
return this.kipKNotificationConfig.asObservable();
|
|
329
|
-
}
|
|
330
|
-
public getNotificationConfig(): INotificationConfig {
|
|
331
|
-
return this.kipKNotificationConfig.getValue();
|
|
332
|
-
}
|
|
333
|
-
public setNotificationConfig(notificationConfig: INotificationConfig) {
|
|
334
|
-
this.kipKNotificationConfig.next(notificationConfig);
|
|
335
|
-
this.saveAppConfigToLocalStorage();
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
//Config manipulation: RAW and SignalK server - used by Settings Config Component
|
|
339
|
-
public resetSettings() {
|
|
340
|
-
localStorage.clear();
|
|
341
|
-
this.reloadApp();
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
/**
|
|
345
|
-
* Updates keys of localStorage config and reloads apps if required to apply new config. IMPORTANT NOTE: Kip does not apply config unless app is reloaded
|
|
346
|
-
* @param configType String of either appConfig, widgetConfig, layoutConfig or themeConfig.
|
|
347
|
-
* @param newConfig Object containing config. Of type IAppConfig, IWidgetConfig, ILayoutConfig or IThemeConfig
|
|
348
|
-
* @param reloadApp Optional Boolean. If True reloads the app, else does nothing. Defaults to False.
|
|
349
|
-
*/
|
|
350
|
-
public replaceConfig(configType: string, newConfig: string, reloadApp?: boolean) {
|
|
351
|
-
localStorage.setItem(configType, newConfig);
|
|
352
|
-
if (reloadApp) {
|
|
353
|
-
this.reloadApp();
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
public loadDemoConfig() {
|
|
358
|
-
localStorage.clear();
|
|
359
|
-
this.replaceConfig("appConfig", JSON.stringify(DemoAppConfig));
|
|
360
|
-
this.replaceConfig("widgetConfig", JSON.stringify(DemoWidgetConfig));
|
|
361
|
-
this.replaceConfig("layoutConfig", JSON.stringify(DemoLayoutConfig));
|
|
362
|
-
this.replaceConfig("themeConfig", JSON.stringify(DemoThemeConfig), true);
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
public reloadApp() {
|
|
366
|
-
this.router.navigate(['/']);
|
|
367
|
-
setTimeout(()=>{ location.reload() }, 200);
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
//// Storage Objects
|
|
371
|
-
// building from running data
|
|
372
|
-
private buildAppStorageObject() {
|
|
373
|
-
let storageObject: IAppConfig = {
|
|
374
|
-
configVersion: configVersion,
|
|
375
|
-
kipUUID: this.kipUUID,
|
|
376
|
-
signalKUrl: this.signalKUrl.getValue().url,
|
|
377
|
-
signalKToken: this.signalKToken.getValue().token,
|
|
378
|
-
dataSets: this.dataSets,
|
|
379
|
-
unitDefaults: this.unitDefaults.getValue(),
|
|
380
|
-
notificationConfig: this.kipKNotificationConfig.getValue(),
|
|
381
|
-
}
|
|
382
|
-
return storageObject;
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
private buildWidgetStorageObject() {
|
|
386
|
-
let storageObject: IWidgetConfig = {
|
|
387
|
-
widgets: this.widgets,
|
|
388
|
-
}
|
|
389
|
-
return storageObject;
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
private buildLayoutStorageObject() {
|
|
393
|
-
let storageObject: ILayoutConfig = {
|
|
394
|
-
splitSets: this.splitSets,
|
|
395
|
-
rootSplits: this.rootSplits,
|
|
396
|
-
}
|
|
397
|
-
return storageObject;
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
private buildThemeStorageObject() {
|
|
401
|
-
let storageObject: IThemeConfig = {
|
|
402
|
-
themeName: this.themeName.getValue()
|
|
403
|
-
}
|
|
404
|
-
return storageObject;
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
private buildZonesStorageObject() {
|
|
408
|
-
let storageObject: IZonesConfig = {
|
|
409
|
-
zones: this.zones.getValue()
|
|
410
|
-
}
|
|
411
|
-
return storageObject;
|
|
412
|
-
}
|
|
413
|
-
|
|
414
|
-
//Saving to Storage
|
|
415
|
-
private saveAppConfigToLocalStorage() {
|
|
416
|
-
console.log("Saving App config to LocalStorage");
|
|
417
|
-
localStorage.setItem('appConfig', JSON.stringify(this.buildAppStorageObject()));
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
private saveWidgetConfigToLocalStorage() {
|
|
421
|
-
console.log("Saving Widgets config to LocalStorage");
|
|
422
|
-
localStorage.setItem('widgetConfig', JSON.stringify(this.buildWidgetStorageObject()));
|
|
423
|
-
}
|
|
424
|
-
|
|
425
|
-
private saveLayoutConfigToLocalStorage() {
|
|
426
|
-
console.log("Saving Layouts config to LocalStorage");
|
|
427
|
-
localStorage.setItem('layoutConfig', JSON.stringify(this.buildLayoutStorageObject()));
|
|
428
|
-
}
|
|
429
|
-
|
|
430
|
-
private saveThemeConfigToLocalStorage() {
|
|
431
|
-
console.log("Saving Theme config to LocalStorage");
|
|
432
|
-
localStorage.setItem('themeConfig', JSON.stringify(this.buildThemeStorageObject()));
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
private saveZonesConfigToLocalStorage() {
|
|
436
|
-
console.log("Saving Zones config to LocalStorage");
|
|
437
|
-
localStorage.setItem('zonesConfig', JSON.stringify(this.buildZonesStorageObject()));
|
|
438
|
-
}
|
|
439
|
-
|
|
440
|
-
// Private Defaults Loading functions
|
|
441
|
-
private getDefaultAppConfig(): IAppConfig {
|
|
442
|
-
let config: IAppConfig = DefaultAppConfig;
|
|
443
|
-
config.notificationConfig = DefaultNotificationConfig;
|
|
444
|
-
config.unitDefaults = DefaultUnitsConfig;
|
|
445
|
-
config.signalKUrl = window.location.origin;
|
|
446
|
-
config['configVersion'] = configVersion;
|
|
447
|
-
config.kipUUID = this.newUuid();
|
|
448
|
-
localStorage.setItem('appConfig', JSON.stringify(config));
|
|
449
|
-
return config;
|
|
450
|
-
}
|
|
451
|
-
|
|
452
|
-
private getDefaultWidgetConfig(): IWidgetConfig {
|
|
453
|
-
let config: IWidgetConfig = DefaultWidgetConfig;
|
|
454
|
-
localStorage.setItem("widgetConfig", JSON.stringify(config));
|
|
455
|
-
return config;
|
|
456
|
-
}
|
|
457
|
-
|
|
458
|
-
private getDefaultLayoutConfig(): ILayoutConfig {
|
|
459
|
-
let config: ILayoutConfig = DefaultLayoutConfig;
|
|
460
|
-
localStorage.setItem("layoutConfig", JSON.stringify(config));
|
|
461
|
-
return config;
|
|
462
|
-
}
|
|
463
|
-
|
|
464
|
-
private getDefaultThemeConfig(): IThemeConfig {
|
|
465
|
-
let config: IThemeConfig = DefaultThemeConfig;
|
|
466
|
-
localStorage.setItem("themeConfig", JSON.stringify(config));
|
|
467
|
-
return config;
|
|
468
|
-
}
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
private newUuid() {
|
|
472
|
-
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
|
|
473
|
-
var r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8);
|
|
474
|
-
return v.toString(16);
|
|
475
|
-
});
|
|
476
|
-
}
|
|
477
|
-
|
|
478
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
.fullheight {
|
|
2
|
-
height: 100%;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
.mainContainer {
|
|
8
|
-
display: flex;
|
|
9
|
-
flex-direction: column;
|
|
10
|
-
align-items: stretch;
|
|
11
|
-
height: 100%;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.mainWindow {
|
|
15
|
-
/* width: 100%; */
|
|
16
|
-
flex: 30;
|
|
17
|
-
/*
|
|
18
|
-
top: 0px;
|
|
19
|
-
bottom: 60px;
|
|
20
|
-
position: absolute;
|
|
21
|
-
*/
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.menuBar {
|
|
25
|
-
/*width: 100%;
|
|
26
|
-
height: 60px; */
|
|
27
|
-
flex: 1;
|
|
28
|
-
/* bottom: 0px;
|
|
29
|
-
position: absolute;
|
|
30
|
-
background-color: rgb(100,100,100);;
|
|
31
|
-
*/
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.menuBarContainer {
|
|
35
|
-
display: flex;
|
|
36
|
-
flex-direction: row;
|
|
37
|
-
justify-content: space-between;
|
|
38
|
-
}
|
|
39
|
-
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
<div [class]="themeClass">
|
|
2
|
-
<div class="mainContainer app-defaults" >
|
|
3
|
-
<div class="mainWindow">
|
|
4
|
-
<router-outlet></router-outlet>
|
|
5
|
-
</div>
|
|
6
|
-
<div class="menuBar">
|
|
7
|
-
<div class="menuBarContainer theme-menu">
|
|
8
|
-
<div class="menuBarButtonGroups">
|
|
9
|
-
<app-alarm-menu></app-alarm-menu>
|
|
10
|
-
</div>
|
|
11
|
-
<div class="menuBarButtonGroups">
|
|
12
|
-
<button color="accent"mat-flat-button class="menuBarNavButtons" (click)="pageDown()">
|
|
13
|
-
<i class="fa-solid fa-chevron-left fa-2x" aria-hidden="true"></i>
|
|
14
|
-
</button>
|
|
15
|
-
</div>
|
|
16
|
-
<div class="menuBarButtonGroups">
|
|
17
|
-
<button color="accent" mat-flat-button class="menuBarNavButtons" (click)="pageUp()">
|
|
18
|
-
<i class="fa-solid fa-chevron-right fa-2x" aria-hidden="true"></i>
|
|
19
|
-
</button>
|
|
20
|
-
</div>
|
|
21
|
-
<div class="menuBarButtonGroups">
|
|
22
|
-
<button color="accent" mat-flat-button class="menuBarSettingsButton" [matMenuTriggerFor]="settingsMenu" >
|
|
23
|
-
<i class="fa-solid fa-bars fa-2x" aria-hidden="true"></i>
|
|
24
|
-
</button>
|
|
25
|
-
</div>
|
|
26
|
-
</div>
|
|
27
|
-
</div>
|
|
28
|
-
</div>
|
|
29
|
-
</div>
|
|
30
|
-
|
|
31
|
-
<mat-menu #settingsMenu="matMenu">
|
|
32
|
-
<button mat-menu-item routerLink="/help">
|
|
33
|
-
<span><i class="fa-solid fa-question-circle" aria-hidden="true"></i> Help</span>
|
|
34
|
-
</button>
|
|
35
|
-
<button mat-menu-item [matMenuTriggerFor]="configMenu">
|
|
36
|
-
<span><i class="fa-solid fa-cog" aria-hidden="true"></i> Configuration</span>
|
|
37
|
-
</button>
|
|
38
|
-
<button mat-menu-item routerLink="/data">
|
|
39
|
-
<span><i class="fa-solid fa-info" aria-hidden="true"></i> Data Browser</span>
|
|
40
|
-
</button>
|
|
41
|
-
<button mat-menu-item (click)="setNightMode(isNightMode ? false : true)">
|
|
42
|
-
<span *ngIf="!isNightMode"><i class="fa-solid fa-moon-o" aria-hidden="true"></i> Night Mode</span>
|
|
43
|
-
<span *ngIf="isNightMode"><i class="fa-solid fa-sun-o" aria-hidden="true"></i> Day Mode</span>
|
|
44
|
-
</button>
|
|
45
|
-
<button mat-menu-item (click)="toggleFullScreen()">
|
|
46
|
-
<span *ngIf="!fullscreenStatus"><i class="fa-solid fa-window-maximize" aria-hidden="true"></i> Fullscreen</span>
|
|
47
|
-
<span *ngIf="fullscreenStatus"><i class="fa-solid fa-window-restore" aria-hidden="true"></i> Exit Fullscreen</span>
|
|
48
|
-
</button>
|
|
49
|
-
</mat-menu>
|
|
50
|
-
|
|
51
|
-
<mat-menu #configMenu="matMenu">
|
|
52
|
-
<button mat-menu-item routerLink="/settings">
|
|
53
|
-
<span><i class="fa-solid fa-sliders" aria-hidden="true"></i> Settings</span>
|
|
54
|
-
</button>
|
|
55
|
-
<button mat-menu-item [disabled]="isNightMode" [matMenuTriggerFor]="themesMenu">
|
|
56
|
-
<span><i class="fa-solid fa-paint-brush"></i> Themes</span>
|
|
57
|
-
</button>
|
|
58
|
-
<button mat-menu-item [disabled]="!unlockStatus" (click)="newPage()">
|
|
59
|
-
<span><i class="fa-solid fa-plus-square" aria-hidden="true"></i> Add Page</span>
|
|
60
|
-
</button>
|
|
61
|
-
<button mat-menu-item (click)="unlockPage()">
|
|
62
|
-
<span *ngIf="!unlockStatus"><i class="fa-solid fa-columns" aria-hidden="true"></i> Edit Layout</span>
|
|
63
|
-
<span *ngIf="unlockStatus"><i class="fa-solid fa-lock" aria-hidden="true"></i> Lock Layout</span>
|
|
64
|
-
</button>
|
|
65
|
-
</mat-menu>
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
<mat-menu #themesMenu="matMenu" xPosition="before">
|
|
69
|
-
<button mat-menu-item (click)="setTheme('default-light')">
|
|
70
|
-
<span><i *ngIf="themeName == 'default-light' else elseBlock" class="fa-solid fa-circle" aria-hidden="true"></i> Light Blue</span>
|
|
71
|
-
<ng-template #elseBlock><i class="fa-solid fa-circle-o" aria-hidden="true"></i></ng-template>
|
|
72
|
-
</button>
|
|
73
|
-
<button mat-menu-item (click)="setTheme('signalk-light')">
|
|
74
|
-
<span><i *ngIf="themeName == 'signalk-light' else elseBlock" class="fa-solid fa-circle" aria-hidden="true"></i> Signal K</span>
|
|
75
|
-
<ng-template #elseBlock><i class="fa-solid fa-circle-o" aria-hidden="true"></i></ng-template>
|
|
76
|
-
</button>
|
|
77
|
-
<button mat-menu-item (click)="setTheme('high-contrast-light')">
|
|
78
|
-
<span><i *ngIf="themeName == 'high-contrast-light' else elseBlock" class="fa-solid fa-circle" aria-hidden="true"></i> High Contrast</span>
|
|
79
|
-
<ng-template #elseBlock><i class="fa-solid fa-circle-o" aria-hidden="true"></i></ng-template>
|
|
80
|
-
</button>
|
|
81
|
-
<button mat-menu-item (click)="setTheme('platypus-light')">
|
|
82
|
-
<span><i *ngIf="themeName == 'platypus-light' else elseBlock" class="fa-solid fa-circle" aria-hidden="true"></i> Platypus</span>
|
|
83
|
-
<ng-template #elseBlock><i class="fa-solid fa-circle-o" aria-hidden="true"></i></ng-template>
|
|
84
|
-
</button>
|
|
85
|
-
<button mat-menu-item (click)="setTheme('darkBlue-dark')">
|
|
86
|
-
<span><i *ngIf="themeName == 'darkBlue-dark' else elseBlock" class="fa-solid fa-circle" aria-hidden="true"></i> Dark Blue</span>
|
|
87
|
-
<ng-template #elseBlock><i class="fa-solid fa-circle-o" aria-hidden="true"></i></ng-template>
|
|
88
|
-
</button>
|
|
89
|
-
<button mat-menu-item (click)="setTheme('modern-dark')">
|
|
90
|
-
<span><i *ngIf="themeName == 'modern-dark' else elseBlock" class="fa-solid fa-circle" aria-hidden="true"></i> Modern Dark</span>
|
|
91
|
-
<ng-template #elseBlock><i class="fa-solid fa-circle-o" aria-hidden="true"></i></ng-template>
|
|
92
|
-
</button>
|
|
93
|
-
</mat-menu>
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
@use '~@angular/material' as mat;
|
|
2
|
-
|
|
3
|
-
@mixin app-theme($theme) {
|
|
4
|
-
$primary: map-get($theme, primary);
|
|
5
|
-
$accent: map-get($theme, accent);
|
|
6
|
-
$warn: map-get($theme, warn);
|
|
7
|
-
$background: map-get($theme, background);
|
|
8
|
-
$foreground: map-get($theme, foreground);
|
|
9
|
-
|
|
10
|
-
.app-defaults {
|
|
11
|
-
background-color: mat.get-color-from-palette($background, background);
|
|
12
|
-
color: mat.get-color-from-palette($foreground, text);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.theme-menu {
|
|
16
|
-
background-color: mat.get-color-from-palette($accent, A200);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.menuBarButtonGroup {
|
|
20
|
-
background-color: mat.get-color-from-palette($foreground, divider);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.fullheight {
|
|
26
|
-
height: 100%;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.mainContainer {
|
|
30
|
-
display: flex;
|
|
31
|
-
flex-direction: column;
|
|
32
|
-
align-items: stretch;
|
|
33
|
-
height: 100%;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.mainWindow {
|
|
37
|
-
flex: 30;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.menuBar {
|
|
41
|
-
flex: 1;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.menuBarContainer {
|
|
45
|
-
display: flex;
|
|
46
|
-
flex-direction: row;
|
|
47
|
-
justify-content: space-between;
|
|
48
|
-
flex-wrap: nowrap;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.menuBarContainer .menuBarButtonGroups {
|
|
52
|
-
flex-grow: 1;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
.menuBarContainer .menuBarButtonGroups:first-child {
|
|
56
|
-
text-align: left;
|
|
57
|
-
margin-left: 2px;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.menuBarContainer .menuBarButtonGroups {
|
|
61
|
-
text-align: center;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
.menuBarContainer .menuBarButtonGroups:last-child {
|
|
65
|
-
text-align: right;
|
|
66
|
-
margin-right: 2px;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
.menuBarButtonGroups .menuBarNavButtons {
|
|
70
|
-
width: 99%;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
.menuBarButtonGroups .menuBarAlarmsButton {
|
|
74
|
-
width: 25%;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
.menuBarButtonGroups .menuBarSettingsButton {
|
|
78
|
-
width: 25%;
|
|
79
|
-
}
|