diff options
author | Kristian Lyngstol <kly@kly@.no> | 2016-03-22 23:13:02 +0100 |
---|---|---|
committer | Kristian Lyngstol <kly@kly@.no> | 2016-03-22 23:13:02 +0100 |
commit | 068baf7c5de1c4bf3a9b12a5eb8c88057178b19d (patch) | |
tree | 55f7b3e2eeda659fa13f018b436b1b4b684282a9 | |
parent | 3e0ad5edff8cf33493b8b6aab92838c939fe5d69 (diff) | |
parent | 047b729a1e92446a1c5ce68f806b932b79c98642 (diff) |
Merge branch 'master' of github.com:tech-server/tgmanage
-rw-r--r-- | web/nms.gathering.org/js/nms-info-box.js | 6 | ||||
-rw-r--r-- | web/nms.gathering.org/js/nms-map-handlers.js | 14 | ||||
-rw-r--r-- | web/nms.gathering.org/js/nms-map.js | 5 |
3 files changed, 13 insertions, 12 deletions
diff --git a/web/nms.gathering.org/js/nms-info-box.js b/web/nms.gathering.org/js/nms-info-box.js index 0080127..0b90d49 100644 --- a/web/nms.gathering.org/js/nms-info-box.js +++ b/web/nms.gathering.org/js/nms-info-box.js @@ -5,9 +5,7 @@ * * Interface: nmsInfoBox.showWindow(windowType,optionalParameter), nmsInfoBox.hide(), nmsInfoBox.refresh() * - * Any windowTypes should at a minimum implement load, unload, getTitle, getContent, getChildContent - * - * TODO: Implement useful update methods on windowTypes + * Any windowTypes should at a minimum implement load, update, unload, getTitle, getContent, getChildContent * */ @@ -88,6 +86,7 @@ nmsInfoBox._show = function(argument) { } this._container.appendChild(panel); this._container.style.display = "block"; + $('[data-toggle="popover"]').popover({placement:"top",container:'body'}); }; /* @@ -251,7 +250,6 @@ nmsInfoBox._windowTypes.switchInfo = { var commenttable = nmsInfoBox._makeCommentTable(comments); commenttable.id = "info-switch-comments-table"; domObj.appendChild(commenttable); - $(function () { $('[data-toggle="popover"]').popover({placement:"top",continer:'body'}) }) } // We have no data for this switch, but its still correct diff --git a/web/nms.gathering.org/js/nms-map-handlers.js b/web/nms.gathering.org/js/nms-map-handlers.js index 0bec084..dac630a 100644 --- a/web/nms.gathering.org/js/nms-map-handlers.js +++ b/web/nms.gathering.org/js/nms-map-handlers.js @@ -235,15 +235,13 @@ function tempUpdater() continue; var tempObj = nmsData.snmp.snmp[sw]["misc"]["enterprises.2636.3.1.13.1.7.7.1.0.0"]; - Object.keys(tempObj).forEach(function (key) { - if(key == "") { - temp = tempObj[key] + "°C"; - t = temp_color(temp); - } - }); + if(tempObj[""]) { + temp = tempObj[""] + "°C"; + t = temp_color(temp); + nmsMap.setSwitchColor(sw, t); + nmsMap.setSwitchInfo(sw, temp); + } - nmsMap.setSwitchColor(sw, t); - nmsMap.setSwitchInfo(sw, temp); } } diff --git a/web/nms.gathering.org/js/nms-map.js b/web/nms.gathering.org/js/nms-map.js index 1f4d6b7..ada6886 100644 --- a/web/nms.gathering.org/js/nms-map.js +++ b/web/nms.gathering.org/js/nms-map.js @@ -275,6 +275,9 @@ nmsMap._drawSwitch = function(sw) this._drawBox(this._c.switch.ctx, box['x'],box['y'],box['width'],box['height']); this._c.switch.ctx.shadowBlur = 0; this._drawText(this._c.text.ctx, sw,box); + + if(this._info[sw]) + this._drawSwitchInfo(sw); }; nmsMap._drawSwitchInfo = function(sw) { @@ -448,6 +451,8 @@ nmsMap.canvasClick = function(e) } else { nmsInfoBox.click(sw); } + } else { + nmsInfoBox.hide(); } }; |