From fd5139ed9b56b3122d73d397482ecd6fd8ffbe26 Mon Sep 17 00:00:00 2001 From: Kristian Lyngstol Date: Wed, 18 May 2016 20:25:35 +0200 Subject: Remove comments from code in place of oplogs --- web/js/nms.js | 64 ----------------------------------------------------------- 1 file changed, 64 deletions(-) (limited to 'web/js/nms.js') diff --git a/web/js/nms.js b/web/js/nms.js index 8eb1f3d..b979a32 100644 --- a/web/js/nms.js +++ b/web/js/nms.js @@ -440,66 +440,6 @@ function toggleConnect() { toggleLayer("linkCanvas"); } -function commentInactive(id) -{ - commentChange(id,"inactive"); -} - -function commentPersist(id) -{ - commentChange(id,"persist"); -} - -function commentDelete(id) -{ - var r = confirm("Really delete comment? (Delted comments are still stored in the database, but never displayed)"); - if (r == true) { - commentChange(id,"delete"); - } -} - -/* - * FIXME: Neither of these two handle failures in any way, shape or form. - * Nor do they really give user-feedback. They work, but only by magic. - */ -function commentChange(id,state) -{ - var myData = { - comment:id, - state:state - }; - myData = JSON.stringify(myData); - $.ajax({ - type: "POST", - url: "/api/write/comment-change", - dataType: "text", - data:myData, - success: function (data, textStatus, jqXHR) { - nmsData.invalidate("comments"); - } - }); -} - -function addComment(sw,comment) -{ - var myData = { - switch:sw, - comment:comment - }; - myData = JSON.stringify(myData); - $.ajax({ - type: "POST", - url: "/api/write/comment-add", - dataType: "text", - data:myData, - success: function (data, textStatus, jqXHR) { - nmsData.invalidate("comments"); - } - }); -} - - - /* * Returns true if the coordinates (x,y) is inside the box defined by * box.{x,y,w.h} (e.g.: placement of a switch). @@ -610,7 +550,6 @@ function initNMS() { if (!nms._public) { // Private nmsData.registerSource("snmp","/api/read/snmp"); - nmsData.registerSource("comments", "/api/read/comments"); nmsData.registerSource("smanagement","/api/read/switches-management"); nmsData.registerSource("oplog", "/api/read/oplog"); nmsOplog.init(); @@ -684,9 +623,6 @@ function setMapModeFromN(e,key) case '3': setUpdater(handler_dhcp); break; - case '4': - setUpdater(handler_comment); - break; case '5': setUpdater(handler_temp); break; -- cgit v1.2.3