diff --git a/README.md b/README.md index 73350de..eb8f4b9 100644 --- a/README.md +++ b/README.md @@ -44,4 +44,55 @@ docker run -p 3100:3100 -p 8999:8999 --name ntopngglobe -d dergeorg/ntopngglobe * Red side of arc is receiving * Green side of arc is sending - +### Settings example +[settings.json](https://git.dergeorg.at/dergeorg/NtopngGlobe/src/branch/master/public/conf/settings.json) +```json +{ + "location": { + "home": { + "lat": 48.1, + "lng": 16.3 + }, + "precision": 0 + }, + "colors": { + "loc": { + "default": "green", + "dualsender": "orange" + }, + "arc": { + "default": [ + "green", + "red" + ], + "dualsender": [ + "orange", + "orange" + ] + } + }, + "sizes": { + "loc": { + "default": 0.1 + }, + "arc": { + "default": 1.1 + }, + "globe": { + "arcDashLength": 0.4, + "arcAltitudeAutoScale": 0.4, + "arcDashGap": 0.1, + "arcDashInitialGap": 0.1, + "arcDashAnimateTime": 7000, + "arcStroke": 0.5, + "labelSize": 0, + "labelDotRadius": 0.4, + "labelResolution": 2 + } + }, + "timer": { + "del": 30, + "refreshTimer": 1 + } +} +``` diff --git a/public/conf/settings.json b/public/conf/settings.json index 1e32b17..1dca7d9 100644 --- a/public/conf/settings.json +++ b/public/conf/settings.json @@ -42,6 +42,7 @@ } }, "timer": { - "del": 30 + "del": 30, + "refreshTimer": 1 } } \ No newline at end of file diff --git a/routes/index.js b/routes/index.js index 0b30997..5192d58 100644 --- a/routes/index.js +++ b/routes/index.js @@ -53,6 +53,9 @@ router.get('/alerts/dates', function(req, res, next) { }); var task = cron.schedule('* * * * *', () => { + if(globe.getSettigns().timer.refreshTimer === 1) { + wss.broadcast("new data is da") + } const TEN_MINUTES = globe.getSettigns().timer.del*60*1000; const date = new Date(); alerts.getAlertDates().forEach(ad => { @@ -79,7 +82,9 @@ router.post('/ws', async function(req, res, next) { if (typeof src !== 'undefined' || typeof dest !== 'undefined') await globe.addArc(src, dest, uid, item.srv_name, item.cli_name) } - wss.broadcast("new data is da") + if(globe.getSettigns().timer.refreshTimer === 0) { + wss.broadcast("new data is da") + } res.sendStatus(200); })