FreifunkBremen / meshviewer

Meshviewer with Grunt v1, formatted code, updated bower components, nodes.json state version (see yanic)
https://map.bremen.freifunk.net
GNU Affero General Public License v3.0
1 stars 1 forks source link

add statistics.clients_by_type to remain compatible with existing nodes.json format #6

Closed oliver closed 7 years ago

oliver commented 7 years ago

The FFHB Meshviewer currently reads data from nodes.json from statistics.clients.wifi24 element etc. to display the client types in more detail. However, this breaks other consumers of the nodes.json file; for example http://freifunk-karte.de expects statistics.clients to be an integer. There might be other consumers which cannot cope with this modified nodes.json either (eg. https://play.google.com/store/apps/details?id=de.appwerft.freifunker).

To solve this, I suggest that the Meshviewer first tries to read these per-type details from a different element, for example from statistics.clients_by_type.wifi24 etc. Then the nodes.json could be generated to contain a the total number of clients in statistics.clients and the details below statistics.clients_by_type. The file would then remain compatible at least with freifunk-karte.de.

This would of course also require changes in the nodes.json generator process (yanic?).

Also, with this change the Meshviewer would be able to support the FFHB nodes.json and the FFRGB nodes.json; so I guess the code could be upstreamed then.

genofire commented 7 years ago

the structur come from gluon: https://github.com/freifunk-gluon/gluon/blob/f238b0117316f30297187b53d5c1eb51870bedf6/package/gluon-mesh-batman-adv-core/src/respondd.c#L554

yanic still generate v2 beside the state version (downloads.bremen.freifunk.net/data/). which should be interpretable in freifunk-karte.de.

I think the problem was, that needed lines was deleted: https://github.com/FreifunkBremen/bremen.freifunk.net/commit/7b54dc6be6064a812cc60e51a18d7ea2c40ef325#commitcomment-21530456

I think we should wait for the result of: https://github.com/FreifunkBremen/bremen.freifunk.net/commit/65f775fd093efe439a9e46c400cb6f34506a83a7

I think where would be in future a new nodes.json format, maybe netjson or maybe a minimal state version with only needed values. But they shoud be independen of freifunk-karte.de and so on.

genofire commented 7 years ago

Could we (you) close it @oliver

oliver commented 7 years ago

Yes, since the http://downloads.bremen.freifunk.net/data/v2/nodes.json file exists, we don't need to keep compatibility in the other nodes.json file.