SignalK / signalk-server

An implementation of a Signal K central server for boats.
http://signalk.org
Apache License 2.0
298 stars 150 forks source link

Metadata editing & zones handling #1730

Closed tkurki closed 1 month ago

tkurki commented 2 months ago

Add support for editing metadata and zones handling = raising notifications based on deltas in the server. Previous work with meta deltas with PUT support makes this pretty straightforward.

image

The goal of this PR is to add the functionality, not be pretty - let's get the initial end2end functionality out there.

Todo:

tkurki commented 2 months ago
image
tkurki commented 2 months ago

For the zones to work we need to either move the zones threshold-state handling logic to server proper or make the plugin use zones data from the server. If the zones editing is going to be in the server admin ui I don't see much point in keeping the plugin around, so integrating the logic in the server seems the best option.

tkurki commented 2 months ago

I enabled building docker container for this branch, so you can check it out with docker pull signalk/signalk-server:metadata-editing && docker run --init --rm -it -p 3000:3000 -v /tmp/:/home/node/.signalk --entrypoint /usr/lib/node_modules/signalk-server/bin/signalk-server signalk/signalk-server:metadata-editing --sample-nmea0183-data

panaaj commented 1 month ago

I get the "Something went wrong." message in the data browser screen when selecting "zones" from the dropdown. It throws the following error with the console.

 TypeError: e.map is not a function
    at Pe (Meta.js:456:16)
    at Gi (react-dom.production.min.js:153:146)
    at Ua (react-dom.production.min.js:175:309)
    at To (react-dom.production.min.js:263:406)
    at Eu (react-dom.production.min.js:246:265)
    at xu (react-dom.production.min.js:246:194)
    at mu (react-dom.production.min.js:239:172)
    at react-dom.production.min.js:123:115
    at t.unstable_runWithPriority (scheduler.production.min.js:19:467)
    at Kl (react-dom.production.min.js:122:325)

Given there is a separate "zones" section it should probably be filtered out from the dropdown list.

tkurki commented 1 month ago

Nice! Fixed in 038a5dabddcdd59ac0fee67d5562f8bf633daa65