diff options
author | Kristian Lyngstol <kly@kly@.no> | 2016-03-22 13:04:37 +0100 |
---|---|---|
committer | Kristian Lyngstol <kly@kly@.no> | 2016-03-22 13:04:37 +0100 |
commit | a8f122dfef27846895805df4db0fd1efb2f715ee (patch) | |
tree | c55add30097e26d38fcf0f2d56c4667c5be578d1 /web/nms.gathering.org/js/nms-info-box.js | |
parent | ef480bf237b88e667ff525a1dfb881cb8bd7cf0a (diff) | |
parent | 490560f31c20dd8191ee1a0f8f6e90b2820d7c77 (diff) |
Merge branch 'master' of github.com:tech-server/tgmanage
Diffstat (limited to 'web/nms.gathering.org/js/nms-info-box.js')
-rw-r--r-- | web/nms.gathering.org/js/nms-info-box.js | 43 |
1 files changed, 20 insertions, 23 deletions
diff --git a/web/nms.gathering.org/js/nms-info-box.js b/web/nms.gathering.org/js/nms-info-box.js index e3956d8..b6b9d7e 100644 --- a/web/nms.gathering.org/js/nms-info-box.js +++ b/web/nms.gathering.org/js/nms-info-box.js @@ -15,8 +15,8 @@ var nmsInfoBox = nmsInfoBox || { stats: {}, _container: false, //Container window _window: false, //Active window (reference to _windowTypes object or false) - _windowTypes: [], //List of all avaliable window types -} + _windowTypes: [] //List of all avaliable window types +}; /* * Shows a window from the _windowTypes list @@ -34,7 +34,7 @@ nmsInfoBox.showWindow = function (windowName,argument) { return; } } -} +}; /* * Refresh the active window @@ -44,7 +44,7 @@ nmsInfoBox.showWindow = function (windowName,argument) { */ nmsInfoBox.refresh = function() { nmsInfoBox._show(); -} +}; /* * Internal function to show the active _window and pass along any arguments @@ -84,7 +84,7 @@ nmsInfoBox._show = function(argument) { } this._container.appendChild(panel); this._container.style.display = "block"; -} +}; /* * Hide the active window and tell it to unload @@ -99,7 +99,7 @@ nmsInfoBox.hide = function() { nmsData.unregisterHandler("switches","switchshower"); nmsData.unregisterHandler("smanagement","switchshower"); nmsData.unregisterHandler("snmp","switchshower"); -} +}; /* * Window type: Add Switch @@ -134,7 +134,7 @@ nmsInfoBox._windowTypes.addSwitch = { data:myData, success: function (data, textStatus, jqXHR) { var result = JSON.parse(data); - if(result.switches_addded.length > 0) { + if(result.switches_addded.length > 0) { // FIXME unresolved variable switches_addded nmsInfoBox.hide(); } nmsData.invalidate("switches"); @@ -230,9 +230,10 @@ nmsInfoBox._windowTypes.switchInfo = { var template = {}; nmsInfoBox._editValues = {}; + var place; for (var v in this.swi) { if (v == "placement") { - var place = JSON.stringify(this.swi[v]); + place = JSON.stringify(this.swi[v]); template[v] = place; continue; } @@ -320,7 +321,7 @@ nmsInfoBox.click = function(sw) { this.showWindow("switchInfo",sw); this._windowTypes.switchInfo.showComments(); -} +}; /* * General-purpose table-maker? @@ -350,7 +351,7 @@ nmsInfoBox._makeTable = function(content, caption) { td2.innerHTML = content[v][1]; } return table; -} +}; /* * Create and return a table for comments. @@ -393,7 +394,7 @@ nmsInfoBox._makeCommentTable = function(content) { td2.innerHTML = comment["comment"]; } return table; -} +}; nmsInfoBox._searchSmart = function(id, sw) { try { @@ -438,7 +439,7 @@ nmsInfoBox._searchSmart = function(id, sw) { return false; } return false; -} +}; /* * FIXME: Not sure this belongs here, it's really part of the "Core" ui, @@ -474,7 +475,7 @@ nmsInfoBox._search = function() { document.getElementById("searchbox-submit").classList.remove("btn-primary"); document.getElementById("searchbox").dataset.match = ''; } -} +}; nmsInfoBox._searchKeyListener = function(e) { switch (e.keyCode) { @@ -492,14 +493,14 @@ nmsInfoBox._searchKeyListener = function(e) { nmsInfoBox.hide(); break; } -} +}; nmsInfoBox._nullBlank = function(x) { if (x == null || x == false || x == undefined) return ""; return x; -} +}; nmsInfoBox._editChange = function(sw, v) { @@ -520,13 +521,9 @@ nmsInfoBox._editChange = function(sw, v) { var myData = nmsInfoBox._editStringify(sw); var out = document.getElementById("edit-output"); out.value = myData; -} +}; nmsInfoBox._editStringify = function(sw) { - for (var key in nmsInfoBox._editValues) { - var val = nmsInfoBox._editValues[key]; - } - nmsInfoBox._editValues['sysname'] = sw; - var myData = JSON.stringify([nmsInfoBox._editValues]); - return myData; -} + nmsInfoBox._editValues['sysname'] = sw; + return JSON.stringify([nmsInfoBox._editValues]); +}; |