diff --git a/README.md b/README.md index 708b07f7..43b797a6 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,10 @@ If there is not data from any of the metrics, you can show the panel as disabled Currently the plugin was tested with **influxDB** and **Graphite**. Support for other data sources could be added by demand ## Release Notes +### Upgrading Tips +When upgrading there might be some changes in the data the plugin uses and saves, so some of the configurations you made might be removed by accident. +To prevent this loss of configuration you should save the panel JSON of all panels you have (by exporting the panel or dashboards) and keep them somewhere safe until you made sure everything is working after the upgrade. + ### Version 1.0.3 * Version (1.0.3) can have some conflicts with older versions. diff --git a/dist/README.md b/dist/README.md index 708b07f7..43b797a6 100644 --- a/dist/README.md +++ b/dist/README.md @@ -60,6 +60,10 @@ If there is not data from any of the metrics, you can show the panel as disabled Currently the plugin was tested with **influxDB** and **Graphite**. Support for other data sources could be added by demand ## Release Notes +### Upgrading Tips +When upgrading there might be some changes in the data the plugin uses and saves, so some of the configurations you made might be removed by accident. +To prevent this loss of configuration you should save the panel JSON of all panels you have (by exporting the panel or dashboards) and keep them somewhere safe until you made sure everything is working after the upgrade. + ### Version 1.0.3 * Version (1.0.3) can have some conflicts with older versions. diff --git a/dist/module.js.map b/dist/module.js.map index b8a3058f..962a6d1c 100644 --- a/dist/module.js.map +++ b/dist/module.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/module.js"],"names":["StatusPluginCtrl"],"mappings":";;;;;;;;AAAQA,sB,gBAAAA,gB;;;2BAGNA,gB","file":"module.js","sourcesContent":["import {StatusPluginCtrl} from './status_ctrl';\r\n\r\nexport {\r\n StatusPluginCtrl as PanelCtrl\r\n};\r\n"]} \ No newline at end of file +{"version":3,"sources":["../src/module.js"],"names":["StatusPluginCtrl"],"mappings":";;;;;;;;AAAQA,sB,gBAAAA,gB;;;2BAGNA,gB","file":"module.js","sourcesContent":["import {StatusPluginCtrl} from './status_ctrl';\n\nexport {\n StatusPluginCtrl as PanelCtrl\n};\n"]} \ No newline at end of file diff --git a/dist/plugin.json b/dist/plugin.json index 63739a08..e654d316 100644 --- a/dist/plugin.json +++ b/dist/plugin.json @@ -23,7 +23,7 @@ {"name": "Warning State", "path": "img/warning.png"}, {"name": "Critical State", "path": "img/error.png"} ], - "version": "1.0.4", + "version": "1.0.5", "updated": "2017-4-27" }, diff --git a/dist/status_ctrl.js b/dist/status_ctrl.js index 29bacd1c..0740e5f3 100644 --- a/dist/status_ctrl.js +++ b/dist/status_ctrl.js @@ -3,7 +3,7 @@ System.register(["app/plugins/sdk", "app/plugins/panel/graph/legend", "app/plugins/panel/graph/series_overrides_ctrl", "lodash", "app/core/time_series2", "app/core/core_module", "app/core/utils/kbn", "moment", "./css/status_panel.css!"], function (_export, _context) { "use strict"; - var MetricsPanelCtrl, _, TimeSeries, coreModule, kbn, moment, _createClass, StatusPluginCtrl; + var MetricsPanelCtrl, _, TimeSeries, coreModule, kbn, moment, _createClass, panelDefaults, StatusPluginCtrl; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { @@ -534,19 +534,21 @@ System.register(["app/plugins/sdk", "app/plugins/panel/graph/legend", "app/plugi var _this6 = this; if (this.panel.maxAlertNumber != null && this.panel.maxAlertNumber >= 0) { - var currentMaxAllowedAlerts = this.panel.maxAlertNumber; - var filteredOutAlerts = 0; - var arrayNamesToSlice = ["disabled", "crit", "warn", "display"]; - arrayNamesToSlice.forEach(function (arrayName) { - var originAlertCount = _this6[arrayName].length; - _this6[arrayName] = _this6[arrayName].slice(0, currentMaxAllowedAlerts); - currentMaxAllowedAlerts = Math.max(currentMaxAllowedAlerts - _this6[arrayName].length, 0); - filteredOutAlerts += originAlertCount - _this6[arrayName].length; - }); - - if (filteredOutAlerts > 0) { - this.extraMoreAlerts = "+ " + filteredOutAlerts + " more"; - } + (function () { + var currentMaxAllowedAlerts = _this6.panel.maxAlertNumber; + var filteredOutAlerts = 0; + var arrayNamesToSlice = ["disabled", "crit", "warn", "display"]; + arrayNamesToSlice.forEach(function (arrayName) { + var originAlertCount = _this6[arrayName].length; + _this6[arrayName] = _this6[arrayName].slice(0, currentMaxAllowedAlerts); + currentMaxAllowedAlerts = Math.max(currentMaxAllowedAlerts - _this6[arrayName].length, 0); + filteredOutAlerts += originAlertCount - _this6[arrayName].length; + }); + + if (filteredOutAlerts > 0) { + _this6.extraMoreAlerts = "+ " + filteredOutAlerts + " more"; + } + })(); } } }, { diff --git a/dist/status_ctrl.js.map b/dist/status_ctrl.js.map index b9aa3ea5..386926c6 100644 --- a/dist/status_ctrl.js.map +++ b/dist/status_ctrl.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/status_ctrl.js"],"names":["MetricsPanelCtrl","_","TimeSeries","coreModule","panelDefaults","flipCard","flipTime","colorMode","colors","crit","warn","ok","disable","isGrayOnNoData","isIgnoreOKColors","isHideAlertsOnDisable","StatusPluginCtrl","$scope","$injector","$log","$filter","annotationsSrv","defaultsDeep","panel","filter","valueHandlers","aggregations","displayTypes","colorModes","events","on","onRender","bind","postRefresh","onDataError","onDataReceived","onInitEditMode","addFilters","numberOrTextFilter","input","angular","isNumber","$stateful","textRegex","length","regex","RegExp","e","matchResults","match","fixedSpan","span","measurements","targets","duplicates","measurement","hide","each","m","res","alias","target","addEditorTab","$panelContainer","find","css","$panelContoller","height","minHeight","tail","panelWidth","innerWidth","isNaN","parseInt","slice","maxWidth","setElementHeight","setTextMaxWidth","upgradeOldVersion","clusterName","displayName","replace","namePrefix","addClass","removeClass","disabled","display","annotation","extraMoreAlerts","series","s","url","displayType","valueDisplayRegex","validateRegex","value","aggregation","max","datapoints","point","stats","min","total","avg","display_value","valueHandler","handleThresholdStatus","handleDisabledStatus","handleTextOnly","autoFlip","updatePanelState","handleCssDisplay","parseUri","handleMaxAlertsToShow","thresholds","parseThresholds","inverted","isCritical","isWarning","isCheckRanges","warnIsNumber","critIsNumber","push","disabledValue","panelState","undefined","okColor","maxAlertNumber","currentMaxAllowedAlerts","filteredOutAlerts","arrayNamesToSlice","forEach","originAlertCount","arrayName","Math","links","link","type","uri","dashUri","params","targetBlank","dataList","map","seriesHandler","render","timeoutId","clearInterval","setInterval","toggleClass","scope","elem","attrs","ctrl","metricOptions","isFloat","parseFloat","val","toString","toLowerCase","indexOf","seriesData","flotpairs","getFlotPairs","templateUrl"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAASA,mB,kBAAAA,gB;;AAGFC,I;;AACAC,a;;AACAC,a;;;;;;;;;;;;;;;;;;;;;AAKDC,gB,GAAgB;AACrBC,cAAU,KADW;AAErBC,cAAU,CAFW;AAGrBC,eAAW,OAHU;AAIrB;AACAC,YAAQ;AACPC,WAAM,wBADC;AAEPC,WAAM,yBAFC;AAGPC,SAAI,wBAHG;AAIPC,cAAS;AAJF,KALa;AAWrBC,oBAAgB,KAXK;AAYrBC,sBAAkB,KAZG;AAarBC,2BAAuB;AAbF,I;;+BAgBTC,gB;;;AACZ;AACA,8BAAYC,MAAZ,EAAoBC,SAApB,EAA+BC,IAA/B,EAAqCC,OAArC,EAA8CC,cAA9C,EAA8D;AAAA;;AAAA,qIACvDJ,MADuD,EAC/CC,SAD+C;;AAE7DjB,OAAEqB,YAAF,CAAe,MAAKC,KAApB,EAA2BnB,aAA3B;;AAEA;AACA,WAAKoB,MAAL,GAAcJ,OAAd;;AAEA,WAAKK,aAAL,GAAqB,CAAC,WAAD,EAAc,kBAAd,EAAkC,WAAlC,CAArB;AACA,WAAKC,YAAL,GAAoB,CAAC,MAAD,EAAS,OAAT,EAAkB,KAAlB,EAAyB,KAAzB,EAAgC,KAAhC,EAAuC,KAAvC,CAApB;AACA,WAAKC,YAAL,GAAoB,CAAC,SAAD,EAAY,YAAZ,CAApB;AACA,WAAKC,UAAL,GAAkB,CAAC,OAAD,EAAU,QAAV,EAAoB,UAApB,CAAlB;;AAEA;AACA,WAAKC,MAAL,CAAYC,EAAZ,CAAe,QAAf,EAAyB,MAAKC,QAAL,CAAcC,IAAd,OAAzB;AACA,WAAKH,MAAL,CAAYC,EAAZ,CAAe,SAAf,EAA0B,MAAKG,WAAL,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CAAe;AAC3BgG,mBAAY+D,WAAW/D,UADI;AAE3BtC,cAAOqG,WAAWpG;AAFS,OAAf,CAAb;;AAKA4B,aAAOyE,SAAP,GAAmBzE,OAAO0E,YAAP,CAAoB,WAApB,CAAnB;;AAEA,aAAO1E,MAAP;AACA;;;;KAtaoCzF,gB;;;;AA4btCgB,oBAAiBoJ,WAAjB,GAA+B,aAA/B","file":"status_ctrl.js","sourcesContent":["import {MetricsPanelCtrl} from \"app/plugins/sdk\";\r\nimport \"app/plugins/panel/graph/legend\";\r\nimport \"app/plugins/panel/graph/series_overrides_ctrl\";\r\nimport _ from \"lodash\";\r\nimport TimeSeries from \"app/core/time_series2\";\r\nimport coreModule from \"app/core/core_module\"\r\n\r\nimport './css/status_panel.css!';\r\n\r\n// Set and populate panel defaults\r\nconst panelDefaults = {\n\tflipCard: false,\r\n\tflipTime: 5,\r\n\tcolorMode: 'Panel',\r\n\t// Changed colors to match Table Panel so colorised text is easier to read\r\n\tcolors: {\r\n\t\tcrit: 'rgba(245, 54, 54, 0.9)',\r\n\t\twarn: 'rgba(237, 129, 40, 0.9)',\r\n\t\tok: 'rgba(50, 128, 45, 0.9)',\r\n\t\tdisable: 'rgba(128, 128, 128, 0.9)'\r\n\t},\r\n\tisGrayOnNoData: false,\r\n\tisIgnoreOKColors: false,\n\tisHideAlertsOnDisable: false\r\n};\r\n\r\nexport class StatusPluginCtrl extends MetricsPanelCtrl {\r\n\t/** @ngInject */\r\n\tconstructor($scope, $injector, $log, $filter, annotationsSrv) {\r\n\t\tsuper($scope, $injector);\r\n\t\t_.defaultsDeep(this.panel, panelDefaults);\r\n\r\n\t\t//this.log = $log.debug;\r\n\t\tthis.filter = $filter;\r\n\r\n\t\tthis.valueHandlers = ['Threshold', 'Disable Criteria', 'Text Only'];\r\n\t\tthis.aggregations = ['Last', 'First', 'Max', 'Min', 'Sum', 'Avg'];\r\n\t\tthis.displayTypes = ['Regular', 'Annotation'];\r\n\t\tthis.colorModes = ['Panel', 'Metric', 'Disabled'];\r\n\r\n\t\t/** Bind events to functions **/\r\n\t\tthis.events.on('render', this.onRender.bind(this));\r\n\t\tthis.events.on('refresh', this.postRefresh.bind(this));\r\n\t\tthis.events.on('data-error', this.onDataError.bind(this));\r\n\t\tthis.events.on('data-received', this.onDataReceived.bind(this));\r\n\t\tthis.events.on('data-snapshot-load', this.onDataReceived.bind(this));\r\n\t\tthis.events.on('init-edit-mode', this.onInitEditMode.bind(this));\r\n\r\n\t\tthis.addFilters()\r\n\t}\r\n\r\n\taddFilters() {\r\n\t\tcoreModule.filter('numberOrText', () => {\r\n\t\t\tlet numberOrTextFilter = (input) => {\r\n\t\t\t\tif(angular.isNumber(input)) {\r\n\t\t\t\t\treturn this.filter('number')(input);\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn input;\r\n\t\t\t\t}\r\n\t\t\t};\r\n\r\n\t\t\tnumberOrTextFilter.$stateful = true;\r\n\t\t\treturn numberOrTextFilter;\r\n\t\t});\r\n\r\n\t\tcoreModule.filter('numberOrTextWithRegex', () => {\r\n\t\t\tlet numberOrTextFilter = (input, textRegex) => {\r\n\t\t\t\tif(angular.isNumber(input)) {\r\n\t\t\t\t\treturn this.filter('number')(input);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif(textRegex == null || textRegex.length == 0) {\r\n\t\t\t\t\t\treturn input;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tlet regex;\r\n\r\n\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\tregex = new RegExp(textRegex);\r\n\t\t\t\t\t\t} catch (e) {\r\n\t\t\t\t\t\t\treturn input;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tlet matchResults = input.match(regex);\r\n\t\t\t\t\t\tif (matchResults == null) {\r\n\t\t\t\t\t\t\treturn input;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\treturn matchResults[0];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t};\r\n\r\n\t\t\tnumberOrTextFilter.$stateful = true;\r\n\t\t\treturn numberOrTextFilter;\r\n\t\t});\r\n\t}\r\n\r\n\tpostRefresh() {\r\n\t\tif (this.panel.fixedSpan) {\r\n\t\t\tthis.panel.span = this.panel.fixedSpan;\r\n\t\t}\r\n\r\n\t\tthis.measurements = this.panel.targets;\r\n\r\n\t\t/** Duplicate alias validation **/\r\n\t\tthis.duplicates = false;\r\n\r\n\t\tthis.measurements = _.filter(this.measurements, (measurement) => {\r\n\t\t\treturn !measurement.hide;\r\n\t\t});\r\n\r\n\t\t_.each(this.measurements, (m) => {\r\n\t\t\tlet res = _.filter(this.measurements, (measurement) => {\r\n\t\t\t\treturn (m.alias == measurement.alias || (m.target == measurement.target && m.target)) && !m.hide;\r\n\t\t\t});\r\n\r\n\t\t\tif (res.length > 1) {\r\n\t\t\t\tthis.duplicates = true;\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\tonInitEditMode() {\r\n\t\tthis.addEditorTab('Options', 'public/plugins/vonage-status-panel/editor.html', 2);\r\n\t}\r\n\r\n\tsetElementHeight() {\r\n\t\tthis.$panelContainer.find('.status-panel').css('min-height', this.$panelContoller.height + 'px');\r\n\t\tthis.minHeight = this.$panelContoller.height-10;\r\n\t}\r\n\r\n\tsetTextMaxWidth() {\r\n\t\tlet tail = ' …';\r\n\t\tlet panelWidth = this.$panelContainer.innerWidth();\r\n\t\tif (isNaN(panelWidth))\r\n\t\t\tpanelWidth = parseInt(panelWidth.slice(0, -2), 10) / 12;\r\n\t\tpanelWidth = panelWidth - 20;\r\n\t\tthis.maxWidth = panelWidth;\r\n\t}\r\n\r\n\tonRender() {\r\n\t\tthis.setElementHeight();\r\n\t\tthis.setTextMaxWidth();\r\n\t\tthis.upgradeOldVersion();\r\n\r\n\t\tif (this.panel.clusterName) {\r\n\t\t\tthis.panel.displayName =\r\n\t\t\t\tthis.filter('interpolateTemplateVars')(this.panel.clusterName, this.$scope)\r\n\t\t\t\t\t.replace(new RegExp(this.panel.namePrefix, 'i'), '');\r\n\t\t} else {\r\n\t\t\tthis.panel.displayName = \"\";\r\n\t\t}\r\n\r\n\t\tif(this.panel.flipCard){\r\n\t\t this.$panelContainer.addClass(\"effect-hover\");\r\n\t\t} else {\r\n\t\t this.$panelContainer.removeClass(\"effect-hover\");\r\n\t\t}\r\n\r\n\t\tlet targets = this.panel.targets;\r\n\r\n\t\tthis.crit = [];\r\n\t\tthis.warn = [];\r\n\t\tthis.disabled = [];\r\n\t\tthis.display = [];\r\n\t\tthis.annotation = [];\r\n\t\tthis.extraMoreAlerts = null;\r\n\r\n\t\t_.each(this.series, (s) => {\r\n\t\t\tlet target = _.find(targets, (target) => {\r\n\t\t\t\treturn target.alias == s.alias || target.target == s.alias;\r\n\t\t\t});\r\n\r\n\t\t\tif (!target) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\ts.alias = target.alias;\r\n\t\t\ts.url = target.url;\r\n\t\t\ts.display = true;\r\n\t\t\ts.displayType = target.displayType;\r\n\t\t\ts.valueDisplayRegex = \"\";\r\n\r\n\t\t\tif(this.validateRegex(target.valueDisplayRegex)) {\r\n\t\t\t\ts.valueDisplayRegex = target.valueDisplayRegex;\r\n\t\t\t}\r\n\r\n\t\t\tlet value;\r\n\t\t\tswitch (target.aggregation) {\r\n\t\t\t\tcase 'Max':\r\n\t\t\t\t\tvalue = _.max(s.datapoints, (point) => { return point[0]; })[0];\r\n\t\t\t\t\tvalue = s.stats.max;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'Min':\r\n\t\t\t\t\tvalue = _.min(s.datapoints, (point) => { return point[0]; })[0];\r\n\t\t\t\t\tvalue = s.stats.min;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'Sum':\r\n\t\t\t\t\tvalue = 0;\r\n\t\t\t\t\t_.each(s.datapoints, (point) => { value += point[0] });\r\n\t\t\t\t\tvalue = s.stats.total;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'Avg':\r\n\t\t\t\t\tvalue = s.stats.avg;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'First':\r\n\t\t\t\t\tvalue = s.datapoints[0][0];\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tvalue = s.datapoints[s.datapoints.length - 1][0];\r\n\t\t\t}\r\n\r\n\t\t\ts.display_value = value;\r\n\r\n\t\t\tif (target.valueHandler == \"Threshold\") {\r\n\t\t\t\tthis.handleThresholdStatus(s, target);\r\n\t\t\t}\r\n\t\t\telse if (target.valueHandler == \"Disable Criteria\") {\r\n\t\t\t\tthis.handleDisabledStatus(s,target);\r\n\t\t\t}\r\n\t\t\telse if (target.valueHandler == \"Text Only\") {\r\n\t\t\t\tthis.handleTextOnly(s, target);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif(this.panel.isHideAlertsOnDisable && this.disabled.length > 0) {\r\n\t\t\tthis.crit = [];\r\n\t\t\tthis.warn = [];\r\n\t\t\tthis.display = [];\r\n\t\t}\r\n\r\n\t\tthis.autoFlip();\r\n\t\tthis.updatePanelState();\r\n\t\tthis.handleCssDisplay();\r\n\t\tthis.parseUri();\r\n\r\n\t\t//This must appear after handling the css style of the panel\r\n\t\tthis.handleMaxAlertsToShow();\r\n\t}\r\n\r\n\tupgradeOldVersion() {\r\n\t\tlet targets = this.panel.targets;\r\n\r\n\t\t//Handle legacy code\r\n\t\t_.each(targets, (target) => {\r\n\t\t\tif(target.valueHandler == null) {\r\n\t\t\t\ttarget.valueHandler = target.displayType;\r\n\t\t\t\tif(target.valueHandler == \"Annotation\") {\r\n\t\t\t\t\ttarget.valueHandler = \"Text Only\"\r\n\t\t\t\t}\r\n\t\t\t\ttarget.displayType = this.displayTypes[0];\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\r\n\thandleThresholdStatus(series, target) {\r\n\t\tseries.thresholds = StatusPluginCtrl.parseThresholds(target);\r\n\t\tseries.inverted = series.thresholds.crit < series.thresholds.warn;\r\n\t\tseries.display = target.display;\r\n\r\n\t\tlet isCritical = false;\r\n\t\tlet isWarning = false;\r\n\t\tlet isCheckRanges = series.thresholds.warnIsNumber && series.thresholds.critIsNumber;\r\n\t\tif (isCheckRanges) {\r\n\t\t\tif (!series.inverted) {\r\n\t\t\t\tif (series.display_value >= series.thresholds.crit) {\r\n\t\t\t\t\tisCritical = true\r\n\t\t\t\t} else if (series.display_value >= series.thresholds.warn) {\r\n\t\t\t\t\tisWarning = true\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif (series.display_value <= series.thresholds.crit) {\r\n\t\t\t\t\tisCritical = true\r\n\t\t\t\t} else if (series.display_value <= series.thresholds.warn) {\r\n\t\t\t\t\tisWarning = true\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif (series.display_value == series.thresholds.crit) {\r\n\t\t\t\tisCritical = true\r\n\t\t\t} else if (series.display_value == series.thresholds.warn) {\r\n\t\t\t\tisWarning = true\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif(isCritical) {\r\n\t\t\tthis.crit.push(series);\r\n\t\t\tseries.displayType = this.displayTypes[0]\r\n\t\t} else if(isWarning) {\r\n\t\t\tthis.warn.push(series);\r\n\t\t\tseries.displayType = this.displayTypes[0]\r\n\t\t} else if (series.display) {\r\n\t\t\tif(series.displayType == \"Annotation\") {\r\n\t\t\t\tthis.annotation.push(series);\r\n\t\t\t} else {\r\n\t\t\t\tthis.display.push(series);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\thandleDisabledStatus(series, target) {\r\n\t\tseries.displayType = this.displayTypes[0];\r\n\t\tseries.disabledValue = target.disabledValue;\r\n\r\n\t\tif (series.display_value == series.disabledValue) {\r\n\t\t\tthis.disabled.push(series);\r\n\t\t}\r\n\t}\r\n\r\n\thandleTextOnly(series, target) {\r\n\t\tif(series.displayType == \"Annotation\") {\r\n\t\t\tthis.annotation.push(series);\r\n\t\t} else {\r\n\t\t\tthis.display.push(series);\r\n\t\t}\r\n\t}\r\n\r\n\tupdatePanelState() {\r\n\r\n\t\tif(this.duplicates) {\r\n\t\t\tthis.panelState = 'error-state';\r\n\t\t} else if (this.disabled.length > 0) {\r\n\t\t\tthis.panelState = 'disabled-state';\r\n\t\t} else if (this.crit.length > 0) {\r\n\t\t\tthis.panelState = 'error-state';\r\n\t\t} else if (this.warn.length > 0) {\r\n\t\t\tthis.panelState = 'warn-state';\r\n\t\t} else if((this.series == undefined || this.series.length == 0) && this.panel.isGrayOnNoData) {\r\n\t\t\tthis.panelState = 'no-data-state';\r\n\t\t} else {\r\n\t\t\tthis.panelState = 'ok-state';\r\n\t\t}\r\n\t}\r\n\r\n\thandleCssDisplay() {\r\n\t\tthis.$panelContainer.removeClass('error-state warn-state disabled-state ok-state no-data-state');\r\n\t\tthis.$panelContainer.addClass(this.panelState);\r\n\r\n\t\tlet okColor = (this.panel.isIgnoreOKColors) ? '' : this.panel.colors.ok;\r\n\r\n\t\tif (this.panel.colorMode === \"Panel\") {\r\n\t\t\tswitch(this.panelState) {\r\n\t\t\t\tcase 'disabled-state': this.$panelContainer.css('background-color', this.panel.colors.disable); break;\r\n\t\t\t\tcase 'error-state': this.$panelContainer.css('background-color', this.panel.colors.crit); break;\r\n\t\t\t\tcase 'warn-state': this.$panelContainer.css('background-color', this.panel.colors.warn); break;\r\n\t\t\t\tcase 'no-data-state': this.$panelContainer.css('background-color', this.panel.colors.disable); break;\r\n\t\t\t\tdefault: this.$panelContainer.css('background-color', okColor); break;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tthis.$panelContainer.css('background-color', '');\r\n\t\t}\r\n\t}\r\n\r\n\thandleMaxAlertsToShow() {\r\n\t\tif(this.panel.maxAlertNumber != null && this.panel.maxAlertNumber >= 0) {\r\n\t\t\tlet currentMaxAllowedAlerts = this.panel.maxAlertNumber;\r\n\t\t\tlet filteredOutAlerts = 0;\r\n\t\t\tlet arrayNamesToSlice = [\"disabled\", \"crit\", \"warn\", \"display\"];\r\n\t\t\tarrayNamesToSlice.forEach( arrayName => {\r\n\t\t\t\tlet originAlertCount = this[arrayName].length;\r\n\t\t\t\tthis[arrayName] = this[arrayName].slice(0,currentMaxAllowedAlerts);\r\n\t\t\t\tcurrentMaxAllowedAlerts = Math.max(currentMaxAllowedAlerts - this[arrayName].length, 0);\r\n\t\t\t\tfilteredOutAlerts += (originAlertCount - this[arrayName].length);\r\n\t\t\t});\r\n\r\n\t\t\tif(filteredOutAlerts > 0) {\r\n\t\t\t\tthis.extraMoreAlerts = \"+ \" + filteredOutAlerts + \" more\"\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tparseUri() {\r\n\t\tif (this.panel.links && this.panel.links.length > 0) {\r\n\t\t\tlet link = this.panel.links[0];\r\n\r\n\t\t\tif (link.type == \"absolute\") {\r\n\t\t\t\tthis.uri = link.url;\r\n\t\t\t} else {\r\n\t\t\t\tthis.uri = 'dashboard/' + link.dashUri;\r\n\t\t\t}\r\n\r\n\t\t\tif (link.params) {\r\n\t\t\t\tthis.uri += \"?\" + link.params;\r\n\t\t\t}\r\n\r\n\t\t\tthis.targetBlank = link.targetBlank;\r\n\t\t} else {\r\n\t\t\tthis.uri = undefined;\r\n\t\t}\r\n\t}\r\n\r\n\tvalidateRegex(textRegex) {\r\n\t\tif(textRegex == null || textRegex.length == 0) {\r\n\t\t\treturn true\r\n\t\t}\r\n\t\ttry {\r\n\t\t\tlet regex = new RegExp(textRegex);\r\n\t\t\treturn true\r\n\t\t} catch(e) {\r\n\t\t\treturn false\r\n\t\t}\r\n\t}\r\n\r\n\tstatic parseThresholds(metricOptions) {\r\n\t\tlet res = {};\r\n\r\n\t\tres.warnIsNumber = StatusPluginCtrl.isFloat(metricOptions.warn)\r\n\t\tif(res.warnIsNumber) {\r\n\t\t\tres.warn = parseFloat(metricOptions.warn);\r\n\t\t} else {\r\n\t\t\tres.warn = metricOptions.warn;\r\n\t\t}\r\n\r\n\t\tres.critIsNumber = StatusPluginCtrl.isFloat(metricOptions.crit);\r\n\t\tif(res.critIsNumber) {\r\n\t\t\tres.crit = parseFloat(metricOptions.crit);\r\n\t\t} else {\r\n\t\t\tres.crit = metricOptions.crit;\r\n\t\t}\r\n\r\n\t\treturn res;\r\n\t}\r\n\r\n\tstatic isFloat(val) {\r\n\t\tif (!isNaN(val) && val.toString().toLowerCase().indexOf('e') == -1) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}\r\n\r\n\tonDataReceived(dataList) {\r\n\t\tthis.series = dataList.map(StatusPluginCtrl.seriesHandler.bind(this));\r\n\t\tthis.render();\r\n\t}\r\n\r\n\tonDataError() {\r\n\t\tthis.crit = [];\r\n\t\tthis.warn = [];\r\n\t}\r\n\r\n\tstatic seriesHandler(seriesData) {\r\n\t\tvar series = new TimeSeries({\r\n\t\t\tdatapoints: seriesData.datapoints,\r\n\t\t\talias: seriesData.target\r\n\t\t});\r\n\r\n\t\tseries.flotpairs = series.getFlotPairs(\"connected\");\r\n\r\n\t\treturn series;\r\n\t}\r\n\r\n\t$onDestroy() {\r\n\t\tif(this.timeoutId) clearInterval(this.timeoutId);\r\n\t}\r\n\r\n\tautoFlip() {\r\n\t\tif (this.timeoutId) clearInterval(this.timeoutId);\r\n\t\tif (this.panel.flipCard && (this.crit.length > 0 || this.warn.length > 0 || this.disabled.length > 0)) {\r\n\t\t\tthis.timeoutId = setInterval(() => {\r\n\t\t\t\tthis.$panelContainer.toggleClass(\"flipped\");\r\n\t\t\t}, this.panel.flipTime * 1000);\r\n\t\t}\r\n\t}\r\n\r\n\tlink(scope, elem, attrs, ctrl) {\r\n\t\tthis.$panelContainer = elem.find('.panel-container');\r\n\t\tthis.$panelContainer.addClass(\"st-card\");\r\n\t\tthis.$panelContoller = ctrl;\r\n\t}\r\n}\r\n\r\nStatusPluginCtrl.templateUrl = 'module.html';\r\n"]} \ No newline at end of file +{"version":3,"sources":["../src/status_ctrl.js"],"names":["MetricsPanelCtrl","_","TimeSeries","coreModule","kbn","moment","panelDefaults","flipCard","flipTime","colorMode","colors","crit","warn","ok","disable","isGrayOnNoData","isIgnoreOKColors","isHideAlertsOnDisable","StatusPluginCtrl","$scope","$injector","$log","$filter","annotationsSrv","defaultsDeep","panel","filter","valueHandlers","aggregations","displayTypes","colorModes","each","targets","t","valueHandler","Date","events","on","onRender","bind","postRefresh","onDataError","onDataReceived","onInitEditMode","addFilters","numberOrTextFilter","input","angular","isNumber","$stateful","textRegex","length","regex","RegExp","e","matchResults","match","fixedSpan","span","measurements","duplicates","measurement","hide","m","res","alias","target","addEditorTab","unitFormats","getUnitFormats","subItem","units","value","render","$panelContainer","find","css","$panelContoller","height","minHeight","tail","panelWidth","innerWidth","isNaN","parseInt","slice","maxWidth","Number","undefined","String","c","w","getTime","setElementHeight","setTextMaxWidth","upgradeOldVersion","clusterName","displayName","replace","namePrefix","addClass","removeClass","disabled","display","annotation","extraMoreAlerts","series","s","url","displayType","valueDisplayRegex","validateRegex","aggregation","max","datapoints","point","stats","min","total","avg","display_value","handleThresholdStatus","handleDisabledStatus","handleTextOnly","autoFlip","updatePanelState","handleCssDisplay","parseUri","handleMaxAlertsToShow","isFloat","thresholds","parseThresholds","inverted","isCritical","isWarning","isCheckRanges","warnIsNumber","critIsNumber","formatDisplayValue","push","isFinite","decimals","Math","floor","toString","split","valueFormats","date","dashboard","isTimezoneUtc","utc","format","dateFormat","disabledValue","panelState","okColor","maxAlertNumber","currentMaxAllowedAlerts","filteredOutAlerts","arrayNamesToSlice","forEach","originAlertCount","arrayName","links","link","type","uri","dashUri","params","targetBlank","dataList","map","seriesHandler","timeoutId","clearInterval","setInterval","toggleClass","scope","elem","attrs","ctrl","metricOptions","parseFloat","valueOf","val","toLowerCase","indexOf","seriesData","flotpairs","getFlotPairs","templateUrl"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAASA,mB,kBAAAA,gB;;AAGFC,I;;AACAC,a;;AACAC,a;;AACAC,M;;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;AACNzE,WAAIrD,IAAJ,GAAW0K,cAAc1K,IAAzB;AACAqD,WAAIyE,YAAJ,GAAmB,KAAnB;AACA;;AAED,aAAOzE,GAAP;AACA;;;6BAEcwH,G,EAAK;AACnB,UAAI,CAACrG,MAAMqG,GAAN,CAAD,IAAeA,IAAIxC,QAAJ,GAAeyC,WAAf,GAA6BC,OAA7B,CAAqC,GAArC,KAA6C,CAAC,CAAjE,EAAoE;AACnE,cAAO,IAAP;AACA;AACD,aAAO,KAAP;AACA;;;mCAYoBC,U,EAAY;AAChC,UAAIjF,SAAS,IAAIxG,UAAJ,CAAe;AAC3BgH,mBAAYyE,WAAWzE,UADI;AAE3BjD,cAAO0H,WAAWzH;AAFS,OAAf,CAAb;;AAKAwC,aAAOkF,SAAP,GAAmBlF,OAAOmF,YAAP,CAAoB,WAApB,CAAnB;;AAEA,aAAOnF,MAAP;AACA;;;;KApgBoC1G,gB;;;;AA0hBtCkB,oBAAiB4K,WAAjB,GAA+B,aAA/B","file":"status_ctrl.js","sourcesContent":["import {MetricsPanelCtrl} from \"app/plugins/sdk\";\nimport \"app/plugins/panel/graph/legend\";\nimport \"app/plugins/panel/graph/series_overrides_ctrl\";\nimport _ from \"lodash\";\nimport TimeSeries from \"app/core/time_series2\";\nimport coreModule from \"app/core/core_module\";\nimport kbn from \"app/core/utils/kbn\";\nimport moment from \"moment\";\n\nimport './css/status_panel.css!';\n\n// Set and populate panel defaults\nconst panelDefaults = {\n\tflipCard: false,\n\tflipTime: 5,\n\tcolorMode: 'Panel',\n\t// Changed colors to match Table Panel so colorised text is easier to read\n\tcolors: {\n\t\tcrit: 'rgba(245, 54, 54, 0.9)',\n\t\twarn: 'rgba(237, 129, 40, 0.9)',\n\t\tok: 'rgba(50, 128, 45, 0.9)',\n\t\tdisable: 'rgba(128, 128, 128, 0.9)'\n\t},\n\tisGrayOnNoData: false,\n\tisIgnoreOKColors: false,\n\tisHideAlertsOnDisable: false\n};\n\nexport class StatusPluginCtrl extends MetricsPanelCtrl {\n\t/** @ngInject */\n\tconstructor($scope, $injector, $log, $filter, annotationsSrv) {\n\t\tsuper($scope, $injector);\n\t\t_.defaultsDeep(this.panel, panelDefaults);\n\n\t\t//this.log = $log.debug;\n\t\tthis.filter = $filter;\n\n\t\tthis.valueHandlers = ['Number Threshold', 'String Threshold', 'Date Threshold', 'Disable Criteria', 'Text Only'];\n\t\tthis.aggregations = ['Last', 'First', 'Max', 'Min', 'Sum', 'Avg'];\n\t\tthis.displayTypes = ['Regular', 'Annotation'];\n\t\tthis.colorModes = ['Panel', 'Metric', 'Disabled'];\n\n\t\t// Dates get stored as strings and will need to be converted back to a Date objects\n\t\t_.each(this.panel.targets, (t) => {\n\t\t\tif (t.valueHandler === \"Date Threshold\") {\n\t\t\t\tif (typeof t.crit != \"undefined\") t.crit = new Date(t.crit);\n\t\t\t\tif (typeof t.warn != \"undefined\") t.warn = new Date(t.warn);\n\t\t\t}\n\t\t});\n\n\t\tthis.panel.flipTime = this.panel.flipTime || 5;\n\n\t\t/** Bind events to functions **/\n\t\tthis.events.on('render', this.onRender.bind(this));\n\t\tthis.events.on('refresh', this.postRefresh.bind(this));\n\t\tthis.events.on('data-error', this.onDataError.bind(this));\n\t\tthis.events.on('data-received', this.onDataReceived.bind(this));\n\t\tthis.events.on('data-snapshot-load', this.onDataReceived.bind(this));\n\t\tthis.events.on('init-edit-mode', this.onInitEditMode.bind(this));\n\n\t\tthis.addFilters()\n\t}\n\n\taddFilters() {\n\t\tcoreModule.filter('numberOrText', () => {\n\t\t\tlet numberOrTextFilter = (input) => {\n\t\t\t\tif(angular.isNumber(input)) {\n\t\t\t\t\treturn this.filter('number')(input);\n\t\t\t\t} else {\n\t\t\t\t\treturn input;\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tnumberOrTextFilter.$stateful = true;\n\t\t\treturn numberOrTextFilter;\n\t\t});\n\n\t\tcoreModule.filter('numberOrTextWithRegex', () => {\n\t\t\tlet numberOrTextFilter = (input, textRegex) => {\n\t\t\t\tif(angular.isNumber(input)) {\n\t\t\t\t\treturn this.filter('number')(input);\n\t\t\t\t} else {\n\t\t\t\t\tif(textRegex == null || textRegex.length == 0) {\n\t\t\t\t\t\treturn input;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlet regex;\n\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tregex = new RegExp(textRegex);\n\t\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\t\treturn input;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (!input) {\n\t\t\t\t\t\t\treturn input;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlet matchResults = input.match(regex);\n\t\t\t\t\t\tif (matchResults == null) {\n\t\t\t\t\t\t\treturn input;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn matchResults[0];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tnumberOrTextFilter.$stateful = true;\n\t\t\treturn numberOrTextFilter;\n\t\t});\n\t}\n\n\tpostRefresh() {\n\t\tif (this.panel.fixedSpan) {\n\t\t\tthis.panel.span = this.panel.fixedSpan;\n\t\t}\n\n\t\tthis.measurements = this.panel.targets;\n\n\t\t/** Duplicate alias validation **/\n\t\tthis.duplicates = false;\n\n\t\tthis.measurements = _.filter(this.measurements, (measurement) => {\n\t\t\treturn !measurement.hide;\n\t\t});\n\n\t\t_.each(this.measurements, (m) => {\n\t\t\tlet res = _.filter(this.measurements, (measurement) => {\n\t\t\t\treturn (m.alias == measurement.alias || (m.target == measurement.target && m.target)) && !m.hide;\n\t\t\t});\n\n\t\t\tif (res.length > 1) {\n\t\t\t\tthis.duplicates = true;\n\t\t\t}\n\t\t});\n\t}\n\n\tonInitEditMode() {\n this.addEditorTab('Options', 'public/plugins/vonage-status-panel/editor.html', 2);\n\t\t// Load in the supported units-of-measure formats so they can be displayed in the editor\n\t\tthis.unitFormats = kbn.getUnitFormats();\n\t}\n\n setUnitFormat(measurement, subItem) {\n\t\tmeasurement.units = subItem.value;\n\t\tthis.render();\n\t}\n\n\tsetElementHeight() {\n\t\tthis.$panelContainer.find('.status-panel').css('min-height', this.$panelContoller.height + 'px');\n\t\tthis.minHeight = this.$panelContoller.height-10;\n\t}\n\n\tsetTextMaxWidth() {\n\t\tlet tail = ' …';\n\t\tlet panelWidth = this.$panelContainer.innerWidth();\n\t\tif (isNaN(panelWidth))\n\t\t\tpanelWidth = parseInt(panelWidth.slice(0, -2), 10) / 12;\n\t\tpanelWidth = panelWidth - 20;\n\t\tthis.maxWidth = panelWidth;\n\t}\n\n\tonHandlerChange(measurement) {\n\t\t// If the Threshold type changes between Number/String/Date then try and recast the thresholds to keep consistent\n\t\tif (measurement.valueHandler === \"Number Threshold\") {\n\t\t\tmeasurement.crit = (isNaN(Number(measurement.crit))) ? undefined : Number(measurement.crit);\n\t\t\tmeasurement.warn = (isNaN(Number(measurement.warn))) ? undefined : Number(measurement.warn);\n\t\t} else if (measurement.valueHandler === \"String Threshold\") {\n\t\t\tif (typeof measurement.crit != \"undefined\") measurement.crit = String(measurement.crit);\n\t\t\tif (typeof measurement.warn != \"undefined\") measurement.warn = String(measurement.warn);\n\t\t} else if (measurement.valueHandler === \"Date Threshold\") {\n\t\t\tlet c = new Date(measurement.crit), w = new Date(measurement.warn);\n\t\t\tmeasurement.crit = (isNaN(c.getTime())) ? undefined : c;\n\t\t\tmeasurement.warn = (isNaN(w.getTime())) ? undefined : w;\n\t\t}\n\t\tthis.onRender();\n\t}\n\n\tonRender() {\n\t\tthis.setElementHeight();\n\t\tthis.setTextMaxWidth();\n\t\tthis.upgradeOldVersion();\n\n\t\tif (this.panel.clusterName) {\n\t\t\tthis.panel.displayName =\n\t\t\t\tthis.filter('interpolateTemplateVars')(this.panel.clusterName, this.$scope)\n\t\t\t\t\t.replace(new RegExp(this.panel.namePrefix, 'i'), '');\n\t\t} else {\n\t\t\tthis.panel.displayName = \"\";\n\t\t}\n\n\t\tif(this.panel.flipCard){\n\t\t this.$panelContainer.addClass(\"effect-hover\");\n\t\t} else {\n\t\t this.$panelContainer.removeClass(\"effect-hover\");\n\t\t}\n\n\t\tlet targets = this.panel.targets;\n\n\t\tthis.crit = [];\n\t\tthis.warn = [];\n\t\tthis.disabled = [];\n\t\tthis.display = [];\n\t\tthis.annotation = [];\n\t\tthis.extraMoreAlerts = null;\n\n\t\t_.each(this.series, (s) => {\n\t\t\tlet target = _.find(targets, (target) => {\n\t\t\t\treturn target.alias == s.alias || target.target == s.alias;\n\t\t\t});\n\n\t\t\tif (!target) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\ts.alias = target.alias;\n\t\t\ts.url = target.url;\n\t\t\ts.display = true;\n\t\t\ts.displayType = target.displayType;\n\t\t\ts.valueDisplayRegex = \"\";\n\n\t\t\tif(this.validateRegex(target.valueDisplayRegex)) {\n\t\t\t\ts.valueDisplayRegex = target.valueDisplayRegex;\n\t\t\t}\n\n\t\t\tlet value;\n\t\t\tswitch (target.aggregation) {\n\t\t\t\tcase 'Max':\n\t\t\t\t\tvalue = _.max(s.datapoints, (point) => { return point[0]; })[0];\n\t\t\t\t\tvalue = s.stats.max;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'Min':\n\t\t\t\t\tvalue = _.min(s.datapoints, (point) => { return point[0]; })[0];\n\t\t\t\t\tvalue = s.stats.min;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'Sum':\n\t\t\t\t\tvalue = 0;\n\t\t\t\t\t_.each(s.datapoints, (point) => { value += point[0] });\n\t\t\t\t\tvalue = s.stats.total;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'Avg':\n\t\t\t\t\tvalue = s.stats.avg;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'First':\n\t\t\t\t\tvalue = s.datapoints[0][0];\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tvalue = s.datapoints[s.datapoints.length - 1][0];\n\t\t\t}\n\n\t\t\ts.display_value = value;\n\n\t\t\tif (target.valueHandler == \"Number Threshold\" ||\n\t\t\t\ttarget.valueHandler == \"String Threshold\" ||\n\t\t\t\ttarget.valueHandler == \"Date Threshold\") {\n\t\t\t\tthis.handleThresholdStatus(s, target);\n\t\t\t}\n\t\t\telse if (target.valueHandler == \"Disable Criteria\") {\n\t\t\t\tthis.handleDisabledStatus(s,target);\n\t\t\t}\n\t\t\telse if (target.valueHandler == \"Text Only\") {\n\t\t\t\tthis.handleTextOnly(s, target);\n\t\t\t}\n\t\t});\n\n\t\tif(this.panel.isHideAlertsOnDisable && this.disabled.length > 0) {\n\t\t\tthis.crit = [];\n\t\t\tthis.warn = [];\n\t\t\tthis.display = [];\n\t\t}\n\n\t\tthis.autoFlip();\n\t\tthis.updatePanelState();\n\t\tthis.handleCssDisplay();\n\t\tthis.parseUri();\n\n\t\t//This must appear after handling the css style of the panel\n\t\tthis.handleMaxAlertsToShow();\n\t}\n\n\tupgradeOldVersion() {\n\t\tlet targets = this.panel.targets;\n\n\t\t//Handle legacy code\n\t\t_.each(targets, (target) => {\n\t\t\tif(target.valueHandler == null) {\n\t\t\t\ttarget.valueHandler = target.displayType;\n\t\t\t\tif(target.valueHandler == \"Annotation\") {\n\t\t\t\t\ttarget.valueHandler = \"Text Only\"\n\t\t\t\t}\n\t\t\t\ttarget.displayType = this.displayTypes[0];\n\t\t\t}\n\t\t});\n\n\t\t// Depreciate Threshold in favour of Type specific versions\n\t\t_.each(targets, (target) => {\n\t\t\tif (target.valueHandler === \"Threshold\") {\n\t\t\t\t// Use the same logic as Threshold Parsing to ensure we retain same behaviour\n\t\t\t\t// i.e. map to Number Threshold if two floats (i.e. range check) otherwise map to String Threshold (i.e. exact match)\n\t\t\t\tif (StatusPluginCtrl.isFloat(target.crit) && StatusPluginCtrl.isFloat(target.warn)) {\n\t\t\t\t\ttarget.valueHandler = \"Number Threshold\"\n\t\t\t\t\ttarget.crit = Number(target.crit);\n\t\t\t\t\ttarget.warn = Number(target.warn);\n\t\t\t\t} else {\n\t\t\t\t\ttarget.valueHandler = \"String Threshold\"\n\t\t\t\t\tif (typeof target.crit != \"undefined\") target.crit = String(target.crit);\n\t\t\t\t\tif (typeof target.warn != \"undefined\") target.warn = String(target.warn);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n\n\thandleThresholdStatus(series, target) {\n\t\tseries.thresholds = StatusPluginCtrl.parseThresholds(target);\n\t\tseries.inverted = series.thresholds.crit < series.thresholds.warn;\n\t\tseries.display = target.display;\n\n\t\tlet isCritical = false;\n\t\tlet isWarning = false;\n\t\tlet isCheckRanges = series.thresholds.warnIsNumber && series.thresholds.critIsNumber;\n\t\tif (isCheckRanges) {\n\t\t\tif (!series.inverted) {\n\t\t\t\tif (series.display_value >= series.thresholds.crit) {\n\t\t\t\t\tisCritical = true\n\t\t\t\t} else if (series.display_value >= series.thresholds.warn) {\n\t\t\t\t\tisWarning = true\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (series.display_value <= series.thresholds.crit) {\n\t\t\t\t\tisCritical = true\n\t\t\t\t} else if (series.display_value <= series.thresholds.warn) {\n\t\t\t\t\tisWarning = true\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tif (series.display_value == series.thresholds.crit) {\n\t\t\t\tisCritical = true\n\t\t\t} else if (series.display_value == series.thresholds.warn) {\n\t\t\t\tisWarning = true\n\t\t\t}\n\t\t}\n\n\t\t// Add units-of-measure and decimal formatting or date formatting as needed\n\t\tseries.display_value = this.formatDisplayValue(series.display_value, target);\n\n\t\tif(isCritical) {\n\t\t\tthis.crit.push(series);\n\t\t\tseries.displayType = this.displayTypes[0]\n\t\t} else if(isWarning) {\n\t\t\tthis.warn.push(series);\n\t\t\tseries.displayType = this.displayTypes[0]\n\t\t} else if (series.display) {\n\t\t\tif(series.displayType == \"Annotation\") {\n\t\t\t\tthis.annotation.push(series);\n\t\t\t} else {\n\t\t\t\tthis.display.push(series);\n\t\t\t}\n\t\t}\n\t}\n\n\tformatDisplayValue(value, target) {\n\t\t// Format the display value. Set to \"Invalid\" if value is out-of-bounds or a type mismatch with the handler\n\t\tif (target.valueHandler === \"Number Threshold\") {\n\t\t\tif (_.isFinite(value)) {\n\t\t\t\tlet units = (typeof target.units === \"string\") ? target.units : 'none';\n\t\t\t\tlet decimals = (Math.floor(value) === value) ? 0 : value.toString().split(\".\")[1].length;\n\t\t\t\tdecimals = (typeof target.decimals === \"number\") ? target.decimals : decimals;\n\t\t\t\tvalue = kbn.valueFormats[units](value, decimals, null);\n\t\t\t} else {\n\t\t\t\tvalue = \"Invalid Number\";\n\t\t\t}\n\t\t} else if (target.valueHandler === \"String Threshold\") {\n\t\t\tif (value === undefined || value === null || value !== value)\n\t\t\t\tvalue = \"Invalid String\";\n\t\t} else if (target.valueHandler === \"Date Threshold\") {\n\t\t\tif (_.isFinite(value)) {\n\t\t\t\tlet date = moment(new Date(value));\n\t\t\t\tif (this.dashboard.isTimezoneUtc()) date = date.utc();\n\t\t\t\tvalue = date.format(target.dateFormat);\n\t\t\t} else {\n\t\t\t\tvalue = \"Invalid Date\";\n\t\t\t}\n\t\t}\n\t\treturn value;\n\t}\n\n\thandleDisabledStatus(series, target) {\n\t\tseries.displayType = this.displayTypes[0];\n\t\tseries.disabledValue = target.disabledValue;\n\n\t\tif (series.display_value == series.disabledValue) {\n\t\t\tthis.disabled.push(series);\n\t\t}\n\t}\n\n\thandleTextOnly(series, target) {\n\t\tif(series.displayType == \"Annotation\") {\n\t\t\tthis.annotation.push(series);\n\t\t} else {\n\t\t\tthis.display.push(series);\n\t\t}\n\t}\n\n\tupdatePanelState() {\n\n\t\tif(this.duplicates) {\n\t\t\tthis.panelState = 'error-state';\n\t\t} else if (this.disabled.length > 0) {\n\t\t\tthis.panelState = 'disabled-state';\n\t\t} else if (this.crit.length > 0) {\n\t\t\tthis.panelState = 'error-state';\n\t\t} else if (this.warn.length > 0) {\n\t\t\tthis.panelState = 'warn-state';\n\t\t} else if((this.series == undefined || this.series.length == 0) && this.panel.isGrayOnNoData) {\n\t\t\tthis.panelState = 'no-data-state';\n\t\t} else {\n\t\t\tthis.panelState = 'ok-state';\n\t\t}\n\t}\n\n\thandleCssDisplay() {\n\t\tthis.$panelContainer.removeClass('error-state warn-state disabled-state ok-state no-data-state');\n\t\tthis.$panelContainer.addClass(this.panelState);\n\n\t\tlet okColor = (this.panel.isIgnoreOKColors) ? '' : this.panel.colors.ok;\n\n\t\tif (this.panel.colorMode === \"Panel\") {\n\t\t\tswitch(this.panelState) {\n\t\t\t\tcase 'disabled-state': this.$panelContainer.css('background-color', this.panel.colors.disable); break;\n\t\t\t\tcase 'error-state': this.$panelContainer.css('background-color', this.panel.colors.crit); break;\n\t\t\t\tcase 'warn-state': this.$panelContainer.css('background-color', this.panel.colors.warn); break;\n\t\t\t\tcase 'no-data-state': this.$panelContainer.css('background-color', this.panel.colors.disable); break;\n\t\t\t\tdefault: this.$panelContainer.css('background-color', okColor); break;\n\t\t\t}\n\t\t} else {\n\t\t\tthis.$panelContainer.css('background-color', '');\n\t\t}\n\t}\n\n\thandleMaxAlertsToShow() {\n\t\tif(this.panel.maxAlertNumber != null && this.panel.maxAlertNumber >= 0) {\n\t\t\tlet currentMaxAllowedAlerts = this.panel.maxAlertNumber;\n\t\t\tlet filteredOutAlerts = 0;\n\t\t\tlet arrayNamesToSlice = [\"disabled\", \"crit\", \"warn\", \"display\"];\n\t\t\tarrayNamesToSlice.forEach( arrayName => {\n\t\t\t\tlet originAlertCount = this[arrayName].length;\n\t\t\t\tthis[arrayName] = this[arrayName].slice(0,currentMaxAllowedAlerts);\n\t\t\t\tcurrentMaxAllowedAlerts = Math.max(currentMaxAllowedAlerts - this[arrayName].length, 0);\n\t\t\t\tfilteredOutAlerts += (originAlertCount - this[arrayName].length);\n\t\t\t});\n\n\t\t\tif(filteredOutAlerts > 0) {\n\t\t\t\tthis.extraMoreAlerts = \"+ \" + filteredOutAlerts + \" more\"\n\t\t\t}\n\t\t}\n\t}\n\n\tparseUri() {\n\t\tif (this.panel.links && this.panel.links.length > 0) {\n\t\t\tlet link = this.panel.links[0];\n\n\t\t\tif (link.type == \"absolute\") {\n\t\t\t\tthis.uri = link.url;\n\t\t\t} else {\n\t\t\t\tthis.uri = 'dashboard/' + link.dashUri;\n\t\t\t}\n\n\t\t\tif (link.params) {\n\t\t\t\tthis.uri += \"?\" + link.params;\n\t\t\t}\n\n\t\t\tthis.targetBlank = link.targetBlank;\n\t\t} else {\n\t\t\tthis.uri = undefined;\n\t\t}\n\t}\n\n\tvalidateRegex(textRegex) {\n\t\tif(textRegex == null || textRegex.length == 0) {\n\t\t\treturn true\n\t\t}\n\t\ttry {\n\t\t\tlet regex = new RegExp(textRegex);\n\t\t\treturn true\n\t\t} catch(e) {\n\t\t\treturn false\n\t\t}\n\t}\n\n\tstatic parseThresholds(metricOptions) {\n\t\tlet res = {};\n\n\t\tif (StatusPluginCtrl.isFloat(metricOptions.warn)) {\n\t\t\tres.warn = parseFloat(metricOptions.warn);\n\t\t\tres.warnIsNumber = true;\n\t\t} else if (metricOptions.warn instanceof Date) {\n\t\t\t// Convert Dates to Numbers and leverage existing threshold logic\n\t\t\tres.warn = metricOptions.warn.valueOf();\n\t\t\tres.warnIsNumber = true;\n\t\t} else {\n\t\t\tres.warn = metricOptions.warn;\n\t\t\tres.warnIsNumber = false;\n\t\t}\n\n\t\tif (StatusPluginCtrl.isFloat(metricOptions.crit)) {\n\t\t\tres.crit = parseFloat(metricOptions.crit);\n\t\t\tres.critIsNumber = true;\n\t\t} else if (metricOptions.crit instanceof Date) {\n\t\t\tres.crit = metricOptions.crit.valueOf();\n\t\t\tres.critIsNumber = true;\n\t\t} else {\n\t\t\tres.crit = metricOptions.crit;\n\t\t\tres.critIsNumber = false;\n\t\t}\n\n\t\treturn res;\n\t}\n\n\tstatic isFloat(val) {\n\t\tif (!isNaN(val) && val.toString().toLowerCase().indexOf('e') == -1) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tonDataReceived(dataList) {\n\t\tthis.series = dataList.map(StatusPluginCtrl.seriesHandler.bind(this));\n\t\tthis.render();\n\t}\n\n\tonDataError() {\n\t\tthis.crit = [];\n\t\tthis.warn = [];\n\t}\n\n\tstatic seriesHandler(seriesData) {\n\t\tvar series = new TimeSeries({\n\t\t\tdatapoints: seriesData.datapoints,\n\t\t\talias: seriesData.target\n\t\t});\n\n\t\tseries.flotpairs = series.getFlotPairs(\"connected\");\n\n\t\treturn series;\n\t}\n\n\t$onDestroy() {\n\t\tif(this.timeoutId) clearInterval(this.timeoutId);\n\t}\n\n\tautoFlip() {\n\t\tif (this.timeoutId) clearInterval(this.timeoutId);\n\t\tif (this.panel.flipCard && (this.crit.length > 0 || this.warn.length > 0 || this.disabled.length > 0)) {\n\t\t\tthis.timeoutId = setInterval(() => {\n\t\t\t\tthis.$panelContainer.toggleClass(\"flipped\");\n\t\t\t}, this.panel.flipTime * 1000);\n\t\t}\n\t}\n\n\tlink(scope, elem, attrs, ctrl) {\n\t\tthis.$panelContainer = elem.find('.panel-container');\n\t\tthis.$panelContainer.addClass(\"st-card\");\n\t\tthis.$panelContoller = ctrl;\n\t}\n}\n\nStatusPluginCtrl.templateUrl = 'module.html';\n"]} \ No newline at end of file diff --git a/package.json b/package.json index 8810b103..da9c1df4 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "vonage-status-panel", "private": true, - "version": "1.0.0", + "version": "1.0.5", "description": "", "repository": { "type": "git", diff --git a/src/plugin.json b/src/plugin.json index 63739a08..e654d316 100644 --- a/src/plugin.json +++ b/src/plugin.json @@ -23,7 +23,7 @@ {"name": "Warning State", "path": "img/warning.png"}, {"name": "Critical State", "path": "img/error.png"} ], - "version": "1.0.4", + "version": "1.0.5", "updated": "2017-4-27" },