[TASK] Optional hardware usage in node infobox

This commit is contained in:
Martin Geno 2017-01-21 01:53:55 +01:00 committed by Xaver Maierhofer
parent 42fe2daed2
commit ecf8fe7ec4
No known key found for this signature in database
GPG Key ID: 7FDCE23FD2EC9FE8
3 changed files with 19 additions and 8 deletions

View File

@ -89,10 +89,6 @@ It may help with firewall problems too.
Change this to match your communities' name. It will be used in various places.
## showContact (bool)
Setting this to `false` will hide contact information for nodes.
## maxAge (integer)
Nodes being online for less than maxAge days are considered "new". Likewise,
@ -103,6 +99,16 @@ nodes being offline for more than than maxAge days are considered "lost".
Max level to be applied by clicking a node or open a node. With value `18` near by buildings and streets should be visible.
Interesting if one of configured map provider has zoom-level under `18`.
## nodeInfobox
#### contact (bool)
Setting this to `false` will hide contact information for nodes.
#### hardwareUsage (bool)
Setting this to `false` will hide bars of memory usage and load avg for nodes.
## mapLayers (List)
A list of objects describing map layers. Each object has at least `name`, `url` and `config` properties. [Example layers and configuration](http://leaflet-extras.github.io/leaflet-providers/preview/) (map against config.json).

View File

@ -27,9 +27,12 @@
"dataPath": "https://regensburg.freifunk.net/data/",
"reverseGeocodingApi": "https://nominatim.openstreetmap.org/reverse",
"siteName": "Freifunk Regensburg",
"showContact": false,
"maxAge": 14,
"nodeZoom": 18,
"nodeInfobox": {
"contact": false,
"hardwareUsage": true
},
"mapLayers": [
{
"name": "Freifunk Regensburg",

View File

@ -227,7 +227,7 @@ define(["chroma-js", "moment/moment", "tablesort", "helper", "moment/locale/de"]
helper.attributeEntry(attributes, "Gateway", d.flags.gateway ? "ja" : null);
helper.attributeEntry(attributes, "Koordinaten", showGeoURI(d));
if (config.showContact) {
if (config.nodeInfobox && config.nodeInfobox.contact) {
helper.attributeEntry(attributes, "Kontakt", helper.dictGet(d.nodeinfo, ["owner", "contact"]));
}
@ -238,8 +238,10 @@ define(["chroma-js", "moment/moment", "tablesort", "helper", "moment/locale/de"]
helper.attributeEntry(attributes, "Site", showSite(d, config));
helper.attributeEntry(attributes, "Uptime", showUptime(d));
helper.attributeEntry(attributes, "Teil des Netzes", showFirstseen(d));
if (config.nodeInfobox && config.nodeInfobox.hardwareUsage) {
helper.attributeEntry(attributes, "Systemlast", showLoad(d));
helper.attributeEntry(attributes, "Arbeitsspeicher", showRAM(d));
}
helper.attributeEntry(attributes, "IP Adressen", showIPs(d));
helper.attributeEntry(attributes, "Webseite", showPages(d));
helper.attributeEntry(attributes, "Gewähltes Gateway", helper.dictGet(d.statistics, ["gateway"]));