aboutsummaryrefslogtreecommitdiffstats
path: root/web/js
diff options
context:
space:
mode:
Diffstat (limited to 'web/js')
-rw-r--r--web/js/nms-admin-pane.js19
-rw-r--r--web/js/nms-map.js2
2 files changed, 20 insertions, 1 deletions
diff --git a/web/js/nms-admin-pane.js b/web/js/nms-admin-pane.js
index 9edf9f9..235da8d 100644
--- a/web/js/nms-admin-pane.js
+++ b/web/js/nms-admin-pane.js
@@ -78,3 +78,22 @@ nmsAdmin.updateConfigPane = function() {
}
}
}
+
+nmsAdmin.addLinknet = function() {
+ var myData = {
+ "switch1": document.getElementById("admin-input-linknet1").value,
+ "switch2": document.getElementById("admin-input-linknet2").value
+ };
+ myData = JSON.stringify(myData);
+ $.ajax({
+ type: "POST",
+ url: "/api/write/linknet-add",
+ dataType: "text",
+ data:myData,
+ success: function (data, textStatus, jqXHR) {
+ nmsData.invalidate("switches");
+ document.getElementById("admin-input-linknet1").value = "";
+ document.getElementById("admin-input-linknet2").value = "";
+ }
+ });
+}
diff --git a/web/js/nms-map.js b/web/js/nms-map.js
index 224b3db..94e0173 100644
--- a/web/js/nms-map.js
+++ b/web/js/nms-map.js
@@ -408,7 +408,7 @@ nmsMap._drawBox = function(ctx, x, y, boxw, boxh) {
};
nmsMap._connectSwitches = function(sw1, sw2, color1, color2) {
- nmsMap._connectBoxes(this._getBox(sw1), this._getBox(sw2),
+ nmsMap._connectBoxes(nmsMap._getBox(sw1), nmsMap._getBox(sw2),
color1, color2);
};