@mxtommy/kip 3.9.0 → 3.10.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/CHANGELOG.md +1 -0
- package/README.md +48 -12
- package/kip-plugin/src/index.ts +48 -0
- package/kip-plugin/tsconfig.plugin.json +13 -0
- package/package.json +11 -4
- package/plugin/index.js +46 -0
- package/public/{chunk-BYWGV2DR.js → chunk-7OMETTVK.js} +1 -1
- package/public/{chunk-NEYBKWJP.js → chunk-A4ZPBM2P.js} +1 -1
- package/public/{chunk-2RLXZJPK.js → chunk-BZF6OYAF.js} +1 -1
- package/public/{chunk-6WOHGZ7K.js → chunk-C4AGB2HA.js} +1 -1
- package/public/{chunk-FYD5M4IT.js → chunk-FW2LAMAA.js} +1 -1
- package/public/{chunk-25PZU2O2.js → chunk-GJ33QBJ6.js} +1 -1
- package/public/{chunk-TP7LH2BI.js → chunk-GJADHEMH.js} +10 -10
- package/public/{chunk-3IUMPTFN.js → chunk-HKUJILH7.js} +1 -1
- package/public/chunk-J3WNXGAQ.js +64 -0
- package/public/{chunk-HECHZXLY.js → chunk-JFDPDIG2.js} +1 -1
- package/public/{chunk-5KVBD33V.js → chunk-LRX3XYXK.js} +1 -1
- package/public/{chunk-ZJO5PJKQ.js → chunk-MXKB5Z6M.js} +1 -1
- package/public/{chunk-RIG2POCP.js → chunk-NL52VRFS.js} +1 -1
- package/public/{chunk-CW3ZK4N3.js → chunk-OCI46H4J.js} +2 -2
- package/public/chunk-PPS4X2U3.js +1 -0
- package/public/{chunk-TGXMWTBW.js → chunk-PTADMSJZ.js} +1 -1
- package/public/{chunk-ZMNGRHMV.js → chunk-T5GXSVMN.js} +1 -1
- package/public/{chunk-DNBBDEKP.js → chunk-TDHAZ7DS.js} +1 -1
- package/public/index.html +1 -1
- package/public/main-ZOSCXBJH.js +53 -0
- package/public/chunk-N6T2NRWF.js +0 -1
- package/public/chunk-NHAQWUX3.js +0 -60
- package/public/main-AQ7CLM7C.js +0 -53
package/CHANGELOG.md
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
* Added canvas bitmap blitting for better rendering speed and visual performance.
|
|
10
10
|
* Replaced HammerJS with native gesture support for improved responsiveness.
|
|
11
11
|
* Updated CSS to help prevent accidental page reloads and unwanted text selection on mobile devices.
|
|
12
|
+
* Enabled Notification audio on mobile.
|
|
12
13
|
# v 3.8.2
|
|
13
14
|
# Improvements
|
|
14
15
|
* Faster app loading with local font and font swap support
|
package/README.md
CHANGED
|
@@ -16,18 +16,6 @@ Key features include:
|
|
|
16
16
|
- **Multiple User Profiles**: Tailor configurations for different roles, devices, or use cases.
|
|
17
17
|
- **Cross-Device Compatibility**: Access KIP remotely on any device by navigating to `http://<Signal K Server URL>:<port>/@mxtommy/kip`.
|
|
18
18
|
|
|
19
|
-
Typical complementary components you may install (many are often bundled with Signal K distributions):
|
|
20
|
-
|
|
21
|
-
**Navigation & Charting**
|
|
22
|
-
- **Freeboard‑SK** – Multi‑station, web chart plotter dedicated to Signal K: routes, waypoints, charts, alarms, weather layers, and instrument overlays.
|
|
23
|
-
|
|
24
|
-
**Visual Flow / Automation**
|
|
25
|
-
- **Node‑RED** – Low‑code, flow‑based wiring of devices, APIs, online services, and custom logic (alert escalation, device control automation, data enrichment, protocol bridging).
|
|
26
|
-
|
|
27
|
-
**Data Storage & Analytics**
|
|
28
|
-
- **InfluxDB / other TSDB** – High‑resolution historical storage of sensor & performance metrics beyond what lightweight widget charts should retain.
|
|
29
|
-
- **Grafana** – Rich exploratory / comparative dashboards, ad‑hoc queries, alert rules on stored metrics, correlation across heterogeneous data sources.
|
|
30
|
-
|
|
31
19
|
KIP is open-source under the MIT license, built by the community and 100% free. Join the community on Discord or contribute to the project on GitHub!
|
|
32
20
|
|
|
33
21
|
## Read the Help introduction How-to
|
|
@@ -134,6 +122,32 @@ For example, Signal K will notify KIP when a water depth or temperature sensor r
|
|
|
134
122
|
## Multiple User Profiles
|
|
135
123
|
If you have different roles on board: captain, skipper, tactician, navigator, engineer—or simply different people with different needs, each can tailor KIP as they wish. The use of profiles also allows you to tie specific configuration arrangements to use cases or device form factors.
|
|
136
124
|
|
|
125
|
+
## Complementary Components
|
|
126
|
+
Typical complementary components you may install (many are often bundled with Signal K distributions):
|
|
127
|
+
|
|
128
|
+
**Navigation & Charting**
|
|
129
|
+
- **Freeboard‑SK** – Multi‑station, web chart plotter dedicated to Signal K: routes, waypoints, charts, alarms, weather layers, and instrument overlays.
|
|
130
|
+
|
|
131
|
+
**Visual Flow / Automation**
|
|
132
|
+
- **Node‑RED** – Low‑code, flow‑based wiring of devices, APIs, online services, and custom logic (alert escalation, device control automation, data enrichment, protocol bridging).
|
|
133
|
+
|
|
134
|
+
**Data Storage & Analytics**
|
|
135
|
+
- **InfluxDB / other TSDB** – High‑resolution historical storage of sensor & performance metrics beyond what lightweight widget charts should retain.
|
|
136
|
+
- **Grafana** – Rich exploratory / comparative dashboards, ad‑hoc queries, alert rules on stored metrics, correlation across heterogeneous data sources.
|
|
137
|
+
|
|
138
|
+
## Complementary Components
|
|
139
|
+
Typical complementary components you may install (many are often bundled with Signal K distributions):
|
|
140
|
+
|
|
141
|
+
**Navigation & Charting**
|
|
142
|
+
- **Freeboard‑SK** – Multi‑station, web chart plotter dedicated to Signal K: routes, waypoints, charts, alarms, weather layers, and instrument overlays.
|
|
143
|
+
|
|
144
|
+
**Visual Flow / Automation**
|
|
145
|
+
- **Node‑RED** – Low‑code, flow‑based wiring of devices, APIs, online services, and custom logic (alert escalation, device control automation, data enrichment, protocol bridging).
|
|
146
|
+
|
|
147
|
+
**Data Storage & Analytics**
|
|
148
|
+
- **InfluxDB / other TSDB** – High‑resolution historical storage of sensor & performance metrics beyond what lightweight widget charts should retain.
|
|
149
|
+
- **Grafana** – Rich exploratory / comparative dashboards, ad‑hoc queries, alert rules on stored metrics, correlation across heterogeneous data sources.
|
|
150
|
+
|
|
137
151
|
# Connect, Share, and Support
|
|
138
152
|
KIP has its own Discord Signal K channel for getting in touch. Join us at https://discord.gg/AMDYT2DQga
|
|
139
153
|
|
|
@@ -166,6 +180,28 @@ Keeping KIP focused preserves responsiveness (lower CPU / memory), reduces UI cl
|
|
|
166
180
|
|
|
167
181
|
In short: use KIP to see & act on live sailing information; use the complementary tools to store it long‑term, analyze it deeply, automate decisions, or build advanced integrations.
|
|
168
182
|
|
|
183
|
+
## Project Scope
|
|
184
|
+
What KIP IS about:
|
|
185
|
+
- Real‑time presentation of vessel & environment data (navigation, performance, systems) pulled from Signal K.
|
|
186
|
+
- Fast, legible, touchscreen‑friendly dashboards for underway decision making.
|
|
187
|
+
- Configurable widgets (gauges, charts, timers, controls) tuned for sailing operations.
|
|
188
|
+
|
|
189
|
+
What KIP deliberately IS NOT trying to become:
|
|
190
|
+
- A full data lake / long‑term time‑series historian.
|
|
191
|
+
- A general purpose automation / rules / orchestration engine.
|
|
192
|
+
- A universal external web‑app embedding or mash‑up framework.
|
|
193
|
+
- A low‑code integration hub for arbitrarily wiring protocols and services.
|
|
194
|
+
|
|
195
|
+
Those domains already have excellent, specialized open‑source tools. Instead of re‑implementing them, KIP plays nicely alongside them within a Signal K based onboard stack.
|
|
196
|
+
|
|
197
|
+
**Processing & Extensions**
|
|
198
|
+
- **Signal K Plugins** – Domain‑specific enrichment (polars, performance calculations, derived environmental data, routing aids) published directly into the Signal K data model that KIP can then display.
|
|
199
|
+
|
|
200
|
+
**Why this separation matters**
|
|
201
|
+
Keeping KIP focused preserves responsiveness (lower CPU / memory), reduces UI clutter, and accelerates iteration on core sailing UX. Heavy analytics, complex workflow logic, and broad third‑party embedding stay where they are strongest—outside—but still feed KIP through the common Signal K data fabric.
|
|
202
|
+
|
|
203
|
+
In short: use KIP to see & act on live sailing information; use the complementary tools to store it long‑term, analyze it deeply, automate decisions, or build advanced integrations.
|
|
204
|
+
|
|
169
205
|
**Tools**
|
|
170
206
|
Linux, Mac, RPi, or Windows dev platform supported
|
|
171
207
|
1. Install the latest Node version (v16+, v18 recommended)
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Delta, Path, Plugin, ServerAPI, Value } from '@signalk/server-api'
|
|
2
|
+
|
|
3
|
+
export default (app: ServerAPI): Plugin => {
|
|
4
|
+
const plugin: Plugin = {
|
|
5
|
+
id: 'kip',
|
|
6
|
+
name: 'KIP',
|
|
7
|
+
description: 'KIP server plugin',
|
|
8
|
+
start: (settings, restartPlugin) => {
|
|
9
|
+
app.debug(`${plugin.name}: Starting plugin`);
|
|
10
|
+
app.registerPutHandler('vessels.self', 'plugins.displays.*', displayPutHandler);
|
|
11
|
+
},
|
|
12
|
+
stop: () => {
|
|
13
|
+
app.debug(`${plugin.name}: Stopping plugin`);
|
|
14
|
+
},
|
|
15
|
+
schema: () => {
|
|
16
|
+
properties: {
|
|
17
|
+
// plugin configuration goes here
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
function displayPutHandler(context: string, path: string, value: Value): { state: 'COMPLETED'; statusCode: number; message?: string } {
|
|
23
|
+
app.debug(`${plugin.name}: PUT handler called for context ${context}, path ${path}, value ${value}`);
|
|
24
|
+
try {
|
|
25
|
+
const delta: Delta = {
|
|
26
|
+
updates: [
|
|
27
|
+
{
|
|
28
|
+
values: [
|
|
29
|
+
{
|
|
30
|
+
path: path as Path,
|
|
31
|
+
value: value
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
};
|
|
37
|
+
app.debug('Sending message: ', JSON.stringify(delta));
|
|
38
|
+
app.handleMessage(plugin.id, delta);
|
|
39
|
+
return { state: "COMPLETED" as const, statusCode: 200 };
|
|
40
|
+
|
|
41
|
+
} catch (error) {
|
|
42
|
+
app.error(`${plugin.name}: Error in PUT handler: ${error}`);
|
|
43
|
+
return { state: "COMPLETED" as const, statusCode: 500, message: (error as Error).message };
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return plugin;
|
|
48
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
|
|
2
|
+
{
|
|
3
|
+
"extends": "../tsconfig.json",
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
"outDir": "../plugin",
|
|
6
|
+
"types": [],
|
|
7
|
+
"resolveJsonModule": true,
|
|
8
|
+
"sourceMap": false,
|
|
9
|
+
"module": "commonjs",
|
|
10
|
+
"moduleResolution": "node"
|
|
11
|
+
},
|
|
12
|
+
"include": ["./src/*.*"]
|
|
13
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mxtommy/kip",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.10.0-beta.1",
|
|
4
4
|
"description": "An advanced and versatile marine instrumentation package to display Signal K data.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -36,12 +36,16 @@
|
|
|
36
36
|
"appIcon": "assets/icon-72x72.png",
|
|
37
37
|
"displayName": "KIP Instrument MFD"
|
|
38
38
|
},
|
|
39
|
+
"main": "plugin/index.js",
|
|
40
|
+
"signalk-plugin-enabled-by-default": true,
|
|
39
41
|
"scripts": {
|
|
40
|
-
"dev": "ng serve --configuration=dev --serve-path=/@mxtommy/kip/",
|
|
41
|
-
"build-dev": "ng build --configuration=dev",
|
|
42
|
-
"build-prod": "ng build --configuration=production",
|
|
43
42
|
"test": "ng test",
|
|
44
43
|
"lint": "ng lint",
|
|
44
|
+
"dev": "ng serve --configuration=dev --serve-path=/@mxtommy/kip/",
|
|
45
|
+
"build:plugin": "tsc -p ./kip-plugin/tsconfig.plugin.json",
|
|
46
|
+
"build:dev": "ng build --configuration=dev",
|
|
47
|
+
"build:prod": "ng build --configuration=production",
|
|
48
|
+
"build:all": "npm run build:prod && npm run build:plugin",
|
|
45
49
|
"e2e": "ng e2e"
|
|
46
50
|
},
|
|
47
51
|
"devDependencies": {
|
|
@@ -104,5 +108,8 @@
|
|
|
104
108
|
"tslib": "^2.6.2",
|
|
105
109
|
"typescript": "^5.8.3",
|
|
106
110
|
"zone.js": "^0.15.1"
|
|
111
|
+
},
|
|
112
|
+
"dependencies": {
|
|
113
|
+
"@signalk/server-api": "^2.7.2"
|
|
107
114
|
}
|
|
108
115
|
}
|
package/plugin/index.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = (app) => {
|
|
4
|
+
const plugin = {
|
|
5
|
+
id: 'kip',
|
|
6
|
+
name: 'KIP',
|
|
7
|
+
description: 'KIP server plugin',
|
|
8
|
+
start: (settings, restartPlugin) => {
|
|
9
|
+
app.debug(`${plugin.name}: Starting plugin`);
|
|
10
|
+
app.registerPutHandler('vessels.self', 'plugins.displays.*', displayPutHandler);
|
|
11
|
+
},
|
|
12
|
+
stop: () => {
|
|
13
|
+
app.debug(`${plugin.name}: Stopping plugin`);
|
|
14
|
+
},
|
|
15
|
+
schema: () => {
|
|
16
|
+
properties: {
|
|
17
|
+
// plugin configuration goes here
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
function displayPutHandler(context, path, value) {
|
|
22
|
+
app.debug(`${plugin.name}: PUT handler called for context ${context}, path ${path}, value ${value}`);
|
|
23
|
+
try {
|
|
24
|
+
const delta = {
|
|
25
|
+
updates: [
|
|
26
|
+
{
|
|
27
|
+
values: [
|
|
28
|
+
{
|
|
29
|
+
path: path,
|
|
30
|
+
value: value
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
};
|
|
36
|
+
app.debug('Sending message: ', JSON.stringify(delta));
|
|
37
|
+
app.handleMessage(plugin.id, delta);
|
|
38
|
+
return { state: "COMPLETED", statusCode: 200 };
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
app.error(`${plugin.name}: Error in PUT handler: ${error}`);
|
|
42
|
+
return { state: "COMPLETED", statusCode: 500, message: error.message };
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return plugin;
|
|
46
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as xe,b as De,c as Me,d as ve,e as Pe,f as Oe,g as V,h as Te,i as Ie,j as ke,k as Re,l as Ee,m as Ve,n as Fe,o as b,p as He,q as y,r as Ue,s as Be}from"./chunk-
|
|
1
|
+
import{a as xe,b as De,c as Me,d as ve,e as Pe,f as Oe,g as V,h as Te,i as Ie,j as ke,k as Re,l as Ee,m as Ve,n as Fe,o as b,p as He,q as y,r as Ue,s as Be}from"./chunk-MXKB5Z6M.js";import"./chunk-JFDPDIG2.js";import{d as we,f as be,n as ye,q as Se}from"./chunk-BZF6OYAF.js";import"./chunk-PTADMSJZ.js";import{A as ge,da as R,ka as E,la as he,oa as _e,p as le,pa as Ce,t as pe,u as se,w as me,x as de,y as ue,z as fe}from"./chunk-HKUJILH7.js";import{$d as ce,A as $,Ab as _,Ac as te,Bb as s,Ca as K,Cb as o,Db as i,Eb as u,Fc as w,Gc as j,Ib as P,Id as ie,Jb as O,Lb as T,Nb as I,P as q,Pb as d,Wa as c,Xb as B,Yb as W,Yd as oe,Zb as G,Zd as re,a as F,ad as ae,b as H,cc as l,dc as k,eb as f,ec as C,hc as J,ia as Q,ic as X,jc as Y,je as L,kb as g,ld as z,m as N,md as ne,me as A,ra as m,tc as Z,uc as ee,vb as M,wa as x,wb as v,xa as D,yb as U,zb as h}from"./chunk-FW2LAMAA.js";function Ae(e,r){e&1&&(o(0,"span",3),l(1,"Boolean"),i())}function Ne(e,r){e&1&&(o(0,"span",3),l(1,"String"),i())}function $e(e,r){e&1&&(o(0,"span",3),l(1,"String"),i())}function qe(e,r){e&1&&(o(0,"span",3),l(1,"Object"),i())}function Qe(e,r){if(e&1){let t=T();o(0,"button",5),I("click",function(){x(t);let n=d();return D(n.openDialog())}),l(1),i()}if(e&2){let t=d();c(),k(t.selectedUnit)}}function Ke(e,r){if(e&1&&(o(0,"mat-option",6),l(1),i()),e&2){let t=r.$implicit;s("value",t.measure),c(),C(" ",t.measure," ")}}function We(e,r){if(e&1&&(o(0,"mat-optgroup",3),h(1,Ke,2,2,"mat-option",6,U),i()),e&2){let t=r.$implicit;s("label",t.group),c(),_(t.units)}}var je=(()=>{class e{_units=m(Se);_dialog=m(me);path=w.required();source=w(void 0);pathValue=w(void 0);type=w.required();units=null;selectedUnit="unitless";ngOnInit(){this.units=this._units.getConversionsForPath(this.path()),this.selectedUnit=this.units.base}convertValue(t,a){return a==="number"?this._units.convertToUnit(this.selectedUnit,t):t}openDialog(){this._dialog.open(Ge,{data:{selectedUnit:this.selectedUnit,units:this.units}}).afterClosed().subscribe(a=>{a&&(this.selectedUnit=a)})}static \u0275fac=function(a){return new(a||e)};static \u0275cmp=f({type:e,selectors:[["data-inspector-row"]],inputs:{path:[1,"path"],source:[1,"source"],pathValue:[1,"pathValue"],type:[1,"type"]},decls:10,vars:3,consts:[[1,"cell-source","cells"],[1,"cell-value","cells"],[1,"cell-action","cells"],[1,"path-type"],["mat-stroked-button","",1,"change-units-btn"],["mat-stroked-button","",1,"change-units-btn",3,"click"]],template:function(a,n){if(a&1&&(o(0,"mat-cell",0),l(1),i(),o(2,"mat-cell",1),l(3),i(),o(4,"mat-cell",2),M(5,Ae,2,0,"span",3)(6,Ne,2,0,"span",3)(7,$e,2,0,"span",3)(8,qe,2,0,"span",3)(9,Qe,2,1,"button",4),i()),a&2){let p;c(),k(n.source()),c(2),k(n.convertValue(n.pathValue(),n.type())),c(2),v((p=n.type())==="boolean"?5:p==="string"?6:p==="Date"?7:p==="object"?8:9)}},dependencies:[V,A,L],styles:[`.change-units-btn{width:100%}.cell-source:first-of-type{padding-left:0;flex:1 1 30%}.cells{border:0px solid white;word-break:break-word;overflow-wrap:break-word}.cell-value{justify-content:flex-start;flex:1 1 70%;padding:0}.cell-action{justify-content:end;flex:0 0 107px}.cell-action:last-of-type{padding:0}.path-type{width:100%;height:40px;align-content:center;text-align:center;color:var(--mat-sys-primary)}
|
|
2
2
|
`],encapsulation:2})}return e})(),Ge=(()=>{class e{dialogRef=m(pe);data=m(se);selectedUnit=null;static \u0275fac=function(a){return new(a||e)};static \u0275cmp=f({type:e,selectors:[["dialog-unit-selector"]],decls:14,vars:2,consts:[["mat-dialog-title",""],["appearance","outline","floatLabel","always",2,"padding-top","15px","padding-bottom","15px"],[3,"valueChange","value"],[3,"label"],["mat-flat-button","","mat-dialog-close",""],["mat-flat-button","",3,"mat-dialog-close"],[3,"value"]],template:function(a,n){a&1&&(o(0,"h2",0),l(1,"Select Unit type"),i(),o(2,"mat-dialog-content")(3,"mat-form-field",1)(4,"mat-label"),l(5,"Unit"),i(),o(6,"mat-select",2),Y("valueChange",function(S){return X(n.data.selectedUnit,S)||(n.data.selectedUnit=S),S}),h(7,We,3,1,"mat-optgroup",3,U),i()()(),o(9,"mat-dialog-actions")(10,"button",4),l(11,"Cancel"),i(),o(12,"button",5),l(13,"Ok"),i()()),a&2&&(c(6),J("value",n.data.selectedUnit),c(),_(n.data.units.conversions),c(5),s("mat-dialog-close",n.data.selectedUnit))},dependencies:[ue,fe,E,R,ye,we,be,ge,A,L,de],encapsulation:2})}return e})();var Je=(e,r)=>r.key;function Xe(e,r){e&1&&(o(0,"mat-header-cell",19),l(1," Path "),i())}function Ye(e,r){if(e&1&&(o(0,"mat-cell",20),l(1),i()),e&2){let t=r.$implicit;c(),C(" ",t.path," ")}}function Ze(e,r){e&1&&(o(0,"mat-header-cell",21),l(1," PUT Support "),i())}function et(e,r){e&1&&(o(0,"mat-icon",23),l(1,"check_circle"),i())}function tt(e,r){if(e&1&&(o(0,"mat-cell",22),M(1,et,2,0,"mat-icon",23),i()),e&2){let t=r.$implicit;c(),v(t.meta!=null&&t.meta.supportsPut?1:-1)}}function at(e,r){e&1&&(o(0,"mat-header-cell",24),l(1," Source "),i())}function nt(e,r){if(e&1&&u(0,"data-inspector-row",27),e&2){let t=r.$implicit,a=d().$implicit,n=d();s("path",a.path)("source",n.getSourceKey(t))("pathValue",n.getSourceValue(t))("type",a.type)}}function it(e,r){if(e&1&&(o(0,"mat-cell",25)(1,"div",26),h(2,nt,1,4,"data-inspector-row",27,Je),Z(4,"keyvalue"),i()()),e&2){let t=r.$implicit;c(2),_(ee(4,0,t.sources))}}function ot(e,r){e&1&&u(0,"mat-header-row",28)}function rt(e,r){e&1&&u(0,"mat-row",29)}function lt(e,r){if(e&1&&(o(0,"tr",30)(1,"td",31),l(2),i()()),e&2){d();let t=G(6);c(2),C('No data matching the filter "',t.value,'"')}}var Nt=(()=>{class e{dataService=m(le);destroyRef=m(K);_responsive=m(ie);isPhonePortrait;filterSubject=new N;paginator=j.required(b);sort=j.required(y);pageTitle="Data Inspector";pageSize=25;hidePageSize=!1;showFirstLastButtons=!0;showPageSizeOptions=[5,10,25,100];tableData=new Fe([]);displayedColumns=["path","supportsPut","defaultSource"];constructor(){this.filterSubject.pipe(q(500)).pipe(z(this.destroyRef)).subscribe(t=>{this.tableData.filter=t.trim().toLowerCase(),this.tableData.paginator&&this.tableData.paginator.firstPage()}),this.isPhonePortrait=ne(this._responsive.observe(ce.HandsetPortrait)),te(()=>{this.isPhonePortrait().matches?(this.hidePageSize=!0,this.showFirstLastButtons=!1,this.showPageSizeOptions=[]):(this.hidePageSize=!1,this.showFirstLastButtons=!0,this.showPageSizeOptions=[5,10,25,100])})}ngAfterViewInit(){this.dataService.startSkDataFullTree().pipe($(t=>t.filter(a=>Object.keys(a.sources||{}).length>0).map(a=>H(F({},a),{sources:a.type&&a.type.includes("object")&&typeof a.sources=="object"?Object.fromEntries(Object.entries(a.sources).map(([n,p])=>[n,H(F({},p),{sourceValue:typeof p.sourceValue=="object"?JSON.stringify(p.sourceValue):p.sourceValue})])):a.sources}))),Q(500),z(this.destroyRef)).subscribe(t=>{this.tableData.data=t}),this.tableData.paginator=this.paginator(),this.tableData.sort=this.sort(),this.tableData.sortingDataAccessor=(t,a)=>{switch(a){case"supportsPut":return t.meta?.supportsPut?1:0;default:return t[a]}}}applyFilter(t){let a=t.target.value;this.filterSubject.next(a)}trackByPath(t,a){return`${a.path}`}trackBySource(t,a){return`${a.key}`}getSourceKey(t){return String(t.key)}getSourceValue(t){return t.value.sourceValue}ngOnDestroy(){this.filterSubject.complete(),this.dataService.stopSkDataFullTree()}static \u0275fac=function(a){return new(a||e)};static \u0275cmp=f({type:e,selectors:[["data-inspector"]],viewQuery:function(a,n){a&1&&(B(n.paginator,b,5),B(n.sort,y,5)),a&2&&W(2)},decls:21,vars:10,consts:[["input",""],[3,"pageTitle"],[1,"data-inspector-container"],[1,"filter-field"],["matInput","","placeholder","Type any part of the path, source or value...","value","",3,"keyup"],["matSort","","matSortActive","path","matSortDirection","asc",1,"table-content-area","mat-elevation-z8",3,"dataSource","trackBy"],["matColumnDef","path"],["class","pathHeader","mat-sort-header","",4,"matHeaderCellDef"],["class","pathCell row-cell",4,"matCellDef"],["matColumnDef","supportsPut"],["class","putHeader","mat-sort-header","",4,"matHeaderCellDef"],["class","putCell row-cell",4,"matCellDef"],["matColumnDef","defaultSource"],["class","dataHeader","mat-sort-header","",4,"matHeaderCellDef"],["class","dataCell row-cell",4,"matCellDef"],["class","headerRow",4,"matHeaderRowDef","matHeaderRowDefSticky"],["class","table-row",4,"matRowDef","matRowDefColumns"],["class","mat-row",4,"matNoDataRow"],[1,"paginator",3,"pageSize","pageSizeOptions","hidePageSize","showFirstLastButtons"],["mat-sort-header","",1,"pathHeader"],[1,"pathCell","row-cell"],["mat-sort-header","",1,"putHeader"],[1,"putCell","row-cell"],["matTooltip","Supports PUT operation",1,"put-icon"],["mat-sort-header","",1,"dataHeader"],[1,"dataCell","row-cell"],[1,"flex-container"],[1,"source-sub-row",3,"path","source","pathValue","type"],[1,"headerRow"],[1,"table-row"],[1,"mat-row"],["colspan","4",1,"mat-cell"]],template:function(a,n){if(a&1){let p=T();u(0,"page-header",1),o(1,"div",2)(2,"mat-form-field",3)(3,"mat-label"),l(4,"Filter"),i(),o(5,"input",4,0),I("keyup",function(ze){return x(p),D(n.applyFilter(ze))}),i()(),o(7,"mat-table",5),P(8,6),g(9,Xe,2,0,"mat-header-cell",7)(10,Ye,2,1,"mat-cell",8),O(),P(11,9),g(12,Ze,2,0,"mat-header-cell",10)(13,tt,2,1,"mat-cell",11),O(),P(14,12),g(15,at,2,0,"mat-header-cell",13)(16,it,5,2,"mat-cell",14),O(),g(17,ot,1,0,"mat-header-row",15)(18,rt,1,0,"mat-row",16)(19,lt,3,1,"tr",17),i(),u(20,"mat-paginator",18),i()}a&2&&(s("pageTitle",n.pageTitle),c(7),s("dataSource",n.tableData)("trackBy",n.trackByPath),c(10),s("matHeaderRowDef",n.displayedColumns)("matHeaderRowDefSticky",!0),c(),s("matRowDefColumns",n.displayedColumns),c(2),s("pageSize",n.pageSize)("pageSizeOptions",n.showPageSizeOptions)("hidePageSize",n.hidePageSize)("showFirstLastButtons",n.showFirstLastButtons))},dependencies:[he,E,R,Ve,De,ve,Te,Pe,Me,Ie,Oe,V,ke,Re,Ee,Ce,_e,He,b,Be,y,Ue,je,xe,re,oe,ae],styles:["[_nghost-%COMP%]{display:block;height:100%;width:100%}.data-inspector-container[_ngcontent-%COMP%]{margin-left:24px;margin-right:24px;height:calc(100% - 63px)}.table-content-area[_ngcontent-%COMP%]{height:calc(100% - 142px);overflow-y:auto;width:100%;scroll-behavior:smooth}.mat-column-path[_ngcontent-%COMP%]{flex:0 0 50%;width:50%}.mat-mdc-table[_ngcontent-%COMP%]{overflow:auto}.paginator[_ngcontent-%COMP%]{width:100%;height:56px;background-color:var(--mat-sys-background)}.filter-field[_ngcontent-%COMP%]{padding:15px 0;width:100%;height:86px}.pathHeader[_ngcontent-%COMP%]{flex:1 1 45%}.putHeader[_ngcontent-%COMP%]{flex:1 1 10%}.dataHeader[_ngcontent-%COMP%]{flex:1 1 45%}.table-row[_ngcontent-%COMP%]{border-bottom-color:var(--mat-table-row-item-outline-color, var(--mat-sys-outline, rgba(0, 0, 0, .12)));border-bottom-width:var(--mat-table-row-item-outline-width, 1px);border-bottom-style:solid}.row-cell[_ngcontent-%COMP%]{border-bottom-color:#fff;border-bottom-width:0px;border-bottom-style:solid}.pathCell[_ngcontent-%COMP%]{flex:1 1 45%;word-break:break-word;overflow-wrap:break-word}.putCell[_ngcontent-%COMP%]{flex:1 1 10%}.dataCell[_ngcontent-%COMP%]{flex:1 1 45%;flex-flow:column;flex-wrap:nowrap;gap:2px}.flex-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex-wrap:nowrap;gap:5px;margin:5px 0;height:100%;width:100%}.source-sub-row[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex-wrap:nowrap;gap:5px;width:100%}.put-icon[_ngcontent-%COMP%]{color:var(--kip-starboard-color)}@media screen and (max-width: 750px){.pathHeader[_ngcontent-%COMP%], .dataHeader[_ngcontent-%COMP%]{flex:1 1 50%}.dataCell[_ngcontent-%COMP%]{flex:1 1 100%}.dataCell[_ngcontent-%COMP%]{flex:1 1 100%;margin-left:24px}.mat-mdc-table[_ngcontent-%COMP%] .mat-mdc-row[_ngcontent-%COMP%]{flex-direction:row;flex-wrap:wrap}.mat-mdc-table[_ngcontent-%COMP%] .mat-mdc-cell[_ngcontent-%COMP%]:before{content:attr(data-label);float:left;padding-right:5px}mat-row[_ngcontent-%COMP%]:after{min-height:auto;padding-bottom:10px}.dataRow[_ngcontent-%COMP%]{flex-direction:column;align-items:flex-start}.actionCell[_ngcontent-%COMP%]{margin-left:24px}}"]})}return e})();export{Nt as DataInspectorComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as c}from"./chunk-
|
|
1
|
+
import{a as c}from"./chunk-T5GXSVMN.js";import{a as g}from"./chunk-PPS4X2U3.js";import"./chunk-GJ33QBJ6.js";import{g as a,i as r,w as l}from"./chunk-HKUJILH7.js";import{eb as s,ra as t}from"./chunk-FW2LAMAA.js";var v=(()=>{class o{dialog=t(l);auth=t(a);appService=t(g);appSettingsService=t(r);connectionConfig=null;ngOnInit(){this.connectionConfig=this.appSettingsService.getConnectionConfig(),this.openUserCredentialModal("Sign in failed: Incorrect user/password. Enter valide credentials or access the Confifuration/Settings menu, validate the server URL or/and disable the user Sign in option")}openUserCredentialModal(e){this.dialog.open(c,{disableClose:!0,data:{user:this.connectionConfig.loginName,password:this.connectionConfig.loginPassword,error:e}}).afterClosed().subscribe(i=>{i===void 0||!i||(this.connectionConfig.loginName=i.user,this.connectionConfig.loginPassword=i.password,this.appSettingsService.setConnectionConfig(this.connectionConfig),this.serverLogin())})}serverLogin(e){this.auth.login({usr:this.connectionConfig.loginName,pwd:this.connectionConfig.loginPassword,newUrl:e}).then(()=>{this.appSettingsService.reloadApp()}).catch(n=>{n.status==401?(this.openUserCredentialModal("Sign in failed: Invalide user/password. Enter valide credentials"),console.log("[Setting-SignalK Component] Sign in failed: "+n.error.message)):n.status==404?(this.appService.sendSnackbarNotification("Sign in failed: Login API not found at URL. See connection detail status in Configuration/Settings",5e3,!1),console.log("[Setting-SignalK Component] Sign in failed: "+n.error.message)):n.status==0?(this.appService.sendSnackbarNotification("Sign in failed: Cannot reach server at Signal K URL. See connection detail status in Configuration/Settings",5e3,!1),console.log("[Setting-SignalK Component] Sign in failed: Cannot reach server at Signal K URL:"+n.message)):(this.appService.sendSnackbarNotification("Unknown authentication failure: "+JSON.stringify(n),5e3,!1),console.log("[Setting-SignalK Component] Unknown login error response: "+JSON.stringify(n)))})}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=s({type:o,selectors:[["app-widget-login"]],decls:0,vars:0,template:function(n,i){},encapsulation:2})}return o})();export{v as WidgetLoginComponent};
|