From 40ebbe2e0236b4cf3d5c91a7b21e286728800325 Mon Sep 17 00:00:00 2001 From: Kristian Lyngstol Date: Wed, 9 Jan 2019 01:42:35 +0100 Subject: Move switch-editing further away from nms-info-box Still needs to be tidied up, but we're getting there. --- web/js/nms-info-box.js | 42 ------------------------------------------ 1 file changed, 42 deletions(-) (limited to 'web/js/nms-info-box.js') diff --git a/web/js/nms-info-box.js b/web/js/nms-info-box.js index 0d18930..d364f8b 100644 --- a/web/js/nms-info-box.js +++ b/web/js/nms-info-box.js @@ -980,48 +980,6 @@ var switchEditPanel = function () { this.refresh = function (reason) { if (this.box) { return; } this.box = new nmsModSwitch(this.sw); - var save = new nmsButton("Save","btn-primary"); - save.panel = this; - save.html.onclick = function(e) { - var diff = this.nmsBox.panel.box.diff() - console.log(diff) - - if (diff != undefined) { - $.ajax({ - type: "POST", - url: "/api/write/switches", - dataType: "text", - data:JSON.stringify([diff]), - success: function (data, textStatus, jqXHR) { - var result = JSON.parse(data); - console.log("hei...") - nmsData.invalidate("switches"); - nmsData.invalidate("smanagement"); - } - }); - } - } - this.box.add(save) - var del = new nmsButton("Delete","btn btn-danger"); - del.panel = this - del.html.onclick = function(e) { - if(confirm("This will delete the switch: " + this.nmsBox.panel.sw)) { - var myData = [{'sysname': this.nmsBox.panel.sw, 'deleted': true}]; - myData = JSON.stringify(myData); - $.ajax({ - type: "POST", - url: "/api/write/switches", - dataType: "text", - data:myData, - success: function (data, textStatus, jqXHR) { - nmsInfoBox.hide(); - nmsData.invalidate("switches"); - nmsData.invalidate("smanagement"); - } - }); - }; - } - this.box.add(del) this.box.attach(this.me) this.box.show() }; -- cgit v1.2.3