diff options
Diffstat (limited to 'web')
-rw-r--r-- | web/index.html | 2 | ||||
-rw-r--r-- | web/js/nms-info-box.js | 32 | ||||
-rw-r--r-- | web/js/nms-ui.js | 4 |
3 files changed, 38 insertions, 0 deletions
diff --git a/web/index.html b/web/index.html index 48f1e04..9362418 100644 --- a/web/index.html +++ b/web/index.html @@ -126,6 +126,7 @@ <li class="dropdown-header">View</li> <li><a href="#" onclick="toggleNightMode()">Toggle Night Mode</a></li> <li><a href="#" onclick="toggleConnect()">Toggle linknets</a></li> + <li><a href="#" onclick="nmsUi.toggleVertical()">Toggle vertical mode</a></li> <li class="divider"> </li> <li class="gondul-is-private dropdown-header">Switches</li> <li class="gondul-is-private"><a href="#" onclick="nmsMap.moveSet(true);">Enable switch moving</a></li> @@ -145,6 +146,7 @@ <div class="input-group input-group-sm"> <input id="searchbox" type="text" class="form-control" placeholder="Filter" oninput="nmsInfoBox._search()" /> <span class="input-group-btn"> + <button id="searchbox-help" class="btn btn-default" type="button" onclick="nmsInfoBox.showWindow('searchHelp');">?</button> <button id="searchbox-submit" class="btn btn-default" type="button" onclick="nmsInfoBox.showWindow('switchInfo',document.getElementById('searchbox').value);">Go!</button> </span> </div> diff --git a/web/js/nms-info-box.js b/web/js/nms-info-box.js index f4dcb49..b83ddd1 100644 --- a/web/js/nms-info-box.js +++ b/web/js/nms-info-box.js @@ -81,6 +81,16 @@ var nmsInfoBox = nmsInfoBox || { } }, { + 'id': 'searchHelp', + 'title': 'Search help', + 'views': { + 'initial': { + 'name': 'Search help', + 'panels': ['searchHelp'] + } + } + }, + { 'id': 'inventoryListing', 'title': 'Inventory listing', 'views': { @@ -577,6 +587,27 @@ var switchDetailsPanel = function() { }; nmsInfoBox.addPanelType("switchDetails",switchDetailsPanel); +var searchHelpPanel = function() { + nmsInfoPanel.call(this,"searchHelp"); + this.refresh = function(reason) { + var x = document.createElement("div"); + var searchHelp = [ + "The search box can be used to identify switches in several ways. The simplest is by name.", + "If you are using the non-public version of Gondul, you can also perform smart searches.", + "Distro search: Type the name of a distro-switch and all access switches registered to that distro switch will also be hilighted.", + 'Active ports: Type "active>x", "active<x" or "active=x" to identify switch with "x" amount of active gigabit ethernet (ge) ports. E.g.: "active>30".', + 'IP search: Start typing an IP and any switch with that IP registered either as management IP or part of its subnet will be identified', + 'SNMP search: Type anything found in the "sysDescr" SNMP OID to hilight a switch matching that. Practical examples include version numbers for firmware (e.g.: "JUNOS 12." vs "JUNOS 14.").']; + for (var a in searchHelp) { + var c = document.createElement("p"); + c.innerText = searchHelp[a]; + x.appendChild(c); + } + this._render(x); + }; +}; +nmsInfoBox.addPanelType("searchHelp",searchHelpPanel); + /* * Panel type: Add switch * @@ -698,6 +729,7 @@ var inventoryListingPanel = function() { this._render(contentObj); }; }; + nmsInfoBox.addPanelType("inventoryListing",inventoryListingPanel); /* diff --git a/web/js/nms-ui.js b/web/js/nms-ui.js index 411ed2f..48865c4 100644 --- a/web/js/nms-ui.js +++ b/web/js/nms-ui.js @@ -21,3 +21,7 @@ nmsUi.setActive = function(pane) { nmsUi._active = pane; } + +nmsUi.toggleVertical = function(x) { + nms.vertical = !nms.vertical; +} |