Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
74b551c250 | ||
|
|
f034fa4105 | ||
|
|
d0f9a45e8d | ||
|
|
8fb29fa607 | ||
|
|
b50215f620 |
+11
-6
@@ -186,13 +186,9 @@ exports.routes = async function(nwid, route, action) {
|
||||
|
||||
const network = await network_detail(nwid);
|
||||
let routes = network.routes;
|
||||
const target6 = new ipaddr.Address6(route.target);
|
||||
if (target6.isValid()) {
|
||||
const parts = route.target.split('/');
|
||||
route.target = target6.canonicalForm() + '/' + parts[1];
|
||||
}
|
||||
route.target = canonicalTarget(route.target);
|
||||
|
||||
const route_to_del = routes.find(rt => rt.target === route.target);
|
||||
const route_to_del = routes.find(rt => canonicalTarget(rt.target) === route.target);
|
||||
|
||||
if (!route_to_del) {
|
||||
if (action === 'add') {
|
||||
@@ -220,6 +216,15 @@ exports.routes = async function(nwid, route, action) {
|
||||
}
|
||||
}
|
||||
|
||||
function canonicalTarget(target) {
|
||||
const target6 = new ipaddr.Address6(target);
|
||||
if (target6.isValid()) {
|
||||
const parts = target.split('/');
|
||||
return target6.canonicalForm() + '/' + parts[1];
|
||||
}
|
||||
return target;
|
||||
}
|
||||
|
||||
exports.network_object = async function(nwid, object) {
|
||||
const options = await init_options();
|
||||
options.method = 'POST';
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ztncui",
|
||||
"version": "0.8.4",
|
||||
"version": "0.8.7",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"start": "node ./bin/www",
|
||||
@@ -19,7 +19,7 @@
|
||||
"got": "^7.1.0",
|
||||
"helmet": "^3.23.0",
|
||||
"ip-address": "^5.8.9",
|
||||
"jquery": "~3.4.1",
|
||||
"jquery": "~3.6.0",
|
||||
"morgan": "~1.9.1",
|
||||
"node-persist": "^2.1.0",
|
||||
"pug": "^3.0.2",
|
||||
|
||||
@@ -121,7 +121,7 @@ block net_content
|
||||
a(href=nwurl + '/member/' + member.id + '/ipAssignments')
|
||||
| IP assignment
|
||||
td
|
||||
if (peer && peer.latency != -1 && peer.versionMajor != -1)
|
||||
if (peer && (peer.latency != -1 || peer.versionMajor != -1))
|
||||
if (peer.latency != -1)
|
||||
span(style='color: green;')
|
||||
| ONLINE (v#{peer.version})
|
||||
|
||||
Reference in New Issue
Block a user