diff options
author | Nicolai Tellefsen <niccofyren@gmail.com> | 2016-03-23 23:41:36 +0100 |
---|---|---|
committer | Nicolai Tellefsen <niccofyren@gmail.com> | 2016-03-23 23:41:36 +0100 |
commit | a3e395b281406b233a7dc949cefb8878971d8b7d (patch) | |
tree | a37096713f735fd1bfb097cd9cfd6efa61581881 /web/nms.gathering.org/js/nms-info-box.js | |
parent | e3349dd677fefd15c9678ce0f4bd0d651f9880ba (diff) |
NMS: Add SSH-button to switchInfo window
Diffstat (limited to 'web/nms.gathering.org/js/nms-info-box.js')
-rw-r--r-- | web/nms.gathering.org/js/nms-info-box.js | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/web/nms.gathering.org/js/nms-info-box.js b/web/nms.gathering.org/js/nms-info-box.js index 0481420..838ebb8 100644 --- a/web/nms.gathering.org/js/nms-info-box.js +++ b/web/nms.gathering.org/js/nms-info-box.js @@ -209,7 +209,16 @@ nmsInfoBox._windowTypes.switchInfo = { } }, getTitle: function() { - return '<h4>' + this.sw + '</h4><button type="button" class="edit btn btn-xs btn-warning" onclick="nmsInfoBox._windowTypes.switchInfo.showEdit(\'' + this.sw + '\');">Edit</button> <button type="button" class="comments btn btn-xs btn-default" onclick="nmsInfoBox._windowTypes.switchInfo.showComments(\'' + this.sw + '\');">Comments</button> <button type="button" class="edit btn btn-xs btn-default" onclick="nmsInfoBox._windowTypes.switchInfo.showSNMP(\'ports\');">Ports</button> <button type="button" class="edit btn btn-xs btn-default" onclick="nmsInfoBox._windowTypes.switchInfo.showSNMP(\'misc\');">Misc</button>'; + var sshButton = ''; + try { + sshButton = nmsInfoBox._window.swm.mgmt_v4_addr; + } catch(e) { + console.log(e); + } + if(sshButton != null && sshButton != undefined && sshButton != '') { + sshButton = ' <button type="button" class="ssh btn btn-xs btn-default"><a href="ssh://' + sshButton + '">SSH</a></button>'; + } + return '<h4>' + this.sw + '</h4><button type="button" class="edit btn btn-xs btn-warning" onclick="nmsInfoBox._windowTypes.switchInfo.showEdit(\'' + this.sw + '\');">Edit</button> <button type="button" class="comments btn btn-xs btn-default" onclick="nmsInfoBox._windowTypes.switchInfo.showComments(\'' + this.sw + '\');">Comments</button> <button type="button" class="edit btn btn-xs btn-default" onclick="nmsInfoBox._windowTypes.switchInfo.showSNMP(\'ports\');">Ports</button> <button type="button" class="edit btn btn-xs btn-default" onclick="nmsInfoBox._windowTypes.switchInfo.showSNMP(\'misc\');">Misc</button>' + sshButton; }, getContent: function() { return this.content; |