diff options
-rw-r--r-- | web/nms.gathering.org/index.html | 12 | ||||
-rw-r--r-- | web/nms.gathering.org/js/nms-info-box.js | 28 |
2 files changed, 30 insertions, 10 deletions
diff --git a/web/nms.gathering.org/index.html b/web/nms.gathering.org/index.html index f770df0..3452b9a 100644 --- a/web/nms.gathering.org/index.html +++ b/web/nms.gathering.org/index.html @@ -221,15 +221,9 @@ </div> </div> </div> - <div style="position: absolute; z-index: 120;" class="col-md-4"> - <div id="info-switch-parent" class="panel panel-default col-d-6" style="display: none; backgroun:silver; position: absolute; z-index: 120;"> - <div class="panel-heading"> - <h3 class="panel-title" id="info-switch-title"></h3> - </div> - <div id="info-switch-panel-body"> - <table class="table" id="info-switch-table"></table> - </div> - </div> + <div id="info-switch-parent" class="panel panel-default col-md-5" style="display: none; position: absolute; z-index: 120;"> + <div class="panel-heading"> <h3 class="panel-title" id="info-switch-title"></h3> </div> + <div id="info-switch-panel-body"> <table class="table" id="info-switch-table"></table> </div> </div> </div> diff --git a/web/nms.gathering.org/js/nms-info-box.js b/web/nms.gathering.org/js/nms-info-box.js index 58beea5..b559ba2 100644 --- a/web/nms.gathering.org/js/nms-info-box.js +++ b/web/nms.gathering.org/js/nms-info-box.js @@ -64,6 +64,7 @@ nmsInfoBox._hide = function() swtop.style.display = 'none'; nmsInfoBox._showing = ""; nmsInfoBox._editHide(); + nmsInfoBox._snmpHide(); } /* @@ -173,6 +174,25 @@ nmsInfoBox._search = function() { } } +nmsInfoBox._snmp = function(x,tree) +{ + + nmsInfoBox._snmpHide(); + var container = document.createElement("div"); + container.id = "nmsInfoBox-snmp-show"; + + var swtop = document.getElementById("info-switch-parent"); + var output = document.createElement("output"); + output.id = "edit-output"; + output.style = "white-space: pre;"; + try { + output.value = JSON.stringify(nmsData.snmp.snmp[x][tree],null,4); + } catch(e) { + output.value = "(no recent data (yet)?)"; + } + container.appendChild(output); + swtop.appendChild(container); +} /* * Display info on switch "x" in the info-box * @@ -191,7 +211,7 @@ nmsInfoBox._show = function(x) nmsInfoBox._hide(); nmsInfoBox._showing = x; - swtitle.innerHTML = ' <button type="button" class="edit btn btn-xs btn-warning" onclick="nmsInfoBox._edit(\'' + x + '\');">Edit</button> ' + x + ' <button type="button" class="close" aria-label="Close" onclick="nmsInfoBox.hide();" style="float: right;"><span aria-hidden="true">×</span></button>'; + swtitle.innerHTML = ' <button type="button" class="edit btn btn-xs btn-warning" onclick="nmsInfoBox._edit(\'' + x + '\');">Edit</button> <button type="button" class="edit btn btn-xs btn-default" onclick="nmsInfoBox._snmp(\'' + x + '\',\'ports\');">Ports</button> <button type="button" class="edit btn btn-xs btn-default" onclick="nmsInfoBox._snmp(\'' + x + '\',\'misc\');">Misc</button> ' + x + ' <button type="button" class="close" aria-label="Close" onclick="nmsInfoBox.hide();" style="float: right;"><span aria-hidden="true">×</span></button>'; for (var v in sw) { if (v == "placement") { @@ -246,11 +266,17 @@ nmsInfoBox._editHide = function() { if (container != undefined) container.parentNode.removeChild(container); } +nmsInfoBox._snmpHide = function() { + var container = document.getElementById("nmsInfoBox-snmp-show"); + if (container != undefined) + container.parentNode.removeChild(container); +} nmsInfoBox._edit = function(sw) { var template = {}; var place = false; nmsInfoBox._editHide(); + nmsInfoBox._snmpHide(); var container = document.createElement("div"); container.id = "nmsInfoBox-edit-box"; |