Merge branch 'develop' of git://github.com/ffrgb/meshviewer into ffrgb-develop

This commit is contained in:
Nils Stinnesbeck 2019-11-17 11:28:03 +01:00
commit 614093d2af
Signed by: nils
GPG Key ID: 86D4882C6C6CA48B
27 changed files with 2707 additions and 1911 deletions

View File

@ -2,14 +2,14 @@
# top-most EditorConfig file
root = true
charset = utf-8
# Get rid of whitespace to avoid diffs with a bunch of EOL changes
trim_trailing_whitespace = true
[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
# Get rid of whitespace to avoid diffs with a bunch of EOL changes
trim_trailing_whitespace = true
[*.{js,html,scss,json,yml,md}]
indent_size = 2

View File

@ -9,5 +9,6 @@ rules:
"func-names": 0
"guard-for-in": 0
"no-undefined": 0
"consistent-return": 0
"no-nested-ternary": 0
"no-extend-native": ["error", { "exceptions": ["String"] }]

View File

@ -4,7 +4,7 @@ dist: trusty
language: node_js
node_js:
- "10"
- "12"
os:
- linux
@ -12,11 +12,10 @@ os:
matrix:
include:
- node_js: 8
- node_js: "8"
os: linux
- node_js: 6
- node_js: "10"
os: linux
cache:
yarn: true

View File

@ -1,7 +1,6 @@
# Meshviewer
[![Build Status](https://img.shields.io/travis/ffrgb/meshviewer/develop.svg?style=flat-square)](https://travis-ci.org/ffrgb/meshviewer)
[![Build Status](https://img.shields.io/travis/com/ffrgb/meshviewer/develop.svg?style=flat-square)](https://travis-ci.com/ffrgb/meshviewer)
[![Scrutinizer Code Quality](https://img.shields.io/scrutinizer/g/ffrgb/meshviewer/develop.svg?style=flat-square)](https://scrutinizer-ci.com/g/ffrgb/meshviewer/?branch=develop)
[![Documentation](https://img.shields.io/badge/documentation-online-brightgreen.svg?style=flat-square)](https://doc.meshviewer.org/)
[![License: AGPL v3](https://img.shields.io/github/license/ffrgb/meshviewer.svg?style=flat-square)](https://www.gnu.org/licenses/agpl-3.0)
Meshviewer is an online visualization app to represent nodes and links on a map for Freifunk open mesh network.
@ -11,30 +10,11 @@ Meshviewer is an online visualization app to represent nodes and links on a map
Embedded: https://regensburg.freifunk.net/netz/karte/
Standalone: https://regensburg.freifunk.net/meshviewer/
## Documentation
Documentation moved to [doc.meshviewer.org](https://doc.meshviewer.org/).
- [Read online](https://doc.meshviewer.org/)
- Export as
- [PDF](https://doc.meshviewer.org/meshviewer.pdf)
- [ePub](https://doc.meshviewer.org/meshviewer.epub)
- [Mobi](https://doc.meshviewer.org/meshviewer.mobi)
### [Changelog](https://doc.meshviewer.org/changelog.html)
#### Why move the documentation/changelog?
- Search available
- Multiple pages
- Less doc commits, faster changes
## Sponsoring / Supporting
- [BrowserStack](https://www.browserstack.com/) for providing an awesome testing service for hundreds of browsers
- [Travis CI](https://travis-ci.org/) for building meshviewer on every push and pull request
- [Travis CI](https://travis-ci.com/) for building meshviewer on every push and pull request
- [Scrutinizer CI](https://scrutinizer-ci.com/g/ffrgb/meshviewer/) for testing code quality on every push and pull request
- [POEditor](https://poeditor.com/join/project/VZBjPNNic9) for providing an easy non-developer translation environment
- [Netlify](https://app.netlify.com/sites/meshviewer/deploys) preview for every PR and also provide a [page with current develop branch](https://meshviewer.netlify.com/)
These tools need a lot of infrastructures and provide a free account for open source software.

22
app.js
View File

@ -9,21 +9,21 @@ require.config({
'moment': '../node_modules/moment/moment',
// d3 modules indirect dependencies
// by d3-zoom: d3-drag
'd3-ease': '../node_modules/d3-ease/build/d3-ease',
'd3-transition': '../node_modules/d3-transition/build/d3-transition',
'd3-color': '../node_modules/d3-color/build/d3-color',
'd3-interpolate': '../node_modules/d3-interpolate/build/d3-interpolate',
'd3-ease': '../node_modules/d3-ease/dist/d3-ease',
'd3-transition': '../node_modules/d3-transition/dist/d3-transition',
'd3-color': '../node_modules/d3-color/dist/d3-color',
'd3-interpolate': '../node_modules/d3-interpolate/dist/d3-interpolate',
// by d3-force
'd3-collection': '../node_modules/d3-collection/build/d3-collection',
'd3-dispatch': '../node_modules/d3-dispatch/build/d3-dispatch',
'd3-quadtree': '../node_modules/d3-quadtree/build/d3-quadtree',
'd3-timer': '../node_modules/d3-timer/build/d3-timer',
'd3-collection': '../node_modules/d3-collection/dist/d3-collection',
'd3-dispatch': '../node_modules/d3-dispatch/dist/d3-dispatch',
'd3-quadtree': '../node_modules/d3-quadtree/dist/d3-quadtree',
'd3-timer': '../node_modules/d3-timer/dist/d3-timer',
// by d3-drag: d3-selection
// d3 modules dependencies
'd3-selection': '../node_modules/d3-selection/dist/d3-selection',
'd3-force': '../node_modules/d3-force/build/d3-force',
'd3-zoom': '../node_modules/d3-zoom/build/d3-zoom',
'd3-drag': '../node_modules/d3-drag/build/d3-drag',
'd3-force': '../node_modules/d3-force/dist/d3-force',
'd3-zoom': '../node_modules/d3-zoom/dist/d3-zoom',
'd3-drag': '../node_modules/d3-drag/dist/d3-drag',
'snabbdom': '../node_modules/snabbdom/dist/snabbdom-patch',
'rbush': '../node_modules/rbush/rbush',
'helper': 'utils/helper'

View File

@ -81,8 +81,8 @@ module.exports = function () {
'value': 'Autoupdate'
},
{
'name': 'node.site',
'value': 'Site'
'name': 'node.domain',
'value': 'Domain'
},
{
'name': 'node.clients',

View File

@ -71,7 +71,7 @@ module.exports = function () {
7.1919
]
],
'siteNames': [
'domainNames': [
{
'site': 'tdf',
'name': 'Troisdorf'

View File

@ -11,7 +11,6 @@ module.exports = function () {
html: ['html/*.html', './config*.js']
},
clean: [build + '/*.map', build + '/vendor', build + '/main.css'],
autoprefixer: ['> 1% in DE'],
browsersync: {
open: false,
server: {

View File

@ -20,8 +20,8 @@ var stringify = function (obj) {
module.exports = function (gulp, plugins, config, env) {
return function html() {
return gulp.src(env.production() ? config.build + '/*.html' : 'html/*.html')
.pipe(env.production(plugins.kyhInlineSource({ compress: false })))
.pipe(plugins.realFavicon.injectFaviconMarkups(JSON.parse(fs.readFileSync(config.faviconData)).favicon.html_code))
.pipe(env.production(plugins.inlineSource({ compress: false })))
.pipe(plugins.inject(gulp.src(['config.js']), {
removeTags: true,
starttag: '<!-- inject:config -->',

View File

@ -9,7 +9,7 @@
<body>
<div class="loader">
<p>
Your are Offline!<br />
You are Offline!<br />
<img inline src="logo.svg" class="spinner" alt="Loading ..."/>
<br />
No connection available.

View File

@ -12,8 +12,8 @@ define(function () {
'</p>' +
'<h4>' + _.t('node.clients') + '</h4>' +
'<p class="legend">' +
'<span class="legend-24ghz"><span class="symbol"></span> 2.4 Ghz</span>' +
'<span class="legend-5ghz"><span class="symbol"></span> 5 Ghz</span>' +
'<span class="legend-24ghz"><span class="symbol"></span> 2.4 GHz</span>' +
'<span class="legend-5ghz"><span class="symbol"></span> 5 GHz</span>' +
'<span class="legend-others"><span class="symbol"></span> ' + _.t('others') + '</span>' +
'</p>' +
'<h3>AGPL 3</h3>' +

View File

@ -10,7 +10,7 @@ define(['infobox/link', 'infobox/node', 'infobox/location'], function (Link, Nod
function destroy() {
if (el && el.parentNode) {
el.parentNode.removeChild(el);
el = undefined;
node = link = el = undefined;
sidebar.reveal();
}
}

View File

@ -70,7 +70,19 @@ define(['sorttable', 'snabbdom', 'd3-interpolate', 'helper', 'utils/node'],
V.h('td', icons),
V.h('td', nodeLink(n.node)),
V.h('td', n.node.clients),
V.h('td', { style: { color: linkScale((n.link.source_tq + n.link.target_tq) / 2) } }, helper.showTq(n.link.source_tq) + ' - ' + helper.showTq(n.link.target_tq)),
V.h('td', [V.h('a', {
style: {
color: linkScale((n.link.source_tq + n.link.target_tq) / 2)
},
props: {
title: n.link.source.hostname + ' - ' + n.link.target.hostname,
href: router.generateLink({ link: n.link.id })
}, on: {
click: function (e) {
router.fullUrl({ link: n.link.id }, e);
}
}
}, helper.showTq(n.link.source_tq) + ' - ' + helper.showTq(n.link.target_tq))]),
V.h('td', helper.showDistance(n.link))
]);
}

View File

@ -82,7 +82,11 @@ define(['map/clientlayer', 'map/labellayer', 'map/button', 'leaflet', 'map/activ
if (config.geo) {
[].forEach.call(config.geo, function (geo) {
L.geoJSON(geo.json, geo.option).addTo(map);
geo.json().then(function (result) {
if (result) {
L.geoJSON(result, geo.option).addTo(map);
}
});
});
}

View File

@ -1,5 +1,5 @@
define(['leaflet', 'rbush', 'helper'],
function (L, rbush, helper) {
function (L, RBush, helper) {
'use strict';
return L.GridLayer.extend({
@ -11,7 +11,7 @@ define(['leaflet', 'rbush', 'helper'],
};
},
setData: function (data) {
var rtreeOnlineAll = rbush(9);
var rtreeOnlineAll = new RBush(9);
this.data = rtreeOnlineAll.load(data.nodes.online.filter(helper.hasLocation).map(this.mapRTree));

View File

@ -1,5 +1,5 @@
define(['leaflet', 'rbush', 'helper', 'moment'],
function (L, rbush, helper, moment) {
function (L, RBush, helper, moment) {
'use strict';
var groupOnline;
@ -239,7 +239,7 @@ define(['leaflet', 'rbush', 'helper', 'moment'],
}
for (var z = minZoom; z <= maxZoom; z++) {
trees[z] = rbush(9);
trees[z] = new RBush(9);
trees[z].load(labels.map(nodeToRect(z)));
}
@ -291,7 +291,7 @@ define(['leaflet', 'rbush', 'helper', 'moment'],
}).sort().reverse()[0];
}
this.labels = rbush(9);
this.labels = new RBush(9);
this.labels.load(labels.map(mapRTree));
this.redraw();

View File

@ -15,7 +15,7 @@ define(['d3-interpolate', 'snabbdom', 'utils/version', 'filters/genericnode', 'h
var autoTable;
var gatewayTable;
var gateway6Table;
var siteTable;
var domainTable;
function count(nodes, key, f) {
var dict = {};
@ -108,11 +108,12 @@ define(['d3-interpolate', 'snabbdom', 'utils/version', 'filters/genericnode', 'h
return _.t('node.deactivated');
});
var siteDict = count(nodes, ['site_code'], function (d) {
if (config.siteNames) {
config.siteNames.forEach(function (t) {
if (d === t.site) {
var domainDict = count(nodes, ['domain'], function (d) {
if (config.domainNames) {
config.domainNames.some(function (t) {
if (d === t.domain) {
d = t.name;
return true;
}
});
}
@ -138,7 +139,7 @@ define(['d3-interpolate', 'snabbdom', 'utils/version', 'filters/genericnode', 'h
gateway6Table = fillTable('node.selectedGatewayIPv6', gateway6Table, gateway6Dict.sort(function (a, b) {
return b[1] - a[1];
}));
siteTable = fillTable('node.site', siteTable, siteDict.sort(function (a, b) {
domainTable = fillTable('node.domain', domainTable, domainDict.sort(function (a, b) {
return b[1] - a[1];
}));
};
@ -151,7 +152,7 @@ define(['d3-interpolate', 'snabbdom', 'utils/version', 'filters/genericnode', 'h
self.renderSingle(el, 'node.update', autoTable);
self.renderSingle(el, 'node.selectedGatewayIPv4', gatewayTable);
self.renderSingle(el, 'node.selectedGatewayIPv6', gateway6Table);
self.renderSingle(el, 'node.site', siteTable);
self.renderSingle(el, 'node.domain', domainTable);
if (config.globalInfos) {
var images = document.createElement('div');

View File

@ -68,12 +68,13 @@ define(['snabbdom', 'helper', 'moment'], function (V, helper, moment) {
return showBar(Math.round(d.memory_usage * 100) + ' %', d.memory_usage, d.memory_usage >= 0.8);
};
self.showSite = function showSite(d) {
var rt = d.site_code;
if (config.siteNames) {
config.siteNames.forEach(function (t) {
if (d.site_code === t.site) {
self.showDomain = function showDomain(d) {
var rt = d.domain;
if (config.domainNames) {
config.domainNames.some(function (t) {
if (rt === t.domain) {
rt = t.name;
return true;
}
});
}
@ -96,14 +97,14 @@ define(['snabbdom', 'helper', 'moment'], function (V, helper, moment) {
[
d.clients_wifi24,
V.h('br'),
V.h('span', { props: { className: 'symbol', title: '2,4 Ghz' } })
V.h('span', { props: { className: 'symbol', title: '2,4 GHz' } })
]),
V.h('span',
{ props: { className: 'legend-5ghz' } },
[
d.clients_wifi5,
V.h('br'),
V.h('span', { props: { className: 'symbol', title: '5 Ghz' } })
V.h('span', { props: { className: 'symbol', title: '5 GHz' } })
]),
V.h('span',
{ props: { className: 'legend-others' } },

View File

@ -17,7 +17,7 @@
"hardware": "Model hardwaru",
"visible": "Visible on the map",
"update": "Automatický update",
"site": "Site",
"domain": "Domain",
"gateway": "Brána",
"coordinates": "Souřadnice",
"contact": "Kontakt",

View File

@ -17,7 +17,7 @@
"hardware": "Geräte-Modell",
"visible": "Auf der Karte sichtbar",
"update": "Auto-Update",
"site": "Site",
"domain": "Domain",
"gateway": "Gateway",
"coordinates": "Koordinaten",
"contact": "Kontakt",

View File

@ -17,7 +17,7 @@
"hardware": "Hardware model",
"visible": "Visible on the map",
"update": "Auto update",
"site": "Site",
"domain": "Domain",
"gateway": "Gateway",
"coordinates": "Coordinates",
"contact": "Contact",

View File

@ -17,7 +17,7 @@
"hardware": "Modèle matériel",
"visible": "Visible sur la carte",
"update": "Mise à jour automatique",
"site": "Site",
"domain": "Domain",
"gateway": "Passerelle",
"coordinates": "Coordonnées",
"contact": "Contact",

View File

@ -17,7 +17,7 @@
"hardware": "Тип оборудования",
"visible": "Видно на карте",
"update": "Автообновление",
"site": "Сайт",
"domain": "Сайт",
"gateway": "Шлюз",
"coordinates": "Координаты",
"contact": "Контакты",

View File

@ -17,7 +17,7 @@
"hardware": "Donanım modeli",
"visible": "Harita üzerinde görünür",
"update": "Otomatik güncelleme",
"site": "Site",
"domain": "Domain",
"gateway": "Geçit",
"coordinates": "Koordinatlar",
"contact": "İlişki",

View File

@ -1,6 +1,6 @@
{
"name": "meshviewer",
"version": "10.0.0",
"version": "11.1.0",
"license": "AGPL-3.0",
"repository": {
"type": "git",
@ -10,29 +10,30 @@
"url": "https://github.com/ffrgb/meshviewer/issues"
},
"devDependencies": {
"babel-eslint": "^8.2.6",
"browser-sync": "^2.24.5",
"eslint": "^5.1.0",
"babel-eslint": "^10.0.1",
"browser-sync": "^2.26.5",
"del": "^5.1.0",
"eslint": "^6.5.1",
"eslint-config-airbnb-es5": "^1.2.0",
"eslint-config-defaults": "^9.0.0",
"eslint-plugin-react": "^7.10.0",
"gulp": "github:gulpjs/gulp#4.0",
"gulp-autoprefixer": "^5.0.0",
"gulp-cache-bust": "^1.3.0",
"gulp-cli": "^2.0.1",
"eslint-plugin-react": "^7.12.4",
"gulp": "^4.0.1",
"gulp-autoprefixer": "^7.0.1",
"gulp-cache-bust": "^1.4.0",
"gulp-cli": "^2.2.0",
"gulp-environments": "^0.1.2",
"gulp-eslint": "^5.0.0",
"gulp-htmlmin": "^4.0.0",
"gulp-inject": "^4.3.2",
"gulp-eslint": "^6.0.0",
"gulp-htmlmin": "^5.0.1",
"gulp-inject": "^5.0.2",
"gulp-inline-source": "^4.0.0",
"gulp-jsonminify": "^1.1.0",
"gulp-kyh-inline-source": "^3.0.2",
"gulp-load-plugins": "^1.5.0",
"gulp-real-favicon": "^0.3.0",
"gulp-load-plugins": "^2.0.1",
"gulp-real-favicon": "^0.3.2",
"gulp-requirejs-optimize": "^1.3.0",
"gulp-sass": "^4.0.1",
"gulp-sass": "^4.0.2",
"gulp-sass-lint": "^1.4.0",
"gulp-sourcemaps": "^2.6.4",
"gulp-uglify": "^3.0.0"
"gulp-sourcemaps": "^2.6.5",
"gulp-uglify": "^3.0.2"
},
"eslintConfig": {
"env": {
@ -44,20 +45,23 @@
},
"dependencies": {
"almond": "^0.3.3",
"d3-drag": "^1.2.1",
"d3-force": "^1.1.0",
"d3-selection": "^1.3.0",
"d3-zoom": "^1.7.1",
"leaflet": "^1.3.3",
"moment": "^2.22.2",
"d3-drag": "^1.2.4",
"d3-force": "^1.2.1",
"d3-selection": "^1.4.0",
"d3-zoom": "^1.8.3",
"leaflet": "^1.5.1",
"moment": "^2.24.0",
"navigo": "^7.1.2",
"node-polyglot": "2.2.2",
"promise-polyfill": "^8.0.0",
"rbush": "^2.0.2",
"requirejs": "^2.3.5",
"snabbdom": "^0.7.1"
"promise-polyfill": "^8.1.3",
"rbush": "^3.0.1",
"requirejs": "^2.3.6",
"snabbdom": "^0.7.3"
},
"scripts": {
"gulp": "./node_modules/gulp-cli/bin/gulp.js"
}
},
"browserslist": [
"> 1% in DE"
]
}

View File

@ -13,6 +13,12 @@ header {
border-bottom: 1px solid darken($color-white, 10%);
}
textarea,
input {
background: transparent;
color: $color-black, 100;
}
h1,
h2,
h3,

4399
yarn.lock

File diff suppressed because it is too large Load Diff