[TASK] Move to es5 eslint airbnb
Step forward to es6 airbnb
This commit is contained in:
parent
2ddc32d8f9
commit
5600832305
@ -1,8 +1,12 @@
|
|||||||
---
|
---
|
||||||
"extends":
|
"extends":
|
||||||
- "defaults/configurations/eslint"
|
- "eslint-config-airbnb-es5"
|
||||||
|
|
||||||
rules:
|
rules:
|
||||||
"semi": ["error", "always"]
|
|
||||||
"no-undef": 0
|
"no-undef": 0
|
||||||
"no-console": ["warn", { allow: ["warn", "error"] }]
|
"no-console": ["warn", { allow: ["warn", "error"] }]
|
||||||
|
"no-param-reassign": 0
|
||||||
|
"func-names": 0
|
||||||
|
"guard-for-in": 0
|
||||||
|
"no-undefined": 0
|
||||||
|
"no-nested-ternary": 0
|
||||||
|
12
Gruntfile.js
12
Gruntfile.js
@ -1,9 +1,9 @@
|
|||||||
module.exports = function (grunt) {
|
module.exports = function exports(grunt) {
|
||||||
"use strict";
|
'use strict';
|
||||||
|
|
||||||
grunt.loadTasks("tasks");
|
grunt.loadTasks('tasks');
|
||||||
|
|
||||||
grunt.registerTask("default", ["lint", "copy", "sass:dist", "postcss", "requirejs:default", "inlinedata", "cachebreaker", "inline", "htmlmin", "clean:release"]);
|
grunt.registerTask('default', ['lint', 'copy', 'sass:dist', 'postcss', 'requirejs:default', 'inlinedata', 'cachebreaker', 'inline', 'htmlmin', 'clean:release']);
|
||||||
grunt.registerTask("lint", ["sasslint", "eslint"]);
|
grunt.registerTask('lint', ['sasslint', 'eslint']);
|
||||||
grunt.registerTask("serve", ["lint", "copy", "sass:dev", "postcss", "requirejs:dev", "inlinedata", "htmlmin", "browserSync", "watch"]);
|
grunt.registerTask('serve', ['lint', 'copy', 'sass:dev', 'postcss', 'requirejs:dev', 'inlinedata', 'htmlmin', 'browserSync', 'watch']);
|
||||||
};
|
};
|
||||||
|
30
app.js
30
app.js
@ -1,26 +1,26 @@
|
|||||||
"use strict";
|
'use strict';
|
||||||
|
|
||||||
require.config({
|
require.config({
|
||||||
baseUrl: "lib",
|
baseUrl: 'lib',
|
||||||
paths: {
|
paths: {
|
||||||
"leaflet": "../node_modules/leaflet/dist/leaflet",
|
'leaflet': '../node_modules/leaflet/dist/leaflet',
|
||||||
"leaflet.label": "../node_modules/leaflet-label/dist/leaflet.label",
|
'leaflet.label': '../node_modules/leaflet-label/dist/leaflet.label',
|
||||||
"chroma-js": "../node_modules/chroma-js/chroma.min",
|
'chroma-js': '../node_modules/chroma-js/chroma.min',
|
||||||
"moment": "../node_modules/moment",
|
'moment': '../node_modules/moment',
|
||||||
"tablesort": "../node_modules/tablesort/src/tablesort",
|
'tablesort': '../node_modules/tablesort/src/tablesort',
|
||||||
"d3": "../node_modules/d3/d3.min",
|
'd3': '../node_modules/d3/d3.min',
|
||||||
"virtual-dom": "../node_modules/virtual-dom/dist/virtual-dom",
|
'virtual-dom': '../node_modules/virtual-dom/dist/virtual-dom',
|
||||||
"rbush": "../node_modules/rbush/rbush",
|
'rbush': '../node_modules/rbush/rbush',
|
||||||
"helper": "utils/helper"
|
'helper': 'utils/helper'
|
||||||
},
|
},
|
||||||
shim: {
|
shim: {
|
||||||
"leaflet.label": ["leaflet"],
|
'leaflet.label': ['leaflet'],
|
||||||
"tablesort": {
|
'tablesort': {
|
||||||
exports: "Tablesort"
|
exports: 'Tablesort'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
require(["main"], function (main) {
|
require(['main'], function (main) {
|
||||||
main(jsonData);
|
main(jsonData);
|
||||||
});
|
});
|
||||||
|
56
lib/about.js
56
lib/about.js
@ -1,42 +1,42 @@
|
|||||||
define(function () {
|
define(function () {
|
||||||
"use strict";
|
'use strict';
|
||||||
|
|
||||||
return function () {
|
return function () {
|
||||||
this.render = function (d) {
|
this.render = function render(d) {
|
||||||
d.innerHTML = "<h2>Über Meshviewer</h2>" +
|
d.innerHTML = '<h2>Über Meshviewer</h2>' +
|
||||||
|
|
||||||
"<p>Mit Doppelklick und Shift+Doppelklick kann man in der Karte " +
|
'<p>Mit Doppelklick und Shift+Doppelklick kann man in der Karte ' +
|
||||||
"auch zoomen.</p>" +
|
'auch zoomen.</p>' +
|
||||||
|
|
||||||
"<h3>AGPL 3</h3>" +
|
'<h3>AGPL 3</h3>' +
|
||||||
|
|
||||||
"<p>Copyright (C) Milan Pässler</p>" +
|
'<p>Copyright (C) Milan Pässler</p>' +
|
||||||
"<p>Copyright (C) Nils Schneider</p>" +
|
'<p>Copyright (C) Nils Schneider</p>' +
|
||||||
|
|
||||||
"<p>This program is free software: you can redistribute it and/or " +
|
'<p>This program is free software: you can redistribute it and/or ' +
|
||||||
"modify it under the terms of the GNU Affero General Public " +
|
'modify it under the terms of the GNU Affero General Public ' +
|
||||||
"License as published by the Free Software Foundation, either " +
|
'License as published by the Free Software Foundation, either ' +
|
||||||
"version 3 of the License, or (at your option) any later version.</p>" +
|
'version 3 of the License, or (at your option) any later version.</p>' +
|
||||||
|
|
||||||
"<p>This program is distributed in the hope that it will be useful, " +
|
'<p>This program is distributed in the hope that it will be useful, ' +
|
||||||
"but WITHOUT ANY WARRANTY; without even the implied warranty of " +
|
'but WITHOUT ANY WARRANTY; without even the implied warranty of ' +
|
||||||
"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the " +
|
'MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' +
|
||||||
"GNU Affero General Public License for more details.</p>" +
|
'GNU Affero General Public License for more details.</p>' +
|
||||||
|
|
||||||
"<p>You should have received a copy of the GNU Affero General " +
|
'<p>You should have received a copy of the GNU Affero General ' +
|
||||||
"Public License along with this program. If not, see " +
|
'Public License along with this program. If not, see ' +
|
||||||
"<a href=\"https://www.gnu.org/licenses/\">" +
|
'<a href="https://www.gnu.org/licenses/">' +
|
||||||
"https://www.gnu.org/licenses/</a>.</p>" +
|
'https://www.gnu.org/licenses/</a>.</p>' +
|
||||||
|
|
||||||
"<p>The source code is available at " +
|
'<p>The source code is available at ' +
|
||||||
"<a href=\"https://github.com/ffrgb/meshviewer\">" +
|
'<a href="https://github.com/ffrgb/meshviewer">' +
|
||||||
"https://github.com/ffrgb/meshviewer</a>." +
|
'https://github.com/ffrgb/meshviewer</a>.' +
|
||||||
|
|
||||||
"<p>Forked and based on " +
|
'<p>Forked and based on ' +
|
||||||
"<a href=\"https://github.com/ffnord/meshviewer\">" +
|
'<a href="https://github.com/ffnord/meshviewer">' +
|
||||||
"https://github.com/ffnord/meshviewer</a> and " +
|
'https://github.com/ffnord/meshviewer</a> and ' +
|
||||||
"<a href=\"https://github.com/plumpudding/hopglass\">" +
|
'<a href="https://github.com/plumpudding/hopglass">' +
|
||||||
"https://github.com/plumpudding/hopglass</a>.</p>";
|
'https://github.com/plumpudding/hopglass</a>.</p>';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
@ -1,20 +1,20 @@
|
|||||||
define([], function () {
|
define([], function () {
|
||||||
"use strict";
|
'use strict';
|
||||||
|
|
||||||
return function (tag) {
|
return function (tag) {
|
||||||
if (!tag) {
|
if (!tag) {
|
||||||
tag = "div";
|
tag = 'div';
|
||||||
}
|
}
|
||||||
|
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
var container = document.createElement(tag);
|
var container = document.createElement(tag);
|
||||||
|
|
||||||
self.add = function (d) {
|
self.add = function add(d) {
|
||||||
d.render(container);
|
d.render(container);
|
||||||
};
|
};
|
||||||
|
|
||||||
self.render = function (el) {
|
self.render = function render(el) {
|
||||||
el.appendChild(container);
|
el.appendChild(container);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
define(["filters/nodefilter"], function (NodeFilter) {
|
define(['filters/nodefilter'], function (NodeFilter) {
|
||||||
"use strict";
|
'use strict';
|
||||||
|
|
||||||
return function () {
|
return function () {
|
||||||
var targets = [];
|
var targets = [];
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
define(function () {
|
define(function () {
|
||||||
"use strict";
|
'use strict';
|
||||||
|
|
||||||
return function (distributor) {
|
return function (distributor) {
|
||||||
var container = document.createElement("ul");
|
var container = document.createElement('ul');
|
||||||
container.classList.add("filters");
|
container.classList.add('filters');
|
||||||
var div = document.createElement("div");
|
var div = document.createElement('div');
|
||||||
|
|
||||||
function render(el) {
|
function render(el) {
|
||||||
el.appendChild(div);
|
el.appendChild(div);
|
||||||
@ -16,13 +16,13 @@ define(function () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
filters.forEach(function (d) {
|
filters.forEach(function (d) {
|
||||||
var li = document.createElement("li");
|
var li = document.createElement('li');
|
||||||
container.appendChild(li);
|
container.appendChild(li);
|
||||||
d.render(li);
|
d.render(li);
|
||||||
|
|
||||||
var button = document.createElement("button");
|
var button = document.createElement('button');
|
||||||
button.classList.add("ion-android-close");
|
button.classList.add('ion-android-close');
|
||||||
button.onclick = function () {
|
button.onclick = function onclick() {
|
||||||
distributor.removeFilter(d);
|
distributor.removeFilter(d);
|
||||||
};
|
};
|
||||||
li.appendChild(button);
|
li.appendChild(button);
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
define(["helper"], function (helper) {
|
define(['helper'], function (helper) {
|
||||||
"use strict";
|
'use strict';
|
||||||
|
|
||||||
return function (name, key, value, f) {
|
return function (name, key, value, f) {
|
||||||
var negate = false;
|
var negate = false;
|
||||||
var refresh;
|
var refresh;
|
||||||
|
|
||||||
var label = document.createElement("label");
|
var label = document.createElement('label');
|
||||||
var strong = document.createElement("strong");
|
var strong = document.createElement('strong');
|
||||||
label.textContent = name + ": ";
|
label.textContent = name + ': ';
|
||||||
label.appendChild(strong);
|
label.appendChild(strong);
|
||||||
|
|
||||||
function run(d) {
|
function run(d) {
|
||||||
@ -20,15 +20,15 @@ define(["helper"], function (helper) {
|
|||||||
return o === value ? !negate : negate;
|
return o === value ? !negate : negate;
|
||||||
}
|
}
|
||||||
|
|
||||||
function setRefresh(f) {
|
function setRefresh(r) {
|
||||||
refresh = f;
|
refresh = r;
|
||||||
}
|
}
|
||||||
|
|
||||||
function draw(el) {
|
function draw(el) {
|
||||||
if (negate) {
|
if (negate) {
|
||||||
el.classList.add("not");
|
el.classList.add('not');
|
||||||
} else {
|
} else {
|
||||||
el.classList.remove("not");
|
el.classList.remove('not');
|
||||||
}
|
}
|
||||||
|
|
||||||
strong.textContent = value;
|
strong.textContent = value;
|
||||||
@ -38,7 +38,7 @@ define(["helper"], function (helper) {
|
|||||||
el.appendChild(label);
|
el.appendChild(label);
|
||||||
draw(el);
|
draw(el);
|
||||||
|
|
||||||
label.onclick = function () {
|
label.onclick = function onclick() {
|
||||||
negate = !negate;
|
negate = !negate;
|
||||||
|
|
||||||
draw(el);
|
draw(el);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
define(function () {
|
define(function () {
|
||||||
"use strict";
|
'use strict';
|
||||||
|
|
||||||
return function (filter) {
|
return function (filter) {
|
||||||
return function (data) {
|
return function (data) {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
define(["d3", "helper"], function (d3, helper) {
|
define(['d3', 'helper'], function (d3, helper) {
|
||||||
"use strict";
|
'use strict';
|
||||||
|
|
||||||
var margin = 200;
|
var margin = 200;
|
||||||
var NODE_RADIUS = 15;
|
var NODE_RADIUS = 15;
|
||||||
@ -7,8 +7,11 @@ define(["d3", "helper"], function (d3, helper) {
|
|||||||
|
|
||||||
return function (config, linkScale, sidebar, router) {
|
return function (config, linkScale, sidebar, router) {
|
||||||
var self = this;
|
var self = this;
|
||||||
var canvas, ctx, screenRect;
|
var canvas;
|
||||||
var nodesDict, linksDict;
|
var ctx;
|
||||||
|
var screenRect;
|
||||||
|
var nodesDict;
|
||||||
|
var linksDict;
|
||||||
var zoomBehavior;
|
var zoomBehavior;
|
||||||
var force;
|
var force;
|
||||||
var el;
|
var el;
|
||||||
@ -30,8 +33,8 @@ define(["d3", "helper"], function (d3, helper) {
|
|||||||
|
|
||||||
var LINK_DISTANCE = 70;
|
var LINK_DISTANCE = 70;
|
||||||
|
|
||||||
function graphDiameter(nodes) {
|
function graphDiameter(n) {
|
||||||
return Math.sqrt(nodes.length / Math.PI) * LINK_DISTANCE * 1.41;
|
return Math.sqrt(n.length / Math.PI) * LINK_DISTANCE * 1.41;
|
||||||
}
|
}
|
||||||
|
|
||||||
function savePositions() {
|
function savePositions() {
|
||||||
@ -40,32 +43,31 @@ define(["d3", "helper"], function (d3, helper) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var save = intNodes.map(function (d) {
|
var save = intNodes.map(function (d) {
|
||||||
return {id: d.o.id, x: d.x, y: d.y};
|
return { id: d.o.id, x: d.x, y: d.y };
|
||||||
});
|
});
|
||||||
|
|
||||||
localStorage.setItem("graph/nodeposition", JSON.stringify(save));
|
localStorage.setItem('graph/nodeposition', JSON.stringify(save));
|
||||||
}
|
}
|
||||||
|
|
||||||
function nodeName(d) {
|
function nodeName(d) {
|
||||||
if (d.o.node && d.o.node.nodeinfo) {
|
if (d.o.node && d.o.node.nodeinfo) {
|
||||||
return d.o.node.nodeinfo.hostname;
|
return d.o.node.nodeinfo.hostname;
|
||||||
} else {
|
|
||||||
return d.o.id;
|
|
||||||
}
|
}
|
||||||
|
return d.o.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
function dragstart() {
|
function dragstart() {
|
||||||
var e = translateXY(d3.mouse(el));
|
var e = translateXY(d3.mouse(el));
|
||||||
|
|
||||||
var nodes = intNodes.filter(function (d) {
|
var n = intNodes.filter(function (d) {
|
||||||
return distancePoint(e, d) < NODE_RADIUS;
|
return distancePoint(e, d) < NODE_RADIUS;
|
||||||
});
|
});
|
||||||
|
|
||||||
if (nodes.length === 0) {
|
if (n.length === 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
draggedNode = nodes[0];
|
draggedNode = n[0];
|
||||||
d3.event.sourceEvent.stopPropagation();
|
d3.event.sourceEvent.stopPropagation();
|
||||||
d3.event.sourceEvent.preventDefault();
|
d3.event.sourceEvent.preventDefault();
|
||||||
draggedNode.fixed |= 2;
|
draggedNode.fixed |= 2;
|
||||||
@ -94,9 +96,9 @@ define(["d3", "helper"], function (d3, helper) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var draggableNode = d3.behavior.drag()
|
var draggableNode = d3.behavior.drag()
|
||||||
.on("dragstart", dragstart)
|
.on('dragstart', dragstart)
|
||||||
.on("drag", dragmove)
|
.on('drag', dragmove)
|
||||||
.on("dragend", dragend);
|
.on('dragend', dragend);
|
||||||
|
|
||||||
function animatePanzoom(translate, scale) {
|
function animatePanzoom(translate, scale) {
|
||||||
var translateP = zoomBehavior.translate();
|
var translateP = zoomBehavior.translate();
|
||||||
@ -107,13 +109,13 @@ define(["d3", "helper"], function (d3, helper) {
|
|||||||
zoomBehavior.scale(scale);
|
zoomBehavior.scale(scale);
|
||||||
panzoom();
|
panzoom();
|
||||||
} else {
|
} else {
|
||||||
var start = {x: translateP[0], y: translateP[1], scale: scaleP};
|
var start = { x: translateP[0], y: translateP[1], scale: scaleP };
|
||||||
var end = {x: translate[0], y: translate[1], scale: scale};
|
var end = { x: translate[0], y: translate[1], scale: scale };
|
||||||
|
|
||||||
var interpolate = d3.interpolateObject(start, end);
|
var interpolate = d3.interpolateObject(start, end);
|
||||||
var duration = 500;
|
var duration = 500;
|
||||||
|
|
||||||
var ease = d3.ease("cubic-in-out");
|
var ease = d3.ease('cubic-in-out');
|
||||||
|
|
||||||
d3.timer(function (t) {
|
d3.timer(function (t) {
|
||||||
if (t >= duration) {
|
if (t >= duration) {
|
||||||
@ -188,7 +190,7 @@ define(["d3", "helper"], function (d3, helper) {
|
|||||||
highlightedLinks = [];
|
highlightedLinks = [];
|
||||||
|
|
||||||
if (highlight !== undefined) {
|
if (highlight !== undefined) {
|
||||||
if (highlight.type === "node") {
|
if (highlight.type === 'node') {
|
||||||
var n = nodesDict[highlight.o.nodeinfo.node_id];
|
var n = nodesDict[highlight.o.nodeinfo.node_id];
|
||||||
|
|
||||||
if (n) {
|
if (n) {
|
||||||
@ -200,7 +202,7 @@ define(["d3", "helper"], function (d3, helper) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
} else if (highlight.type === "link") {
|
} else if (highlight.type === 'link') {
|
||||||
var l = linksDict[highlight.o.id];
|
var l = linksDict[highlight.o.id];
|
||||||
|
|
||||||
if (l) {
|
if (l) {
|
||||||
@ -231,8 +233,8 @@ define(["d3", "helper"], function (d3, helper) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function drawLabel(d) {
|
function drawLabel(d) {
|
||||||
var neighbours = d.neighbours.filter(function (d) {
|
var neighbours = d.neighbours.filter(function (n) {
|
||||||
return d.link.o.type !== "fastd" && d.link.o.type !== "L2TP";
|
return n.link.o.type !== 'fastd' && n.link.o.type !== 'L2TP';
|
||||||
});
|
});
|
||||||
|
|
||||||
var sum = neighbours.reduce(function (a, b) {
|
var sum = neighbours.reduce(function (a, b) {
|
||||||
@ -273,10 +275,10 @@ define(["d3", "helper"], function (d3, helper) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function drawNode(color, radius, scale, r) {
|
function drawNode(color, radius, scale, r) {
|
||||||
var node = document.createElement("canvas");
|
var node = document.createElement('canvas');
|
||||||
node.height = node.width = scale * radius * 8 * r;
|
node.height = node.width = scale * radius * 8 * r;
|
||||||
|
|
||||||
var nctx = node.getContext("2d");
|
var nctx = node.getContext('2d');
|
||||||
nctx.scale(scale * r, scale * r);
|
nctx.scale(scale * r, scale * r);
|
||||||
nctx.save();
|
nctx.save();
|
||||||
|
|
||||||
@ -287,16 +289,16 @@ define(["d3", "helper"], function (d3, helper) {
|
|||||||
nctx.moveTo(radius, 0);
|
nctx.moveTo(radius, 0);
|
||||||
nctx.arc(0, 0, radius, 0, 2 * Math.PI);
|
nctx.arc(0, 0, radius, 0, 2 * Math.PI);
|
||||||
|
|
||||||
nctx.strokeStyle = "rgba(255, 0, 0, 1)";
|
nctx.strokeStyle = 'rgba(255, 0, 0, 1)';
|
||||||
nctx.shadowOffsetX = node.width * 1.5;
|
nctx.shadowOffsetX = node.width * 1.5;
|
||||||
nctx.shadowOffsetY = node.height * 1.5 + 3;
|
nctx.shadowOffsetY = node.height * 1.5 + 3;
|
||||||
nctx.shadowBlur = 12;
|
nctx.shadowBlur = 12;
|
||||||
nctx.shadowColor = "rgba(0, 0, 0, 0.16)";
|
nctx.shadowColor = 'rgba(0, 0, 0, 0.16)';
|
||||||
nctx.stroke();
|
nctx.stroke();
|
||||||
nctx.shadowOffsetX = node.width * 1.5;
|
nctx.shadowOffsetX = node.width * 1.5;
|
||||||
nctx.shadowOffsetY = node.height * 1.5 + 3;
|
nctx.shadowOffsetY = node.height * 1.5 + 3;
|
||||||
nctx.shadowBlur = 12;
|
nctx.shadowBlur = 12;
|
||||||
nctx.shadowColor = "rgba(0, 0, 0, 0.23)";
|
nctx.shadowColor = 'rgba(0, 0, 0, 0.23)';
|
||||||
nctx.stroke();
|
nctx.stroke();
|
||||||
|
|
||||||
nctx.restore();
|
nctx.restore();
|
||||||
@ -328,14 +330,14 @@ define(["d3", "helper"], function (d3, helper) {
|
|||||||
ctx.translate(translate[0], translate[1]);
|
ctx.translate(translate[0], translate[1]);
|
||||||
ctx.scale(scale, scale);
|
ctx.scale(scale, scale);
|
||||||
|
|
||||||
var clientColor = "rgba(230, 50, 75, 1.0)";
|
var clientColor = 'rgba(230, 50, 75, 1.0)';
|
||||||
var unknownColor = "#D10E2A";
|
var unknownColor = '#D10E2A';
|
||||||
var nonUplinkColor = "#F2E3C6";
|
var nonUplinkColor = '#F2E3C6';
|
||||||
var uplinkColor = "#5BAAEB";
|
var uplinkColor = '#5BAAEB';
|
||||||
var unseenColor = "#FFA726";
|
var unseenColor = '#FFA726';
|
||||||
var highlightColor = "rgba(252, 227, 198, 0.15)";
|
var highlightColor = 'rgba(252, 227, 198, 0.15)';
|
||||||
var nodeRadius = 6;
|
var nodeRadius = 6;
|
||||||
var cableColor = "#50B0F0";
|
var cableColor = '#50B0F0';
|
||||||
|
|
||||||
// -- draw links --
|
// -- draw links --
|
||||||
ctx.save();
|
ctx.save();
|
||||||
@ -349,9 +351,9 @@ define(["d3", "helper"], function (d3, helper) {
|
|||||||
ctx.beginPath();
|
ctx.beginPath();
|
||||||
ctx.moveTo(d.source.x + dx * nodeRadius, d.source.y + dy * nodeRadius);
|
ctx.moveTo(d.source.x + dx * nodeRadius, d.source.y + dy * nodeRadius);
|
||||||
ctx.lineTo(d.target.x - dx * nodeRadius, d.target.y - dy * nodeRadius);
|
ctx.lineTo(d.target.x - dx * nodeRadius, d.target.y - dy * nodeRadius);
|
||||||
ctx.strokeStyle = d.o.type === "Kabel" ? cableColor : d.color;
|
ctx.strokeStyle = d.o.type === 'Kabel' ? cableColor : d.color;
|
||||||
ctx.globalAlpha = d.o.type === "fastd" || d.o.type === "L2TP" ? 0.2 : 0.8;
|
ctx.globalAlpha = d.o.type === 'fastd' || d.o.type === 'L2TP' ? 0.2 : 0.8;
|
||||||
ctx.lineWidth = d.o.type === "fastd" || d.o.type === "L2TP" ? 1.5 : 2.5;
|
ctx.lineWidth = d.o.type === 'fastd' || d.o.type === 'L2TP' ? 1.5 : 2.5;
|
||||||
ctx.stroke();
|
ctx.stroke();
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -405,14 +407,14 @@ define(["d3", "helper"], function (d3, helper) {
|
|||||||
var startAngle = Math.PI;
|
var startAngle = Math.PI;
|
||||||
|
|
||||||
for (var orbit = 0, i = 0; i < clients; orbit++) {
|
for (var orbit = 0, i = 0; i < clients; orbit++) {
|
||||||
var distance = startDistance + orbit * 2 * radius * a;
|
var di = startDistance + orbit * 2 * radius * a;
|
||||||
var n = Math.floor((Math.PI * distance) / (a * radius));
|
var n = Math.floor((Math.PI * di) / (a * radius));
|
||||||
var delta = clients - i;
|
var delta = clients - i;
|
||||||
|
|
||||||
for (var j = 0; j < Math.min(delta, n); i++, j++) {
|
for (var j = 0; j < Math.min(delta, n); i++, j++) {
|
||||||
var angle = 2 * Math.PI / n * j;
|
var angle = 2 * Math.PI / n * j;
|
||||||
var x = d.x + distance * Math.cos(angle + startAngle);
|
var x = d.x + di * Math.cos(angle + startAngle);
|
||||||
var y = d.y + distance * Math.sin(angle + startAngle);
|
var y = d.y + di * Math.sin(angle + startAngle);
|
||||||
|
|
||||||
ctx.moveTo(x, y);
|
ctx.moveTo(x, y);
|
||||||
ctx.arc(x, y, radius, 0, 2 * Math.PI);
|
ctx.arc(x, y, radius, 0, 2 * Math.PI);
|
||||||
@ -427,11 +429,11 @@ define(["d3", "helper"], function (d3, helper) {
|
|||||||
// -- draw node highlights --
|
// -- draw node highlights --
|
||||||
if (highlightedNodes.length) {
|
if (highlightedNodes.length) {
|
||||||
ctx.save();
|
ctx.save();
|
||||||
ctx.shadowColor = "rgba(255, 255, 255, 1.0)";
|
ctx.shadowColor = 'rgba(255, 255, 255, 1.0)';
|
||||||
ctx.shadowBlur = 10 * nodeRadius;
|
ctx.shadowBlur = 10 * nodeRadius;
|
||||||
ctx.shadowOffsetX = 0;
|
ctx.shadowOffsetX = 0;
|
||||||
ctx.shadowOffsetY = 0;
|
ctx.shadowOffsetY = 0;
|
||||||
ctx.globalCompositeOperation = "lighten";
|
ctx.globalCompositeOperation = 'lighten';
|
||||||
ctx.fillStyle = highlightColor;
|
ctx.fillStyle = highlightColor;
|
||||||
|
|
||||||
ctx.beginPath();
|
ctx.beginPath();
|
||||||
@ -448,13 +450,13 @@ define(["d3", "helper"], function (d3, helper) {
|
|||||||
if (highlightedLinks.length) {
|
if (highlightedLinks.length) {
|
||||||
ctx.save();
|
ctx.save();
|
||||||
ctx.lineWidth = 2 * 5 * nodeRadius;
|
ctx.lineWidth = 2 * 5 * nodeRadius;
|
||||||
ctx.shadowColor = "rgba(255, 255, 255, 1.0)";
|
ctx.shadowColor = 'rgba(255, 255, 255, 1.0)';
|
||||||
ctx.shadowBlur = 10 * nodeRadius;
|
ctx.shadowBlur = 10 * nodeRadius;
|
||||||
ctx.shadowOffsetX = 0;
|
ctx.shadowOffsetX = 0;
|
||||||
ctx.shadowOffsetY = 0;
|
ctx.shadowOffsetY = 0;
|
||||||
ctx.globalCompositeOperation = "lighten";
|
ctx.globalCompositeOperation = 'lighten';
|
||||||
ctx.strokeStyle = highlightColor;
|
ctx.strokeStyle = highlightColor;
|
||||||
ctx.lineCap = "round";
|
ctx.lineCap = 'round';
|
||||||
|
|
||||||
ctx.beginPath();
|
ctx.beginPath();
|
||||||
highlightedLinks.forEach(function (d) {
|
highlightedLinks.forEach(function (d) {
|
||||||
@ -482,8 +484,8 @@ define(["d3", "helper"], function (d3, helper) {
|
|||||||
var r = window.devicePixelRatio;
|
var r = window.devicePixelRatio;
|
||||||
canvas.width = el.offsetWidth * r;
|
canvas.width = el.offsetWidth * r;
|
||||||
canvas.height = el.offsetHeight * r;
|
canvas.height = el.offsetHeight * r;
|
||||||
canvas.style.width = el.offsetWidth + "px";
|
canvas.style.width = el.offsetWidth + 'px';
|
||||||
canvas.style.height = el.offsetHeight + "px";
|
canvas.style.height = el.offsetHeight + 'px';
|
||||||
ctx.setTransform(1, 0, 0, 1, 0, 0);
|
ctx.setTransform(1, 0, 0, 1, 0, 0);
|
||||||
ctx.scale(r, r);
|
ctx.scale(r, r);
|
||||||
requestAnimationFrame(redraw);
|
requestAnimationFrame(redraw);
|
||||||
@ -539,17 +541,17 @@ define(["d3", "helper"], function (d3, helper) {
|
|||||||
|
|
||||||
var e = translateXY(d3.mouse(el));
|
var e = translateXY(d3.mouse(el));
|
||||||
|
|
||||||
var nodes = intNodes.filter(function (d) {
|
var n = intNodes.filter(function (d) {
|
||||||
return distancePoint(e, d) < NODE_RADIUS;
|
return distancePoint(e, d) < NODE_RADIUS;
|
||||||
});
|
});
|
||||||
|
|
||||||
if (nodes.length > 0) {
|
if (n.length > 0) {
|
||||||
router.node(nodes[0].o.node)();
|
router.node(n[0].o.node)();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var links = intLinks.filter(function (d) {
|
var links = intLinks.filter(function (d) {
|
||||||
return d.o.type !== "fastd" && d.o.type !== "L2TP";
|
return d.o.type !== 'fastd' && d.o.type !== 'L2TP';
|
||||||
}).filter(function (d) {
|
}).filter(function (d) {
|
||||||
return distanceLink(e, d.source, d.target) < LINE_RADIUS;
|
return distanceLink(e, d.source, d.target) < LINE_RADIUS;
|
||||||
});
|
});
|
||||||
@ -589,52 +591,50 @@ define(["d3", "helper"], function (d3, helper) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
el = document.createElement("div");
|
el = document.createElement('div');
|
||||||
el.classList.add("graph");
|
el.classList.add('graph');
|
||||||
|
|
||||||
font = window.getComputedStyle(el).fontSize + " " + window.getComputedStyle(el).fontFamily;
|
font = window.getComputedStyle(el).fontSize + ' ' + window.getComputedStyle(el).fontFamily;
|
||||||
|
|
||||||
zoomBehavior = d3.behavior.zoom()
|
zoomBehavior = d3.behavior.zoom()
|
||||||
.scaleExtent([1 / 3, 3])
|
.scaleExtent([1 / 3, 3])
|
||||||
.on("zoom", onPanZoom)
|
.on('zoom', onPanZoom)
|
||||||
.translate([sidebar(), 0]);
|
.translate([sidebar(), 0]);
|
||||||
|
|
||||||
canvas = d3.select(el)
|
canvas = d3.select(el)
|
||||||
.attr("tabindex", 1)
|
.attr('tabindex', 1)
|
||||||
.on("keypress", keyboardZoom(zoomBehavior))
|
.on('keypress', keyboardZoom(zoomBehavior))
|
||||||
.call(zoomBehavior)
|
.call(zoomBehavior)
|
||||||
.append("canvas")
|
.append('canvas')
|
||||||
.on("click", onClick)
|
.on('click', onClick)
|
||||||
.call(draggableNode)
|
.call(draggableNode)
|
||||||
.node();
|
.node();
|
||||||
|
|
||||||
ctx = canvas.getContext("2d");
|
ctx = canvas.getContext('2d');
|
||||||
|
|
||||||
force = d3.layout.force()
|
force = d3.layout.force()
|
||||||
.charge(-250)
|
.charge(-250)
|
||||||
.gravity(0.1)
|
.gravity(0.1)
|
||||||
.linkDistance(function (d) {
|
.linkDistance(function (d) {
|
||||||
if (d.o.type === "fastd" || d.o.type === "L2TP") {
|
if (d.o.type === 'fastd' || d.o.type === 'L2TP') {
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
|
||||||
return LINK_DISTANCE;
|
|
||||||
}
|
}
|
||||||
|
return LINK_DISTANCE;
|
||||||
})
|
})
|
||||||
.linkStrength(function (d) {
|
.linkStrength(function (d) {
|
||||||
if (d.o.type === "fastd" || d.o.type === "L2TP") {
|
if (d.o.type === 'fastd' || d.o.type === 'L2TP') {
|
||||||
return 0.02;
|
return 0.02;
|
||||||
} else {
|
|
||||||
return Math.max(0.5, 1 / d.o.tq);
|
|
||||||
}
|
}
|
||||||
|
return Math.max(0.5, 1 / d.o.tq);
|
||||||
})
|
})
|
||||||
.on("tick", tickEvent)
|
.on('tick', tickEvent)
|
||||||
.on("end", savePositions);
|
.on('end', savePositions);
|
||||||
|
|
||||||
window.addEventListener("resize", resizeCanvas);
|
window.addEventListener('resize', resizeCanvas);
|
||||||
|
|
||||||
panzoom();
|
panzoom();
|
||||||
|
|
||||||
self.setData = function (data) {
|
self.setData = function setData(data) {
|
||||||
var oldNodes = {};
|
var oldNodes = {};
|
||||||
|
|
||||||
intNodes.forEach(function (d) {
|
intNodes.forEach(function (d) {
|
||||||
@ -696,9 +696,9 @@ define(["d3", "helper"], function (d3, helper) {
|
|||||||
|
|
||||||
var offset = 5;
|
var offset = 5;
|
||||||
var lineWidth = 3;
|
var lineWidth = 3;
|
||||||
var buffer = document.createElement("canvas");
|
var buffer = document.createElement('canvas');
|
||||||
var r = window.devicePixelRatio;
|
var r = window.devicePixelRatio;
|
||||||
var bctx = buffer.getContext("2d");
|
var bctx = buffer.getContext('2d');
|
||||||
bctx.font = font;
|
bctx.font = font;
|
||||||
var width = bctx.measureText(name).width;
|
var width = bctx.measureText(name).width;
|
||||||
var scale = zoomBehavior.scaleExtent()[1] * r;
|
var scale = zoomBehavior.scaleExtent()[1] * r;
|
||||||
@ -706,10 +706,10 @@ define(["d3", "helper"], function (d3, helper) {
|
|||||||
buffer.height = (16 + 2 * lineWidth) * scale;
|
buffer.height = (16 + 2 * lineWidth) * scale;
|
||||||
bctx.font = font;
|
bctx.font = font;
|
||||||
bctx.scale(scale, scale);
|
bctx.scale(scale, scale);
|
||||||
bctx.textBaseline = "middle";
|
bctx.textBaseline = 'middle';
|
||||||
bctx.textAlign = "center";
|
bctx.textAlign = 'center';
|
||||||
bctx.fillStyle = "rgba(242, 227, 198, 1.0)";
|
bctx.fillStyle = 'rgba(242, 227, 198, 1.0)';
|
||||||
bctx.shadowColor = "rgba(0, 0, 0, 1)";
|
bctx.shadowColor = 'rgba(0, 0, 0, 1)';
|
||||||
bctx.shadowBlur = 5;
|
bctx.shadowBlur = 5;
|
||||||
bctx.fillText(name, buffer.width / (2 * scale), buffer.height / (2 * scale));
|
bctx.fillText(name, buffer.width / (2 * scale), buffer.height / (2 * scale));
|
||||||
|
|
||||||
@ -743,7 +743,7 @@ define(["d3", "helper"], function (d3, helper) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (helper.localStorageTest()) {
|
if (helper.localStorageTest()) {
|
||||||
var save = JSON.parse(localStorage.getItem("graph/nodeposition"));
|
var save = JSON.parse(localStorage.getItem('graph/nodeposition'));
|
||||||
|
|
||||||
if (save) {
|
if (save) {
|
||||||
var nodePositions = {};
|
var nodePositions = {};
|
||||||
@ -772,25 +772,25 @@ define(["d3", "helper"], function (d3, helper) {
|
|||||||
resizeCanvas();
|
resizeCanvas();
|
||||||
};
|
};
|
||||||
|
|
||||||
self.resetView = function () {
|
self.resetView = function resetView() {
|
||||||
highlight = undefined;
|
highlight = undefined;
|
||||||
updateHighlight();
|
updateHighlight();
|
||||||
doAnimation = true;
|
doAnimation = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
self.gotoNode = function (d) {
|
self.gotoNode = function gotoNode(d) {
|
||||||
highlight = {type: "node", o: d};
|
highlight = { type: 'node', o: d };
|
||||||
updateHighlight();
|
updateHighlight();
|
||||||
doAnimation = true;
|
doAnimation = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
self.gotoLink = function (d) {
|
self.gotoLink = function gotoLink(d) {
|
||||||
highlight = {type: "link", o: d};
|
highlight = { type: 'link', o: d };
|
||||||
updateHighlight();
|
updateHighlight();
|
||||||
doAnimation = true;
|
doAnimation = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
self.destroy = function () {
|
self.destroy = function destroy() {
|
||||||
force.stop();
|
force.stop();
|
||||||
canvas.remove();
|
canvas.remove();
|
||||||
force = null;
|
force = null;
|
||||||
@ -800,7 +800,7 @@ define(["d3", "helper"], function (d3, helper) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
self.render = function (d) {
|
self.render = function render(d) {
|
||||||
d.appendChild(el);
|
d.appendChild(el);
|
||||||
resizeCanvas();
|
resizeCanvas();
|
||||||
updateHighlight();
|
updateHighlight();
|
||||||
|
56
lib/gui.js
56
lib/gui.js
@ -1,22 +1,22 @@
|
|||||||
define(["chroma-js", "map", "sidebar", "tabs", "container", "legend",
|
define(['chroma-js', 'map', 'sidebar', 'tabs', 'container', 'legend',
|
||||||
"linklist", "nodelist", "simplenodelist", "infobox/main",
|
'linklist', 'nodelist', 'simplenodelist', 'infobox/main',
|
||||||
"proportions", "forcegraph", "title", "about", "datadistributor",
|
'proportions', 'forcegraph', 'title', 'about', 'datadistributor',
|
||||||
"filters/filtergui"],
|
'filters/filtergui'],
|
||||||
function (chroma, Map, Sidebar, Tabs, Container, Legend, Linklist,
|
function (chroma, Map, Sidebar, Tabs, Container, Legend, Linklist,
|
||||||
Nodelist, SimpleNodelist, Infobox, Proportions, ForceGraph,
|
Nodelist, SimpleNodelist, Infobox, Proportions, ForceGraph,
|
||||||
Title, About, DataDistributor, FilterGUI) {
|
Title, About, DataDistributor, FilterGUI) {
|
||||||
"use strict";
|
'use strict';
|
||||||
|
|
||||||
return function (config, router) {
|
return function (config, router) {
|
||||||
var self = this;
|
var self = this;
|
||||||
var content;
|
var content;
|
||||||
var contentDiv;
|
var contentDiv;
|
||||||
|
|
||||||
var linkScale = chroma.scale(chroma.bezier(["#04C714", "#FF5500", "#F02311"])).domain([1, 5]);
|
var linkScale = chroma.scale(chroma.bezier(['#04C714', '#FF5500', '#F02311'])).domain([1, 5]);
|
||||||
var sidebar;
|
var sidebar;
|
||||||
|
|
||||||
var buttons = document.createElement("div");
|
var buttons = document.createElement('div');
|
||||||
buttons.classList.add("buttons");
|
buttons.classList.add('buttons');
|
||||||
|
|
||||||
var fanout = new DataDistributor();
|
var fanout = new DataDistributor();
|
||||||
var fanoutUnfiltered = new DataDistributor();
|
var fanoutUnfiltered = new DataDistributor();
|
||||||
@ -51,24 +51,24 @@ define(["chroma-js", "map", "sidebar", "tabs", "container", "legend",
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
var loader = document.getElementsByClassName("loader")[0];
|
var loader = document.getElementsByClassName('loader')[0];
|
||||||
loader.classList.add("hide");
|
loader.classList.add('hide');
|
||||||
|
|
||||||
contentDiv = document.createElement("div");
|
contentDiv = document.createElement('div');
|
||||||
contentDiv.classList.add("content");
|
contentDiv.classList.add('content');
|
||||||
document.body.appendChild(contentDiv);
|
document.body.appendChild(contentDiv);
|
||||||
|
|
||||||
sidebar = new Sidebar(document.body);
|
sidebar = new Sidebar(document.body);
|
||||||
|
|
||||||
contentDiv.appendChild(buttons);
|
contentDiv.appendChild(buttons);
|
||||||
|
|
||||||
var buttonToggle = document.createElement("button");
|
var buttonToggle = document.createElement('button');
|
||||||
buttonToggle.classList.add("ion-eye", "shadow");
|
buttonToggle.classList.add('ion-eye', 'shadow');
|
||||||
buttonToggle.onclick = function () {
|
buttonToggle.onclick = function onclick() {
|
||||||
if (content.constructor === Map) {
|
if (content.constructor === Map) {
|
||||||
router.view("g");
|
router.view('g');
|
||||||
} else {
|
} else {
|
||||||
router.view("m");
|
router.view('m');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -76,13 +76,13 @@ define(["chroma-js", "map", "sidebar", "tabs", "container", "legend",
|
|||||||
|
|
||||||
var title = new Title(config);
|
var title = new Title(config);
|
||||||
|
|
||||||
var header = new Container("header");
|
var header = new Container('header');
|
||||||
var infobox = new Infobox(config, sidebar, router);
|
var infobox = new Infobox(config, sidebar, router);
|
||||||
var tabs = new Tabs();
|
var tabs = new Tabs();
|
||||||
var overview = new Container();
|
var overview = new Container();
|
||||||
var legend = new Legend(config);
|
var legend = new Legend(config);
|
||||||
var newnodeslist = new SimpleNodelist("new", "firstseen", router, "Neue Knoten");
|
var newnodeslist = new SimpleNodelist('new', 'firstseen', router, 'Neue Knoten');
|
||||||
var lostnodeslist = new SimpleNodelist("lost", "lastseen", router, "Verschwundene Knoten");
|
var lostnodeslist = new SimpleNodelist('lost', 'lastseen', router, 'Verschwundene Knoten');
|
||||||
var nodelist = new Nodelist(router);
|
var nodelist = new Nodelist(router);
|
||||||
var linklist = new Linklist(linkScale, router);
|
var linklist = new Linklist(linkScale, router);
|
||||||
var statistics = new Proportions(config, fanout);
|
var statistics = new Proportions(config, fanout);
|
||||||
@ -106,19 +106,19 @@ define(["chroma-js", "map", "sidebar", "tabs", "container", "legend",
|
|||||||
header.add(filterGUI);
|
header.add(filterGUI);
|
||||||
|
|
||||||
sidebar.add(tabs);
|
sidebar.add(tabs);
|
||||||
tabs.add("Aktuelles", overview);
|
tabs.add('Aktuelles', overview);
|
||||||
tabs.add("Knoten", nodelist);
|
tabs.add('Knoten', nodelist);
|
||||||
tabs.add("Verbindungen", linklist);
|
tabs.add('Verbindungen', linklist);
|
||||||
tabs.add("Statistiken", statistics);
|
tabs.add('Statistiken', statistics);
|
||||||
tabs.add("Über", about);
|
tabs.add('Über', about);
|
||||||
|
|
||||||
router.addTarget(title);
|
router.addTarget(title);
|
||||||
router.addTarget(infobox);
|
router.addTarget(infobox);
|
||||||
|
|
||||||
router.addView("m", mkView(Map));
|
router.addView('m', mkView(Map));
|
||||||
router.addView("g", mkView(ForceGraph));
|
router.addView('g', mkView(ForceGraph));
|
||||||
|
|
||||||
router.view("m");
|
router.view('m');
|
||||||
|
|
||||||
self.setData = fanoutUnfiltered.setData;
|
self.setData = fanoutUnfiltered.setData;
|
||||||
|
|
||||||
|
@ -1,55 +1,55 @@
|
|||||||
define(["helper"], function (helper) {
|
define(['helper'], function (helper) {
|
||||||
"use strict";
|
'use strict';
|
||||||
|
|
||||||
function showStatImg(o, source, target, time) {
|
function showStatImg(o, source, target, time) {
|
||||||
var subst = {};
|
var subst = {};
|
||||||
subst["{SOURCE}"] = source;
|
subst['{SOURCE}'] = source;
|
||||||
subst["{TARGET}"] = target;
|
subst['{TARGET}'] = target;
|
||||||
subst["{TIME}"] = time;
|
subst['{TIME}'] = time;
|
||||||
return helper.showStat(o, subst);
|
return helper.showStat(o, subst);
|
||||||
}
|
}
|
||||||
|
|
||||||
return function (config, el, router, d) {
|
return function (config, el, router, d) {
|
||||||
var unknown = !d.source.node;
|
var unknown = !d.source.node;
|
||||||
var h2 = document.createElement("h2");
|
var h2 = document.createElement('h2');
|
||||||
var a1;
|
var a1;
|
||||||
if (!unknown) {
|
if (!unknown) {
|
||||||
a1 = document.createElement("a");
|
a1 = document.createElement('a');
|
||||||
a1.href = "#";
|
a1.href = '#';
|
||||||
a1.onclick = router.node(d.source.node);
|
a1.onclick = router.node(d.source.node);
|
||||||
} else {
|
} else {
|
||||||
a1 = document.createElement("span");
|
a1 = document.createElement('span');
|
||||||
}
|
}
|
||||||
a1.textContent = unknown ? d.source.id : d.source.node.nodeinfo.hostname;
|
a1.textContent = unknown ? d.source.id : d.source.node.nodeinfo.hostname;
|
||||||
h2.appendChild(a1);
|
h2.appendChild(a1);
|
||||||
|
|
||||||
var arrow = document.createElement("spam");
|
var arrow = document.createElement('spam');
|
||||||
arrow.classList.add("ion-ios-arrow-thin-right");
|
arrow.classList.add('ion-ios-arrow-thin-right');
|
||||||
h2.appendChild(arrow);
|
h2.appendChild(arrow);
|
||||||
|
|
||||||
var a2 = document.createElement("a");
|
var a2 = document.createElement('a');
|
||||||
a2.href = "#";
|
a2.href = '#';
|
||||||
a2.onclick = router.node(d.target.node);
|
a2.onclick = router.node(d.target.node);
|
||||||
a2.textContent = d.target.node.nodeinfo.hostname;
|
a2.textContent = d.target.node.nodeinfo.hostname;
|
||||||
h2.appendChild(a2);
|
h2.appendChild(a2);
|
||||||
el.appendChild(h2);
|
el.appendChild(h2);
|
||||||
|
|
||||||
var attributes = document.createElement("table");
|
var attributes = document.createElement('table');
|
||||||
attributes.classList.add("attributes");
|
attributes.classList.add('attributes');
|
||||||
|
|
||||||
helper.attributeEntry(attributes, "TQ", helper.showTq(d));
|
helper.attributeEntry(attributes, 'TQ', helper.showTq(d));
|
||||||
helper.attributeEntry(attributes, "Entfernung", helper.showDistance(d));
|
helper.attributeEntry(attributes, 'Entfernung', helper.showDistance(d));
|
||||||
var hw1 = unknown ? null : helper.dictGet(d.source.node.nodeinfo, ["hardware", "model"]);
|
var hw1 = unknown ? null : helper.dictGet(d.source.node.nodeinfo, ['hardware', 'model']);
|
||||||
var hw2 = helper.dictGet(d.target.node.nodeinfo, ["hardware", "model"]);
|
var hw2 = helper.dictGet(d.target.node.nodeinfo, ['hardware', 'model']);
|
||||||
helper.attributeEntry(attributes, "Hardware", (hw1 != null ? hw1 : "unbekannt") + " – " + (hw2 != null ? hw2 : "unbekannt"));
|
helper.attributeEntry(attributes, 'Hardware', (hw1 !== null ? hw1 : 'unbekannt') + ' – ' + (hw2 !== null ? hw2 : 'unbekannt'));
|
||||||
el.appendChild(attributes);
|
el.appendChild(attributes);
|
||||||
|
|
||||||
if (config.linkInfos) {
|
if (config.linkInfos) {
|
||||||
var source = d.source.node_id;
|
var source = d.source.node_id;
|
||||||
var target = d.target.node_id;
|
var target = d.target.node_id;
|
||||||
var time = d.target.node.lastseen.format("DDMMYYYYHmmss");
|
var time = d.target.node.lastseen.format('DDMMYYYYHmmss');
|
||||||
config.linkInfos.forEach(function (linkInfo) {
|
config.linkInfos.forEach(function (linkInfo) {
|
||||||
var h4 = document.createElement("h4");
|
var h4 = document.createElement('h4');
|
||||||
h4.textContent = linkInfo.name;
|
h4.textContent = linkInfo.name;
|
||||||
el.appendChild(h4);
|
el.appendChild(h4);
|
||||||
el.appendChild(showStatImg(linkInfo, source, target, time));
|
el.appendChild(showStatImg(linkInfo, source, target, time));
|
||||||
|
@ -1,68 +1,67 @@
|
|||||||
define(["helper"], function (helper) {
|
define(['helper'], function (helper) {
|
||||||
"use strict";
|
'use strict';
|
||||||
|
|
||||||
return function (config, el, router, d) {
|
return function (config, el, router, d) {
|
||||||
var sidebarTitle = document.createElement("h2");
|
var sidebarTitle = document.createElement('h2');
|
||||||
sidebarTitle.textContent = "Location: " + d.toString();
|
sidebarTitle.textContent = 'Location: ' + d.toString();
|
||||||
el.appendChild(sidebarTitle);
|
el.appendChild(sidebarTitle);
|
||||||
|
|
||||||
helper.getJSON(config.reverseGeocodingApi + "?format=json&lat=" + d.lat + "&lon=" + d.lng + "&zoom=18&addressdetails=0")
|
helper.getJSON(config.reverseGeocodingApi + '?format=json&lat=' + d.lat + '&lon=' + d.lng + '&zoom=18&addressdetails=0')
|
||||||
.then(function (result) {
|
.then(function (result) {
|
||||||
if (result.display_name) {
|
if (result.display_name) {
|
||||||
sidebarTitle.textContent = result.display_name;
|
sidebarTitle.textContent = result.display_name;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
var editLat = document.createElement("input");
|
var editLat = document.createElement('input');
|
||||||
editLat.type = "text";
|
editLat.type = 'text';
|
||||||
editLat.value = d.lat.toFixed(9);
|
editLat.value = d.lat.toFixed(9);
|
||||||
el.appendChild(createBox("lat", "Breitengrad", editLat));
|
el.appendChild(createBox('lat', 'Breitengrad', editLat));
|
||||||
|
|
||||||
var editLng = document.createElement("input");
|
var editLng = document.createElement('input');
|
||||||
editLng.type = "text";
|
editLng.type = 'text';
|
||||||
editLng.value = d.lng.toFixed(9);
|
editLng.value = d.lng.toFixed(9);
|
||||||
el.appendChild(createBox("lng", "Längengrad", editLng));
|
el.appendChild(createBox('lng', 'Längengrad', editLng));
|
||||||
|
|
||||||
var editUci = document.createElement("textarea");
|
var editUci = document.createElement('textarea');
|
||||||
editUci.value =
|
editUci.value =
|
||||||
"uci set gluon-node-info.@location[0]='location'; " +
|
"uci set gluon-node-info.@location[0]='location'; " +
|
||||||
"uci set gluon-node-info.@location[0].share_location='1';" +
|
"uci set gluon-node-info.@location[0].share_location='1';" +
|
||||||
"uci set gluon-node-info.@location[0].latitude='" + d.lat.toFixed(9) + "';" +
|
"uci set gluon-node-info.@location[0].latitude='" + d.lat.toFixed(9) + "';" +
|
||||||
"uci set gluon-node-info.@location[0].longitude='" + d.lng.toFixed(9) + "';" +
|
"uci set gluon-node-info.@location[0].longitude='" + d.lng.toFixed(9) + "';" +
|
||||||
"uci commit gluon-node-info";
|
'uci commit gluon-node-info';
|
||||||
|
|
||||||
el.appendChild(createBox("uci", "Uci", editUci));
|
el.appendChild(createBox('uci', 'Uci', editUci));
|
||||||
|
|
||||||
function createBox(name, title, inputElem) {
|
function createBox(name, title, inputElem) {
|
||||||
var box = document.createElement("div");
|
var box = document.createElement('div');
|
||||||
var heading = document.createElement("h3");
|
var heading = document.createElement('h3');
|
||||||
heading.textContent = title;
|
heading.textContent = title;
|
||||||
box.appendChild(heading);
|
box.appendChild(heading);
|
||||||
var btn = document.createElement("button");
|
var btn = document.createElement('button');
|
||||||
btn.classList.add("ion-ios-copy");
|
btn.classList.add('ion-ios-copy');
|
||||||
btn.title = "Kopieren";
|
btn.title = 'Kopieren';
|
||||||
btn.onclick = function () {
|
btn.onclick = function onclick() {
|
||||||
copy2clip(inputElem.id);
|
copy2clip(inputElem.id);
|
||||||
};
|
};
|
||||||
inputElem.id = "location-" + name;
|
inputElem.id = 'location-' + name;
|
||||||
inputElem.readOnly = true;
|
inputElem.readOnly = true;
|
||||||
var line = document.createElement("p");
|
var line = document.createElement('p');
|
||||||
line.appendChild(inputElem);
|
line.appendChild(inputElem);
|
||||||
line.appendChild(btn);
|
line.appendChild(btn);
|
||||||
box.appendChild(line);
|
box.appendChild(line);
|
||||||
box.id = "box-" + name;
|
box.id = 'box-' + name;
|
||||||
return box;
|
return box;
|
||||||
}
|
}
|
||||||
|
|
||||||
function copy2clip(id) {
|
function copy2clip(id) {
|
||||||
var copyField = document.querySelector("#" + id);
|
var copyField = document.querySelector('#' + id);
|
||||||
copyField.select();
|
copyField.select();
|
||||||
try {
|
try {
|
||||||
document.execCommand("copy");
|
document.execCommand('copy');
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.warn(err);
|
console.warn(err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
define(["infobox/link", "infobox/node", "infobox/location"], function (Link, Node, Location) {
|
define(['infobox/link', 'infobox/node', 'infobox/location'], function (link, node, location) {
|
||||||
"use strict";
|
'use strict';
|
||||||
|
|
||||||
return function (config, sidebar, router) {
|
return function (config, sidebar, router) {
|
||||||
var self = this;
|
var self = this;
|
||||||
@ -18,16 +18,16 @@ define(["infobox/link", "infobox/node", "infobox/location"], function (Link, Nod
|
|||||||
sidebar.ensureVisible();
|
sidebar.ensureVisible();
|
||||||
sidebar.hide();
|
sidebar.hide();
|
||||||
|
|
||||||
el = document.createElement("div");
|
el = document.createElement('div');
|
||||||
sidebar.container.insertBefore(el, sidebar.container.firstChild);
|
sidebar.container.insertBefore(el, sidebar.container.firstChild);
|
||||||
|
|
||||||
el.scrollIntoView(false);
|
el.scrollIntoView(false);
|
||||||
el.classList.add("infobox");
|
el.classList.add('infobox');
|
||||||
el.destroy = destroy;
|
el.destroy = destroy;
|
||||||
|
|
||||||
var closeButton = document.createElement("button");
|
var closeButton = document.createElement('button');
|
||||||
closeButton.classList.add("close");
|
closeButton.classList.add('close');
|
||||||
closeButton.classList.add("ion-android-close");
|
closeButton.classList.add('ion-android-close');
|
||||||
closeButton.onclick = router.reset;
|
closeButton.onclick = router.reset;
|
||||||
el.appendChild(closeButton);
|
el.appendChild(closeButton);
|
||||||
}
|
}
|
||||||
@ -42,27 +42,27 @@ define(["infobox/link", "infobox/node", "infobox/location"], function (Link, Nod
|
|||||||
|
|
||||||
self.resetView = destroy;
|
self.resetView = destroy;
|
||||||
|
|
||||||
self.gotoNode = function (d, update) {
|
self.gotoNode = function gotoNode(d, update) {
|
||||||
if (update !== true) {
|
if (update !== true) {
|
||||||
create();
|
create();
|
||||||
} else {
|
} else {
|
||||||
clear();
|
clear();
|
||||||
}
|
}
|
||||||
Node(config, el, router, d);
|
node(config, el, router, d);
|
||||||
};
|
};
|
||||||
|
|
||||||
self.gotoLink = function (d, update) {
|
self.gotoLink = function gotoLink(d, update) {
|
||||||
if (update !== true) {
|
if (update !== true) {
|
||||||
create();
|
create();
|
||||||
} else {
|
} else {
|
||||||
clear();
|
clear();
|
||||||
}
|
}
|
||||||
Link(config, el, router, d);
|
link(config, el, router, d);
|
||||||
};
|
};
|
||||||
|
|
||||||
self.gotoLocation = function (d) {
|
self.gotoLocation = function gotoLocation(d) {
|
||||||
create();
|
create();
|
||||||
Location(config, el, router, d);
|
location(config, el, router, d);
|
||||||
};
|
};
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
define(["chroma-js", "moment/moment", "tablesort", "helper", "moment/locale/de"],
|
define(['chroma-js', 'moment/moment', 'tablesort', 'helper', 'moment/locale/de'],
|
||||||
function (chroma, moment, Tablesort, helper) {
|
function (chroma, moment, tablesort, helper) {
|
||||||
"use strict";
|
'use strict';
|
||||||
|
|
||||||
function showGeoURI(d) {
|
function showGeoURI(d) {
|
||||||
if (!helper.hasLocation(d)) {
|
if (!helper.hasLocation(d)) {
|
||||||
@ -8,37 +8,37 @@ define(["chroma-js", "moment/moment", "tablesort", "helper", "moment/locale/de"]
|
|||||||
}
|
}
|
||||||
|
|
||||||
return function (el) {
|
return function (el) {
|
||||||
var a = document.createElement("a");
|
var a = document.createElement('a');
|
||||||
a.textContent = Number(d.nodeinfo.location.latitude.toFixed(6)) + ", " + Number(d.nodeinfo.location.longitude.toFixed(6));
|
a.textContent = Number(d.nodeinfo.location.latitude.toFixed(6)) + ', ' + Number(d.nodeinfo.location.longitude.toFixed(6));
|
||||||
a.href = "geo:" + d.nodeinfo.location.latitude + "," + d.nodeinfo.location.longitude;
|
a.href = 'geo:' + d.nodeinfo.location.latitude + ',' + d.nodeinfo.location.longitude;
|
||||||
el.appendChild(a);
|
el.appendChild(a);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function showStatus(d) {
|
function showStatus(d) {
|
||||||
return function (el) {
|
return function (el) {
|
||||||
el.classList.add(d.flags.unseen ? "unseen" : (d.flags.online ? "online" : "offline"));
|
el.classList.add(d.flags.unseen ? 'unseen' : (d.flags.online ? 'online' : 'offline'));
|
||||||
if (d.flags.online) {
|
if (d.flags.online) {
|
||||||
el.textContent = "online, letzte Nachricht " + d.lastseen.fromNow() + " (" + d.lastseen.format("DD.MM.YYYY, H:mm:ss") + ")";
|
el.textContent = 'online, letzte Nachricht ' + d.lastseen.fromNow() + ' (' + d.lastseen.format('DD.MM.YYYY, H:mm:ss') + ')';
|
||||||
} else {
|
} else {
|
||||||
el.textContent = "offline, letzte Nachricht " + d.lastseen.fromNow() + " (" + d.lastseen.format("DD.MM.YYYY, H:mm:ss") + ")";
|
el.textContent = 'offline, letzte Nachricht ' + d.lastseen.fromNow() + ' (' + d.lastseen.format('DD.MM.YYYY, H:mm:ss') + ')';
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function showFirmware(d) {
|
function showFirmware(d) {
|
||||||
var release = helper.dictGet(d.nodeinfo, ["software", "firmware", "release"]);
|
var release = helper.dictGet(d.nodeinfo, ['software', 'firmware', 'release']);
|
||||||
var base = helper.dictGet(d.nodeinfo, ["software", "firmware", "base"]);
|
var base = helper.dictGet(d.nodeinfo, ['software', 'firmware', 'base']);
|
||||||
|
|
||||||
if (release === null || base === null) {
|
if (release === null || base === null) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
return release + " / " + base;
|
return release + ' / ' + base;
|
||||||
}
|
}
|
||||||
|
|
||||||
function showSite(d, config) {
|
function showSite(d, config) {
|
||||||
var site = helper.dictGet(d.nodeinfo, ["system", "site_code"]);
|
var site = helper.dictGet(d.nodeinfo, ['system', 'site_code']);
|
||||||
var rt = site;
|
var rt = site;
|
||||||
if (config.siteNames) {
|
if (config.siteNames) {
|
||||||
config.siteNames.forEach(function (t) {
|
config.siteNames.forEach(function (t) {
|
||||||
@ -51,15 +51,15 @@ define(["chroma-js", "moment/moment", "tablesort", "helper", "moment/locale/de"]
|
|||||||
}
|
}
|
||||||
|
|
||||||
function showUptime(d) {
|
function showUptime(d) {
|
||||||
if (!("uptime" in d.statistics)) {
|
if (!('uptime' in d.statistics)) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
return moment.duration(d.statistics.uptime, "seconds").humanize();
|
return moment.duration(d.statistics.uptime, 'seconds').humanize();
|
||||||
}
|
}
|
||||||
|
|
||||||
function showFirstseen(d) {
|
function showFirstseen(d) {
|
||||||
if (!("firstseen" in d)) {
|
if (!('firstseen' in d)) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -72,18 +72,18 @@ define(["chroma-js", "moment/moment", "tablesort", "helper", "moment/locale/de"]
|
|||||||
}
|
}
|
||||||
|
|
||||||
return function (el) {
|
return function (el) {
|
||||||
el.appendChild(document.createTextNode(d.statistics.clients > 0 ? d.statistics.clients : "keine"));
|
el.appendChild(document.createTextNode(d.statistics.clients > 0 ? d.statistics.clients : 'keine'));
|
||||||
el.appendChild(document.createElement("br"));
|
el.appendChild(document.createElement('br'));
|
||||||
|
|
||||||
var span = document.createElement("span");
|
var span = document.createElement('span');
|
||||||
span.classList.add("clients");
|
span.classList.add('clients');
|
||||||
span.innerHTML = "<i class=\"ion-ios-person\"></i>".repeat(d.statistics.clients);
|
span.innerHTML = '<i class="ion-ios-person"></i>'.repeat(d.statistics.clients);
|
||||||
el.appendChild(span);
|
el.appendChild(span);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function showIPs(d) {
|
function showIPs(d) {
|
||||||
var ips = helper.dictGet(d.nodeinfo, ["network", "addresses"]);
|
var ips = helper.dictGet(d.nodeinfo, ['network', 'addresses']);
|
||||||
if (ips === null) {
|
if (ips === null) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
@ -92,15 +92,15 @@ define(["chroma-js", "moment/moment", "tablesort", "helper", "moment/locale/de"]
|
|||||||
|
|
||||||
return function (el) {
|
return function (el) {
|
||||||
ips.forEach(function (ip, i) {
|
ips.forEach(function (ip, i) {
|
||||||
var link = !ip.startsWith("fe80:");
|
var link = !ip.startsWith('fe80:');
|
||||||
|
|
||||||
if (i > 0) {
|
if (i > 0) {
|
||||||
el.appendChild(document.createElement("br"));
|
el.appendChild(document.createElement('br'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (link) {
|
if (link) {
|
||||||
var a = document.createElement("a");
|
var a = document.createElement('a');
|
||||||
a.href = "http://[" + ip + "]/";
|
a.href = 'http://[' + ip + ']/';
|
||||||
a.textContent = ip;
|
a.textContent = ip;
|
||||||
el.appendChild(a);
|
el.appendChild(a);
|
||||||
} else {
|
} else {
|
||||||
@ -111,32 +111,32 @@ define(["chroma-js", "moment/moment", "tablesort", "helper", "moment/locale/de"]
|
|||||||
}
|
}
|
||||||
|
|
||||||
function showBar(v) {
|
function showBar(v) {
|
||||||
var span = document.createElement("span");
|
var span = document.createElement('span');
|
||||||
span.classList.add("bar");
|
span.classList.add('bar');
|
||||||
|
|
||||||
var bar = document.createElement("span");
|
var bar = document.createElement('span');
|
||||||
bar.style.width = (v * 100) + "%";
|
bar.style.width = (v * 100) + '%';
|
||||||
span.appendChild(bar);
|
span.appendChild(bar);
|
||||||
|
|
||||||
var label = document.createElement("label");
|
var label = document.createElement('label');
|
||||||
label.textContent = (Math.round(v * 100)) + " %";
|
label.textContent = (Math.round(v * 100)) + ' %';
|
||||||
span.appendChild(label);
|
span.appendChild(label);
|
||||||
|
|
||||||
return span;
|
return span;
|
||||||
}
|
}
|
||||||
|
|
||||||
function showLoadBar(v, p) {
|
function showLoadBar(v, p) {
|
||||||
var span = document.createElement("span");
|
var span = document.createElement('span');
|
||||||
span.classList.add("bar");
|
span.classList.add('bar');
|
||||||
|
|
||||||
var bar = document.createElement("span");
|
var bar = document.createElement('span');
|
||||||
bar.style.width = ((v * 100) % 100) + "%";
|
bar.style.width = ((v * 100) % 100) + '%';
|
||||||
if (v >= p) {
|
if (v >= p) {
|
||||||
span.classList.add("warning");
|
span.classList.add('warning');
|
||||||
}
|
}
|
||||||
span.appendChild(bar);
|
span.appendChild(bar);
|
||||||
|
|
||||||
var label = document.createElement("label");
|
var label = document.createElement('label');
|
||||||
label.textContent = (v);
|
label.textContent = (v);
|
||||||
span.appendChild(label);
|
span.appendChild(label);
|
||||||
|
|
||||||
@ -144,7 +144,7 @@ define(["chroma-js", "moment/moment", "tablesort", "helper", "moment/locale/de"]
|
|||||||
}
|
}
|
||||||
|
|
||||||
function showLoad(d) {
|
function showLoad(d) {
|
||||||
if (!("loadavg" in d.statistics)) {
|
if (!('loadavg' in d.statistics)) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -154,7 +154,7 @@ define(["chroma-js", "moment/moment", "tablesort", "helper", "moment/locale/de"]
|
|||||||
}
|
}
|
||||||
|
|
||||||
function showRAM(d) {
|
function showRAM(d) {
|
||||||
if (!("memory_usage" in d.statistics)) {
|
if (!('memory_usage' in d.statistics)) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -164,60 +164,60 @@ define(["chroma-js", "moment/moment", "tablesort", "helper", "moment/locale/de"]
|
|||||||
}
|
}
|
||||||
|
|
||||||
function showAutoupdate(d) {
|
function showAutoupdate(d) {
|
||||||
var au = helper.dictGet(d.nodeinfo, ["software", "autoupdater"]);
|
var au = helper.dictGet(d.nodeinfo, ['software', 'autoupdater']);
|
||||||
if (!au) {
|
if (!au) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
return au.enabled ? "aktiviert (" + au.branch + ")" : "deaktiviert";
|
return au.enabled ? 'aktiviert (' + au.branch + ')' : 'deaktiviert';
|
||||||
}
|
}
|
||||||
|
|
||||||
function showStatImg(o, d) {
|
function showStatImg(o, d) {
|
||||||
var subst = {};
|
var subst = {};
|
||||||
subst["{NODE_ID}"] = d.nodeinfo.node_id ? d.nodeinfo.node_id : "unknown";
|
subst['{NODE_ID}'] = d.nodeinfo.node_id ? d.nodeinfo.node_id : 'unknown';
|
||||||
subst["{NODE_NAME}"] = d.nodeinfo.hostname ? d.nodeinfo.hostname.replace(/[^a-z0-9\-]/ig, "_") : "unknown";
|
subst['{NODE_NAME}'] = d.nodeinfo.hostname ? d.nodeinfo.hostname.replace(/[^a-z0-9\-]/ig, '_') : 'unknown';
|
||||||
subst["{TIME}"] = d.lastseen.format("DDMMYYYYHmmss");
|
subst['{TIME}'] = d.lastseen.format('DDMMYYYYHmmss');
|
||||||
return helper.showStat(o, subst);
|
return helper.showStat(o, subst);
|
||||||
}
|
}
|
||||||
|
|
||||||
return function (config, el, router, d) {
|
return function (config, el, router, d) {
|
||||||
var linkScale = chroma.scale(chroma.bezier(["#04C714", "#FF5500", "#F02311"])).domain([1, 5]);
|
var linkScale = chroma.scale(chroma.bezier(['#04C714', '#FF5500', '#F02311'])).domain([1, 5]);
|
||||||
var h2 = document.createElement("h2");
|
var h2 = document.createElement('h2');
|
||||||
h2.textContent = d.nodeinfo.hostname;
|
h2.textContent = d.nodeinfo.hostname;
|
||||||
el.appendChild(h2);
|
el.appendChild(h2);
|
||||||
|
|
||||||
var attributes = document.createElement("table");
|
var attributes = document.createElement('table');
|
||||||
attributes.classList.add("attributes");
|
attributes.classList.add('attributes');
|
||||||
|
|
||||||
helper.attributeEntry(attributes, "Status", showStatus(d));
|
helper.attributeEntry(attributes, 'Status', showStatus(d));
|
||||||
helper.attributeEntry(attributes, "Gateway", d.flags.gateway ? "ja" : null);
|
helper.attributeEntry(attributes, 'Gateway', d.flags.gateway ? 'ja' : null);
|
||||||
helper.attributeEntry(attributes, "Koordinaten", showGeoURI(d));
|
helper.attributeEntry(attributes, 'Koordinaten', showGeoURI(d));
|
||||||
|
|
||||||
if (config.nodeInfobox && config.nodeInfobox.contact) {
|
if (config.nodeInfobox && config.nodeInfobox.contact) {
|
||||||
helper.attributeEntry(attributes, "Kontakt", helper.dictGet(d.nodeinfo, ["owner", "contact"]));
|
helper.attributeEntry(attributes, 'Kontakt', helper.dictGet(d.nodeinfo, ['owner', 'contact']));
|
||||||
}
|
}
|
||||||
|
|
||||||
helper.attributeEntry(attributes, "Hardware", helper.dictGet(d.nodeinfo, ["hardware", "model"]));
|
helper.attributeEntry(attributes, 'Hardware', helper.dictGet(d.nodeinfo, ['hardware', 'model']));
|
||||||
helper.attributeEntry(attributes, "Primäre MAC", helper.dictGet(d.nodeinfo, ["network", "mac"]));
|
helper.attributeEntry(attributes, 'Primäre MAC', helper.dictGet(d.nodeinfo, ['network', 'mac']));
|
||||||
helper.attributeEntry(attributes, "Node ID", helper.dictGet(d.nodeinfo, ["node_id"]));
|
helper.attributeEntry(attributes, 'Node ID', helper.dictGet(d.nodeinfo, ['node_id']));
|
||||||
helper.attributeEntry(attributes, "Firmware", showFirmware(d));
|
helper.attributeEntry(attributes, 'Firmware', showFirmware(d));
|
||||||
helper.attributeEntry(attributes, "Site", showSite(d, config));
|
helper.attributeEntry(attributes, 'Site', showSite(d, config));
|
||||||
helper.attributeEntry(attributes, "Uptime", showUptime(d));
|
helper.attributeEntry(attributes, 'Uptime', showUptime(d));
|
||||||
helper.attributeEntry(attributes, "Teil des Netzes", showFirstseen(d));
|
helper.attributeEntry(attributes, 'Teil des Netzes', showFirstseen(d));
|
||||||
if (config.nodeInfobox && config.nodeInfobox.hardwareUsage) {
|
if (config.nodeInfobox && config.nodeInfobox.hardwareUsage) {
|
||||||
helper.attributeEntry(attributes, "Systemlast", showLoad(d));
|
helper.attributeEntry(attributes, 'Systemlast', showLoad(d));
|
||||||
helper.attributeEntry(attributes, "Arbeitsspeicher", showRAM(d));
|
helper.attributeEntry(attributes, 'Arbeitsspeicher', showRAM(d));
|
||||||
}
|
}
|
||||||
helper.attributeEntry(attributes, "IP Adressen", showIPs(d));
|
helper.attributeEntry(attributes, 'IP Adressen', showIPs(d));
|
||||||
helper.attributeEntry(attributes, "Gewähltes Gateway", helper.dictGet(d.statistics, ["gateway"]));
|
helper.attributeEntry(attributes, 'Gewähltes Gateway', helper.dictGet(d.statistics, ['gateway']));
|
||||||
helper.attributeEntry(attributes, "Autom. Updates", showAutoupdate(d));
|
helper.attributeEntry(attributes, 'Autom. Updates', showAutoupdate(d));
|
||||||
helper.attributeEntry(attributes, "Clients", showClients(d));
|
helper.attributeEntry(attributes, 'Clients', showClients(d));
|
||||||
|
|
||||||
el.appendChild(attributes);
|
el.appendChild(attributes);
|
||||||
|
|
||||||
if (config.nodeInfos) {
|
if (config.nodeInfos) {
|
||||||
config.nodeInfos.forEach(function (nodeInfo) {
|
config.nodeInfos.forEach(function (nodeInfo) {
|
||||||
var h4 = document.createElement("h4");
|
var h4 = document.createElement('h4');
|
||||||
h4.textContent = nodeInfo.name;
|
h4.textContent = nodeInfo.name;
|
||||||
el.appendChild(h4);
|
el.appendChild(h4);
|
||||||
el.appendChild(showStatImg(nodeInfo, d));
|
el.appendChild(showStatImg(nodeInfo, d));
|
||||||
@ -225,86 +225,86 @@ define(["chroma-js", "moment/moment", "tablesort", "helper", "moment/locale/de"]
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (d.neighbours.length > 0) {
|
if (d.neighbours.length > 0) {
|
||||||
var h3 = document.createElement("h3");
|
var h3 = document.createElement('h3');
|
||||||
h3.textContent = "Links (" + d.neighbours.length + ")";
|
h3.textContent = 'Links (' + d.neighbours.length + ')';
|
||||||
el.appendChild(h3);
|
el.appendChild(h3);
|
||||||
|
|
||||||
var table = document.createElement("table");
|
var table = document.createElement('table');
|
||||||
var thead = document.createElement("thead");
|
var thead = document.createElement('thead');
|
||||||
|
|
||||||
var tr = document.createElement("tr");
|
var tr = document.createElement('tr');
|
||||||
var th1 = document.createElement("th");
|
var th1 = document.createElement('th');
|
||||||
th1.textContent = " ";
|
th1.textContent = ' ';
|
||||||
tr.appendChild(th1);
|
tr.appendChild(th1);
|
||||||
|
|
||||||
var th2 = document.createElement("th");
|
var th2 = document.createElement('th');
|
||||||
th2.textContent = "Knoten";
|
th2.textContent = 'Knoten';
|
||||||
th2.classList.add("sort-default");
|
th2.classList.add('sort-default');
|
||||||
tr.appendChild(th2);
|
tr.appendChild(th2);
|
||||||
|
|
||||||
var th3 = document.createElement("th");
|
var th3 = document.createElement('th');
|
||||||
th3.textContent = "TQ";
|
th3.textContent = 'TQ';
|
||||||
tr.appendChild(th3);
|
tr.appendChild(th3);
|
||||||
|
|
||||||
var th4 = document.createElement("th");
|
var th4 = document.createElement('th');
|
||||||
th4.textContent = "Entfernung";
|
th4.textContent = 'Entfernung';
|
||||||
tr.appendChild(th4);
|
tr.appendChild(th4);
|
||||||
|
|
||||||
thead.appendChild(tr);
|
thead.appendChild(tr);
|
||||||
table.appendChild(thead);
|
table.appendChild(thead);
|
||||||
|
|
||||||
var tbody = document.createElement("tbody");
|
var tbody = document.createElement('tbody');
|
||||||
|
|
||||||
d.neighbours.forEach(function (d) {
|
d.neighbours.forEach(function (n) {
|
||||||
var unknown = !(d.node);
|
var unknown = !(n.node);
|
||||||
var tr = document.createElement("tr");
|
var tr1 = document.createElement('tr');
|
||||||
|
|
||||||
var td1 = document.createElement("td");
|
var td1 = document.createElement('td');
|
||||||
|
|
||||||
var direction = document.createElement("span");
|
var direction = document.createElement('span');
|
||||||
direction.classList.add(d.incoming ? "ion-ios-arrow-thin-left" : "ion-ios-arrow-thin-right");
|
direction.classList.add(n.incoming ? 'ion-ios-arrow-thin-left' : 'ion-ios-arrow-thin-right');
|
||||||
td1.appendChild(direction);
|
td1.appendChild(direction);
|
||||||
|
|
||||||
if (!unknown && helper.hasLocation(d.node)) {
|
if (!unknown && helper.hasLocation(n.node)) {
|
||||||
var span = document.createElement("span");
|
var span = document.createElement('span');
|
||||||
span.classList.add("ion-location");
|
span.classList.add('ion-location');
|
||||||
td1.appendChild(span);
|
td1.appendChild(span);
|
||||||
}
|
}
|
||||||
|
|
||||||
tr.appendChild(td1);
|
tr1.appendChild(td1);
|
||||||
|
|
||||||
var td2 = document.createElement("td");
|
var td2 = document.createElement('td');
|
||||||
|
|
||||||
if (!unknown) {
|
if (!unknown) {
|
||||||
var a1 = document.createElement("a");
|
var a1 = document.createElement('a');
|
||||||
a1.textContent = d.node.nodeinfo.hostname;
|
a1.textContent = n.node.nodeinfo.hostname;
|
||||||
a1.classList.add("online");
|
a1.classList.add('online');
|
||||||
a1.href = "#";
|
a1.href = '#';
|
||||||
a1.onclick = router.node(d.node);
|
a1.onclick = router.node(n.node);
|
||||||
td2.appendChild(a1);
|
td2.appendChild(a1);
|
||||||
} else {
|
} else {
|
||||||
td2.textContent = d.id;
|
td2.textContent = n.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
tr.appendChild(td2);
|
tr1.appendChild(td2);
|
||||||
|
|
||||||
var td3 = document.createElement("td");
|
var td3 = document.createElement('td');
|
||||||
td3.textContent = helper.showTq(d.link);
|
td3.textContent = helper.showTq(n.link);
|
||||||
td3.style.color = linkScale(d.link.tq).hex();
|
td3.style.color = linkScale(n.link.tq).hex();
|
||||||
tr.appendChild(td3);
|
tr1.appendChild(td3);
|
||||||
|
|
||||||
var td4 = document.createElement("td");
|
var td4 = document.createElement('td');
|
||||||
td4.textContent = helper.showDistance(d.link);
|
td4.textContent = helper.showDistance(n.link);
|
||||||
td4.setAttribute("data-sort", d.link.distance !== undefined ? -d.link.distance : 1);
|
td4.setAttribute('data-sort', n.link.distance !== undefined ? -n.link.distance : 1);
|
||||||
tr.appendChild(td4);
|
tr1.appendChild(td4);
|
||||||
|
|
||||||
tbody.appendChild(tr);
|
tbody.appendChild(tr);
|
||||||
});
|
});
|
||||||
|
|
||||||
table.appendChild(tbody);
|
table.appendChild(tbody);
|
||||||
table.classList.add("node-links");
|
table.classList.add('node-links');
|
||||||
|
|
||||||
Tablesort(table);
|
tablesort(table);
|
||||||
|
|
||||||
el.appendChild(table);
|
el.appendChild(table);
|
||||||
}
|
}
|
||||||
|
@ -1,44 +1,44 @@
|
|||||||
define(["helper"], function (helper) {
|
define(['helper'], function (helper) {
|
||||||
"use strict";
|
'use strict';
|
||||||
|
|
||||||
return function (config) {
|
return function (config) {
|
||||||
var self = this;
|
var self = this;
|
||||||
var stats = document.createTextNode("");
|
var stats = document.createTextNode('');
|
||||||
var timestamp = document.createTextNode("");
|
var timestamp = document.createTextNode('');
|
||||||
|
|
||||||
self.setData = function (d) {
|
self.setData = function setData(d) {
|
||||||
var totalNodes = helper.sum(d.nodes.all.map(helper.one));
|
var totalNodes = helper.sum(d.nodes.all.map(helper.one));
|
||||||
var totalOnlineNodes = helper.sum(d.nodes.all.filter(helper.online).map(helper.one));
|
var totalOnlineNodes = helper.sum(d.nodes.all.filter(helper.online).map(helper.one));
|
||||||
var totalClients = helper.sum(d.nodes.all.filter(helper.online).map(function (d) {
|
var totalClients = helper.sum(d.nodes.all.filter(helper.online).map(function (n) {
|
||||||
return d.statistics.clients ? d.statistics.clients : 0;
|
return n.statistics.clients ? n.statistics.clients : 0;
|
||||||
}));
|
}));
|
||||||
var totalGateways = helper.sum(d.nodes.all.filter(helper.online).filter(function (d) {
|
var totalGateways = helper.sum(d.nodes.all.filter(helper.online).filter(function (n) {
|
||||||
return d.flags.gateway;
|
return n.flags.gateway;
|
||||||
}).map(helper.one));
|
}).map(helper.one));
|
||||||
|
|
||||||
stats.textContent = totalNodes + " Knoten, " +
|
stats.textContent = totalNodes + ' Knoten, ' +
|
||||||
"davon " + totalOnlineNodes + " Knoten online " +
|
'davon ' + totalOnlineNodes + ' Knoten online ' +
|
||||||
"mit " + totalClients + " Client" + ( totalClients === 1 ? " " : "s " ) +
|
'mit ' + totalClients + ' Client' + ( totalClients === 1 ? ' ' : 's ' ) +
|
||||||
"auf " + totalGateways + " Gateway" + ( totalGateways === 1 ? "" : "s" );
|
'auf ' + totalGateways + ' Gateway' + ( totalGateways === 1 ? '' : 's' );
|
||||||
|
|
||||||
timestamp.textContent = "Stand: " + d.timestamp.format("DD.MM.Y HH:mm");
|
timestamp.textContent = 'Stand: ' + d.timestamp.format('DD.MM.Y HH:mm');
|
||||||
};
|
};
|
||||||
|
|
||||||
self.render = function (el) {
|
self.render = function render(el) {
|
||||||
var h2 = document.createElement("h2");
|
var h2 = document.createElement('h2');
|
||||||
h2.textContent = config.siteName;
|
h2.textContent = config.siteName;
|
||||||
el.appendChild(h2);
|
el.appendChild(h2);
|
||||||
|
|
||||||
var p = document.createElement("p");
|
var p = document.createElement('p');
|
||||||
p.classList.add("legend");
|
p.classList.add('legend');
|
||||||
p.innerHTML = '<span class="legend-new"><span class="symbol"></span> Neuer Knoten</span>' +
|
p.innerHTML = '<span class="legend-new"><span class="symbol"></span> Neuer Knoten</span>' +
|
||||||
'<span class="legend-online"><span class="symbol"></span> Knoten ist online</span>' +
|
'<span class="legend-online"><span class="symbol"></span> Knoten ist online</span>' +
|
||||||
'<span class="legend-offline"><span class="symbol"></span> Knoten ist offline</span>';
|
'<span class="legend-offline"><span class="symbol"></span> Knoten ist offline</span>';
|
||||||
el.appendChild(p);
|
el.appendChild(p);
|
||||||
|
|
||||||
p.appendChild(document.createElement("br"));
|
p.appendChild(document.createElement('br'));
|
||||||
p.appendChild(stats);
|
p.appendChild(stats);
|
||||||
p.appendChild(document.createElement("br"));
|
p.appendChild(document.createElement('br'));
|
||||||
p.appendChild(timestamp);
|
p.appendChild(timestamp);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,26 +1,24 @@
|
|||||||
define(["sorttable", "virtual-dom", "helper"], function (SortTable, V, helper) {
|
define(['sorttable', 'virtual-dom', 'helper'], function (SortTable, V, helper) {
|
||||||
"use strict";
|
'use strict';
|
||||||
|
|
||||||
function linkName(d) {
|
function linkName(d) {
|
||||||
return (d.source.node ? d.source.node.nodeinfo.hostname : d.source.id) + " – " + d.target.node.nodeinfo.hostname;
|
return (d.source.node ? d.source.node.nodeinfo.hostname : d.source.id) + ' – ' + d.target.node.nodeinfo.hostname;
|
||||||
}
|
}
|
||||||
|
|
||||||
var headings = [{
|
var headings = [{
|
||||||
name: "Knoten",
|
name: 'Knoten',
|
||||||
sort: function (a, b) {
|
sort: function (a, b) {
|
||||||
return linkName(a).localeCompare(linkName(b));
|
return linkName(a).localeCompare(linkName(b));
|
||||||
},
|
},
|
||||||
reverse: false
|
reverse: false
|
||||||
},
|
}, {
|
||||||
{
|
name: 'TQ',
|
||||||
name: "TQ",
|
|
||||||
sort: function (a, b) {
|
sort: function (a, b) {
|
||||||
return a.tq - b.tq;
|
return a.tq - b.tq;
|
||||||
},
|
},
|
||||||
reverse: true
|
reverse: true
|
||||||
},
|
}, {
|
||||||
{
|
name: 'Entfernung',
|
||||||
name: "Entfernung",
|
|
||||||
sort: function (a, b) {
|
sort: function (a, b) {
|
||||||
return (a.distance === undefined ? -1 : a.distance) -
|
return (a.distance === undefined ? -1 : a.distance) -
|
||||||
(b.distance === undefined ? -1 : b.distance);
|
(b.distance === undefined ? -1 : b.distance);
|
||||||
@ -30,27 +28,27 @@ define(["sorttable", "virtual-dom", "helper"], function (SortTable, V, helper) {
|
|||||||
|
|
||||||
return function (linkScale, router) {
|
return function (linkScale, router) {
|
||||||
var table = new SortTable(headings, 2, renderRow);
|
var table = new SortTable(headings, 2, renderRow);
|
||||||
table.el.classList.add("link-list");
|
table.el.classList.add('link-list');
|
||||||
|
|
||||||
function renderRow(d) {
|
function renderRow(d) {
|
||||||
var td1Content = [V.h("a", {href: "#", onclick: router.link(d)}, linkName(d))];
|
var td1Content = [V.h('a', { href: '#', onclick: router.link(d) }, linkName(d))];
|
||||||
|
|
||||||
var td1 = V.h("td", td1Content);
|
var td1 = V.h('td', td1Content);
|
||||||
var td2 = V.h("td", {style: {color: linkScale(d.tq).hex()}}, helper.showTq(d));
|
var td2 = V.h('td', { style: { color: linkScale(d.tq).hex() } }, helper.showTq(d));
|
||||||
var td3 = V.h("td", helper.showDistance(d));
|
var td3 = V.h('td', helper.showDistance(d));
|
||||||
|
|
||||||
return V.h("tr", [td1, td2, td3]);
|
return V.h('tr', [td1, td2, td3]);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.render = function (d) {
|
this.render = function render(d) {
|
||||||
var h2 = document.createElement("h2");
|
var h2 = document.createElement('h2');
|
||||||
h2.textContent = "Verbindungen";
|
h2.textContent = 'Verbindungen';
|
||||||
d.appendChild(h2);
|
d.appendChild(h2);
|
||||||
|
|
||||||
d.appendChild(table.el);
|
d.appendChild(table.el);
|
||||||
};
|
};
|
||||||
|
|
||||||
this.setData = function (d) {
|
this.setData = function setData(d) {
|
||||||
table.setData(d.graph.links);
|
table.setData(d.graph.links);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
define(["leaflet"], function (L) {
|
define(['leaflet'], function (L) {
|
||||||
"use strict";
|
'use strict';
|
||||||
|
|
||||||
return L.CircleMarker.extend({
|
return L.CircleMarker.extend({
|
||||||
outerCircle: {
|
outerCircle: {
|
||||||
stroke: false,
|
stroke: false,
|
||||||
color: "#4285F4",
|
color: '#4285F4',
|
||||||
opacity: 1,
|
opacity: 1,
|
||||||
fillOpacity: 0.3,
|
fillOpacity: 0.3,
|
||||||
clickable: false,
|
clickable: false,
|
||||||
@ -13,8 +13,8 @@ define(["leaflet"], function (L) {
|
|||||||
|
|
||||||
innerCircle: {
|
innerCircle: {
|
||||||
stroke: true,
|
stroke: true,
|
||||||
color: "#ffffff",
|
color: '#ffffff',
|
||||||
fillColor: "#4285F4",
|
fillColor: '#4285F4',
|
||||||
weight: 1.5,
|
weight: 1.5,
|
||||||
clickable: false,
|
clickable: false,
|
||||||
opacity: 1,
|
opacity: 1,
|
||||||
@ -24,7 +24,7 @@ define(["leaflet"], function (L) {
|
|||||||
|
|
||||||
accuracyCircle: {
|
accuracyCircle: {
|
||||||
stroke: true,
|
stroke: true,
|
||||||
color: "#4285F4",
|
color: '#4285F4',
|
||||||
weight: 1,
|
weight: 1,
|
||||||
clickable: false,
|
clickable: false,
|
||||||
opacity: 0.7,
|
opacity: 0.7,
|
||||||
@ -36,7 +36,7 @@ define(["leaflet"], function (L) {
|
|||||||
this.outerCircle = L.circleMarker(latlng, this.outerCircle);
|
this.outerCircle = L.circleMarker(latlng, this.outerCircle);
|
||||||
L.CircleMarker.prototype.initialize.call(this, latlng, this.innerCircle);
|
L.CircleMarker.prototype.initialize.call(this, latlng, this.innerCircle);
|
||||||
|
|
||||||
this.on("remove", function () {
|
this.on('remove', function () {
|
||||||
this._map.removeLayer(this.accuracyCircle);
|
this._map.removeLayer(this.accuracyCircle);
|
||||||
this._map.removeLayer(this.outerCircle);
|
this._map.removeLayer(this.outerCircle);
|
||||||
});
|
});
|
||||||
|
50
lib/main.js
50
lib/main.js
@ -1,6 +1,6 @@
|
|||||||
define(["moment/moment", "router", "leaflet", "gui", "helper", "moment/locale/de"],
|
define(['moment/moment', 'router', 'leaflet', 'gui', 'helper', 'moment/locale/de'],
|
||||||
function (moment, Router, L, GUI, helper) {
|
function (moment, Router, L, GUI, helper) {
|
||||||
"use strict";
|
'use strict';
|
||||||
|
|
||||||
return function (config) {
|
return function (config) {
|
||||||
function handleData(data) {
|
function handleData(data) {
|
||||||
@ -20,8 +20,8 @@ define(["moment/moment", "router", "leaflet", "gui", "helper", "moment/locale/de
|
|||||||
var vererr;
|
var vererr;
|
||||||
if (i % 2) {
|
if (i % 2) {
|
||||||
if (data[i].version !== 1) {
|
if (data[i].version !== 1) {
|
||||||
vererr = "Unsupported graph version: " + data[i].version;
|
vererr = 'Unsupported graph version: ' + data[i].version;
|
||||||
console.error(vererr); //silent fail
|
console.error(vererr); // silent fail
|
||||||
} else {
|
} else {
|
||||||
data[i].batadv.links.forEach(rearrangeLinks);
|
data[i].batadv.links.forEach(rearrangeLinks);
|
||||||
dataGraph.batadv.nodes = dataGraph.batadv.nodes.concat(data[i].batadv.nodes);
|
dataGraph.batadv.nodes = dataGraph.batadv.nodes.concat(data[i].batadv.nodes);
|
||||||
@ -29,8 +29,8 @@ define(["moment/moment", "router", "leaflet", "gui", "helper", "moment/locale/de
|
|||||||
dataGraph.timestamp = data[i].timestamp;
|
dataGraph.timestamp = data[i].timestamp;
|
||||||
}
|
}
|
||||||
} else if (data[i].version !== 2) {
|
} else if (data[i].version !== 2) {
|
||||||
vererr = "Unsupported nodes version: " + data[i].version;
|
vererr = 'Unsupported nodes version: ' + data[i].version;
|
||||||
console.error(vererr); //silent fail
|
console.error(vererr); // silent fail
|
||||||
} else {
|
} else {
|
||||||
dataNodes.nodes = dataNodes.nodes.concat(data[i].nodes);
|
dataNodes.nodes = dataNodes.nodes.concat(data[i].nodes);
|
||||||
dataNodes.timestamp = data[i].timestamp;
|
dataNodes.timestamp = data[i].timestamp;
|
||||||
@ -38,7 +38,7 @@ define(["moment/moment", "router", "leaflet", "gui", "helper", "moment/locale/de
|
|||||||
}
|
}
|
||||||
|
|
||||||
var nodes = dataNodes.nodes.filter(function (d) {
|
var nodes = dataNodes.nodes.filter(function (d) {
|
||||||
return "firstseen" in d && "lastseen" in d;
|
return 'firstseen' in d && 'lastseen' in d;
|
||||||
});
|
});
|
||||||
|
|
||||||
nodes.forEach(function (node) {
|
nodes.forEach(function (node) {
|
||||||
@ -47,10 +47,10 @@ define(["moment/moment", "router", "leaflet", "gui", "helper", "moment/locale/de
|
|||||||
});
|
});
|
||||||
|
|
||||||
var now = moment();
|
var now = moment();
|
||||||
var age = moment(now).subtract(config.maxAge, "days");
|
var age = moment(now).subtract(config.maxAge, 'days');
|
||||||
|
|
||||||
var newnodes = helper.limit("firstseen", age, helper.sortByKey("firstseen", nodes).filter(helper.online));
|
var newnodes = helper.limit('firstseen', age, helper.sortByKey('firstseen', nodes).filter(helper.online));
|
||||||
var lostnodes = helper.limit("lastseen", age, helper.sortByKey("lastseen", nodes).filter(helper.offline));
|
var lostnodes = helper.limit('lastseen', age, helper.sortByKey('lastseen', nodes).filter(helper.offline));
|
||||||
|
|
||||||
var graphnodes = {};
|
var graphnodes = {};
|
||||||
|
|
||||||
@ -88,11 +88,11 @@ define(["moment/moment", "router", "leaflet", "gui", "helper", "moment/locale/de
|
|||||||
var unknown = (d.source.node === undefined);
|
var unknown = (d.source.node === undefined);
|
||||||
var ids;
|
var ids;
|
||||||
if (unknown) {
|
if (unknown) {
|
||||||
ids = [d.source.id.replace(/:/g, ""), d.target.node.nodeinfo.node_id];
|
ids = [d.source.id.replace(/:/g, ''), d.target.node.nodeinfo.node_id];
|
||||||
} else {
|
} else {
|
||||||
ids = [d.source.node.nodeinfo.node_id, d.target.node.nodeinfo.node_id];
|
ids = [d.source.node.nodeinfo.node_id, d.target.node.nodeinfo.node_id];
|
||||||
}
|
}
|
||||||
d.id = ids.join("-");
|
d.id = ids.join('-');
|
||||||
|
|
||||||
if (unknown || !d.source.node.nodeinfo.location || !d.target.node.nodeinfo.location ||
|
if (unknown || !d.source.node.nodeinfo.location || !d.target.node.nodeinfo.location ||
|
||||||
isNaN(d.source.node.nodeinfo.location.latitude) ||
|
isNaN(d.source.node.nodeinfo.location.latitude) ||
|
||||||
@ -115,18 +115,18 @@ define(["moment/moment", "router", "leaflet", "gui", "helper", "moment/locale/de
|
|||||||
|
|
||||||
links.forEach(function (d) {
|
links.forEach(function (d) {
|
||||||
if (d.target.node.flags.gateway === true || (d.source.node !== undefined && d.source.node.flags.gateway === true)) {
|
if (d.target.node.flags.gateway === true || (d.source.node !== undefined && d.source.node.flags.gateway === true)) {
|
||||||
d.type = "fastd";
|
d.type = 'fastd';
|
||||||
} else {
|
} else {
|
||||||
d.type = "N/A";
|
d.type = 'N/A';
|
||||||
}
|
}
|
||||||
var unknown = (d.source.node === undefined);
|
var unknown = (d.source.node === undefined);
|
||||||
if (unknown) {
|
if (unknown) {
|
||||||
d.target.node.neighbours.push({id: d.source.id, link: d, incoming: true});
|
d.target.node.neighbours.push({ id: d.source.id, link: d, incoming: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
d.source.node.neighbours.push({node: d.target.node, link: d, incoming: false});
|
d.source.node.neighbours.push({ node: d.target.node, link: d, incoming: false });
|
||||||
d.target.node.neighbours.push({node: d.source.node, link: d, incoming: true});
|
d.target.node.neighbours.push({ node: d.source.node, link: d, incoming: true });
|
||||||
if (d.type !== "fastd" && d.type !== "L2TP") {
|
if (d.type !== 'fastd' && d.type !== 'L2TP') {
|
||||||
d.source.node.meshlinks = d.source.node.meshlinks ? d.source.node.meshlinks + 1 : 1;
|
d.source.node.meshlinks = d.source.node.meshlinks ? d.source.node.meshlinks + 1 : 1;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -150,19 +150,19 @@ define(["moment/moment", "router", "leaflet", "gui", "helper", "moment/locale/de
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
moment.locale("de");
|
moment.locale('de');
|
||||||
|
|
||||||
var router = new Router();
|
var router = new Router();
|
||||||
|
|
||||||
var urls = [];
|
var urls = [];
|
||||||
|
|
||||||
if (typeof config.dataPath === "string" || config.dataPath instanceof String) {
|
if (typeof config.dataPath === 'string' || config.dataPath instanceof String) {
|
||||||
config.dataPath = [config.dataPath];
|
config.dataPath = [config.dataPath];
|
||||||
}
|
}
|
||||||
|
|
||||||
for (var i in config.dataPath) {
|
for (var i in config.dataPath) {
|
||||||
urls.push(config.dataPath[i] + "nodes.json");
|
urls.push(config.dataPath[i] + 'nodes.json');
|
||||||
urls.push(config.dataPath[i] + "graph.json");
|
urls.push(config.dataPath[i] + 'graph.json');
|
||||||
}
|
}
|
||||||
|
|
||||||
function update() {
|
function update() {
|
||||||
@ -178,9 +178,9 @@ define(["moment/moment", "router", "leaflet", "gui", "helper", "moment/locale/de
|
|||||||
router.start();
|
router.start();
|
||||||
|
|
||||||
window.setInterval(function () {
|
window.setInterval(function () {
|
||||||
update().then(function (d) {
|
update().then(function (n) {
|
||||||
gui.setData(d);
|
gui.setData(n);
|
||||||
router.setData(d);
|
router.setData(n);
|
||||||
router.update();
|
router.update();
|
||||||
});
|
});
|
||||||
}, 60000);
|
}, 60000);
|
||||||
|
164
lib/map.js
164
lib/map.js
@ -1,8 +1,6 @@
|
|||||||
define(["map/clientlayer", "map/labelslayer",
|
define(['map/clientlayer', 'map/labelslayer', 'leaflet', 'moment/moment', 'locationmarker', 'rbush', 'helper', 'leaflet.label', 'moment/locale/de'],
|
||||||
"leaflet", "moment/moment", "locationmarker", "rbush", "helper",
|
|
||||||
"leaflet.label", "moment/locale/de"],
|
|
||||||
function (ClientLayer, LabelsLayer, L, moment, LocationMarker, rbush, helper) {
|
function (ClientLayer, LabelsLayer, L, moment, LocationMarker, rbush, helper) {
|
||||||
"use strict";
|
'use strict';
|
||||||
|
|
||||||
var options = {
|
var options = {
|
||||||
worldCopyJump: true,
|
worldCopyJump: true,
|
||||||
@ -11,21 +9,21 @@ define(["map/clientlayer", "map/labelslayer",
|
|||||||
|
|
||||||
var LocateButton = L.Control.extend({
|
var LocateButton = L.Control.extend({
|
||||||
options: {
|
options: {
|
||||||
position: "bottomright"
|
position: 'bottomright'
|
||||||
},
|
},
|
||||||
|
|
||||||
active: false,
|
active: false,
|
||||||
button: undefined,
|
button: undefined,
|
||||||
|
|
||||||
initialize: function (f, options) {
|
initialize: function (f, o) {
|
||||||
L.Util.setOptions(this, options);
|
L.Util.setOptions(this, o);
|
||||||
this.f = f;
|
this.f = f;
|
||||||
},
|
},
|
||||||
|
|
||||||
onAdd: function () {
|
onAdd: function () {
|
||||||
var button = L.DomUtil.create("button", "ion-android-locate shadow");
|
var button = L.DomUtil.create('button', 'ion-android-locate shadow');
|
||||||
L.DomEvent.disableClickPropagation(button);
|
L.DomEvent.disableClickPropagation(button);
|
||||||
L.DomEvent.addListener(button, "click", this.onClick, this);
|
L.DomEvent.addListener(button, 'click', this.onClick, this);
|
||||||
|
|
||||||
this.button = button;
|
this.button = button;
|
||||||
|
|
||||||
@ -33,7 +31,7 @@ define(["map/clientlayer", "map/labelslayer",
|
|||||||
},
|
},
|
||||||
|
|
||||||
update: function () {
|
update: function () {
|
||||||
this.button.classList.toggle("active", this.active);
|
this.button.classList.toggle('active', this.active);
|
||||||
},
|
},
|
||||||
|
|
||||||
set: function (v) {
|
set: function (v) {
|
||||||
@ -48,23 +46,23 @@ define(["map/clientlayer", "map/labelslayer",
|
|||||||
|
|
||||||
var CoordsPickerButton = L.Control.extend({
|
var CoordsPickerButton = L.Control.extend({
|
||||||
options: {
|
options: {
|
||||||
position: "bottomright"
|
position: 'bottomright'
|
||||||
},
|
},
|
||||||
|
|
||||||
active: false,
|
active: false,
|
||||||
button: undefined,
|
button: undefined,
|
||||||
|
|
||||||
initialize: function (f, options) {
|
initialize: function (f, o) {
|
||||||
L.Util.setOptions(this, options);
|
L.Util.setOptions(this, o);
|
||||||
this.f = f;
|
this.f = f;
|
||||||
},
|
},
|
||||||
|
|
||||||
onAdd: function () {
|
onAdd: function () {
|
||||||
var button = L.DomUtil.create("button", "ion-pin shadow");
|
var button = L.DomUtil.create('button', 'ion-pin shadow');
|
||||||
|
|
||||||
// Click propagation isn't disabled as this causes problems with the
|
// Click propagation isn't disabled as this causes problems with the
|
||||||
// location picking mode; instead propagation is stopped in onClick().
|
// location picking mode; instead propagation is stopped in onClick().
|
||||||
L.DomEvent.addListener(button, "click", this.onClick, this);
|
L.DomEvent.addListener(button, 'click', this.onClick, this);
|
||||||
|
|
||||||
this.button = button;
|
this.button = button;
|
||||||
|
|
||||||
@ -72,7 +70,7 @@ define(["map/clientlayer", "map/labelslayer",
|
|||||||
},
|
},
|
||||||
|
|
||||||
update: function () {
|
update: function () {
|
||||||
this.button.classList.toggle("active", this.active);
|
this.button.classList.toggle('active', this.active);
|
||||||
},
|
},
|
||||||
|
|
||||||
set: function (v) {
|
set: function (v) {
|
||||||
@ -91,11 +89,11 @@ define(["map/clientlayer", "map/labelslayer",
|
|||||||
return function (d) {
|
return function (d) {
|
||||||
var m = L.circleMarker([d.nodeinfo.location.latitude, d.nodeinfo.location.longitude], iconFunc(d));
|
var m = L.circleMarker([d.nodeinfo.location.latitude, d.nodeinfo.location.longitude], iconFunc(d));
|
||||||
|
|
||||||
m.resetStyle = function () {
|
m.resetStyle = function resetStyle() {
|
||||||
m.setStyle(iconFunc(d));
|
m.setStyle(iconFunc(d));
|
||||||
};
|
};
|
||||||
|
|
||||||
m.on("click", router.node(d));
|
m.on('click', router.node(d));
|
||||||
m.bindLabel(d.nodeinfo.hostname);
|
m.bindLabel(d.nodeinfo.hostname);
|
||||||
|
|
||||||
dict[d.nodeinfo.node_id] = m;
|
dict[d.nodeinfo.node_id] = m;
|
||||||
@ -106,25 +104,25 @@ define(["map/clientlayer", "map/labelslayer",
|
|||||||
|
|
||||||
function addLinksToMap(dict, linkScale, graph, router) {
|
function addLinksToMap(dict, linkScale, graph, router) {
|
||||||
graph = graph.filter(function (d) {
|
graph = graph.filter(function (d) {
|
||||||
return "distance" in d && d.type !== "VPN";
|
return 'distance' in d && d.type !== 'VPN';
|
||||||
});
|
});
|
||||||
|
|
||||||
return graph.map(function (d) {
|
return graph.map(function (d) {
|
||||||
var opts = {
|
var opts = {
|
||||||
color: d.type === "Kabel" ? "#50B0F0" : linkScale(d.tq).hex(),
|
color: d.type === 'Kabel' ? '#50B0F0' : linkScale(d.tq).hex(),
|
||||||
weight: 4,
|
weight: 4,
|
||||||
opacity: 0.5,
|
opacity: 0.5,
|
||||||
dashArray: "none"
|
dashArray: 'none'
|
||||||
};
|
};
|
||||||
|
|
||||||
var line = L.polyline(d.latlngs, opts);
|
var line = L.polyline(d.latlngs, opts);
|
||||||
|
|
||||||
line.resetStyle = function () {
|
line.resetStyle = function resetStyle() {
|
||||||
line.setStyle(opts);
|
line.setStyle(opts);
|
||||||
};
|
};
|
||||||
|
|
||||||
line.bindLabel(d.source.node.nodeinfo.hostname + " – " + d.target.node.nodeinfo.hostname + "<br><strong>" + helper.showDistance(d) + " / " + helper.showTq(d) + "</strong>");
|
line.bindLabel(d.source.node.nodeinfo.hostname + ' – ' + d.target.node.nodeinfo.hostname + '<br><strong>' + helper.showDistance(d) + ' / ' + helper.showTq(d) + '</strong>');
|
||||||
line.on("click", router.link(d));
|
line.on('click', router.link(d));
|
||||||
|
|
||||||
dict[d.id] = line;
|
dict[d.id] = line;
|
||||||
|
|
||||||
@ -133,50 +131,55 @@ define(["map/clientlayer", "map/labelslayer",
|
|||||||
}
|
}
|
||||||
|
|
||||||
var iconOnline = {
|
var iconOnline = {
|
||||||
color: "#1566A9",
|
color: '#1566A9',
|
||||||
fillColor: "#1566A9",
|
fillColor: '#1566A9',
|
||||||
radius: 6,
|
radius: 6,
|
||||||
fillOpacity: 0.5,
|
fillOpacity: 0.5,
|
||||||
opacity: 0.5,
|
opacity: 0.5,
|
||||||
weight: 2,
|
weight: 2,
|
||||||
className: "stroke-first"
|
className: 'stroke-first'
|
||||||
};
|
};
|
||||||
var iconOffline = {
|
var iconOffline = {
|
||||||
color: "#D43E2A",
|
color: '#D43E2A',
|
||||||
fillColor: "#D43E2A",
|
fillColor: '#D43E2A',
|
||||||
radius: 3,
|
radius: 3,
|
||||||
fillOpacity: 0.5,
|
fillOpacity: 0.5,
|
||||||
opacity: 0.5,
|
opacity: 0.5,
|
||||||
weight: 1,
|
weight: 1,
|
||||||
className: "stroke-first"
|
className: 'stroke-first'
|
||||||
};
|
};
|
||||||
var iconLost = {
|
var iconLost = {
|
||||||
color: "#D43E2A",
|
color: '#D43E2A',
|
||||||
fillColor: "#D43E2A",
|
fillColor: '#D43E2A',
|
||||||
radius: 4,
|
radius: 4,
|
||||||
fillOpacity: 0.8,
|
fillOpacity: 0.8,
|
||||||
opacity: 0.8,
|
opacity: 0.8,
|
||||||
weight: 1,
|
weight: 1,
|
||||||
className: "stroke-first"
|
className: 'stroke-first'
|
||||||
};
|
};
|
||||||
var iconAlert = {
|
var iconAlert = {
|
||||||
color: "#D43E2A",
|
color: '#D43E2A',
|
||||||
fillColor: "#D43E2A",
|
fillColor: '#D43E2A',
|
||||||
radius: 5,
|
radius: 5,
|
||||||
fillOpacity: 0.8,
|
fillOpacity: 0.8,
|
||||||
opacity: 0.8,
|
opacity: 0.8,
|
||||||
weight: 2,
|
weight: 2,
|
||||||
className: "stroke-first"
|
className: 'stroke-first'
|
||||||
};
|
};
|
||||||
var iconNew = {color: "#1566A9", fillColor: "#93E929", radius: 6, fillOpacity: 1.0, opacity: 0.5, weight: 2};
|
var iconNew = { color: '#1566A9', fillColor: '#93E929', radius: 6, fillOpacity: 1.0, opacity: 0.5, weight: 2 };
|
||||||
|
|
||||||
return function (config, linkScale, sidebar, router, buttons) {
|
return function (config, linkScale, sidebar, router, buttons) {
|
||||||
var self = this;
|
var self = this;
|
||||||
var barycenter;
|
var barycenter;
|
||||||
var groupOnline, groupOffline, groupNew, groupLost, groupLines;
|
var groupOnline;
|
||||||
|
var groupOffline;
|
||||||
|
var groupNew;
|
||||||
|
var groupLost;
|
||||||
|
var groupLines;
|
||||||
var savedView;
|
var savedView;
|
||||||
|
|
||||||
var map, userLocation;
|
var map;
|
||||||
|
var userLocation;
|
||||||
var layerControl;
|
var layerControl;
|
||||||
var baseLayers = {};
|
var baseLayers = {};
|
||||||
|
|
||||||
@ -233,14 +236,14 @@ define(["map/clientlayer", "map/labelslayer",
|
|||||||
}
|
}
|
||||||
|
|
||||||
function enableCoords() {
|
function enableCoords() {
|
||||||
map.getContainer().classList.add("pick-coordinates");
|
map.getContainer().classList.add('pick-coordinates');
|
||||||
map.on("click", showCoordinates);
|
map.on('click', showCoordinates);
|
||||||
showCoordsPickerButton.set(true);
|
showCoordsPickerButton.set(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
function disableCoords() {
|
function disableCoords() {
|
||||||
map.getContainer().classList.remove("pick-coordinates");
|
map.getContainer().classList.remove('pick-coordinates');
|
||||||
map.off("click", showCoordinates);
|
map.off('click', showCoordinates);
|
||||||
showCoordsPickerButton.set(false);
|
showCoordsPickerButton.set(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -266,11 +269,11 @@ define(["map/clientlayer", "map/labelslayer",
|
|||||||
}
|
}
|
||||||
|
|
||||||
function contextMenuOpenLayerMenu() {
|
function contextMenuOpenLayerMenu() {
|
||||||
document.querySelector(".leaflet-control-layers").classList.add("leaflet-control-layers-expanded");
|
document.querySelector('.leaflet-control-layers').classList.add('leaflet-control-layers-expanded');
|
||||||
}
|
}
|
||||||
|
|
||||||
var el = document.createElement("div");
|
var el = document.createElement('div');
|
||||||
el.classList.add("map");
|
el.classList.add('map');
|
||||||
|
|
||||||
map = L.map(el, options);
|
map = L.map(el, options);
|
||||||
var now = new Date();
|
var now = new Date();
|
||||||
@ -288,8 +291,8 @@ define(["map/clientlayer", "map/labelslayer",
|
|||||||
|
|
||||||
var layers = config.mapLayers.map(function (d) {
|
var layers = config.mapLayers.map(function (d) {
|
||||||
return {
|
return {
|
||||||
"name": d.name,
|
'name': d.name,
|
||||||
"layer": "url" in d ? L.tileLayer(d.url.replace("{retina}", L.Browser.retina ? '@2x' : ''), d.config) : console.warn("Missing map url")
|
'layer': 'url' in d ? L.tileLayer(d.url.replace('{retina}', L.Browser.retina ? '@2x' : ''), d.config) : console.warn('Missing map url')
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -299,18 +302,18 @@ define(["map/clientlayer", "map/labelslayer",
|
|||||||
baseLayers[d.name] = d.layer;
|
baseLayers[d.name] = d.layer;
|
||||||
});
|
});
|
||||||
|
|
||||||
map.on("locationfound", locationFound);
|
map.on('locationfound', locationFound);
|
||||||
map.on("locationerror", locationError);
|
map.on('locationerror', locationError);
|
||||||
map.on("dragend", saveView);
|
map.on('dragend', saveView);
|
||||||
map.on("contextmenu", contextMenuOpenLayerMenu);
|
map.on('contextmenu', contextMenuOpenLayerMenu);
|
||||||
|
|
||||||
addButton(locateUserButton);
|
addButton(locateUserButton);
|
||||||
addButton(showCoordsPickerButton);
|
addButton(showCoordsPickerButton);
|
||||||
|
|
||||||
layerControl = L.control.layers(baseLayers, [], {position: "bottomright"});
|
layerControl = L.control.layers(baseLayers, [], { position: 'bottomright' });
|
||||||
layerControl.addTo(map);
|
layerControl.addTo(map);
|
||||||
|
|
||||||
var clientLayer = new ClientLayer({minZoom: 15});
|
var clientLayer = new ClientLayer({ minZoom: 15 });
|
||||||
clientLayer.addTo(map);
|
clientLayer.addTo(map);
|
||||||
clientLayer.setZIndex(5);
|
clientLayer.setZIndex(5);
|
||||||
|
|
||||||
@ -318,7 +321,7 @@ define(["map/clientlayer", "map/labelslayer",
|
|||||||
labelsLayer.addTo(map);
|
labelsLayer.addTo(map);
|
||||||
labelsLayer.setZIndex(6);
|
labelsLayer.setZIndex(6);
|
||||||
|
|
||||||
map.on("baselayerchange", function (e) {
|
map.on('baselayerchange', function (e) {
|
||||||
map.options.maxZoom = e.layer.options.maxZoom;
|
map.options.maxZoom = e.layer.options.maxZoom;
|
||||||
clientLayer.options.maxZoom = map.options.maxZoom;
|
clientLayer.options.maxZoom = map.options.maxZoom;
|
||||||
labelsLayer.options.maxZoom = map.options.maxZoom;
|
labelsLayer.options.maxZoom = map.options.maxZoom;
|
||||||
@ -326,20 +329,20 @@ define(["map/clientlayer", "map/labelslayer",
|
|||||||
map.setZoom(map.options.maxZoom);
|
map.setZoom(map.options.maxZoom);
|
||||||
}
|
}
|
||||||
if (helper.localStorageTest()) {
|
if (helper.localStorageTest()) {
|
||||||
localStorage.setItem("map/selectedLayer", JSON.stringify({name: e.name}));
|
localStorage.setItem('map/selectedLayer', JSON.stringify({ name: e.name }));
|
||||||
}
|
}
|
||||||
|
|
||||||
var cssMode = document.querySelector(".css-mode");
|
var cssMode = document.querySelector('.css-mode');
|
||||||
if (cssMode) {
|
if (cssMode) {
|
||||||
cssMode.parentNode.removeChild(cssMode);
|
cssMode.parentNode.removeChild(cssMode);
|
||||||
document.querySelector("html").className = '';
|
document.querySelector('html').className = '';
|
||||||
labelsLayer.updateLayer();
|
labelsLayer.updateLayer();
|
||||||
}
|
}
|
||||||
if (e.layer.options.mode) {
|
if (e.layer.options.mode) {
|
||||||
document.querySelector("head").innerHTML += "<link rel='stylesheet' class='css-mode' href='" + e.layer.options.mode + ".css'>";
|
document.querySelector('head').innerHTML += "<link rel='stylesheet' class='css-mode' href='" + e.layer.options.mode + ".css'>";
|
||||||
document.querySelector("html").classList.add(e.layer.options.mode);
|
document.querySelector('html').classList.add(e.layer.options.mode);
|
||||||
var cssInterval = setInterval(function () {
|
var cssInterval = setInterval(function () {
|
||||||
if (typeof document.querySelector(".css-mode").sheet.cssRules != 'undefined') {
|
if (typeof document.querySelector('.css-mode').sheet.cssRules !== 'undefined') {
|
||||||
labelsLayer.updateLayer();
|
labelsLayer.updateLayer();
|
||||||
clearInterval(cssInterval);
|
clearInterval(cssInterval);
|
||||||
}
|
}
|
||||||
@ -362,7 +365,7 @@ define(["map/clientlayer", "map/labelslayer",
|
|||||||
}
|
}
|
||||||
|
|
||||||
function setView(bounds) {
|
function setView(bounds) {
|
||||||
map.fitBounds(bounds, {paddingTopLeft: [sidebar(), 0], maxZoom: config.nodeZoom});
|
map.fitBounds(bounds, { paddingTopLeft: [sidebar(), 0], maxZoom: config.nodeZoom });
|
||||||
}
|
}
|
||||||
|
|
||||||
function resetZoom() {
|
function resetZoom() {
|
||||||
@ -374,7 +377,7 @@ define(["map/clientlayer", "map/labelslayer",
|
|||||||
function goto(m) {
|
function goto(m) {
|
||||||
var bounds;
|
var bounds;
|
||||||
|
|
||||||
if ("getBounds" in m) {
|
if ('getBounds' in m) {
|
||||||
bounds = m.getBounds();
|
bounds = m.getBounds();
|
||||||
} else {
|
} else {
|
||||||
bounds = L.latLngBounds([m.getLatLng()]);
|
bounds = L.latLngBounds([m.getLatLng()]);
|
||||||
@ -390,17 +393,17 @@ define(["map/clientlayer", "map/labelslayer",
|
|||||||
var m;
|
var m;
|
||||||
|
|
||||||
if (highlight !== undefined) {
|
if (highlight !== undefined) {
|
||||||
if (highlight.type === "node") {
|
if (highlight.type === 'node') {
|
||||||
m = nodeDict[highlight.o.nodeinfo.node_id];
|
m = nodeDict[highlight.o.nodeinfo.node_id];
|
||||||
|
|
||||||
if (m) {
|
if (m) {
|
||||||
m.setStyle({color: "orange", weight: 20, fillOpacity: 1, opacity: 0.7, className: "stroke-first"});
|
m.setStyle({ color: 'orange', weight: 20, fillOpacity: 1, opacity: 0.7, className: 'stroke-first' });
|
||||||
}
|
}
|
||||||
} else if (highlight.type === "link") {
|
} else if (highlight.type === 'link') {
|
||||||
m = linkDict[highlight.o.id];
|
m = linkDict[highlight.o.id];
|
||||||
|
|
||||||
if (m) {
|
if (m) {
|
||||||
m.setStyle({weight: 4, opacity: 1, dashArray: "5, 10"});
|
m.setStyle({ weight: 4, opacity: 1, dashArray: '5, 10' });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -425,7 +428,7 @@ define(["map/clientlayer", "map/labelslayer",
|
|||||||
return o;
|
return o;
|
||||||
}
|
}
|
||||||
|
|
||||||
self.setData = function (data) {
|
self.setData = function setData(data) {
|
||||||
nodeDict = {};
|
nodeDict = {};
|
||||||
linkDict = {};
|
linkDict = {};
|
||||||
|
|
||||||
@ -452,7 +455,7 @@ define(["map/clientlayer", "map/labelslayer",
|
|||||||
var lines = addLinksToMap(linkDict, linkScale, data.graph.links, router);
|
var lines = addLinksToMap(linkDict, linkScale, data.graph.links, router);
|
||||||
groupLines = L.featureGroup(lines).addTo(map);
|
groupLines = L.featureGroup(lines).addTo(map);
|
||||||
|
|
||||||
if (typeof config.fixedCenter === "undefined") {
|
if (typeof config.fixedCenter === 'undefined') {
|
||||||
console.error('FixedCenter is required');
|
console.error('FixedCenter is required');
|
||||||
} else {
|
} else {
|
||||||
barycenter = L.circle(L.latLng(new L.LatLng(config.fixedCenter.lat, config.fixedCenter.lng)), config.fixedCenter.radius * 1000);
|
barycenter = L.circle(L.latLng(new L.LatLng(config.fixedCenter.lat, config.fixedCenter.lng)), config.fixedCenter.radius * 1000);
|
||||||
@ -478,13 +481,14 @@ define(["map/clientlayer", "map/labelslayer",
|
|||||||
|
|
||||||
var markersLost = data.nodes.lost.filter(helper.hasLocation)
|
var markersLost = data.nodes.lost.filter(helper.hasLocation)
|
||||||
.map(mkMarker(nodeDict, function (d) {
|
.map(mkMarker(nodeDict, function (d) {
|
||||||
if (d.lastseen.isAfter(moment(data.now).subtract(3, "days"))) {
|
if (d.lastseen.isAfter(moment(data.now).subtract(3, 'days'))) {
|
||||||
return iconAlert;
|
return iconAlert;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (d.lastseen.isAfter(moment(data.now).subtract(14, "days"))) {
|
if (d.lastseen.isAfter(moment(data.now).subtract(14, 'days'))) {
|
||||||
return iconLost;
|
return iconLost;
|
||||||
}
|
}
|
||||||
|
return null;
|
||||||
}, router));
|
}, router));
|
||||||
|
|
||||||
groupOffline = L.featureGroup(markersOffline).addTo(map);
|
groupOffline = L.featureGroup(markersOffline).addTo(map);
|
||||||
@ -507,29 +511,29 @@ define(["map/clientlayer", "map/labelslayer",
|
|||||||
updateView(true);
|
updateView(true);
|
||||||
};
|
};
|
||||||
|
|
||||||
self.resetView = function () {
|
self.resetView = function resetView() {
|
||||||
disableTracking();
|
disableTracking();
|
||||||
highlight = undefined;
|
highlight = undefined;
|
||||||
updateView();
|
updateView();
|
||||||
};
|
};
|
||||||
|
|
||||||
self.gotoNode = function (d, update) {
|
self.gotoNode = function gotoNode(d, update) {
|
||||||
disableTracking();
|
disableTracking();
|
||||||
highlight = {type: "node", o: d};
|
highlight = { type: 'node', o: d };
|
||||||
updateView(update);
|
updateView(update);
|
||||||
};
|
};
|
||||||
|
|
||||||
self.gotoLink = function (d, update) {
|
self.gotoLink = function gotoLink(d, update) {
|
||||||
disableTracking();
|
disableTracking();
|
||||||
highlight = {type: "link", o: d};
|
highlight = { type: 'link', o: d };
|
||||||
updateView(update);
|
updateView(update);
|
||||||
};
|
};
|
||||||
|
|
||||||
self.gotoLocation = function () {
|
self.gotoLocation = function gotoLocation() {
|
||||||
//ignore
|
// ignore
|
||||||
};
|
};
|
||||||
|
|
||||||
self.destroy = function () {
|
self.destroy = function destroy() {
|
||||||
clearButtons();
|
clearButtons();
|
||||||
map.remove();
|
map.remove();
|
||||||
|
|
||||||
@ -538,7 +542,7 @@ define(["map/clientlayer", "map/labelslayer",
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
self.render = function (d) {
|
self.render = function render(d) {
|
||||||
d.appendChild(el);
|
d.appendChild(el);
|
||||||
map.invalidateSize();
|
map.invalidateSize();
|
||||||
};
|
};
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
define(["leaflet"],
|
define(['leaflet'],
|
||||||
function (L) {
|
function (L) {
|
||||||
"use strict";
|
'use strict';
|
||||||
|
|
||||||
return L.TileLayer.Canvas.extend({
|
return L.TileLayer.Canvas.extend({
|
||||||
setData: function (d) {
|
setData: function (d) {
|
||||||
this.data = d;
|
this.data = d;
|
||||||
|
|
||||||
//pre-calculate start angles
|
// pre-calculate start angles
|
||||||
this.data.all().forEach(function (d) {
|
this.data.all().forEach(function (n) {
|
||||||
d.startAngle = (parseInt(d.node.nodeinfo.node_id.substr(10, 2), 16) / 255) * 2 * Math.PI;
|
n.startAngle = (parseInt(n.node.nodeinfo.node_id.substr(10, 2), 16) / 255) * 2 * Math.PI;
|
||||||
});
|
});
|
||||||
this.redraw();
|
this.redraw();
|
||||||
},
|
},
|
||||||
@ -37,7 +37,7 @@ define(["leaflet"],
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var ctx = canvas.getContext("2d");
|
var ctx = canvas.getContext('2d');
|
||||||
|
|
||||||
var radius = 3;
|
var radius = 3;
|
||||||
var a = 1.2;
|
var a = 1.2;
|
||||||
@ -71,7 +71,7 @@ define(["leaflet"],
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
ctx.fillStyle = "rgba(220, 0, 103, 0.7)";
|
ctx.fillStyle = 'rgba(220, 0, 103, 0.7)';
|
||||||
ctx.fill();
|
ctx.fill();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -1,24 +1,24 @@
|
|||||||
define(["leaflet", "rbush"],
|
define(['leaflet', 'rbush'],
|
||||||
function (L, rbush) {
|
function (L, rbush) {
|
||||||
"use strict";
|
'use strict';
|
||||||
|
|
||||||
var labelLocations = [["left", "middle", 0 / 8],
|
var labelLocations = [['left', 'middle', 0 / 8],
|
||||||
["center", "top", 6 / 8],
|
['center', 'top', 6 / 8],
|
||||||
["right", "middle", 4 / 8],
|
['right', 'middle', 4 / 8],
|
||||||
["left", "top", 7 / 8],
|
['left', 'top', 7 / 8],
|
||||||
["left", "ideographic", 1 / 8],
|
['left', 'ideographic', 1 / 8],
|
||||||
["right", "top", 5 / 8],
|
['right', 'top', 5 / 8],
|
||||||
["center", "ideographic", 2 / 8],
|
['center', 'ideographic', 2 / 8],
|
||||||
["right", "ideographic", 3 / 8]];
|
['right', 'ideographic', 3 / 8]];
|
||||||
var bodyStyle = window.getComputedStyle(document.querySelector('body'));
|
var bodyStyle = window.getComputedStyle(document.querySelector('body'));
|
||||||
var labelShadow;
|
var labelShadow;
|
||||||
var nodeRadius = 4;
|
var nodeRadius = 4;
|
||||||
|
|
||||||
var ctx = document.createElement("canvas").getContext("2d");
|
var cFont = document.createElement('canvas').getContext('2d');
|
||||||
|
|
||||||
function measureText(font, text) {
|
function measureText(font, text) {
|
||||||
ctx.font = font;
|
cFont.font = font;
|
||||||
return ctx.measureText(text);
|
return cFont.measureText(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
function mapRTree(d) {
|
function mapRTree(d) {
|
||||||
@ -31,7 +31,7 @@ define(["leaflet", "rbush"],
|
|||||||
|
|
||||||
function prepareLabel(fillStyle, fontSize, offset, stroke, minZoom) {
|
function prepareLabel(fillStyle, fontSize, offset, stroke, minZoom) {
|
||||||
return function (d) {
|
return function (d) {
|
||||||
var font = fontSize + "px " + bodyStyle.fontFamily;
|
var font = fontSize + 'px ' + bodyStyle.fontFamily;
|
||||||
return {
|
return {
|
||||||
position: L.latLng(d.nodeinfo.location.latitude, d.nodeinfo.location.longitude),
|
position: L.latLng(d.nodeinfo.location.latitude, d.nodeinfo.location.longitude),
|
||||||
label: d.nodeinfo.hostname,
|
label: d.nodeinfo.hostname,
|
||||||
@ -103,10 +103,10 @@ define(["leaflet", "rbush"],
|
|||||||
// - color (string)
|
// - color (string)
|
||||||
|
|
||||||
var labelsOnline = d.online.map(prepareLabel(bodyStyle.color, 11, 8, true, 13));
|
var labelsOnline = d.online.map(prepareLabel(bodyStyle.color, 11, 8, true, 13));
|
||||||
var labelsOffline = d.offline.map(prepareLabel("rgba(212, 62, 42, 0.9)", 9, 5, false, 16));
|
var labelsOffline = d.offline.map(prepareLabel('rgba(212, 62, 42, 0.9)', 9, 5, false, 16));
|
||||||
var labelsNew = d.new.map(prepareLabel("rgba(48, 99, 20, 0.9)", 11, 8, true, 0));
|
var labelsNew = d.new.map(prepareLabel('rgba(48, 99, 20, 0.9)', 11, 8, true, 0));
|
||||||
var labelsLost = d.lost.map(prepareLabel("rgba(212, 62, 42, 0.9)", 11, 8, true, 0));
|
var labelsLost = d.lost.map(prepareLabel('rgba(212, 62, 42, 0.9)', 11, 8, true, 0));
|
||||||
labelShadow = bodyStyle.backgroundColor.replace(/rgb/i, "rgba").replace(/\)/i, ',0.7)');
|
labelShadow = bodyStyle.backgroundColor.replace(/rgb/i, 'rgba').replace(/\)/i, ',0.7)');
|
||||||
|
|
||||||
var labels = []
|
var labels = []
|
||||||
.concat(labelsNew)
|
.concat(labelsNew)
|
||||||
@ -122,8 +122,8 @@ define(["leaflet", "rbush"],
|
|||||||
var map = this._map;
|
var map = this._map;
|
||||||
|
|
||||||
function nodeToRect(z) {
|
function nodeToRect(z) {
|
||||||
return function (d) {
|
return function (n) {
|
||||||
var p = map.project(d.position, z);
|
var p = map.project(n.position, z);
|
||||||
return [p.x - nodeRadius, p.y - nodeRadius,
|
return [p.x - nodeRadius, p.y - nodeRadius,
|
||||||
p.x + nodeRadius, p.y + nodeRadius];
|
p.x + nodeRadius, p.y + nodeRadius];
|
||||||
};
|
};
|
||||||
@ -134,52 +134,51 @@ define(["leaflet", "rbush"],
|
|||||||
trees[z].load(labels.map(nodeToRect(z)));
|
trees[z].load(labels.map(nodeToRect(z)));
|
||||||
}
|
}
|
||||||
|
|
||||||
labels = labels.map(function (d) {
|
labels = labels.map(function (n) {
|
||||||
var best = labelLocations.map(function (loc) {
|
var best = labelLocations.map(function (loc) {
|
||||||
var offset = calcOffset(d.offset, loc);
|
var offset = calcOffset(n.offset, loc);
|
||||||
var z;
|
var i;
|
||||||
|
|
||||||
for (z = maxZoom; z >= d.minZoom; z--) {
|
for (i = maxZoom; i >= n.minZoom; i--) {
|
||||||
var p = map.project(d.position, z);
|
var p = map.project(n.position, i);
|
||||||
var rect = labelRect(p, offset, loc, d, minZoom, maxZoom, z);
|
var rect = labelRect(p, offset, loc, n, minZoom, maxZoom, i);
|
||||||
var candidates = trees[z].search(rect);
|
var candidates = trees[i].search(rect);
|
||||||
|
|
||||||
if (candidates.length > 0) {
|
if (candidates.length > 0) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return {loc: loc, z: z + 1};
|
return { loc: loc, z: i + 1 };
|
||||||
}).filter(function (d) {
|
}).filter(function (k) {
|
||||||
return d.z <= maxZoom;
|
return k.z <= maxZoom;
|
||||||
}).sort(function (a, b) {
|
}).sort(function (a, b) {
|
||||||
return a.z - b.z;
|
return a.z - b.z;
|
||||||
})[0];
|
})[0];
|
||||||
|
|
||||||
if (best !== undefined) {
|
if (best !== undefined) {
|
||||||
d.offset = calcOffset(d.offset, best.loc);
|
n.offset = calcOffset(n.offset, best.loc);
|
||||||
d.minZoom = best.z;
|
n.minZoom = best.z;
|
||||||
d.anchor = best.loc;
|
n.anchor = best.loc;
|
||||||
|
|
||||||
for (var z = maxZoom; z >= best.z; z--) {
|
for (var i = maxZoom; i >= best.z; i--) {
|
||||||
var p = map.project(d.position, z);
|
var p = map.project(n.position, i);
|
||||||
var rect = labelRect(p, d.offset, best.loc, d, minZoom, maxZoom, z);
|
var rect = labelRect(p, n.offset, best.loc, n, minZoom, maxZoom, i);
|
||||||
trees[z].insert(rect);
|
trees[i].insert(rect);
|
||||||
}
|
}
|
||||||
|
|
||||||
return d;
|
return n;
|
||||||
} else {
|
}
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}).filter(function (n) {
|
||||||
}).filter(function (d) {
|
return n !== undefined;
|
||||||
return d !== undefined;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
this.margin = 16;
|
this.margin = 16;
|
||||||
|
|
||||||
if (labels.length > 0) {
|
if (labels.length > 0) {
|
||||||
this.margin += labels.map(function (d) {
|
this.margin += labels.map(function (n) {
|
||||||
return d.width;
|
return n.width;
|
||||||
}).sort().reverse()[0];
|
}).sort().reverse()[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -210,14 +209,14 @@ define(["leaflet", "rbush"],
|
|||||||
p.x -= s.x;
|
p.x -= s.x;
|
||||||
p.y -= s.y;
|
p.y -= s.y;
|
||||||
|
|
||||||
return {p: p, label: d.label};
|
return { p: p, label: d.label };
|
||||||
}
|
}
|
||||||
|
|
||||||
var bbox = getTileBBox(s, map, tileSize, this.margin);
|
var bbox = getTileBBox(s, map, tileSize, this.margin);
|
||||||
|
|
||||||
var labels = this.labels.search(bbox).map(projectNodes);
|
var labels = this.labels.search(bbox).map(projectNodes);
|
||||||
|
|
||||||
var ctx = canvas.getContext("2d");
|
var ctx = canvas.getContext('2d');
|
||||||
|
|
||||||
ctx.lineWidth = 5;
|
ctx.lineWidth = 5;
|
||||||
ctx.strokeStyle = labelShadow;
|
ctx.strokeStyle = labelShadow;
|
||||||
|
@ -1,23 +1,24 @@
|
|||||||
define(["sorttable", "virtual-dom", "helper"], function (SortTable, V, helper) {
|
define(['sorttable', 'virtual-dom', 'helper'], function (SortTable, V, helper) {
|
||||||
"use strict";
|
'use strict';
|
||||||
|
|
||||||
function getUptime(now, d) {
|
function getUptime(now, d) {
|
||||||
if (d.flags.online && "uptime" in d.statistics) {
|
if (d.flags.online && 'uptime' in d.statistics) {
|
||||||
return Math.round(d.statistics.uptime);
|
return Math.round(d.statistics.uptime);
|
||||||
} else if (!d.flags.online && "lastseen" in d) {
|
} else if (!d.flags.online && 'lastseen' in d) {
|
||||||
return Math.round(-(now.unix() - d.lastseen.unix()));
|
return Math.round(-(now.unix() - d.lastseen.unix()));
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
function showUptime(uptime) {
|
function showUptime(uptime) {
|
||||||
var s = "";
|
var s = '';
|
||||||
uptime /= 3600;
|
uptime /= 3600;
|
||||||
|
|
||||||
if (uptime !== undefined) {
|
if (uptime !== undefined) {
|
||||||
if (Math.abs(uptime) >= 24) {
|
if (Math.abs(uptime) >= 24) {
|
||||||
s = Math.round(uptime / 24) + "d";
|
s = Math.round(uptime / 24) + 'd';
|
||||||
} else {
|
} else {
|
||||||
s = Math.round(uptime) + "h";
|
s = Math.round(uptime) + 'h';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -27,31 +28,28 @@ define(["sorttable", "virtual-dom", "helper"], function (SortTable, V, helper) {
|
|||||||
var headings = [{
|
var headings = [{
|
||||||
name: ''
|
name: ''
|
||||||
}, {
|
}, {
|
||||||
name: "Knoten",
|
name: 'Knoten',
|
||||||
sort: function (a, b) {
|
sort: function (a, b) {
|
||||||
return a.nodeinfo.hostname.localeCompare(b.nodeinfo.hostname);
|
return a.nodeinfo.hostname.localeCompare(b.nodeinfo.hostname);
|
||||||
},
|
},
|
||||||
reverse: false
|
reverse: false
|
||||||
},
|
}, {
|
||||||
{
|
name: 'Uptime',
|
||||||
name: "Uptime",
|
|
||||||
sort: function (a, b) {
|
sort: function (a, b) {
|
||||||
return a.uptime - b.uptime;
|
return a.uptime - b.uptime;
|
||||||
},
|
},
|
||||||
reverse: true
|
reverse: true
|
||||||
},
|
}, {
|
||||||
{
|
name: '#Links',
|
||||||
name: "#Links",
|
|
||||||
sort: function (a, b) {
|
sort: function (a, b) {
|
||||||
return a.meshlinks - b.meshlinks;
|
return a.meshlinks - b.meshlinks;
|
||||||
},
|
},
|
||||||
reverse: true
|
reverse: true
|
||||||
},
|
}, {
|
||||||
{
|
name: 'Clients',
|
||||||
name: "Clients",
|
|
||||||
sort: function (a, b) {
|
sort: function (a, b) {
|
||||||
return ("clients" in a.statistics ? a.statistics.clients : -1) -
|
return ('clients' in a.statistics ? a.statistics.clients : -1) -
|
||||||
("clients" in b.statistics ? b.statistics.clients : -1);
|
('clients' in b.statistics ? b.statistics.clients : -1);
|
||||||
},
|
},
|
||||||
reverse: true
|
reverse: true
|
||||||
}];
|
}];
|
||||||
@ -60,42 +58,42 @@ define(["sorttable", "virtual-dom", "helper"], function (SortTable, V, helper) {
|
|||||||
function renderRow(d) {
|
function renderRow(d) {
|
||||||
var td0Content = [];
|
var td0Content = [];
|
||||||
var td1Content = [];
|
var td1Content = [];
|
||||||
var aClass = ["hostname", d.flags.online ? "online" : "offline"];
|
var aClass = ['hostname', d.flags.online ? 'online' : 'offline'];
|
||||||
|
|
||||||
td1Content.push(V.h("a", {
|
td1Content.push(V.h('a', {
|
||||||
className: aClass.join(" "),
|
className: aClass.join(' '),
|
||||||
onclick: router.node(d),
|
onclick: router.node(d),
|
||||||
href: "#"
|
href: '#'
|
||||||
}, d.nodeinfo.hostname));
|
}, d.nodeinfo.hostname));
|
||||||
|
|
||||||
if (helper.hasLocation(d)) {
|
if (helper.hasLocation(d)) {
|
||||||
td0Content.push(V.h("span", {className: "icon ion-location"}));
|
td0Content.push(V.h('span', { className: 'icon ion-location' }));
|
||||||
}
|
}
|
||||||
|
|
||||||
var td0 = V.h("td", td0Content);
|
var td0 = V.h('td', td0Content);
|
||||||
var td1 = V.h("td", td1Content);
|
var td1 = V.h('td', td1Content);
|
||||||
var td2 = V.h("td", showUptime(d.uptime));
|
var td2 = V.h('td', showUptime(d.uptime));
|
||||||
var td3 = V.h("td", d.meshlinks.toString());
|
var td3 = V.h('td', d.meshlinks.toString());
|
||||||
var td4 = V.h("td", Number("clients" in d.statistics ? d.statistics.clients : 0).toFixed(0));
|
var td4 = V.h('td', Number('clients' in d.statistics ? d.statistics.clients : 0).toFixed(0));
|
||||||
|
|
||||||
return V.h("tr", [td0, td1, td2, td3, td4]);
|
return V.h('tr', [td0, td1, td2, td3, td4]);
|
||||||
}
|
}
|
||||||
|
|
||||||
var table = new SortTable(headings, 1, renderRow);
|
var table = new SortTable(headings, 1, renderRow);
|
||||||
table.el.classList.add('node-list');
|
table.el.classList.add('node-list');
|
||||||
|
|
||||||
this.render = function (d) {
|
this.render = function render(d) {
|
||||||
var h2 = document.createElement("h2");
|
var h2 = document.createElement('h2');
|
||||||
h2.textContent = "Alle Knoten";
|
h2.textContent = 'Alle Knoten';
|
||||||
d.appendChild(h2);
|
d.appendChild(h2);
|
||||||
|
|
||||||
d.appendChild(table.el);
|
d.appendChild(table.el);
|
||||||
};
|
};
|
||||||
|
|
||||||
this.setData = function (d) {
|
this.setData = function setData(d) {
|
||||||
var data = d.nodes.all.map(function (e) {
|
var data = d.nodes.all.map(function (e) {
|
||||||
var n = Object.create(e);
|
var n = Object.create(e);
|
||||||
n.uptime = getUptime(d.now, e) || 0;
|
n.uptime = getUptime(d.now, e);
|
||||||
n.meshlinks = e.meshlinks || 0;
|
n.meshlinks = e.meshlinks || 0;
|
||||||
return n;
|
return n;
|
||||||
});
|
});
|
||||||
|
@ -1,28 +1,28 @@
|
|||||||
define(["chroma-js", "virtual-dom", "filters/genericnode", "helper"],
|
define(['chroma-js', 'virtual-dom', 'filters/genericnode', 'helper'],
|
||||||
function (Chroma, V, Filter, helper) {
|
function (Chroma, V, Filter, helper) {
|
||||||
"use strict";
|
'use strict';
|
||||||
|
|
||||||
return function (config, filterManager) {
|
return function (config, filterManager) {
|
||||||
var self = this;
|
var self = this;
|
||||||
var scale = Chroma.scale("YlGnBu").mode("lab");
|
var scale = Chroma.scale('YlGnBu').mode('lab');
|
||||||
|
|
||||||
var statusTable = document.createElement("table");
|
var statusTable = document.createElement('table');
|
||||||
statusTable.classList.add("proportion");
|
statusTable.classList.add('proportion');
|
||||||
|
|
||||||
var fwTable = document.createElement("table");
|
var fwTable = document.createElement('table');
|
||||||
fwTable.classList.add("proportion");
|
fwTable.classList.add('proportion');
|
||||||
|
|
||||||
var hwTable = document.createElement("table");
|
var hwTable = document.createElement('table');
|
||||||
hwTable.classList.add("proportion");
|
hwTable.classList.add('proportion');
|
||||||
|
|
||||||
var geoTable = document.createElement("table");
|
var geoTable = document.createElement('table');
|
||||||
geoTable.classList.add("proportion");
|
geoTable.classList.add('proportion');
|
||||||
|
|
||||||
var autoTable = document.createElement("table");
|
var autoTable = document.createElement('table');
|
||||||
autoTable.classList.add("proportion");
|
autoTable.classList.add('proportion');
|
||||||
|
|
||||||
var siteTable = document.createElement("table");
|
var siteTable = document.createElement('table');
|
||||||
siteTable.classList.add("proportion");
|
siteTable.classList.add('proportion');
|
||||||
|
|
||||||
function showStatGlobal(o) {
|
function showStatGlobal(o) {
|
||||||
return helper.showStat(o);
|
return helper.showStat(o);
|
||||||
@ -60,7 +60,7 @@ define(["chroma-js", "virtual-dom", "filters/genericnode", "helper"],
|
|||||||
|
|
||||||
function fillTable(name, table, data) {
|
function fillTable(name, table, data) {
|
||||||
if (!table.last) {
|
if (!table.last) {
|
||||||
table.last = V.h("table");
|
table.last = V.h('table');
|
||||||
}
|
}
|
||||||
|
|
||||||
var max = 0;
|
var max = 0;
|
||||||
@ -72,31 +72,31 @@ define(["chroma-js", "virtual-dom", "filters/genericnode", "helper"],
|
|||||||
|
|
||||||
var items = data.map(function (d) {
|
var items = data.map(function (d) {
|
||||||
var v = d[1] / max;
|
var v = d[1] / max;
|
||||||
var c1 = Chroma.contrast(scale(v), "white");
|
var c1 = Chroma.contrast(scale(v), 'white');
|
||||||
var c2 = Chroma.contrast(scale(v), "black");
|
var c2 = Chroma.contrast(scale(v), 'black');
|
||||||
|
|
||||||
var filter = new Filter(name, d[2], d[0], d[3]);
|
var filter = new Filter(name, d[2], d[0], d[3]);
|
||||||
|
|
||||||
var a = V.h("a", {href: "#", onclick: addFilter(filter)}, d[0]);
|
var a = V.h('a', { href: '#', onclick: addFilter(filter) }, d[0]);
|
||||||
|
|
||||||
var th = V.h("th", a);
|
var th = V.h('th', a);
|
||||||
var td = V.h("td", V.h("span", {
|
var td = V.h('td', V.h('span', {
|
||||||
style: {
|
style: {
|
||||||
width: Math.round(v * 100) + "%",
|
width: Math.round(v * 100) + '%',
|
||||||
backgroundColor: scale(v).hex(),
|
backgroundColor: scale(v).hex(),
|
||||||
color: c1 > c2 ? "white" : "black"
|
color: c1 > c2 ? 'white' : 'black'
|
||||||
}
|
}
|
||||||
}, d[1].toFixed(0)));
|
}, d[1].toFixed(0)));
|
||||||
|
|
||||||
return V.h("tr", [th, td]);
|
return V.h('tr', [th, td]);
|
||||||
});
|
});
|
||||||
|
|
||||||
var tableNew = V.h("table", items);
|
var tableNew = V.h('table', items);
|
||||||
table = V.patch(table, V.diff(table.last, tableNew));
|
table = V.patch(table, V.diff(table.last, tableNew));
|
||||||
table.last = tableNew;
|
table.last = tableNew;
|
||||||
}
|
}
|
||||||
|
|
||||||
self.setData = function (data) {
|
self.setData = function setData(data) {
|
||||||
var onlineNodes = data.nodes.all.filter(helper.online);
|
var onlineNodes = data.nodes.all.filter(helper.online);
|
||||||
var nodes = onlineNodes.concat(data.nodes.lost);
|
var nodes = onlineNodes.concat(data.nodes.lost);
|
||||||
var nodeDict = {};
|
var nodeDict = {};
|
||||||
@ -105,26 +105,25 @@ define(["chroma-js", "virtual-dom", "filters/genericnode", "helper"],
|
|||||||
nodeDict[d.nodeinfo.node_id] = d;
|
nodeDict[d.nodeinfo.node_id] = d;
|
||||||
});
|
});
|
||||||
|
|
||||||
var statusDict = count(nodes, ["flags", "online"], function (d) {
|
var statusDict = count(nodes, ['flags', 'online'], function (d) {
|
||||||
return d ? "online" : "offline";
|
return d ? 'online' : 'offline';
|
||||||
});
|
});
|
||||||
var fwDict = count(nodes, ["nodeinfo", "software", "firmware", "release"]);
|
var fwDict = count(nodes, ['nodeinfo', 'software', 'firmware', 'release']);
|
||||||
var hwDict = count(nodes, ["nodeinfo", "hardware", "model"]);
|
var hwDict = count(nodes, ['nodeinfo', 'hardware', 'model']);
|
||||||
var geoDict = count(nodes, ["nodeinfo", "location"], function (d) {
|
var geoDict = count(nodes, ['nodeinfo', 'location'], function (d) {
|
||||||
return d && d.longitude && d.latitude ? "ja" : "nein";
|
return d && d.longitude && d.latitude ? 'ja' : 'nein';
|
||||||
});
|
});
|
||||||
|
|
||||||
var autoDict = count(nodes, ["nodeinfo", "software", "autoupdater"], function (d) {
|
var autoDict = count(nodes, ['nodeinfo', 'software', 'autoupdater'], function (d) {
|
||||||
if (d === null) {
|
if (d === null) {
|
||||||
return null;
|
return null;
|
||||||
} else if (d.enabled) {
|
} else if (d.enabled) {
|
||||||
return d.branch;
|
return d.branch;
|
||||||
} else {
|
|
||||||
return "(deaktiviert)";
|
|
||||||
}
|
}
|
||||||
|
return '(deaktiviert)';
|
||||||
});
|
});
|
||||||
|
|
||||||
var siteDict = count(nodes, ["nodeinfo", "system", "site_code"], function (d) {
|
var siteDict = count(nodes, ['nodeinfo', 'system', 'site_code'], function (d) {
|
||||||
var rt = d;
|
var rt = d;
|
||||||
if (config.siteNames) {
|
if (config.siteNames) {
|
||||||
config.siteNames.forEach(function (t) {
|
config.siteNames.forEach(function (t) {
|
||||||
@ -136,10 +135,10 @@ define(["chroma-js", "virtual-dom", "filters/genericnode", "helper"],
|
|||||||
return rt;
|
return rt;
|
||||||
});
|
});
|
||||||
|
|
||||||
fillTable("Status", statusTable, statusDict.sort(function (a, b) {
|
fillTable('Status', statusTable, statusDict.sort(function (a, b) {
|
||||||
return b[1] - a[1];
|
return b[1] - a[1];
|
||||||
}));
|
}));
|
||||||
fillTable("Firmware", fwTable, fwDict.sort(function (a, b) {
|
fillTable('Firmware', fwTable, fwDict.sort(function (a, b) {
|
||||||
if (b[0] < a[0]) {
|
if (b[0] < a[0]) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -148,32 +147,32 @@ define(["chroma-js", "virtual-dom", "filters/genericnode", "helper"],
|
|||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}));
|
}));
|
||||||
fillTable("Hardware", hwTable, hwDict.sort(function (a, b) {
|
fillTable('Hardware', hwTable, hwDict.sort(function (a, b) {
|
||||||
return b[1] - a[1];
|
return b[1] - a[1];
|
||||||
}));
|
}));
|
||||||
fillTable("Koordinaten", geoTable, geoDict.sort(function (a, b) {
|
fillTable('Koordinaten', geoTable, geoDict.sort(function (a, b) {
|
||||||
return b[1] - a[1];
|
return b[1] - a[1];
|
||||||
}));
|
}));
|
||||||
fillTable("Autom. Updates", autoTable, autoDict.sort(function (a, b) {
|
fillTable('Autom. Updates', autoTable, autoDict.sort(function (a, b) {
|
||||||
return b[1] - a[1];
|
return b[1] - a[1];
|
||||||
}));
|
}));
|
||||||
fillTable("Site", siteTable, siteDict.sort(function (a, b) {
|
fillTable('Site', siteTable, siteDict.sort(function (a, b) {
|
||||||
return b[1] - a[1];
|
return b[1] - a[1];
|
||||||
}));
|
}));
|
||||||
};
|
};
|
||||||
|
|
||||||
self.render = function (el) {
|
self.render = function render(el) {
|
||||||
var h2;
|
var h2;
|
||||||
self.renderSingle(el, "Status", statusTable);
|
self.renderSingle(el, 'Status', statusTable);
|
||||||
self.renderSingle(el, "Firmwareversionen", fwTable);
|
self.renderSingle(el, 'Firmwareversionen', fwTable);
|
||||||
self.renderSingle(el, "Hardwaremodelle", hwTable);
|
self.renderSingle(el, 'Hardwaremodelle', hwTable);
|
||||||
self.renderSingle(el, "Auf der Karte sichtbar", geoTable);
|
self.renderSingle(el, 'Auf der Karte sichtbar', geoTable);
|
||||||
self.renderSingle(el, "Autoupdater", autoTable);
|
self.renderSingle(el, 'Autoupdater', autoTable);
|
||||||
self.renderSingle(el, "Site", siteTable);
|
self.renderSingle(el, 'Site', siteTable);
|
||||||
|
|
||||||
if (config.globalInfos) {
|
if (config.globalInfos) {
|
||||||
config.globalInfos.forEach(function (globalInfo) {
|
config.globalInfos.forEach(function (globalInfo) {
|
||||||
h2 = document.createElement("h2");
|
h2 = document.createElement('h2');
|
||||||
h2.textContent = globalInfo.name;
|
h2.textContent = globalInfo.name;
|
||||||
el.appendChild(h2);
|
el.appendChild(h2);
|
||||||
el.appendChild(showStatGlobal(globalInfo));
|
el.appendChild(showStatGlobal(globalInfo));
|
||||||
@ -181,12 +180,12 @@ define(["chroma-js", "virtual-dom", "filters/genericnode", "helper"],
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
self.renderSingle = function (el, heading, table) {
|
self.renderSingle = function renderSingle(el, heading, table) {
|
||||||
var h2;
|
var h2;
|
||||||
h2 = document.createElement("h2");
|
h2 = document.createElement('h2');
|
||||||
h2.textContent = heading;
|
h2.textContent = heading;
|
||||||
h2.onclick = function () {
|
h2.onclick = function onclick() {
|
||||||
table.classList.toggle("hidden");
|
table.classList.toggle('hidden');
|
||||||
};
|
};
|
||||||
el.appendChild(h2);
|
el.appendChild(h2);
|
||||||
el.appendChild(table);
|
el.appendChild(table);
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
define(["helper"], function (helper) {
|
define(['helper'], function (helper) {
|
||||||
"use strict";
|
'use strict';
|
||||||
|
|
||||||
return function () {
|
return function () {
|
||||||
var self = this;
|
var self = this;
|
||||||
var objects = {nodes: {}, links: {}};
|
var objects = { nodes: {}, links: {} };
|
||||||
var targets = [];
|
var targets = [];
|
||||||
var views = {};
|
var views = {};
|
||||||
var currentView;
|
var currentView;
|
||||||
@ -14,20 +14,20 @@ define(["helper"], function (helper) {
|
|||||||
var e = [];
|
var e = [];
|
||||||
|
|
||||||
if (currentView) {
|
if (currentView) {
|
||||||
e.push("v:" + currentView);
|
e.push('v:' + currentView);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (currentObject) {
|
if (currentObject) {
|
||||||
if ("node" in currentObject) {
|
if ('node' in currentObject) {
|
||||||
e.push("n:" + encodeURIComponent(currentObject.node.nodeinfo.node_id));
|
e.push('n:' + encodeURIComponent(currentObject.node.nodeinfo.node_id));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ("link" in currentObject) {
|
if ('link' in currentObject) {
|
||||||
e.push("l:" + encodeURIComponent(currentObject.link.id));
|
e.push('l:' + encodeURIComponent(currentObject.link.id));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var s = "#!" + e.join(";");
|
var s = '#!' + e.join(';');
|
||||||
|
|
||||||
window.history.pushState(s, undefined, s);
|
window.history.pushState(s, undefined, s);
|
||||||
}
|
}
|
||||||
@ -76,7 +76,7 @@ define(["helper"], function (helper) {
|
|||||||
|
|
||||||
targets.forEach(function (t) {
|
targets.forEach(function (t) {
|
||||||
if (!t.gotoLocation) {
|
if (!t.gotoLocation) {
|
||||||
console.warn("has no gotoLocation", t);
|
console.warn('has no gotoLocation', t);
|
||||||
}
|
}
|
||||||
t.gotoLocation(d);
|
t.gotoLocation(d);
|
||||||
});
|
});
|
||||||
@ -91,35 +91,35 @@ define(["helper"], function (helper) {
|
|||||||
|
|
||||||
s = decodeURIComponent(s);
|
s = decodeURIComponent(s);
|
||||||
|
|
||||||
if (!s.startsWith("#!")) {
|
if (!s.startsWith('#!')) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
var targetSet = false;
|
var targetSet = false;
|
||||||
|
|
||||||
s.slice(2).split(";").forEach(function (d) {
|
s.slice(2).split(';').forEach(function (d) {
|
||||||
var args = d.split(":");
|
var args = d.split(':');
|
||||||
|
|
||||||
if (update !== true && args[0] === "v" && args[1] in views) {
|
if (update !== true && args[0] === 'v' && args[1] in views) {
|
||||||
currentView = args[1];
|
currentView = args[1];
|
||||||
views[args[1]]();
|
views[args[1]]();
|
||||||
}
|
}
|
||||||
|
|
||||||
var id;
|
var id;
|
||||||
|
|
||||||
if (args[0] === "n") {
|
if (args[0] === 'n') {
|
||||||
id = args[1];
|
id = args[1];
|
||||||
if (id in objects.nodes) {
|
if (id in objects.nodes) {
|
||||||
currentObject = {node: objects.nodes[id]};
|
currentObject = { node: objects.nodes[id] };
|
||||||
gotoNode(objects.nodes[id], update);
|
gotoNode(objects.nodes[id], update);
|
||||||
targetSet = true;
|
targetSet = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args[0] === "l") {
|
if (args[0] === 'l') {
|
||||||
id = args[1];
|
id = args[1];
|
||||||
if (id in objects.links) {
|
if (id in objects.links) {
|
||||||
currentObject = {link: objects.links[id]};
|
currentObject = { link: objects.links[id] };
|
||||||
gotoLink(objects.links[id], update);
|
gotoLink(objects.links[id], update);
|
||||||
targetSet = true;
|
targetSet = true;
|
||||||
}
|
}
|
||||||
@ -129,21 +129,21 @@ define(["helper"], function (helper) {
|
|||||||
return targetSet;
|
return targetSet;
|
||||||
}
|
}
|
||||||
|
|
||||||
self.start = function () {
|
self.start = function start() {
|
||||||
running = true;
|
running = true;
|
||||||
|
|
||||||
if (!loadState(window.location.hash)) {
|
if (!loadState(window.location.hash)) {
|
||||||
resetView(false);
|
resetView(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
window.onpopstate = function (d) {
|
window.onpopstate = function onpopstate(d) {
|
||||||
if (!loadState(d.state)) {
|
if (!loadState(d.state)) {
|
||||||
resetView(false);
|
resetView(false);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
self.view = function (d) {
|
self.view = function view(d) {
|
||||||
if (d in views) {
|
if (d in views) {
|
||||||
views[d]();
|
views[d]();
|
||||||
|
|
||||||
@ -162,20 +162,20 @@ define(["helper"], function (helper) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ("node" in currentObject) {
|
if ('node' in currentObject) {
|
||||||
gotoNode(currentObject.node);
|
gotoNode(currentObject.node);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ("link" in currentObject) {
|
if ('link' in currentObject) {
|
||||||
gotoLink(currentObject.link);
|
gotoLink(currentObject.link);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
self.node = function (d) {
|
self.node = function node(d) {
|
||||||
return function () {
|
return function () {
|
||||||
if (gotoNode(d)) {
|
if (gotoNode(d)) {
|
||||||
currentObject = {node: d};
|
currentObject = { node: d };
|
||||||
saveState();
|
saveState();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -183,10 +183,10 @@ define(["helper"], function (helper) {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
self.link = function (d) {
|
self.link = function link(d) {
|
||||||
return function () {
|
return function () {
|
||||||
if (gotoLink(d)) {
|
if (gotoLink(d)) {
|
||||||
currentObject = {link: d};
|
currentObject = { link: d };
|
||||||
saveState();
|
saveState();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -196,25 +196,25 @@ define(["helper"], function (helper) {
|
|||||||
|
|
||||||
self.gotoLocation = gotoLocation;
|
self.gotoLocation = gotoLocation;
|
||||||
|
|
||||||
self.reset = function () {
|
self.reset = function reset() {
|
||||||
resetView();
|
resetView();
|
||||||
};
|
};
|
||||||
|
|
||||||
self.addTarget = function (d) {
|
self.addTarget = function addTarget(d) {
|
||||||
targets.push(d);
|
targets.push(d);
|
||||||
};
|
};
|
||||||
|
|
||||||
self.removeTarget = function (d) {
|
self.removeTarget = function removeTarget(d) {
|
||||||
targets = targets.filter(function (e) {
|
targets = targets.filter(function (e) {
|
||||||
return d !== e;
|
return d !== e;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
self.addView = function (k, d) {
|
self.addView = function addView(k, d) {
|
||||||
views[k] = d;
|
views[k] = d;
|
||||||
};
|
};
|
||||||
|
|
||||||
self.setData = function (data) {
|
self.setData = function setData(data) {
|
||||||
objects.nodes = {};
|
objects.nodes = {};
|
||||||
objects.links = {};
|
objects.links = {};
|
||||||
|
|
||||||
@ -225,10 +225,9 @@ define(["helper"], function (helper) {
|
|||||||
data.graph.links.forEach(function (d) {
|
data.graph.links.forEach(function (d) {
|
||||||
objects.links[d.id] = d;
|
objects.links[d.id] = d;
|
||||||
});
|
});
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
self.update = function () {
|
self.update = function update() {
|
||||||
loadState(window.location.hash, true);
|
loadState(window.location.hash, true);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,48 +1,48 @@
|
|||||||
define(function () {
|
define(function () {
|
||||||
"use strict";
|
'use strict';
|
||||||
|
|
||||||
return function (el) {
|
return function (el) {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
var sidebar = document.createElement("div");
|
var sidebar = document.createElement('div');
|
||||||
sidebar.classList.add("sidebar");
|
sidebar.classList.add('sidebar');
|
||||||
el.appendChild(sidebar);
|
el.appendChild(sidebar);
|
||||||
|
|
||||||
var button = document.createElement("button");
|
var button = document.createElement('button');
|
||||||
sidebar.appendChild(button);
|
sidebar.appendChild(button);
|
||||||
|
|
||||||
button.classList.add("sidebarhandle", "shadow");
|
button.classList.add('sidebarhandle', 'shadow');
|
||||||
button.onclick = function () {
|
button.onclick = function onclick() {
|
||||||
sidebar.classList.toggle("hidden");
|
sidebar.classList.toggle('hidden');
|
||||||
};
|
};
|
||||||
|
|
||||||
var container = document.createElement("div");
|
var container = document.createElement('div');
|
||||||
container.classList.add("container");
|
container.classList.add('container');
|
||||||
sidebar.appendChild(container);
|
sidebar.appendChild(container);
|
||||||
|
|
||||||
self.getWidth = function () {
|
self.getWidth = function getWidth() {
|
||||||
if (sidebar.classList.contains("hidden")) {
|
if (sidebar.classList.contains('hidden')) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
var small = window.matchMedia("(max-width: 630pt)");
|
var small = window.matchMedia('(max-width: 630pt)');
|
||||||
return small.matches ? 0 : sidebar.offsetWidth;
|
return small.matches ? 0 : sidebar.offsetWidth;
|
||||||
};
|
};
|
||||||
|
|
||||||
self.add = function (d) {
|
self.add = function add(d) {
|
||||||
d.render(container);
|
d.render(container);
|
||||||
};
|
};
|
||||||
|
|
||||||
self.ensureVisible = function () {
|
self.ensureVisible = function ensureVisible() {
|
||||||
sidebar.classList.remove("hidden");
|
sidebar.classList.remove('hidden');
|
||||||
};
|
};
|
||||||
|
|
||||||
self.hide = function () {
|
self.hide = function hide() {
|
||||||
container.classList.add("hidden");
|
container.classList.add('hidden');
|
||||||
};
|
};
|
||||||
|
|
||||||
self.reveal = function () {
|
self.reveal = function reveal() {
|
||||||
container.classList.remove("hidden");
|
container.classList.remove('hidden');
|
||||||
};
|
};
|
||||||
|
|
||||||
self.container = sidebar;
|
self.container = sidebar;
|
||||||
|
@ -1,15 +1,16 @@
|
|||||||
define(["moment/moment", "virtual-dom", "helper", "moment/locale/de"], function (moment, V, helper) {
|
define(['moment/moment', 'virtual-dom', 'helper', 'moment/locale/de'], function (moment, V, helper) {
|
||||||
"use strict";
|
'use strict';
|
||||||
|
|
||||||
return function (nodes, field, router, title) {
|
return function (nodes, field, router, title) {
|
||||||
var self = this;
|
var self = this;
|
||||||
var el, tbody;
|
var el;
|
||||||
|
var tbody;
|
||||||
|
|
||||||
self.render = function (d) {
|
self.render = function render(d) {
|
||||||
el = d;
|
el = d;
|
||||||
};
|
};
|
||||||
|
|
||||||
self.setData = function (data) {
|
self.setData = function setData(data) {
|
||||||
var list = data.nodes[nodes];
|
var list = data.nodes[nodes];
|
||||||
|
|
||||||
if (list.length === 0) {
|
if (list.length === 0) {
|
||||||
@ -18,16 +19,16 @@ define(["moment/moment", "virtual-dom", "helper", "moment/locale/de"], function
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!tbody) {
|
if (!tbody) {
|
||||||
var h2 = document.createElement("h2");
|
var h2 = document.createElement('h2');
|
||||||
h2.textContent = title;
|
h2.textContent = title;
|
||||||
el.appendChild(h2);
|
el.appendChild(h2);
|
||||||
|
|
||||||
var table = document.createElement("table");
|
var table = document.createElement('table');
|
||||||
table.classList.add("node-list");
|
table.classList.add('node-list');
|
||||||
el.appendChild(table);
|
el.appendChild(table);
|
||||||
|
|
||||||
tbody = document.createElement("tbody");
|
tbody = document.createElement('tbody');
|
||||||
tbody.last = V.h("tbody");
|
tbody.last = V.h('tbody');
|
||||||
table.appendChild(tbody);
|
table.appendChild(tbody);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -36,26 +37,26 @@ define(["moment/moment", "virtual-dom", "helper", "moment/locale/de"], function
|
|||||||
var td0Content = [];
|
var td0Content = [];
|
||||||
var td1Content = [];
|
var td1Content = [];
|
||||||
|
|
||||||
var aClass = ["hostname", d.flags.online ? "online" : "offline"];
|
var aClass = ['hostname', d.flags.online ? 'online' : 'offline'];
|
||||||
|
|
||||||
td1Content.push(V.h("a", {
|
td1Content.push(V.h('a', {
|
||||||
className: aClass.join(" "),
|
className: aClass.join(' '),
|
||||||
onclick: router.node(d),
|
onclick: router.node(d),
|
||||||
href: "#"
|
href: '#'
|
||||||
}, d.nodeinfo.hostname));
|
}, d.nodeinfo.hostname));
|
||||||
|
|
||||||
if (helper.hasLocation(d)) {
|
if (helper.hasLocation(d)) {
|
||||||
td0Content.push(V.h("span", {className: "icon ion-location"}));
|
td0Content.push(V.h('span', { className: 'icon ion-location' }));
|
||||||
}
|
}
|
||||||
|
|
||||||
var td0 = V.h("td", td0Content);
|
var td0 = V.h('td', td0Content);
|
||||||
var td1 = V.h("td", td1Content);
|
var td1 = V.h('td', td1Content);
|
||||||
var td2 = V.h("td", time);
|
var td2 = V.h('td', time);
|
||||||
|
|
||||||
return V.h("tr", [td0, td1, td2]);
|
return V.h('tr', [td0, td1, td2]);
|
||||||
});
|
});
|
||||||
|
|
||||||
var tbodyNew = V.h("tbody", items);
|
var tbodyNew = V.h('tbody', items);
|
||||||
tbody = V.patch(tbody, V.diff(tbody.last, tbodyNew));
|
tbody = V.patch(tbody, V.diff(tbody.last, tbodyNew));
|
||||||
tbody.last = tbodyNew;
|
tbody.last = tbodyNew;
|
||||||
};
|
};
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
define(["virtual-dom"], function (V) {
|
define(['virtual-dom'], function (V) {
|
||||||
"use strict";
|
'use strict';
|
||||||
|
|
||||||
return function (headings, sortIndex, renderRow) {
|
return function (headings, sortIndex, renderRow) {
|
||||||
var data;
|
var data;
|
||||||
var sortReverse = false;
|
var sortReverse = false;
|
||||||
var el = document.createElement("table");
|
var el = document.createElement('table');
|
||||||
var elLast = V.h("table");
|
var elLast = V.h('table');
|
||||||
|
|
||||||
function sortTable(i) {
|
function sortTable(i) {
|
||||||
sortReverse = i === sortIndex ? !sortReverse : false;
|
sortReverse = i === sortIndex ? !sortReverse : false;
|
||||||
@ -27,14 +27,14 @@ define(["virtual-dom"], function (V) {
|
|||||||
var th = headings.map(function (d, i) {
|
var th = headings.map(function (d, i) {
|
||||||
var properties = {
|
var properties = {
|
||||||
onclick: sortTableHandler(i),
|
onclick: sortTableHandler(i),
|
||||||
className: "sort-header"
|
className: 'sort-header'
|
||||||
};
|
};
|
||||||
|
|
||||||
if (sortIndex === i) {
|
if (sortIndex === i) {
|
||||||
properties.className += sortReverse ? " sort-up" : " sort-down";
|
properties.className += sortReverse ? ' sort-up' : ' sort-down';
|
||||||
}
|
}
|
||||||
|
|
||||||
return V.h("th", properties, d.name);
|
return V.h('th', properties, d.name);
|
||||||
});
|
});
|
||||||
|
|
||||||
var links = data.slice(0).sort(headings[sortIndex].sort);
|
var links = data.slice(0).sort(headings[sortIndex].sort);
|
||||||
@ -43,16 +43,16 @@ define(["virtual-dom"], function (V) {
|
|||||||
links = links.reverse();
|
links = links.reverse();
|
||||||
}
|
}
|
||||||
|
|
||||||
children.push(V.h("thead", V.h("tr", th)));
|
children.push(V.h('thead', V.h('tr', th)));
|
||||||
children.push(V.h("tbody", links.map(renderRow)));
|
children.push(V.h('tbody', links.map(renderRow)));
|
||||||
}
|
}
|
||||||
|
|
||||||
var elNew = V.h("table", children);
|
var elNew = V.h('table', children);
|
||||||
el = V.patch(el, V.diff(elLast, elNew));
|
el = V.patch(el, V.diff(elLast, elNew));
|
||||||
elLast = elNew;
|
elLast = elNew;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.setData = function (d) {
|
this.setData = function setData(d) {
|
||||||
data = d;
|
data = d;
|
||||||
updateView();
|
updateView();
|
||||||
};
|
};
|
||||||
|
24
lib/tabs.js
24
lib/tabs.js
@ -1,27 +1,27 @@
|
|||||||
define(function () {
|
define(function () {
|
||||||
"use strict";
|
'use strict';
|
||||||
|
|
||||||
return function () {
|
return function () {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
var tabs = document.createElement("ul");
|
var tabs = document.createElement('ul');
|
||||||
tabs.classList.add("tabs");
|
tabs.classList.add('tabs');
|
||||||
|
|
||||||
var container = document.createElement("div");
|
var container = document.createElement('div');
|
||||||
|
|
||||||
function gotoTab(li) {
|
function gotoTab(li) {
|
||||||
for (var i = 0; i < tabs.children.length; i++) {
|
for (var i = 0; i < tabs.children.length; i++) {
|
||||||
tabs.children[i].classList.remove("visible");
|
tabs.children[i].classList.remove('visible');
|
||||||
}
|
}
|
||||||
|
|
||||||
while (container.firstChild) {
|
while (container.firstChild) {
|
||||||
container.removeChild(container.firstChild);
|
container.removeChild(container.firstChild);
|
||||||
}
|
}
|
||||||
|
|
||||||
li.classList.add("visible");
|
li.classList.add('visible');
|
||||||
|
|
||||||
var tab = document.createElement("div");
|
var tab = document.createElement('div');
|
||||||
tab.classList.add("tab");
|
tab.classList.add('tab');
|
||||||
container.appendChild(tab);
|
container.appendChild(tab);
|
||||||
li.child.render(tab);
|
li.child.render(tab);
|
||||||
}
|
}
|
||||||
@ -32,8 +32,8 @@ define(function () {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
self.add = function (title, d) {
|
self.add = function add(title, d) {
|
||||||
var li = document.createElement("li");
|
var li = document.createElement('li');
|
||||||
li.textContent = title;
|
li.textContent = title;
|
||||||
li.onclick = switchTab;
|
li.onclick = switchTab;
|
||||||
li.child = d;
|
li.child = d;
|
||||||
@ -42,7 +42,7 @@ define(function () {
|
|||||||
var anyVisible = false;
|
var anyVisible = false;
|
||||||
|
|
||||||
for (var i = 0; i < tabs.children.length; i++) {
|
for (var i = 0; i < tabs.children.length; i++) {
|
||||||
if (tabs.children[i].classList.contains("visible")) {
|
if (tabs.children[i].classList.contains('visible')) {
|
||||||
anyVisible = true;
|
anyVisible = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -53,7 +53,7 @@ define(function () {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
self.render = function (el) {
|
self.render = function render(el) {
|
||||||
el.appendChild(tabs);
|
el.appendChild(tabs);
|
||||||
el.appendChild(container);
|
el.appendChild(container);
|
||||||
};
|
};
|
||||||
|
18
lib/title.js
18
lib/title.js
@ -1,5 +1,5 @@
|
|||||||
define(function () {
|
define(function () {
|
||||||
"use strict";
|
'use strict';
|
||||||
|
|
||||||
return function (config) {
|
return function (config) {
|
||||||
function setTitle(d) {
|
function setTitle(d) {
|
||||||
@ -9,30 +9,30 @@ define(function () {
|
|||||||
title.push(d);
|
title.push(d);
|
||||||
}
|
}
|
||||||
|
|
||||||
document.title = title.join(": ");
|
document.title = title.join(': ');
|
||||||
}
|
}
|
||||||
|
|
||||||
this.resetView = function () {
|
this.resetView = function resetView() {
|
||||||
setTitle();
|
setTitle();
|
||||||
};
|
};
|
||||||
|
|
||||||
this.gotoNode = function (d) {
|
this.gotoNode = function gotoNode(d) {
|
||||||
if (d) {
|
if (d) {
|
||||||
setTitle(d.nodeinfo.hostname);
|
setTitle(d.nodeinfo.hostname);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
this.gotoLink = function (d) {
|
this.gotoLink = function gotoLink(d) {
|
||||||
if (d) {
|
if (d) {
|
||||||
setTitle((d.source.node ? d.source.node.nodeinfo.hostname : d.source.id) + " – " + d.target.node.nodeinfo.hostname);
|
setTitle((d.source.node ? d.source.node.nodeinfo.hostname : d.source.id) + ' – ' + d.target.node.nodeinfo.hostname);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
this.gotoLocation = function () {
|
this.gotoLocation = function gotoLocation() {
|
||||||
//ignore
|
// ignore
|
||||||
};
|
};
|
||||||
|
|
||||||
this.destroy = function () {
|
this.destroy = function destroy() {
|
||||||
};
|
};
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
|
@ -1,74 +1,73 @@
|
|||||||
"use strict";
|
'use strict';
|
||||||
|
|
||||||
define({
|
define({
|
||||||
get: function (url) {
|
get: function get(url) {
|
||||||
return new Promise(function (resolve, reject) {
|
return new Promise(function (resolve, reject) {
|
||||||
var req = new XMLHttpRequest();
|
var req = new XMLHttpRequest();
|
||||||
req.open("GET", url);
|
req.open('GET', url);
|
||||||
|
|
||||||
req.onload = function () {
|
req.onload = function onload() {
|
||||||
if (req.status == 200) {
|
if (req.status === 200) {
|
||||||
resolve(req.response);
|
resolve(req.response);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
reject(Error(req.statusText));
|
reject(Error(req.statusText));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
req.onerror = function () {
|
req.onerror = function onerror() {
|
||||||
reject(Error("Network Error"));
|
reject(Error('Network Error'));
|
||||||
};
|
};
|
||||||
|
|
||||||
req.send();
|
req.send();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
getJSON: function (url) {
|
getJSON: function getJSON(url) {
|
||||||
return require("helper").get(url).then(JSON.parse);
|
return require('helper').get(url).then(JSON.parse);
|
||||||
},
|
},
|
||||||
|
|
||||||
sortByKey: function (key, d) {
|
sortByKey: function sortByKey(key, d) {
|
||||||
return d.slice().sort(function (a, b) {
|
return d.slice().sort(function (a, b) {
|
||||||
return a[key] - b[key];
|
return a[key] - b[key];
|
||||||
}).reverse();
|
}).reverse();
|
||||||
},
|
},
|
||||||
|
|
||||||
limit: function (key, m, d) {
|
limit: function limit(key, m, d) {
|
||||||
return d.filter(function (d) {
|
return d.filter(function (n) {
|
||||||
return d[key].isAfter(m);
|
return n[key].isAfter(m);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
sum: function (a) {
|
sum: function sum(a) {
|
||||||
return a.reduce(function (a, b) {
|
return a.reduce(function (b, c) {
|
||||||
return a + b;
|
return b + c;
|
||||||
}, 0);
|
}, 0);
|
||||||
},
|
},
|
||||||
|
|
||||||
one: function () {
|
one: function one() {
|
||||||
return 1;
|
return 1;
|
||||||
},
|
},
|
||||||
|
|
||||||
trueDefault: function (d) {
|
trueDefault: function trueDefault(d) {
|
||||||
return d === undefined ? true : d;
|
return d === undefined ? true : d;
|
||||||
},
|
},
|
||||||
|
|
||||||
dictGet: function (dict, key) {
|
dictGet: function dictGet(dict, key) {
|
||||||
var k = key.shift();
|
var k = key.shift();
|
||||||
|
|
||||||
if (!(k in dict)) {
|
if (!(k in dict)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (key.length == 0) {
|
if (key.length === 0) {
|
||||||
return dict[k];
|
return dict[k];
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.dictGet(dict[k], key);
|
return this.dictGet(dict[k], key);
|
||||||
},
|
},
|
||||||
|
|
||||||
localStorageTest: function () {
|
localStorageTest: function localStorageTest() {
|
||||||
var test = "test";
|
var test = 'test';
|
||||||
try {
|
try {
|
||||||
localStorage.setItem(test, test);
|
localStorage.setItem(test, test);
|
||||||
localStorage.removeItem(test);
|
localStorage.removeItem(test);
|
||||||
@ -78,9 +77,9 @@ define({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
listReplace: function (s, subst) {
|
listReplace: function listReplace(s, subst) {
|
||||||
for (var key in subst) {
|
for (var key in subst) {
|
||||||
var re = new RegExp(key, "g");
|
var re = new RegExp(key, 'g');
|
||||||
s = s.replace(re, subst[key]);
|
s = s.replace(re, subst[key]);
|
||||||
}
|
}
|
||||||
return s;
|
return s;
|
||||||
@ -88,21 +87,21 @@ define({
|
|||||||
|
|
||||||
/* Helpers working with nodes */
|
/* Helpers working with nodes */
|
||||||
|
|
||||||
offline: function (d) {
|
offline: function offline(d) {
|
||||||
return !d.flags.online;
|
return !d.flags.online;
|
||||||
},
|
},
|
||||||
|
|
||||||
online: function (d) {
|
online: function online(d) {
|
||||||
return d.flags.online;
|
return d.flags.online;
|
||||||
},
|
},
|
||||||
|
|
||||||
hasLocation: function (d) {
|
hasLocation: function hasLocation(d) {
|
||||||
return "location" in d.nodeinfo &&
|
return 'location' in d.nodeinfo &&
|
||||||
Math.abs(d.nodeinfo.location.latitude) < 90 &&
|
Math.abs(d.nodeinfo.location.latitude) < 90 &&
|
||||||
Math.abs(d.nodeinfo.location.longitude) < 180;
|
Math.abs(d.nodeinfo.location.longitude) < 180;
|
||||||
},
|
},
|
||||||
|
|
||||||
subtract: function (a, b) {
|
subtract: function subtract(a, b) {
|
||||||
var ids = {};
|
var ids = {};
|
||||||
|
|
||||||
b.forEach(function (d) {
|
b.forEach(function (d) {
|
||||||
@ -116,31 +115,31 @@ define({
|
|||||||
|
|
||||||
/* Helpers working with links */
|
/* Helpers working with links */
|
||||||
|
|
||||||
showDistance: function (d) {
|
showDistance: function showDistance(d) {
|
||||||
if (isNaN(d.distance)) {
|
if (isNaN(d.distance)) {
|
||||||
return;
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
return d.distance.toFixed(0) + " m";
|
return d.distance.toFixed(0) + ' m';
|
||||||
},
|
},
|
||||||
|
|
||||||
showTq: function (d) {
|
showTq: function showTq(d) {
|
||||||
return (1 / d.tq * 100).toFixed(0) + "%";
|
return (1 / d.tq * 100).toFixed(0) + '%';
|
||||||
},
|
},
|
||||||
|
|
||||||
attributeEntry: function (el, label, value) {
|
attributeEntry: function attributeEntry(el, label, value) {
|
||||||
if (value === null || value == undefined) {
|
if (value === null || value === undefined) {
|
||||||
return;
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
var tr = document.createElement("tr");
|
var tr = document.createElement('tr');
|
||||||
var th = document.createElement("th");
|
var th = document.createElement('th');
|
||||||
th.textContent = label;
|
th.textContent = label;
|
||||||
tr.appendChild(th);
|
tr.appendChild(th);
|
||||||
|
|
||||||
var td = document.createElement("td");
|
var td = document.createElement('td');
|
||||||
|
|
||||||
if (typeof value == "function") {
|
if (typeof value === 'function') {
|
||||||
value(td);
|
value(td);
|
||||||
} else {
|
} else {
|
||||||
td.appendChild(document.createTextNode(value));
|
td.appendChild(document.createTextNode(value));
|
||||||
@ -153,10 +152,10 @@ define({
|
|||||||
return td;
|
return td;
|
||||||
},
|
},
|
||||||
|
|
||||||
createIframe: function (opt, width, height) {
|
createIframe: function createIframe(opt, width, height) {
|
||||||
var el = document.createElement("iframe");
|
var el = document.createElement('iframe');
|
||||||
width = typeof width !== "undefined" ? width : "525px";
|
width = typeof width !== 'undefined' ? width : '525px';
|
||||||
height = typeof height !== "undefined" ? height : "350px";
|
height = typeof height !== 'undefined' ? height : '350px';
|
||||||
|
|
||||||
if (opt.src) {
|
if (opt.src) {
|
||||||
el.src = opt.src;
|
el.src = opt.src;
|
||||||
@ -182,23 +181,24 @@ define({
|
|||||||
el.height = height;
|
el.height = height;
|
||||||
}
|
}
|
||||||
|
|
||||||
el.scrolling = "no";
|
el.scrolling = 'no';
|
||||||
el.seamless = "seamless";
|
el.seamless = 'seamless';
|
||||||
|
|
||||||
return el;
|
return el;
|
||||||
},
|
},
|
||||||
|
|
||||||
showStat: function (o, subst) {
|
showStat: function showStat(o, subst) {
|
||||||
var content, caption;
|
var content;
|
||||||
subst = typeof subst !== "undefined" ? subst : {};
|
var caption;
|
||||||
|
subst = typeof subst !== 'undefined' ? subst : {};
|
||||||
|
|
||||||
if (o.thumbnail) {
|
if (o.thumbnail) {
|
||||||
content = document.createElement("img");
|
content = document.createElement('img');
|
||||||
content.src = require("helper").listReplace(o.thumbnail, subst);
|
content.src = require('helper').listReplace(o.thumbnail, subst);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (o.caption) {
|
if (o.caption) {
|
||||||
caption = require("helper").listReplace(o.caption, subst);
|
caption = require('helper').listReplace(o.caption, subst);
|
||||||
|
|
||||||
if (!content) {
|
if (!content) {
|
||||||
content = document.createTextNode(caption);
|
content = document.createTextNode(caption);
|
||||||
@ -206,20 +206,20 @@ define({
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (o.iframe) {
|
if (o.iframe) {
|
||||||
content = require("helper").createIframe(o.iframe, o.width, o.height);
|
content = require('helper').createIframe(o.iframe, o.width, o.height);
|
||||||
if (o.iframe.src) {
|
if (o.iframe.src) {
|
||||||
content.src = require("helper").listReplace(o.iframe.src, subst);
|
content.src = require('helper').listReplace(o.iframe.src, subst);
|
||||||
} else {
|
} else {
|
||||||
content.src = require("helper").listReplace(o.iframe, subst);
|
content.src = require('helper').listReplace(o.iframe, subst);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var p = document.createElement("p");
|
var p = document.createElement('p');
|
||||||
|
|
||||||
if (o.href) {
|
if (o.href) {
|
||||||
var link = document.createElement("a");
|
var link = document.createElement('a');
|
||||||
link.target = "_blank";
|
link.target = '_blank';
|
||||||
link.href = require("helper").listReplace(o.href, subst);
|
link.href = require('helper').listReplace(o.href, subst);
|
||||||
link.appendChild(content);
|
link.appendChild(content);
|
||||||
|
|
||||||
if (caption && o.thumbnail) {
|
if (caption && o.thumbnail) {
|
||||||
|
@ -40,8 +40,11 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"almond": "^0.3.3",
|
"almond": "^0.3.3",
|
||||||
|
"babel-eslint": "6.x",
|
||||||
"chroma-js": "^1.2.1",
|
"chroma-js": "^1.2.1",
|
||||||
"d3": "3.5",
|
"d3": "3.5",
|
||||||
|
"eslint-config-airbnb-es5": "^1.1.0",
|
||||||
|
"eslint-plugin-react": "^6.9.0",
|
||||||
"leaflet": "https://github.com/davojta/Leaflet.git#stable_0_7_7_1_release",
|
"leaflet": "https://github.com/davojta/Leaflet.git#stable_0_7_7_1_release",
|
||||||
"leaflet-label": "^0.2.1-0",
|
"leaflet-label": "^0.2.1-0",
|
||||||
"moment": "^2.17.1",
|
"moment": "^2.17.1",
|
||||||
|
104
tasks/build.js
104
tasks/build.js
@ -1,58 +1,58 @@
|
|||||||
module.exports = function (grunt) {
|
module.exports = function exports(grunt) {
|
||||||
"use strict";
|
'use strict';
|
||||||
|
|
||||||
grunt.config.merge({
|
grunt.config.merge({
|
||||||
nodedir: "node_modules",
|
nodedir: 'node_modules',
|
||||||
copy: {
|
copy: {
|
||||||
html: {
|
html: {
|
||||||
src: ["*.html"],
|
src: ['*.html'],
|
||||||
expand: true,
|
expand: true,
|
||||||
cwd: "html/",
|
cwd: 'html/',
|
||||||
dest: "build/"
|
dest: 'build/'
|
||||||
},
|
},
|
||||||
vendorjs: {
|
vendorjs: {
|
||||||
src: ["promise-polyfill/promise.js"],
|
src: ['promise-polyfill/promise.js'],
|
||||||
expand: true,
|
expand: true,
|
||||||
cwd: "<%=nodedir%>/",
|
cwd: '<%=nodedir%>/',
|
||||||
dest: "build/vendor/"
|
dest: 'build/vendor/'
|
||||||
},
|
},
|
||||||
config: {
|
config: {
|
||||||
src: ["config.json"],
|
src: ['config.json'],
|
||||||
expand: true,
|
expand: true,
|
||||||
cwd: ".",
|
cwd: '.',
|
||||||
dest: "build/"
|
dest: 'build/'
|
||||||
},
|
},
|
||||||
ionicons: {
|
ionicons: {
|
||||||
src: ["fonts/*"],
|
src: ['fonts/*'],
|
||||||
expand: true,
|
expand: true,
|
||||||
dest: "build/",
|
dest: 'build/',
|
||||||
cwd: "assets/icons/"
|
cwd: 'assets/icons/'
|
||||||
},
|
},
|
||||||
assistantFont: {
|
assistantFont: {
|
||||||
src: ["fonts/*"],
|
src: ['fonts/*'],
|
||||||
expand: true,
|
expand: true,
|
||||||
dest: "build/",
|
dest: 'build/',
|
||||||
cwd: "assets/"
|
cwd: 'assets/'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
sass: {
|
sass: {
|
||||||
dev: {
|
dev: {
|
||||||
options: {
|
options: {
|
||||||
sourceMap: true,
|
sourceMap: true,
|
||||||
outputStyle: "expanded"
|
outputStyle: 'expanded'
|
||||||
},
|
},
|
||||||
files: {
|
files: {
|
||||||
"build/style.css": "scss/main.scss",
|
'build/style.css': 'scss/main.scss',
|
||||||
"build/night.css": "scss/night.scss"
|
'build/night.css': 'scss/night.scss'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
dist: {
|
dist: {
|
||||||
options: {
|
options: {
|
||||||
outputStyle: "compressed"
|
outputStyle: 'compressed'
|
||||||
},
|
},
|
||||||
files: {
|
files: {
|
||||||
"build/style.css": "scss/main.scss",
|
'build/style.css': 'scss/main.scss',
|
||||||
"build/night.css": "scss/night.scss"
|
'build/night.css': 'scss/night.scss'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -60,13 +60,13 @@ module.exports = function (grunt) {
|
|||||||
options: {
|
options: {
|
||||||
map: false,
|
map: false,
|
||||||
processors: [
|
processors: [
|
||||||
require("autoprefixer")({
|
require('autoprefixer')({
|
||||||
browsers: ["> 1% in DE"]
|
browsers: ['> 1% in DE']
|
||||||
})
|
})
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
dist: {
|
dist: {
|
||||||
src: "build/*.css"
|
src: 'build/*.css'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
inline: {
|
inline: {
|
||||||
@ -75,8 +75,8 @@ module.exports = function (grunt) {
|
|||||||
cssmin: true,
|
cssmin: true,
|
||||||
uglify: true
|
uglify: true
|
||||||
},
|
},
|
||||||
src: "build/index.html",
|
src: 'build/index.html',
|
||||||
dest: "build/index.html"
|
dest: 'build/index.html'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
htmlmin: {
|
htmlmin: {
|
||||||
@ -94,30 +94,30 @@ module.exports = function (grunt) {
|
|||||||
inlinedata: {
|
inlinedata: {
|
||||||
injs: {
|
injs: {
|
||||||
expand: true,
|
expand: true,
|
||||||
cwd: ".",
|
cwd: '.',
|
||||||
src: ["build/*.html"],
|
src: ['build/*.html'],
|
||||||
ext: ".html"
|
ext: '.html'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
requirejs: {
|
requirejs: {
|
||||||
default: {
|
default: {
|
||||||
options: {
|
options: {
|
||||||
baseUrl: "lib",
|
baseUrl: 'lib',
|
||||||
name: "../<%=nodedir%>/almond/almond",
|
name: '../<%=nodedir%>/almond/almond',
|
||||||
mainConfigFile: "app.js",
|
mainConfigFile: 'app.js',
|
||||||
include: "../app",
|
include: '../app',
|
||||||
out: "build/app.js",
|
out: 'build/app.js',
|
||||||
build: true
|
build: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
dev: {
|
dev: {
|
||||||
options: {
|
options: {
|
||||||
baseUrl: "lib",
|
baseUrl: 'lib',
|
||||||
name: "../<%=nodedir%>/almond/almond",
|
name: '../<%=nodedir%>/almond/almond',
|
||||||
mainConfigFile: "app.js",
|
mainConfigFile: 'app.js',
|
||||||
include: "../app",
|
include: '../app',
|
||||||
optimize: "none",
|
optimize: 'none',
|
||||||
out: "build/app.js",
|
out: 'build/app.js',
|
||||||
build: false,
|
build: false,
|
||||||
generateSourceMaps: true
|
generateSourceMaps: true
|
||||||
}
|
}
|
||||||
@ -126,21 +126,21 @@ module.exports = function (grunt) {
|
|||||||
cachebreaker: {
|
cachebreaker: {
|
||||||
default: {
|
default: {
|
||||||
options: {
|
options: {
|
||||||
match: ["app.js"]
|
match: ['app.js']
|
||||||
},
|
},
|
||||||
files: {
|
files: {
|
||||||
src: ["build/index.html"]
|
src: ['build/index.html']
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
grunt.loadNpmTasks("grunt-contrib-copy");
|
grunt.loadNpmTasks('grunt-contrib-copy');
|
||||||
grunt.loadNpmTasks("grunt-contrib-requirejs");
|
grunt.loadNpmTasks('grunt-contrib-requirejs');
|
||||||
grunt.loadNpmTasks("grunt-sass");
|
grunt.loadNpmTasks('grunt-sass');
|
||||||
grunt.loadNpmTasks("grunt-postcss");
|
grunt.loadNpmTasks('grunt-postcss');
|
||||||
grunt.loadNpmTasks("grunt-inline");
|
grunt.loadNpmTasks('grunt-inline');
|
||||||
grunt.loadNpmTasks("grunt-inline-data");
|
grunt.loadNpmTasks('grunt-inline-data');
|
||||||
grunt.loadNpmTasks('grunt-contrib-htmlmin');
|
grunt.loadNpmTasks('grunt-contrib-htmlmin');
|
||||||
grunt.loadNpmTasks("grunt-cache-breaker");
|
grunt.loadNpmTasks('grunt-cache-breaker');
|
||||||
};
|
};
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
module.exports = function (grunt) {
|
module.exports = function exports(grunt) {
|
||||||
"use strict";
|
'use strict';
|
||||||
|
|
||||||
grunt.config.merge({
|
grunt.config.merge({
|
||||||
clean: {
|
clean: {
|
||||||
build: ["build/**/*", "node_modules/grunt-newer/.cache"],
|
build: ['build/**/*', 'node_modules/grunt-newer/.cache'],
|
||||||
release: ["build/vendor", "build/*.map", "build/config.json", "build/style.css"]
|
release: ['build/vendor', 'build/*.map', 'build/config.json', 'build/style.css']
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
grunt.loadNpmTasks("grunt-contrib-clean");
|
grunt.loadNpmTasks('grunt-contrib-clean');
|
||||||
};
|
};
|
||||||
|
@ -1,43 +1,43 @@
|
|||||||
module.exports = function (grunt) {
|
module.exports = function exports(grunt) {
|
||||||
"use strict";
|
'use strict';
|
||||||
|
|
||||||
grunt.config.merge({
|
grunt.config.merge({
|
||||||
"browserSync": {
|
'browserSync': {
|
||||||
dev: {
|
dev: {
|
||||||
bsFiles: {
|
bsFiles: {
|
||||||
src: [
|
src: [
|
||||||
"build/*.css",
|
'build/*.css',
|
||||||
"build/*.js",
|
'build/*.js',
|
||||||
"build/*.html"
|
'build/*.html'
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
options: {
|
options: {
|
||||||
open: "local",
|
open: 'local',
|
||||||
watchTask: true,
|
watchTask: true,
|
||||||
injectChanges: true,
|
injectChanges: true,
|
||||||
server: {
|
server: {
|
||||||
baseDir: "build",
|
baseDir: 'build',
|
||||||
index: "index.html"
|
index: 'index.html'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
html: {
|
html: {
|
||||||
files: ["html/index.html", "config.json"],
|
files: ['html/index.html', 'config.json'],
|
||||||
tasks: ["copy", "inlinedata", "htmlmin"]
|
tasks: ['copy', 'inlinedata', 'htmlmin']
|
||||||
},
|
},
|
||||||
sass: {
|
sass: {
|
||||||
files: ["scss/**/*.scss"],
|
files: ['scss/**/*.scss'],
|
||||||
tasks: ["sasslint", "sass", "postcss"]
|
tasks: ['sasslint', 'sass', 'postcss']
|
||||||
},
|
},
|
||||||
js: {
|
js: {
|
||||||
files: ["app.js", "lib/**/*.js"],
|
files: ['app.js', 'lib/**/*.js'],
|
||||||
tasks: ["eslint", "requirejs:dev"]
|
tasks: ['eslint', 'requirejs:dev']
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
grunt.loadNpmTasks("grunt-browser-sync");
|
grunt.loadNpmTasks('grunt-browser-sync');
|
||||||
grunt.loadNpmTasks("grunt-contrib-watch");
|
grunt.loadNpmTasks('grunt-contrib-watch');
|
||||||
};
|
};
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
module.exports = function (grunt) {
|
module.exports = function exports(grunt) {
|
||||||
"use strict";
|
'use strict';
|
||||||
|
|
||||||
grunt.config.merge({
|
grunt.config.merge({
|
||||||
checkDependencies: {
|
checkDependencies: {
|
||||||
@ -9,20 +9,20 @@ module.exports = function (grunt) {
|
|||||||
},
|
},
|
||||||
sasslint: {
|
sasslint: {
|
||||||
options: {
|
options: {
|
||||||
configFile: ".sass-lint.yml"
|
configFile: '.sass-lint.yml'
|
||||||
},
|
},
|
||||||
target: ['scss/main.scss', 'scss/night.scss', 'scss/*/*.scss']
|
target: ['scss/main.scss', 'scss/night.scss', 'scss/*/*.scss']
|
||||||
},
|
},
|
||||||
eslint: {
|
eslint: {
|
||||||
sources: {
|
sources: {
|
||||||
src: ["app.js", "!Gruntfile.js", "lib/**/*.js", "tasks/**/*.js"]
|
src: ['app.js', '!Gruntfile.js', 'lib/**/*.js', 'tasks/**/*.js']
|
||||||
},
|
},
|
||||||
grunt: {
|
grunt: {
|
||||||
src: ["Gruntfile.js", "tasks/*.js"]
|
src: ['Gruntfile.js', 'tasks/*.js']
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
grunt.loadNpmTasks('grunt-sass-lint');
|
grunt.loadNpmTasks('grunt-sass-lint');
|
||||||
grunt.loadNpmTasks("grunt-eslint");
|
grunt.loadNpmTasks('grunt-eslint');
|
||||||
};
|
};
|
||||||
|
269
yarn.lock
269
yarn.lock
@ -38,12 +38,12 @@ after@0.8.1:
|
|||||||
resolved "https://registry.yarnpkg.com/after/-/after-0.8.1.tgz#ab5d4fb883f596816d3515f8f791c0af486dd627"
|
resolved "https://registry.yarnpkg.com/after/-/after-0.8.1.tgz#ab5d4fb883f596816d3515f8f791c0af486dd627"
|
||||||
|
|
||||||
ajv-keywords@^1.0.0:
|
ajv-keywords@^1.0.0:
|
||||||
version "1.5.0"
|
version "1.5.1"
|
||||||
resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-1.5.0.tgz#c11e6859eafff83e0dafc416929472eca946aa2c"
|
resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-1.5.1.tgz#314dd0a4b3368fad3dfcdc54ede6171b886daf3c"
|
||||||
|
|
||||||
ajv@^4.7.0:
|
ajv@^4.7.0:
|
||||||
version "4.10.4"
|
version "4.11.2"
|
||||||
resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.10.4.tgz#c0974dd00b3464984892d6010aa9c2c945933254"
|
resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.2.tgz#f166c3c11cbc6cb9dcc102a5bcfe5b72c95287e6"
|
||||||
dependencies:
|
dependencies:
|
||||||
co "^4.6.0"
|
co "^4.6.0"
|
||||||
json-stable-stringify "^1.0.1"
|
json-stable-stringify "^1.0.1"
|
||||||
@ -136,6 +136,13 @@ array-unique@^0.2.1:
|
|||||||
version "0.2.1"
|
version "0.2.1"
|
||||||
resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53"
|
resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53"
|
||||||
|
|
||||||
|
array.prototype.find@^2.0.1:
|
||||||
|
version "2.0.3"
|
||||||
|
resolved "https://registry.yarnpkg.com/array.prototype.find/-/array.prototype.find-2.0.3.tgz#08c3ec33e32ec4bab362a2958e686ae92f59271d"
|
||||||
|
dependencies:
|
||||||
|
define-properties "^1.1.2"
|
||||||
|
es-abstract "^1.7.0"
|
||||||
|
|
||||||
arraybuffer.slice@0.0.6:
|
arraybuffer.slice@0.0.6:
|
||||||
version "0.0.6"
|
version "0.0.6"
|
||||||
resolved "https://registry.yarnpkg.com/arraybuffer.slice/-/arraybuffer.slice-0.0.6.tgz#f33b2159f0532a3f3107a272c0ccfbd1ad2979ca"
|
resolved "https://registry.yarnpkg.com/arraybuffer.slice/-/arraybuffer.slice-0.0.6.tgz#f33b2159f0532a3f3107a272c0ccfbd1ad2979ca"
|
||||||
@ -181,14 +188,14 @@ asynckit@^0.4.0:
|
|||||||
resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79"
|
resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79"
|
||||||
|
|
||||||
autoprefixer@^6.6.1:
|
autoprefixer@^6.6.1:
|
||||||
version "6.6.1"
|
version "6.7.0"
|
||||||
resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-6.6.1.tgz#11a4077abb4b313253ec2f6e1adb91ad84253519"
|
resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-6.7.0.tgz#88992cf04df141e7b8293550f2ee716c565d1cae"
|
||||||
dependencies:
|
dependencies:
|
||||||
browserslist "~1.5.1"
|
browserslist "~1.6.0"
|
||||||
caniuse-db "^1.0.30000604"
|
caniuse-db "^1.0.30000613"
|
||||||
normalize-range "^0.1.2"
|
normalize-range "^0.1.2"
|
||||||
num2fraction "^1.2.2"
|
num2fraction "^1.2.2"
|
||||||
postcss "^5.2.8"
|
postcss "^5.2.11"
|
||||||
postcss-value-parser "^3.2.3"
|
postcss-value-parser "^3.2.3"
|
||||||
|
|
||||||
aws-sign2@~0.6.0:
|
aws-sign2@~0.6.0:
|
||||||
@ -199,13 +206,63 @@ aws4@^1.2.1:
|
|||||||
version "1.5.0"
|
version "1.5.0"
|
||||||
resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.5.0.tgz#0a29ffb79c31c9e712eeb087e8e7a64b4a56d755"
|
resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.5.0.tgz#0a29ffb79c31c9e712eeb087e8e7a64b4a56d755"
|
||||||
|
|
||||||
babel-code-frame@^6.16.0:
|
babel-code-frame@^6.16.0, babel-code-frame@^6.22.0:
|
||||||
version "6.20.0"
|
version "6.22.0"
|
||||||
resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.20.0.tgz#b968f839090f9a8bc6d41938fb96cb84f7387b26"
|
resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.22.0.tgz#027620bee567a88c32561574e7fd0801d33118e4"
|
||||||
dependencies:
|
dependencies:
|
||||||
chalk "^1.1.0"
|
chalk "^1.1.0"
|
||||||
esutils "^2.0.2"
|
esutils "^2.0.2"
|
||||||
js-tokens "^2.0.0"
|
js-tokens "^3.0.0"
|
||||||
|
|
||||||
|
babel-eslint@6.x:
|
||||||
|
version "6.1.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-6.1.2.tgz#5293419fe3672d66598d327da9694567ba6a5f2f"
|
||||||
|
dependencies:
|
||||||
|
babel-traverse "^6.0.20"
|
||||||
|
babel-types "^6.0.19"
|
||||||
|
babylon "^6.0.18"
|
||||||
|
lodash.assign "^4.0.0"
|
||||||
|
lodash.pickby "^4.0.0"
|
||||||
|
|
||||||
|
babel-messages@^6.22.0:
|
||||||
|
version "6.22.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.22.0.tgz#36066a214f1217e4ed4164867669ecb39e3ea575"
|
||||||
|
dependencies:
|
||||||
|
babel-runtime "^6.22.0"
|
||||||
|
|
||||||
|
babel-runtime@^6.22.0:
|
||||||
|
version "6.22.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.22.0.tgz#1cf8b4ac67c77a4ddb0db2ae1f74de52ac4ca611"
|
||||||
|
dependencies:
|
||||||
|
core-js "^2.4.0"
|
||||||
|
regenerator-runtime "^0.10.0"
|
||||||
|
|
||||||
|
babel-traverse@^6.0.20:
|
||||||
|
version "6.22.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.22.1.tgz#3b95cd6b7427d6f1f757704908f2fc9748a5f59f"
|
||||||
|
dependencies:
|
||||||
|
babel-code-frame "^6.22.0"
|
||||||
|
babel-messages "^6.22.0"
|
||||||
|
babel-runtime "^6.22.0"
|
||||||
|
babel-types "^6.22.0"
|
||||||
|
babylon "^6.15.0"
|
||||||
|
debug "^2.2.0"
|
||||||
|
globals "^9.0.0"
|
||||||
|
invariant "^2.2.0"
|
||||||
|
lodash "^4.2.0"
|
||||||
|
|
||||||
|
babel-types@^6.0.19, babel-types@^6.22.0:
|
||||||
|
version "6.22.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.22.0.tgz#2a447e8d0ea25d2512409e4175479fd78cc8b1db"
|
||||||
|
dependencies:
|
||||||
|
babel-runtime "^6.22.0"
|
||||||
|
esutils "^2.0.2"
|
||||||
|
lodash "^4.2.0"
|
||||||
|
to-fast-properties "^1.0.1"
|
||||||
|
|
||||||
|
babylon@^6.0.18, babylon@^6.15.0:
|
||||||
|
version "6.15.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.15.0.tgz#ba65cfa1a80e1759b0e89fb562e27dccae70348e"
|
||||||
|
|
||||||
backo2@1.0.2:
|
backo2@1.0.2:
|
||||||
version "1.0.2"
|
version "1.0.2"
|
||||||
@ -342,11 +399,12 @@ browser-sync@^2.6.4:
|
|||||||
ua-parser-js "0.7.12"
|
ua-parser-js "0.7.12"
|
||||||
yargs "6.4.0"
|
yargs "6.4.0"
|
||||||
|
|
||||||
browserslist@~1.5.1:
|
browserslist@~1.6.0:
|
||||||
version "1.5.2"
|
version "1.6.0"
|
||||||
resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-1.5.2.tgz#1c82fde0ee8693e6d15c49b7bff209dc06298c56"
|
resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-1.6.0.tgz#85fb7c993540d3fda31c282baf7f5aee698ac9ee"
|
||||||
dependencies:
|
dependencies:
|
||||||
caniuse-db "^1.0.30000604"
|
caniuse-db "^1.0.30000613"
|
||||||
|
electron-to-chromium "^1.2.0"
|
||||||
|
|
||||||
bs-recipes@1.3.4:
|
bs-recipes@1.3.4:
|
||||||
version "1.3.4"
|
version "1.3.4"
|
||||||
@ -437,9 +495,9 @@ camelize@^1.0.0:
|
|||||||
version "1.0.0"
|
version "1.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/camelize/-/camelize-1.0.0.tgz#164a5483e630fa4321e5af07020e531831b2609b"
|
resolved "https://registry.yarnpkg.com/camelize/-/camelize-1.0.0.tgz#164a5483e630fa4321e5af07020e531831b2609b"
|
||||||
|
|
||||||
caniuse-db@^1.0.30000604:
|
caniuse-db@^1.0.30000613:
|
||||||
version "1.0.30000611"
|
version "1.0.30000617"
|
||||||
resolved "https://registry.yarnpkg.com/caniuse-db/-/caniuse-db-1.0.30000611.tgz#1075d14d9b3cc153caf5e9e35f45565b03304c37"
|
resolved "https://registry.yarnpkg.com/caniuse-db/-/caniuse-db-1.0.30000617.tgz#9b7fd81f58a35526315c83e60cb5f076f0beb392"
|
||||||
|
|
||||||
caseless@~0.11.0:
|
caseless@~0.11.0:
|
||||||
version "0.11.0"
|
version "0.11.0"
|
||||||
@ -502,8 +560,8 @@ clean-css@1.1.7:
|
|||||||
commander "2.0.x"
|
commander "2.0.x"
|
||||||
|
|
||||||
clean-css@3.4.x:
|
clean-css@3.4.x:
|
||||||
version "3.4.23"
|
version "3.4.24"
|
||||||
resolved "https://registry.yarnpkg.com/clean-css/-/clean-css-3.4.23.tgz#604fbbca24c12feb59b02f00b84f1fb7ded6d001"
|
resolved "https://registry.yarnpkg.com/clean-css/-/clean-css-3.4.24.tgz#89f5a5e9da37ae02394fe049a41388abbe72c3b5"
|
||||||
dependencies:
|
dependencies:
|
||||||
commander "2.8.x"
|
commander "2.8.x"
|
||||||
source-map "0.4.x"
|
source-map "0.4.x"
|
||||||
@ -633,6 +691,10 @@ cookie@0.3.1:
|
|||||||
version "0.3.1"
|
version "0.3.1"
|
||||||
resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.3.1.tgz#e7e0a1f9ef43b4c8ba925c5c5a96e806d16873bb"
|
resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.3.1.tgz#e7e0a1f9ef43b4c8ba925c5c5a96e806d16873bb"
|
||||||
|
|
||||||
|
core-js@^2.4.0:
|
||||||
|
version "2.4.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.4.1.tgz#4de911e667b0eae9124e34254b53aea6fc618d3e"
|
||||||
|
|
||||||
core-util-is@~1.0.0:
|
core-util-is@~1.0.0:
|
||||||
version "1.0.2"
|
version "1.0.2"
|
||||||
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
|
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
|
||||||
@ -686,7 +748,7 @@ dateformat@~1.0.12:
|
|||||||
get-stdin "^4.0.1"
|
get-stdin "^4.0.1"
|
||||||
meow "^3.3.0"
|
meow "^3.3.0"
|
||||||
|
|
||||||
debug@2.2.0, debug@^2.1.1, debug@^2.2.0, debug@~2.2.0:
|
debug@2.2.0, debug@~2.2.0:
|
||||||
version "2.2.0"
|
version "2.2.0"
|
||||||
resolved "https://registry.yarnpkg.com/debug/-/debug-2.2.0.tgz#f87057e995b1a1f6ae6a4960664137bc56f039da"
|
resolved "https://registry.yarnpkg.com/debug/-/debug-2.2.0.tgz#f87057e995b1a1f6ae6a4960664137bc56f039da"
|
||||||
dependencies:
|
dependencies:
|
||||||
@ -698,6 +760,12 @@ debug@2.3.3:
|
|||||||
dependencies:
|
dependencies:
|
||||||
ms "0.7.2"
|
ms "0.7.2"
|
||||||
|
|
||||||
|
debug@^2.1.1, debug@^2.2.0:
|
||||||
|
version "2.6.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.0.tgz#bc596bcabe7617f11d9fa15361eded5608b8499b"
|
||||||
|
dependencies:
|
||||||
|
ms "0.7.2"
|
||||||
|
|
||||||
decamelize@^1.0.0, decamelize@^1.1.1, decamelize@^1.1.2:
|
decamelize@^1.0.0, decamelize@^1.1.1, decamelize@^1.1.2:
|
||||||
version "1.2.0"
|
version "1.2.0"
|
||||||
resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290"
|
resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290"
|
||||||
@ -710,6 +778,13 @@ deep-is@~0.1.3:
|
|||||||
version "0.1.3"
|
version "0.1.3"
|
||||||
resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34"
|
resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34"
|
||||||
|
|
||||||
|
define-properties@^1.1.2:
|
||||||
|
version "1.1.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.2.tgz#83a73f2fea569898fb737193c8f873caf6d45c94"
|
||||||
|
dependencies:
|
||||||
|
foreach "^2.0.5"
|
||||||
|
object-keys "^1.0.8"
|
||||||
|
|
||||||
del@^2.0.2:
|
del@^2.0.2:
|
||||||
version "2.2.2"
|
version "2.2.2"
|
||||||
resolved "https://registry.yarnpkg.com/del/-/del-2.2.2.tgz#c12c981d067846c84bcaf862cff930d907ffd1a8"
|
resolved "https://registry.yarnpkg.com/del/-/del-2.2.2.tgz#c12c981d067846c84bcaf862cff930d907ffd1a8"
|
||||||
@ -786,6 +861,10 @@ ee-first@1.1.1:
|
|||||||
version "1.1.1"
|
version "1.1.1"
|
||||||
resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d"
|
resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d"
|
||||||
|
|
||||||
|
electron-to-chromium@^1.2.0:
|
||||||
|
version "1.2.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.2.1.tgz#63ac7579a1c5bedb296c8607621f2efc9a54b968"
|
||||||
|
|
||||||
emitter-steward@^1.0.0:
|
emitter-steward@^1.0.0:
|
||||||
version "1.0.0"
|
version "1.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/emitter-steward/-/emitter-steward-1.0.0.tgz#f3411ade9758a7565df848b2da0cbbd1b46cbd64"
|
resolved "https://registry.yarnpkg.com/emitter-steward/-/emitter-steward-1.0.0.tgz#f3411ade9758a7565df848b2da0cbbd1b46cbd64"
|
||||||
@ -847,6 +926,23 @@ error@^4.3.0:
|
|||||||
string-template "~0.2.0"
|
string-template "~0.2.0"
|
||||||
xtend "~4.0.0"
|
xtend "~4.0.0"
|
||||||
|
|
||||||
|
es-abstract@^1.7.0:
|
||||||
|
version "1.7.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.7.0.tgz#dfade774e01bfcd97f96180298c449c8623fb94c"
|
||||||
|
dependencies:
|
||||||
|
es-to-primitive "^1.1.1"
|
||||||
|
function-bind "^1.1.0"
|
||||||
|
is-callable "^1.1.3"
|
||||||
|
is-regex "^1.0.3"
|
||||||
|
|
||||||
|
es-to-primitive@^1.1.1:
|
||||||
|
version "1.1.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.1.1.tgz#45355248a88979034b6792e19bb81f2b7975dd0d"
|
||||||
|
dependencies:
|
||||||
|
is-callable "^1.1.1"
|
||||||
|
is-date-object "^1.0.1"
|
||||||
|
is-symbol "^1.0.1"
|
||||||
|
|
||||||
es5-ext@^0.10.7, es5-ext@^0.10.8, es5-ext@~0.10.11, es5-ext@~0.10.2, es5-ext@~0.10.7:
|
es5-ext@^0.10.7, es5-ext@^0.10.8, es5-ext@~0.10.11, es5-ext@~0.10.2, es5-ext@~0.10.7:
|
||||||
version "0.10.12"
|
version "0.10.12"
|
||||||
resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.12.tgz#aa84641d4db76b62abba5e45fd805ecbab140047"
|
resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.12.tgz#aa84641d4db76b62abba5e45fd805ecbab140047"
|
||||||
@ -916,10 +1012,24 @@ escope@^3.6.0:
|
|||||||
esrecurse "^4.1.0"
|
esrecurse "^4.1.0"
|
||||||
estraverse "^4.1.1"
|
estraverse "^4.1.1"
|
||||||
|
|
||||||
|
eslint-config-airbnb-es5@^1.1.0:
|
||||||
|
version "1.1.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/eslint-config-airbnb-es5/-/eslint-config-airbnb-es5-1.1.0.tgz#f342474fe7c8e02745707d1c5e3bca0a3ab9e968"
|
||||||
|
dependencies:
|
||||||
|
strip-json-comments "1.0.2"
|
||||||
|
|
||||||
eslint-config-defaults@^9.0.0:
|
eslint-config-defaults@^9.0.0:
|
||||||
version "9.0.0"
|
version "9.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/eslint-config-defaults/-/eslint-config-defaults-9.0.0.tgz#a090adc13b2935e3f43b3cd048a92701654e5ad5"
|
resolved "https://registry.yarnpkg.com/eslint-config-defaults/-/eslint-config-defaults-9.0.0.tgz#a090adc13b2935e3f43b3cd048a92701654e5ad5"
|
||||||
|
|
||||||
|
eslint-plugin-react@^6.9.0:
|
||||||
|
version "6.9.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-6.9.0.tgz#54c2e9906b76f9d10142030bdc34e9d6840a0bb2"
|
||||||
|
dependencies:
|
||||||
|
array.prototype.find "^2.0.1"
|
||||||
|
doctrine "^1.2.2"
|
||||||
|
jsx-ast-utils "^1.3.4"
|
||||||
|
|
||||||
eslint@^2.7.0:
|
eslint@^2.7.0:
|
||||||
version "2.13.1"
|
version "2.13.1"
|
||||||
resolved "https://registry.yarnpkg.com/eslint/-/eslint-2.13.1.tgz#e4cc8fa0f009fb829aaae23855a29360be1f6c11"
|
resolved "https://registry.yarnpkg.com/eslint/-/eslint-2.13.1.tgz#e4cc8fa0f009fb829aaae23855a29360be1f6c11"
|
||||||
@ -959,8 +1069,8 @@ eslint@^2.7.0:
|
|||||||
user-home "^2.0.0"
|
user-home "^2.0.0"
|
||||||
|
|
||||||
eslint@^3.0.0, eslint@^3.14.0:
|
eslint@^3.0.0, eslint@^3.14.0:
|
||||||
version "3.14.0"
|
version "3.14.1"
|
||||||
resolved "https://registry.yarnpkg.com/eslint/-/eslint-3.14.0.tgz#2c617e5f782fda5cbee5bc8be7ef5053af8e63a3"
|
resolved "https://registry.yarnpkg.com/eslint/-/eslint-3.14.1.tgz#8a62175f2255109494747a1b25128d97b8eb3d97"
|
||||||
dependencies:
|
dependencies:
|
||||||
babel-code-frame "^6.16.0"
|
babel-code-frame "^6.16.0"
|
||||||
chalk "^1.1.3"
|
chalk "^1.1.3"
|
||||||
@ -1186,6 +1296,10 @@ for-own@^0.1.4:
|
|||||||
dependencies:
|
dependencies:
|
||||||
for-in "^0.1.5"
|
for-in "^0.1.5"
|
||||||
|
|
||||||
|
foreach@^2.0.5:
|
||||||
|
version "2.0.5"
|
||||||
|
resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99"
|
||||||
|
|
||||||
forever-agent@~0.6.1:
|
forever-agent@~0.6.1:
|
||||||
version "0.6.1"
|
version "0.6.1"
|
||||||
resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91"
|
resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91"
|
||||||
@ -1248,6 +1362,10 @@ fstream@^1.0.0, fstream@^1.0.2, fstream@~1.0.10:
|
|||||||
mkdirp ">=0.5 0"
|
mkdirp ">=0.5 0"
|
||||||
rimraf "2"
|
rimraf "2"
|
||||||
|
|
||||||
|
function-bind@^1.1.0:
|
||||||
|
version "1.1.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.0.tgz#16176714c801798e4e8f2cf7f7529467bb4a5771"
|
||||||
|
|
||||||
gauge@~2.7.1:
|
gauge@~2.7.1:
|
||||||
version "2.7.2"
|
version "2.7.2"
|
||||||
resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.2.tgz#15cecc31b02d05345a5d6b0e171cdb3ad2307774"
|
resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.2.tgz#15cecc31b02d05345a5d6b0e171cdb3ad2307774"
|
||||||
@ -1348,7 +1466,7 @@ global@^4.3.0:
|
|||||||
min-document "^2.19.0"
|
min-document "^2.19.0"
|
||||||
process "~0.5.1"
|
process "~0.5.1"
|
||||||
|
|
||||||
globals@^9.14.0, globals@^9.2.0:
|
globals@^9.0.0, globals@^9.14.0, globals@^9.2.0:
|
||||||
version "9.14.0"
|
version "9.14.0"
|
||||||
resolved "https://registry.yarnpkg.com/globals/-/globals-9.14.0.tgz#8859936af0038741263053b39d0e76ca241e4034"
|
resolved "https://registry.yarnpkg.com/globals/-/globals-9.14.0.tgz#8859936af0038741263053b39d0e76ca241e4034"
|
||||||
|
|
||||||
@ -1596,8 +1714,8 @@ hawk@~3.1.3:
|
|||||||
sntp "1.x.x"
|
sntp "1.x.x"
|
||||||
|
|
||||||
he@1.1.x:
|
he@1.1.x:
|
||||||
version "1.1.0"
|
version "1.1.1"
|
||||||
resolved "https://registry.yarnpkg.com/he/-/he-1.1.0.tgz#29319d49beec13a9b1f3c4f9b2a6dde4859bb2a7"
|
resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd"
|
||||||
|
|
||||||
hoek@2.x.x:
|
hoek@2.x.x:
|
||||||
version "2.16.3"
|
version "2.16.3"
|
||||||
@ -1663,8 +1781,8 @@ iconv-lite@~0.4.13:
|
|||||||
resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.15.tgz#fe265a218ac6a57cfe854927e9d04c19825eddeb"
|
resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.15.tgz#fe265a218ac6a57cfe854927e9d04c19825eddeb"
|
||||||
|
|
||||||
ignore@^3.1.2, ignore@^3.2.0:
|
ignore@^3.1.2, ignore@^3.2.0:
|
||||||
version "3.2.0"
|
version "3.2.2"
|
||||||
resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.2.0.tgz#8d88f03c3002a0ac52114db25d2c673b0bf1e435"
|
resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.2.2.tgz#1c51e1ef53bab6ddc15db4d9ac4ec139eceb3410"
|
||||||
|
|
||||||
immutable@3.8.1, immutable@^3.7.6:
|
immutable@3.8.1, immutable@^3.7.6:
|
||||||
version "3.8.1"
|
version "3.8.1"
|
||||||
@ -1733,6 +1851,12 @@ interpret@^1.0.0:
|
|||||||
version "1.0.1"
|
version "1.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.0.1.tgz#d579fb7f693b858004947af39fa0db49f795602c"
|
resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.0.1.tgz#d579fb7f693b858004947af39fa0db49f795602c"
|
||||||
|
|
||||||
|
invariant@^2.2.0:
|
||||||
|
version "2.2.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.2.tgz#9e1f56ac0acdb6bf303306f338be3b204ae60360"
|
||||||
|
dependencies:
|
||||||
|
loose-envify "^1.0.0"
|
||||||
|
|
||||||
invert-kv@^1.0.0:
|
invert-kv@^1.0.0:
|
||||||
version "1.0.0"
|
version "1.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6"
|
resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6"
|
||||||
@ -1757,6 +1881,14 @@ is-builtin-module@^1.0.0:
|
|||||||
dependencies:
|
dependencies:
|
||||||
builtin-modules "^1.0.0"
|
builtin-modules "^1.0.0"
|
||||||
|
|
||||||
|
is-callable@^1.1.1, is-callable@^1.1.3:
|
||||||
|
version "1.1.3"
|
||||||
|
resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.3.tgz#86eb75392805ddc33af71c92a0eedf74ee7604b2"
|
||||||
|
|
||||||
|
is-date-object@^1.0.1:
|
||||||
|
version "1.0.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.1.tgz#9aa20eb6aeebbff77fbd33e74ca01b33581d3a16"
|
||||||
|
|
||||||
is-dotfile@^1.0.0:
|
is-dotfile@^1.0.0:
|
||||||
version "1.0.2"
|
version "1.0.2"
|
||||||
resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.2.tgz#2c132383f39199f8edc268ca01b9b007d205cc4d"
|
resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.2.tgz#2c132383f39199f8edc268ca01b9b007d205cc4d"
|
||||||
@ -1851,12 +1983,20 @@ is-property@^1.0.0:
|
|||||||
version "1.0.2"
|
version "1.0.2"
|
||||||
resolved "https://registry.yarnpkg.com/is-property/-/is-property-1.0.2.tgz#57fe1c4e48474edd65b09911f26b1cd4095dda84"
|
resolved "https://registry.yarnpkg.com/is-property/-/is-property-1.0.2.tgz#57fe1c4e48474edd65b09911f26b1cd4095dda84"
|
||||||
|
|
||||||
|
is-regex@^1.0.3:
|
||||||
|
version "1.0.3"
|
||||||
|
resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.3.tgz#0d55182bddf9f2fde278220aec3a75642c908637"
|
||||||
|
|
||||||
is-resolvable@^1.0.0:
|
is-resolvable@^1.0.0:
|
||||||
version "1.0.0"
|
version "1.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/is-resolvable/-/is-resolvable-1.0.0.tgz#8df57c61ea2e3c501408d100fb013cf8d6e0cc62"
|
resolved "https://registry.yarnpkg.com/is-resolvable/-/is-resolvable-1.0.0.tgz#8df57c61ea2e3c501408d100fb013cf8d6e0cc62"
|
||||||
dependencies:
|
dependencies:
|
||||||
tryit "^1.0.1"
|
tryit "^1.0.1"
|
||||||
|
|
||||||
|
is-symbol@^1.0.1:
|
||||||
|
version "1.0.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.1.tgz#3cc59f00025194b6ab2e38dbae6689256b660572"
|
||||||
|
|
||||||
is-typedarray@~1.0.0:
|
is-typedarray@~1.0.0:
|
||||||
version "1.0.0"
|
version "1.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a"
|
resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a"
|
||||||
@ -1897,9 +2037,9 @@ js-base64@^2.1.9:
|
|||||||
version "2.1.9"
|
version "2.1.9"
|
||||||
resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-2.1.9.tgz#f0e80ae039a4bd654b5f281fc93f04a914a7fcce"
|
resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-2.1.9.tgz#f0e80ae039a4bd654b5f281fc93f04a914a7fcce"
|
||||||
|
|
||||||
js-tokens@^2.0.0:
|
js-tokens@^3.0.0:
|
||||||
version "2.0.0"
|
version "3.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-2.0.0.tgz#79903f5563ee778cc1162e6dcf1a0027c97f9cb5"
|
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.0.tgz#a2f2a969caae142fb3cd56228358c89366957bd1"
|
||||||
|
|
||||||
js-yaml@^3.4.6, js-yaml@^3.5.1, js-yaml@^3.5.4, js-yaml@~3.5.2:
|
js-yaml@^3.4.6, js-yaml@^3.5.1, js-yaml@^3.5.4, js-yaml@~3.5.2:
|
||||||
version "3.5.5"
|
version "3.5.5"
|
||||||
@ -1952,6 +2092,13 @@ jsprim@^1.2.2:
|
|||||||
json-schema "0.2.3"
|
json-schema "0.2.3"
|
||||||
verror "1.3.6"
|
verror "1.3.6"
|
||||||
|
|
||||||
|
jsx-ast-utils@^1.3.4:
|
||||||
|
version "1.3.5"
|
||||||
|
resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-1.3.5.tgz#9ba6297198d9f754594d62e59496ffb923778dd4"
|
||||||
|
dependencies:
|
||||||
|
acorn-jsx "^3.0.1"
|
||||||
|
object-assign "^4.1.0"
|
||||||
|
|
||||||
kind-of@^3.0.2:
|
kind-of@^3.0.2:
|
||||||
version "3.1.0"
|
version "3.1.0"
|
||||||
resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.1.0.tgz#475d698a5e49ff5e53d14e3e732429dc8bf4cf47"
|
resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.1.0.tgz#475d698a5e49ff5e53d14e3e732429dc8bf4cf47"
|
||||||
@ -2058,7 +2205,7 @@ lodash._getnative@^3.0.0:
|
|||||||
version "3.9.1"
|
version "3.9.1"
|
||||||
resolved "https://registry.yarnpkg.com/lodash._getnative/-/lodash._getnative-3.9.1.tgz#570bc7dede46d61cdcde687d65d3eecbaa3aaff5"
|
resolved "https://registry.yarnpkg.com/lodash._getnative/-/lodash._getnative-3.9.1.tgz#570bc7dede46d61cdcde687d65d3eecbaa3aaff5"
|
||||||
|
|
||||||
lodash.assign@^4.0.3, lodash.assign@^4.0.6, lodash.assign@^4.2.0:
|
lodash.assign@^4.0.0, lodash.assign@^4.0.3, lodash.assign@^4.0.6, lodash.assign@^4.2.0:
|
||||||
version "4.2.0"
|
version "4.2.0"
|
||||||
resolved "https://registry.yarnpkg.com/lodash.assign/-/lodash.assign-4.2.0.tgz#0d99f3ccd7a6d261d19bdaeb9245005d285808e7"
|
resolved "https://registry.yarnpkg.com/lodash.assign/-/lodash.assign-4.2.0.tgz#0d99f3ccd7a6d261d19bdaeb9245005d285808e7"
|
||||||
|
|
||||||
@ -2105,6 +2252,10 @@ lodash.mergewith@^4.6.0:
|
|||||||
version "4.6.0"
|
version "4.6.0"
|
||||||
resolved "https://registry.yarnpkg.com/lodash.mergewith/-/lodash.mergewith-4.6.0.tgz#150cf0a16791f5903b8891eab154609274bdea55"
|
resolved "https://registry.yarnpkg.com/lodash.mergewith/-/lodash.mergewith-4.6.0.tgz#150cf0a16791f5903b8891eab154609274bdea55"
|
||||||
|
|
||||||
|
lodash.pickby@^4.0.0:
|
||||||
|
version "4.6.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/lodash.pickby/-/lodash.pickby-4.6.0.tgz#7dea21d8c18d7703a27c704c15d3b84a67e33aff"
|
||||||
|
|
||||||
lodash@2.2.1:
|
lodash@2.2.1:
|
||||||
version "2.2.1"
|
version "2.2.1"
|
||||||
resolved "https://registry.yarnpkg.com/lodash/-/lodash-2.2.1.tgz#ca935fd14ab3c0c872abacf198b9cda501440867"
|
resolved "https://registry.yarnpkg.com/lodash/-/lodash-2.2.1.tgz#ca935fd14ab3c0c872abacf198b9cda501440867"
|
||||||
@ -2113,18 +2264,28 @@ lodash@^3.10.1, lodash@~3.10.1:
|
|||||||
version "3.10.1"
|
version "3.10.1"
|
||||||
resolved "https://registry.yarnpkg.com/lodash/-/lodash-3.10.1.tgz#5bf45e8e49ba4189e17d482789dfd15bd140b7b6"
|
resolved "https://registry.yarnpkg.com/lodash/-/lodash-3.10.1.tgz#5bf45e8e49ba4189e17d482789dfd15bd140b7b6"
|
||||||
|
|
||||||
lodash@^4.0.0, lodash@^4.3.0, lodash@~4.3.0:
|
lodash@^4.0.0, lodash@^4.2.0, lodash@^4.3.0:
|
||||||
version "4.3.0"
|
version "4.17.4"
|
||||||
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.3.0.tgz#efd9c4a6ec53f3b05412429915c3e4824e4d25a4"
|
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae"
|
||||||
|
|
||||||
lodash@~4.16.4:
|
lodash@~4.16.4:
|
||||||
version "4.16.6"
|
version "4.16.6"
|
||||||
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.16.6.tgz#d22c9ac660288f3843e16ba7d2b5d06cca27d777"
|
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.16.6.tgz#d22c9ac660288f3843e16ba7d2b5d06cca27d777"
|
||||||
|
|
||||||
|
lodash@~4.3.0:
|
||||||
|
version "4.3.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.3.0.tgz#efd9c4a6ec53f3b05412429915c3e4824e4d25a4"
|
||||||
|
|
||||||
longest@^1.0.1:
|
longest@^1.0.1:
|
||||||
version "1.0.1"
|
version "1.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097"
|
resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097"
|
||||||
|
|
||||||
|
loose-envify@^1.0.0:
|
||||||
|
version "1.3.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848"
|
||||||
|
dependencies:
|
||||||
|
js-tokens "^3.0.0"
|
||||||
|
|
||||||
loud-rejection@^1.0.0:
|
loud-rejection@^1.0.0:
|
||||||
version "1.6.0"
|
version "1.6.0"
|
||||||
resolved "https://registry.yarnpkg.com/loud-rejection/-/loud-rejection-1.6.0.tgz#5b46f80147edee578870f086d04821cf998e551f"
|
resolved "https://registry.yarnpkg.com/loud-rejection/-/loud-rejection-1.6.0.tgz#5b46f80147edee578870f086d04821cf998e551f"
|
||||||
@ -2267,8 +2428,8 @@ mute-stream@0.0.5:
|
|||||||
resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.5.tgz#8fbfabb0a98a253d3184331f9e8deb7372fac6c0"
|
resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.5.tgz#8fbfabb0a98a253d3184331f9e8deb7372fac6c0"
|
||||||
|
|
||||||
nan@^2.3.0, nan@^2.3.2:
|
nan@^2.3.0, nan@^2.3.2:
|
||||||
version "2.5.0"
|
version "2.5.1"
|
||||||
resolved "https://registry.yarnpkg.com/nan/-/nan-2.5.0.tgz#aa8f1e34531d807e9e27755b234b4a6ec0c152a8"
|
resolved "https://registry.yarnpkg.com/nan/-/nan-2.5.1.tgz#d5b01691253326a97a2bbee9e61c55d8d60351e2"
|
||||||
|
|
||||||
natural-compare@^1.4.0:
|
natural-compare@^1.4.0:
|
||||||
version "1.4.0"
|
version "1.4.0"
|
||||||
@ -2327,8 +2488,8 @@ node-pre-gyp@^0.6.29:
|
|||||||
tar-pack "~3.3.0"
|
tar-pack "~3.3.0"
|
||||||
|
|
||||||
node-sass@^4.0.0:
|
node-sass@^4.0.0:
|
||||||
version "4.3.0"
|
version "4.4.0"
|
||||||
resolved "https://registry.yarnpkg.com/node-sass/-/node-sass-4.3.0.tgz#d014f64595d77b26af99e9f7a7e74704d9976bda"
|
resolved "https://registry.yarnpkg.com/node-sass/-/node-sass-4.4.0.tgz#ff08ff2fded2a1d0bee270e8ed1275f7bc9c5a16"
|
||||||
dependencies:
|
dependencies:
|
||||||
async-foreach "^0.1.3"
|
async-foreach "^0.1.3"
|
||||||
chalk "^1.1.1"
|
chalk "^1.1.1"
|
||||||
@ -2409,6 +2570,10 @@ object-component@0.0.3:
|
|||||||
version "0.0.3"
|
version "0.0.3"
|
||||||
resolved "https://registry.yarnpkg.com/object-component/-/object-component-0.0.3.tgz#f0c69aa50efc95b866c186f400a33769cb2f1291"
|
resolved "https://registry.yarnpkg.com/object-component/-/object-component-0.0.3.tgz#f0c69aa50efc95b866c186f400a33769cb2f1291"
|
||||||
|
|
||||||
|
object-keys@^1.0.8:
|
||||||
|
version "1.0.11"
|
||||||
|
resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.11.tgz#c54601778ad560f1142ce0e01bcca8b56d13426d"
|
||||||
|
|
||||||
object-path@^0.9.0:
|
object-path@^0.9.0:
|
||||||
version "0.9.2"
|
version "0.9.2"
|
||||||
resolved "https://registry.yarnpkg.com/object-path/-/object-path-0.9.2.tgz#0fd9a74fc5fad1ae3968b586bda5c632bd6c05a5"
|
resolved "https://registry.yarnpkg.com/object-path/-/object-path-0.9.2.tgz#0fd9a74fc5fad1ae3968b586bda5c632bd6c05a5"
|
||||||
@ -2589,14 +2754,14 @@ postcss-value-parser@^3.2.3:
|
|||||||
version "3.3.0"
|
version "3.3.0"
|
||||||
resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-3.3.0.tgz#87f38f9f18f774a4ab4c8a232f5c5ce8872a9d15"
|
resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-3.3.0.tgz#87f38f9f18f774a4ab4c8a232f5c5ce8872a9d15"
|
||||||
|
|
||||||
postcss@^5.0.0, postcss@^5.2.8:
|
postcss@^5.0.0, postcss@^5.2.11:
|
||||||
version "5.2.10"
|
version "5.2.11"
|
||||||
resolved "https://registry.yarnpkg.com/postcss/-/postcss-5.2.10.tgz#b58b64e04f66f838b7bc7cb41f7dac168568a945"
|
resolved "https://registry.yarnpkg.com/postcss/-/postcss-5.2.11.tgz#ff29bcd6d2efb98bfe08a022055ec599bbe7b761"
|
||||||
dependencies:
|
dependencies:
|
||||||
chalk "^1.1.3"
|
chalk "^1.1.3"
|
||||||
js-base64 "^2.1.9"
|
js-base64 "^2.1.9"
|
||||||
source-map "^0.5.6"
|
source-map "^0.5.6"
|
||||||
supports-color "^3.1.2"
|
supports-color "^3.2.3"
|
||||||
|
|
||||||
prelude-ls@~1.1.2:
|
prelude-ls@~1.1.2:
|
||||||
version "1.1.2"
|
version "1.1.2"
|
||||||
@ -2755,6 +2920,10 @@ redent@^1.0.0:
|
|||||||
indent-string "^2.1.0"
|
indent-string "^2.1.0"
|
||||||
strip-indent "^1.0.1"
|
strip-indent "^1.0.1"
|
||||||
|
|
||||||
|
regenerator-runtime@^0.10.0:
|
||||||
|
version "0.10.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.1.tgz#257f41961ce44558b18f7814af48c17559f9faeb"
|
||||||
|
|
||||||
regex-cache@^0.4.2:
|
regex-cache@^0.4.2:
|
||||||
version "0.4.3"
|
version "0.4.3"
|
||||||
resolved "https://registry.yarnpkg.com/regex-cache/-/regex-cache-0.4.3.tgz#9b1a6c35d4d0dfcef5711ae651e8e9d3d7114145"
|
resolved "https://registry.yarnpkg.com/regex-cache/-/regex-cache-0.4.3.tgz#9b1a6c35d4d0dfcef5711ae651e8e9d3d7114145"
|
||||||
@ -3181,6 +3350,10 @@ strip-indent@^1.0.1:
|
|||||||
dependencies:
|
dependencies:
|
||||||
get-stdin "^4.0.1"
|
get-stdin "^4.0.1"
|
||||||
|
|
||||||
|
strip-json-comments@1.0.2:
|
||||||
|
version "1.0.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-1.0.2.tgz#5a48ab96023dbac1b7b8d0ffabf6f63f1677be9f"
|
||||||
|
|
||||||
strip-json-comments@~1.0.1, strip-json-comments@~1.0.4:
|
strip-json-comments@~1.0.1, strip-json-comments@~1.0.4:
|
||||||
version "1.0.4"
|
version "1.0.4"
|
||||||
resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-1.0.4.tgz#1e15fbcac97d3ee99bf2d73b4c656b082bbafb91"
|
resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-1.0.4.tgz#1e15fbcac97d3ee99bf2d73b4c656b082bbafb91"
|
||||||
@ -3197,7 +3370,7 @@ supports-color@^2.0.0:
|
|||||||
version "2.0.0"
|
version "2.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7"
|
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7"
|
||||||
|
|
||||||
supports-color@^3.1.2:
|
supports-color@^3.2.3:
|
||||||
version "3.2.3"
|
version "3.2.3"
|
||||||
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.2.3.tgz#65ac0504b3954171d8a64946b2ae3cbb8a5f54f6"
|
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.2.3.tgz#65ac0504b3954171d8a64946b2ae3cbb8a5f54f6"
|
||||||
dependencies:
|
dependencies:
|
||||||
@ -3273,6 +3446,10 @@ to-array@0.1.4:
|
|||||||
version "0.1.4"
|
version "0.1.4"
|
||||||
resolved "https://registry.yarnpkg.com/to-array/-/to-array-0.1.4.tgz#17e6c11f73dd4f3d74cda7a4ff3238e9ad9bf890"
|
resolved "https://registry.yarnpkg.com/to-array/-/to-array-0.1.4.tgz#17e6c11f73dd4f3d74cda7a4ff3238e9ad9bf890"
|
||||||
|
|
||||||
|
to-fast-properties@^1.0.1:
|
||||||
|
version "1.0.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.2.tgz#f3f5c0c3ba7299a7ef99427e44633257ade43320"
|
||||||
|
|
||||||
tough-cookie@~2.3.0:
|
tough-cookie@~2.3.0:
|
||||||
version "2.3.2"
|
version "2.3.2"
|
||||||
resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.2.tgz#f081f76e4c85720e6c37a5faced737150d84072a"
|
resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.2.tgz#f081f76e4c85720e6c37a5faced737150d84072a"
|
||||||
|
Loading…
Reference in New Issue
Block a user