Author SHA1 Message Date
Key Networks 74b551c250 fix-relay-status: jquery 3.4.1 -> 3.6.0 2022-01-08 13:56:03 +08:00
Key Networks f034fa4105 fix-relay-status: Version bump 2022-01-08 13:49:22 +08:00
lideming d0f9a45e8d fix "relay" status not showing 2022-01-08 00:20:13 +08:00
Key Networks 8fb29fa607 Version bump 2022-01-03 09:46:43 +08:00
lidemingandGitHub b50215f620 fix IPv6 route target comparing (#75) 2022-01-03 09:43:40 +08:00
3 changed files with 14 additions and 9 deletions
+11 -6
View File
@@ -186,13 +186,9 @@ exports.routes = async function(nwid, route, action) {
const network = await network_detail(nwid); const network = await network_detail(nwid);
let routes = network.routes; let routes = network.routes;
const target6 = new ipaddr.Address6(route.target); route.target = canonicalTarget(route.target);
if (target6.isValid()) {
const parts = route.target.split('/');
route.target = target6.canonicalForm() + '/' + parts[1];
}
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 (!route_to_del) {
if (action === 'add') { 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) { exports.network_object = async function(nwid, object) {
const options = await init_options(); const options = await init_options();
options.method = 'POST'; options.method = 'POST';
+2 -2
View File
@@ -1,6 +1,6 @@
{ {
"name": "ztncui", "name": "ztncui",
"version": "0.8.4", "version": "0.8.7",
"private": true, "private": true,
"scripts": { "scripts": {
"start": "node ./bin/www", "start": "node ./bin/www",
@@ -19,7 +19,7 @@
"got": "^7.1.0", "got": "^7.1.0",
"helmet": "^3.23.0", "helmet": "^3.23.0",
"ip-address": "^5.8.9", "ip-address": "^5.8.9",
"jquery": "~3.4.1", "jquery": "~3.6.0",
"morgan": "~1.9.1", "morgan": "~1.9.1",
"node-persist": "^2.1.0", "node-persist": "^2.1.0",
"pug": "^3.0.2", "pug": "^3.0.2",
+1 -1
View File
@@ -121,7 +121,7 @@ block net_content
a(href=nwurl + '/member/' + member.id + '/ipAssignments') a(href=nwurl + '/member/' + member.id + '/ipAssignments')
| IP assignment | IP assignment
td td
if (peer && peer.latency != -1 && peer.versionMajor != -1) if (peer && (peer.latency != -1 || peer.versionMajor != -1))
if (peer.latency != -1) if (peer.latency != -1)
span(style='color: green;') span(style='color: green;')
| ONLINE (v#{peer.version}) | ONLINE (v#{peer.version})