config_js
Gulp merges config.js
into config.default.js
(config.default.js
will be overwritten). This is no deep merge, i.e. you always need to add complete arrays or objects like nodeInfobox
or supportedLocale
to your config.js
. You can use JS and functions to create new node details rows.
config.default.js
contains settings likesupportedLocale
ormaxAge
config.js
contains community specific settings like statistic images orsiteName
(and the values/arrays/objects you want to overwrite in config.default.js)
config.js
dataPath (string/array)
dataPath
needs a path/URL with meshviewer.js
provided in an array. Don't forget the trailing slash! Also, proxying the data through a webserver will allow brotli
or deflat/gzip
which will greatly reduce bandwidth consumption. The header Access-Control-Allow-Origin: "*"
should be added to allow local development.
Single data source
Multiple data sources
siteName (string)
Set this to match your community name. It's used in several places.
mapLayers (List)
A list of objects describing the map layers. Each object has at least the properties name
, url
and config
.
A list of some possible layers available: Example layers and configuration, but every source supporting the used standard will work.
mode (string, optional)
Allows to load an additional style for a night mode or a similar use case. It is possible to load the stylesheet inline
or with a link
-tag. Inline avoids re-rendering and possible issues with label-layer updates. It is important to add the following attributes: class="css-mode mode-name" media="not"
.
Default mode is night
which is added inline in index.html
html/index.html
or
start (integer, optional)
Start a time range to put this mapLayer on first position.
end (integer, optional)
End a time range for first map. Stops sort this mapLayer.
fixedCenter (array[array, array])
This sets the initial area shown on loading the map. Chose exactly two locations. Everything between those two locations will be displayed. Nodes outside the initial `fixedCenter`` will be visible then you use map controls like zoom or moving around on the map.
Examples for fixedCenter
:
nodeInfos (array, optional)
This option allows to show node statistics depending on following case-sensitive parameters:
name
- header of statistics segment in the infoboxhref
- absolute or relative URL to statistics imageimage
(required) - absolute or relative URL to image,can be the same like
href
title
- the image title tag (also used as mouse hover)
To insert variables in either href
, image
or title
you can use the case-sensitive template strings {NODE_ID}
, {NODE_NAME}
, {LOCALE}
and {TIME}
(as cache-breaker).
Examples for nodeInfos
:
In order to have statistics images available, you have to set up an instance of each Prometheus and Grafana.
globalInfos (array, optional)
This option allows to show global statistics on statistics page depending on following case-sensitive parameters:
name
- header of statistics segment in the infoboxhref
- absolute or relative URL to statistics imageimage
(required) - absolute or relative URL to image,can be the same like
href
title
- the image title tag (also used as mouse hover)
To insert the variables locale or time (as cache-breaker) in either href
, image
or title
you can use the case-sensitive template strings {LOCALE}
and {TIME}
.
Examples for globalInfos
using Grafana server rendering:
linkInfos (array, optional)
This option allows to show link statistics depending on the following case-sensitive parameters:
name
- header of statistics segment in the infoboxhref
- absolute or relative URL to statistics imageimage
(required) - absolute or relative URL to image,can be the same like
href
title
- the image title tag (also used as mouse hover)
To insert the source or target variables in either href
, image
or title
you can use the case-sensitive template strings {SOURCE_ID}
, {TARGET_ID}
, {SOURCE_MAC}
, {TARGET_MAC}
, {SOURCE_ADDR}
, {TARGET_ADDR}
, {SOURCE_NAME}
, {TARGET_NAME}
, {LOCALE}
and {TIME}
(as cache-breaker).
siteNames (array, optional)
In this array name definitions for site statistics and node info can be set. This requires one object for each site
code. This object must contain:
site
- the site codename
- the displayed name for this site
If neither siteNames
nor showSites
are set, site statistics and node info won't be displayed.
Example for siteNames
:
linkList (array, optional)
Defines an additional list of links displayed in the infobox. It can be used for links to legal notice, web or stats:
title
- the image title tag (also used as mouse hover) linkhref
- URL of the link
Example for linkList
:
geo (array, optional)
The definition for additional custom GeoJSON objects to be displayed in Meshviewer.
json
- geoJSON (javascript allowed e.g. load external json)option
- style or other options
Example for geo
:
config.default.js
reverseGeocodingApi (string)
Settings for a reverse proxy or your own geocoding server used by the location-picker. Setting up this will enhance data privacy and avoid problems caused by script-blockers like NoScript in case you are using different domains for your json data or the map tiles. External URLs need to be considered in your privacy policy.
maxAge (string)
Nodes being online for less than maxAge
days are considered "new". Likewise, nodes being offline for more than than maxAge
days are considered "lost".
maxAgeAlert (integer)
Nodes being offline for more than than maxAge
days are considered "lost". Lost will be split up in alert
and lost
.
nodeZoom (integer)
The zoom level that is used when clicking on a node or when using a deep-link URL directly to a node. The value 18
is a good default where nearby buildings and streets should be visible.
labelZoom (integer)
Min. zoom level from which on the node labels are shown on the map. Note that every level in between labelZoom
and maxZoom
(defined in mapLayers
) has a negative performance impact.
clientZoom (integer)
The min. level from which on the client dots are visible. Note that every level in between clientZoom
and maxZoom
(defined in mapLayers
) has a negative performance impact.
nodeAttr (array)
Remove or add node properties in details view. The value can be a node attribute (depth 1) or any of the functions with a name starting with "show" from lib/utils/node.js
.
supportedLocale (array)
Add supported locale (with matching language file in locales/*.js
). This will be matched against the browser language setting. Fallback will be the first language in the array.
Example for supportedLocale
:
color (array)
Different color values for all canvas related settings. Couldn't be done via SCSS.
cacheBreaker (string)
Will be replaced in every build to avoid missing or outdated language strings because language.js
is not up to date.
Fixed value (vy0zx).
Last updated
Was this helpful?