From d14e1e09a03257d0fa9008087da8714368d0d1ff Mon Sep 17 00:00:00 2001 From: Sriramajeyam Date: Tue, 26 Feb 2019 11:39:10 +0000 Subject: [PATCH] v1.0.0 (#64) * v1.0.0 release --- .circleci/config.yml | 2 +- .gitignore | 4 +- GruntFile.js | 63 +- README.md | 41 +- dist/README.md | 41 +- dist/app/app.js | 229 ++++--- dist/app/app.js.map | 1 - dist/app/boom/Boom.interface.js | 10 + dist/app/boom/BoomPattern.js | 80 +++ dist/app/boom/BoomSeries.js | 242 +++++++ dist/app/boom/BoomTimeBasedThreshold.js | 22 + dist/app/boom/BoomUtils.js | 126 ++++ dist/app/boom/index.js | 35 + dist/app/config.js | 35 + dist/app/utils.js | 32 - dist/app/utils.js.map | 1 - dist/css/default.dark.css | 55 +- dist/css/default.light.css | 55 +- dist/module.js | 653 ++++--------------- dist/module.js.map | 1 - dist/partials/module.html | 45 +- dist/partials/options.html | 167 +++-- dist/partials/patterns-advanced-options.html | 148 ----- dist/partials/patterns.html | 470 ++++++------- dist/plugin.json | 2 +- jest.config.js | 25 + package.json | 32 +- plugin.json | 2 +- src/app/app.ts | 228 ++++--- src/app/boom/Boom.interface.ts | 93 +++ src/app/boom/BoomPattern.ts | 114 ++++ src/app/boom/BoomSeries.ts | 242 +++++++ src/app/boom/BoomTimeBasedThreshold.ts | 20 + src/app/boom/BoomUtils.ts | 113 ++++ src/app/boom/index.ts | 5 + src/app/config.ts | 27 + src/app/utils.ts | 19 - src/css/_boomtable.scss | 47 ++ src/css/default.dark.css | 17 - src/css/default.dark.scss | 9 + src/css/default.light.css | 17 - src/css/default.light.scss | 9 + src/module.ts | 637 +++--------------- src/partials/module.html | 45 +- src/partials/options.html | 167 +++-- src/partials/patterns-advanced-options.html | 148 ----- src/partials/patterns.html | 470 ++++++------- tests/basic.spec.ts | 13 + tsconfig.json | 51 +- tslint.json | 128 ++-- 50 files changed, 2796 insertions(+), 2442 deletions(-) delete mode 100644 dist/app/app.js.map create mode 100644 dist/app/boom/Boom.interface.js create mode 100644 dist/app/boom/BoomPattern.js create mode 100644 dist/app/boom/BoomSeries.js create mode 100644 dist/app/boom/BoomTimeBasedThreshold.js create mode 100644 dist/app/boom/BoomUtils.js create mode 100644 dist/app/boom/index.js create mode 100644 dist/app/config.js delete mode 100644 dist/app/utils.js delete mode 100644 dist/app/utils.js.map delete mode 100644 dist/module.js.map delete mode 100644 dist/partials/patterns-advanced-options.html create mode 100644 jest.config.js create mode 100644 src/app/boom/Boom.interface.ts create mode 100644 src/app/boom/BoomPattern.ts create mode 100644 src/app/boom/BoomSeries.ts create mode 100644 src/app/boom/BoomTimeBasedThreshold.ts create mode 100644 src/app/boom/BoomUtils.ts create mode 100644 src/app/boom/index.ts create mode 100644 src/app/config.ts delete mode 100644 src/app/utils.ts create mode 100644 src/css/_boomtable.scss delete mode 100644 src/css/default.dark.css create mode 100644 src/css/default.dark.scss delete mode 100644 src/css/default.light.css create mode 100644 src/css/default.light.scss delete mode 100644 src/partials/patterns-advanced-options.html create mode 100644 tests/basic.spec.ts diff --git a/.circleci/config.yml b/.circleci/config.yml index 0d558e5..b5e84d5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,7 +7,7 @@ jobs: build: docker: # specify the version you desire here - - image: circleci/node:7.10 + - image: circleci/node:latest # Specify service dependencies here if necessary # CircleCI maintains a library of pre-built images diff --git a/.gitignore b/.gitignore index ccb2c80..d62609e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ node_modules/ -package-lock.json \ No newline at end of file +package-lock.json +.tscache/ +*.tmp.txt \ No newline at end of file diff --git a/GruntFile.js b/GruntFile.js index 98a4330..cb70f97 100644 --- a/GruntFile.js +++ b/GruntFile.js @@ -1,18 +1,17 @@ +const sass = require('node-sass'); + module.exports = grunt => { require("load-grunt-tasks")(grunt); - grunt.loadNpmTasks("grunt-execute"); - grunt.loadNpmTasks("grunt-contrib-clean"); - grunt.loadNpmTasks('grunt-typescript'); - grunt.initConfig({ + clean: ["dist"], copy: { src_to_dist: { cwd: "src", expand: true, - src: ["**/*", "css/*.css", "!**/*.ts", "!**/*.js", "!**/*.scss", "!img/**/*"], + src: ["**/*", "!**/*.ts", "!**/*.js", "!**/*.scss", "!img/**/*"], dest: "dist" }, pluginDef: { @@ -38,29 +37,59 @@ module.exports = grunt => { } }, - typescript: { + sass: { build: { - src: ['src/**/*.ts', '!**/*.d.ts'], - dest: 'dist/', options: { - module: 'system', - target: 'es5', - declaration: false, - emitDecoratorMetadata: true, - experimentalDecorators: true, - sourceMap: true, - noImplicitAny: false, + debugInfo: true, + check: true, + implementation: sass, + sourceMap: false + }, + files: { + 'dist/css/default.dark.css': 'src/css/default.dark.scss', + 'dist/css/default.light.css': 'src/css/default.light.scss' } } + }, + + tslint : { + options: { + configuration: "tslint.json" + }, + files: { + src: ['src/**/*.ts'], + }, + }, + + ts: { + default: { + tsconfig: './tsconfig.json' + } + }, + + run: { + options: { + }, + tests: { + exec: "npm run test" + } } }); + grunt.registerTask("test", [ + "run:tests", + "tslint" + ]); + grunt.registerTask("default", [ "clean", + "run:tests", + "tslint", + "ts:default", + "sass:build", "copy:src_to_dist", "copy:pluginDef", - "copy:img_to_dist", - "typescript" + "copy:img_to_dist" ]); }; \ No newline at end of file diff --git a/README.md b/README.md index c09ada2..fb33467 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,6 @@ Boom Table Panel for Grafana. Table/MultiStat plugin with multiple columns for G ![Boom Table - Panel with Font Awesome icons](https://raw.githubusercontent.com/yesoreyeram/yesoreyeram-boomtable-panel/master/dist/src/img/panels-fa.png) -![Image transform](https://raw.githubusercontent.com/yesoreyeram/yesoreyeram-boomtable-panel/master/dist/src/img/img-transform-example.png) Features : ---------- @@ -41,6 +40,7 @@ Tested Grafana versions : * Grafana version 4.5.2 * Grafana version 5.0.2 +* Grafana version 6.0.0 Screenshots : @@ -48,23 +48,16 @@ Screenshots : Pattern Editors Sample screenshots -![Boom Table - Editor 1 Screenshot](https://raw.githubusercontent.com/yesoreyeram/yesoreyeram-boomtable-panel/master/dist/src/img/editor-1.png) +![image](https://user-images.githubusercontent.com/153843/53409051-e973f580-39b7-11e9-83e3-e1b6306abafb.png) -![Boom Table - Editor 2 Screenshot](https://raw.githubusercontent.com/yesoreyeram/yesoreyeram-boomtable-panel/master/dist/src/img/editor-2.png) +![image](https://user-images.githubusercontent.com/153843/53409071-fa246b80-39b7-11e9-9e8e-05baa8fc1531.png) -![Boom Table - Editor Default Screenshot](https://raw.githubusercontent.com/yesoreyeram/yesoreyeram-boomtable-panel/master/dist/src/img/editor-default.png) +![image](https://user-images.githubusercontent.com/153843/53409114-13c5b300-39b8-11e9-9227-339dcd110276.png) Debug UI Sample screenshots -![Boom Table - Debug UI Screenshot](https://raw.githubusercontent.com/yesoreyeram/yesoreyeram-boomtable-panel/master/dist/src/img/debug-ui.png) - -Metrics screenshots - -![Boom Table - Metrics Screenshot](https://raw.githubusercontent.com/yesoreyeram/yesoreyeram-boomtable-panel/master/dist/src/img/metrics.png) +![image](https://user-images.githubusercontent.com/153843/53409376-acf4c980-39b8-11e9-89bc-363822fe370d.png) -Version 5 screenshots - -![Boom Table - Version 5 support Screenshot](https://raw.githubusercontent.com/yesoreyeram/yesoreyeram-boomtable-panel/master/dist/src/img/version-5.0.2.png) # Setup @@ -108,7 +101,7 @@ patterns and matching metrics Row and Column name guidelines ------------------------------ -Row and Col names are derived from series name. If n is wrapped by "_", then that will be replaced by n-th column in graphite/influxdb/prometheus metric (seperated by delimiter). Refer below examples and screenshots to get more idea. Or use debug mode to try. +Row and Col names are derived from series name. If n is wrapped by "_", then that will be replaced by n-th column in graphite/influxdb/prometheus metric (seperated by delimiter). Refer below examples and screenshots to get more idea. Or use debug mode to try. (n starts from index 0) Sample graphite series / Influx / Prometheus Metrics @@ -220,6 +213,8 @@ Logic is same as background color. But the value to be displayed can be altered `_col_name_` will be replaced by col name. This will be useful when you hide the table header. +`_n_` will be replaced by nth part of the series using `_` delimiter. Same rule as row_name and col_name + Example transformation patterns : _value_|_value_|_value_ @@ -329,6 +324,21 @@ If your row name / col name / transform metrics contains strings that starts wit Note : When using images from other domains, please take care of CORS policy, legal and copyright polices. +Options +------- + +`Text alignment for first column` -> This option specify the text alignment of first column cells in the table. Can be `left`,`right` or `center`. Default is left. + +`Text alignment for table header` -> This option specify the text alignment of table headers excluding first column. Can be `left`,`right` or `center`. Default is left. + +`Text alignment for values` -> This option specify the text alignment of value cells in the table. Can be `left`,`right` or `center`. Default is left. + +`Non matching cells text` -> If no series matches for the given row and col match, the corresponding text can be specified using this option. This option can also contain font awesome and image replacement tokens. + +`Non matching cells BG Color` -> If no series matches for the given row and col match, the corresponding bg color can be specified using this option + +`Non matching cells Text Color` -> If no series matches for the given row and col match, the corresponding text color can be specified using this option + Prometheus Guidelines --------------------- @@ -354,6 +364,11 @@ Same as other time series data sources. You need to properly format your legend | Version | Changes | | --------|-----------| +| 1.0.0 | Typescript & TSLint implementation | +| | Jest testcases implemented | +| | SASS implementation for stylesheets | +| | Display options improved | +| | Display values can have part of series name | | 0.5.1 | Images as values based on thresholds | | 0.5.0 | Background Color & Transform value overrides | | | Bug fixes #43 #44 #45 | diff --git a/dist/README.md b/dist/README.md index c09ada2..fb33467 100644 --- a/dist/README.md +++ b/dist/README.md @@ -9,7 +9,6 @@ Boom Table Panel for Grafana. Table/MultiStat plugin with multiple columns for G ![Boom Table - Panel with Font Awesome icons](https://raw.githubusercontent.com/yesoreyeram/yesoreyeram-boomtable-panel/master/dist/src/img/panels-fa.png) -![Image transform](https://raw.githubusercontent.com/yesoreyeram/yesoreyeram-boomtable-panel/master/dist/src/img/img-transform-example.png) Features : ---------- @@ -41,6 +40,7 @@ Tested Grafana versions : * Grafana version 4.5.2 * Grafana version 5.0.2 +* Grafana version 6.0.0 Screenshots : @@ -48,23 +48,16 @@ Screenshots : Pattern Editors Sample screenshots -![Boom Table - Editor 1 Screenshot](https://raw.githubusercontent.com/yesoreyeram/yesoreyeram-boomtable-panel/master/dist/src/img/editor-1.png) +![image](https://user-images.githubusercontent.com/153843/53409051-e973f580-39b7-11e9-83e3-e1b6306abafb.png) -![Boom Table - Editor 2 Screenshot](https://raw.githubusercontent.com/yesoreyeram/yesoreyeram-boomtable-panel/master/dist/src/img/editor-2.png) +![image](https://user-images.githubusercontent.com/153843/53409071-fa246b80-39b7-11e9-9e8e-05baa8fc1531.png) -![Boom Table - Editor Default Screenshot](https://raw.githubusercontent.com/yesoreyeram/yesoreyeram-boomtable-panel/master/dist/src/img/editor-default.png) +![image](https://user-images.githubusercontent.com/153843/53409114-13c5b300-39b8-11e9-9227-339dcd110276.png) Debug UI Sample screenshots -![Boom Table - Debug UI Screenshot](https://raw.githubusercontent.com/yesoreyeram/yesoreyeram-boomtable-panel/master/dist/src/img/debug-ui.png) - -Metrics screenshots - -![Boom Table - Metrics Screenshot](https://raw.githubusercontent.com/yesoreyeram/yesoreyeram-boomtable-panel/master/dist/src/img/metrics.png) +![image](https://user-images.githubusercontent.com/153843/53409376-acf4c980-39b8-11e9-89bc-363822fe370d.png) -Version 5 screenshots - -![Boom Table - Version 5 support Screenshot](https://raw.githubusercontent.com/yesoreyeram/yesoreyeram-boomtable-panel/master/dist/src/img/version-5.0.2.png) # Setup @@ -108,7 +101,7 @@ patterns and matching metrics Row and Column name guidelines ------------------------------ -Row and Col names are derived from series name. If n is wrapped by "_", then that will be replaced by n-th column in graphite/influxdb/prometheus metric (seperated by delimiter). Refer below examples and screenshots to get more idea. Or use debug mode to try. +Row and Col names are derived from series name. If n is wrapped by "_", then that will be replaced by n-th column in graphite/influxdb/prometheus metric (seperated by delimiter). Refer below examples and screenshots to get more idea. Or use debug mode to try. (n starts from index 0) Sample graphite series / Influx / Prometheus Metrics @@ -220,6 +213,8 @@ Logic is same as background color. But the value to be displayed can be altered `_col_name_` will be replaced by col name. This will be useful when you hide the table header. +`_n_` will be replaced by nth part of the series using `_` delimiter. Same rule as row_name and col_name + Example transformation patterns : _value_|_value_|_value_ @@ -329,6 +324,21 @@ If your row name / col name / transform metrics contains strings that starts wit Note : When using images from other domains, please take care of CORS policy, legal and copyright polices. +Options +------- + +`Text alignment for first column` -> This option specify the text alignment of first column cells in the table. Can be `left`,`right` or `center`. Default is left. + +`Text alignment for table header` -> This option specify the text alignment of table headers excluding first column. Can be `left`,`right` or `center`. Default is left. + +`Text alignment for values` -> This option specify the text alignment of value cells in the table. Can be `left`,`right` or `center`. Default is left. + +`Non matching cells text` -> If no series matches for the given row and col match, the corresponding text can be specified using this option. This option can also contain font awesome and image replacement tokens. + +`Non matching cells BG Color` -> If no series matches for the given row and col match, the corresponding bg color can be specified using this option + +`Non matching cells Text Color` -> If no series matches for the given row and col match, the corresponding text color can be specified using this option + Prometheus Guidelines --------------------- @@ -354,6 +364,11 @@ Same as other time series data sources. You need to properly format your legend | Version | Changes | | --------|-----------| +| 1.0.0 | Typescript & TSLint implementation | +| | Jest testcases implemented | +| | SASS implementation for stylesheets | +| | Display options improved | +| | Display values can have part of series name | | 0.5.1 | Images as values based on thresholds | | 0.5.0 | Background Color & Transform value overrides | | | Bug fixes #43 #44 #45 | diff --git a/dist/app/app.js b/dist/app/app.js index 6b70030..5a9ba5f 100644 --- a/dist/app/app.js +++ b/dist/app/app.js @@ -1,112 +1,131 @@ -/// -System.register(['app/core/utils/kbn', "app/plugins/sdk", "app/core/time_series2", "./utils"], function(exports_1) { - var kbn_1, sdk_1, time_series2_1, utils; - var plugin_id, config; +System.register(["lodash", "./boom/index"], function (exports_1, context_1) { + "use strict"; + var lodash_1, index_1, defaultPattern, seriesToTable, getRenderingHTML, getDebugData; + var __moduleName = context_1 && context_1.id; return { - setters:[ - function (kbn_1_1) { - kbn_1 = kbn_1_1; + setters: [ + function (lodash_1_1) { + lodash_1 = lodash_1_1; }, - function (sdk_1_1) { - sdk_1 = sdk_1_1; - }, - function (time_series2_1_1) { - time_series2_1 = time_series2_1_1; - }, - function (utils_1) { - utils = utils_1; - }], - execute: function() { - plugin_id = "yesoreyeram-boomtable-panel"; - config = { - plugin_id: plugin_id, - debug_mode: false, - hide_first_column: false, - hide_headers: false, - error: undefined, - groupedData: undefined, - panelDefaults: { - plugin_title: "Boom Table", - nullPointMode: "connected", - patterns: [], - defaultPattern: { - delimiter: ".", - valueName: "avg", - row_name: "_series_", - col_name: "Value", - thresholds: "70,90", - time_based_thresholds: [], - enable_time_based_thresholds: false, - enable_bgColor: false, - bgColors: "green|orange|red", - enable_bgColor_overrides: false, - bgColors_overrides: "0->green|2->red|1->yellow", - enable_transform: false, - transform_values: "_value_|_value_|_value_", - enable_transform_overrides: false, - transform_values_overrides: "0->down|1->up", - decimals: 2, - format: "none", - null_color: "darkred", - null_value: "No data", - enable_clickable_cells: false, - clickable_cells_link: "", - filter: { - value_below: "", - value_above: "" + function (index_1_1) { + index_1 = index_1_1; + } + ], + execute: function () { + defaultPattern = new index_1.BoomPattern({ + bgColors: "green|orange|red", + bgColors_overrides: "0->green|2->red|1->yellow", + clickable_cells_link: "", + col_name: "Value", + decimals: 2, + delimiter: ".", + format: "none", + name: "Default Pattern", + null_color: "darkred", + null_textcolor: "white", + null_value: "No data", + pattern: "*", + row_name: "_series_", + textColor: "red|orange|green", + textColors_overrides: "0->red|2->green|1->yellow", + thresholds: "70,90", + time_based_thresholds: [], + transform_values: "_value_|_value_|_value_", + transform_values_overrides: "0->down|1->up", + valueName: "avg" + }); + exports_1("defaultPattern", defaultPattern); + seriesToTable = function (inputdata, options) { + var rows_found = lodash_1.default.uniq(lodash_1.default.map(inputdata, function (d) { return d.row_name; })); + var cols_found = lodash_1.default.uniq(lodash_1.default.map(inputdata, function (d) { return d.col_name; })); + var output = []; + lodash_1.default.each(rows_found, function (row_name) { + var cols = []; + lodash_1.default.each(cols_found, function (col_name) { + var matched_items = lodash_1.default.filter(inputdata, function (o) { + return o.row_name === row_name && o.col_name === col_name; + }); + if (!matched_items || matched_items.length === 0) { + cols.push({ + "col_name": col_name, + "color_bg": options.non_matching_cells_color_bg, + "color_text": options.non_matching_cells_color_text, + "display_value": index_1.replaceTokens(options.non_matching_cells_text), + "hidden": false, + "link": "-", + "row_name": row_name, + "tooltip": "-" + }); + } + else if (matched_items && matched_items.length === 1) { + cols.push(matched_items[0]); + } + else if (matched_items && matched_items.length > 1) { + cols.push({ + "col_name": col_name, + "color_bg": "darkred", + "color_text": "white", + "display_value": "Duplicate matches", + "hidden": false, + "link": "-", + "row_name": row_name, + "tooltip": "-" + }); } - }, - activePatternIndex: -1, - row_col_wrapper: "_", - default_title_for_rows: "Metric" - }, - list_of_stylesheets: { - dark: "plugins/" + plugin_id + "/css/default.dark.css", - light: "plugins/" + plugin_id + "/css/default.light.css" - }, - editorTabs: [{ - name: "Patterns", - template: "/partials/patterns.html", - position: 2 - }, - { - name: "Time based thresholds & Filters", - template: "/partials/patterns-advanced-options.html", - position: 3 - }, { - name: "Options", - template: "/partials/options.html", - position: 4 - }], - valueNameOptions: [{ - value: "min", - text: "Min" - }, - { - value: "max", - text: "Max" - }, - { - value: "avg", - text: "Average" - }, - { - value: "current", - text: "Current" - }, - { - value: "total", - text: "Total" + }); + output.push(cols); + }); + return { + cols_found: cols_found, + output: output, + rows_found: rows_found, + }; + }; + exports_1("seriesToTable", seriesToTable); + getRenderingHTML = function (data, options) { + var output = { + body: "", + footer: "", + headers: "", + }; + var default_title_for_rows = options.default_title_for_rows, hide_headers = options.hide_headers, hide_first_column = options.hide_first_column; + if (hide_headers !== true) { + output.headers += ""; + if (hide_first_column !== true) { + output.headers += "" + default_title_for_rows + ""; + } + lodash_1.default.each(data.cols_found, function (c) { + output.headers += "" + c + ""; + }); + output.body += ""; + } + lodash_1.default.each(data.output, function (o) { + if (o.map(function (item) { return item.hidden.toString(); }).indexOf("false") > -1) { + output.body += ""; + if (hide_first_column !== true) { + output.body += "\n \n " + lodash_1.default.first(o.map(function (item) { return item.row_name; })) + "\n "; + } + lodash_1.default.each(o, function (item) { + var item_style = "padding:4px;background-color:" + item.color_bg + ";color:" + item.color_text + ";text-align:" + options.text_alignment_values; + var item_display = item.link === "#" ? item.display_value : "" + item.display_value + ""; + var tooltip = !item.tooltip || item.tooltip === "-" ? undefined : " data-toggle=\"tooltip\" data-html=\"true\" data-placement=\"auto\" title=\"" + item.tooltip + "\" "; + output.body += "\n \n " + (tooltip ? "" : "") + "\n " + item_display + "\n " + (tooltip ? "" : "") + "\n \n "; + }); + output.body += ""; } - ], + }); + return output; + }; + exports_1("getRenderingHTML", getRenderingHTML); + getDebugData = function (data) { + var debugdata = ""; + debugdata = lodash_1.default.map(data, function (d) { + return "\n \n " + d.seriesName + "\n " + (d.pattern.name || d.pattern.pattern || "Default") + "\n " + d.display_value + "\n " + d.row_name + "\n " + d.col_name + "\n " + d.thresholds.join(",") + "\n " + d.color_bg + "\n " + d.color_text + "\n \n "; + }).join(""); + return debugdata; }; - exports_1("kbn", kbn_1.default); - exports_1("loadPluginCss", sdk_1.loadPluginCss); - exports_1("MetricsPanelCtrl", sdk_1.MetricsPanelCtrl); - exports_1("TimeSeries", time_series2_1.default); - exports_1("utils", utils); - exports_1("config", config); + exports_1("getDebugData", getDebugData); } - } + }; }); -//# sourceMappingURL=app.js.map \ No newline at end of file +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXBwLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2FwcC9hcHAudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7WUFJTSxjQUFjLEdBQUcsSUFBSSxtQkFBVyxDQUFDO2dCQUNuQyxRQUFRLEVBQUUsa0JBQWtCO2dCQUM1QixrQkFBa0IsRUFBRSwyQkFBMkI7Z0JBQy9DLG9CQUFvQixFQUFFLEVBQUU7Z0JBQ3hCLFFBQVEsRUFBRSxPQUFPO2dCQUNqQixRQUFRLEVBQUUsQ0FBQztnQkFDWCxTQUFTLEVBQUUsR0FBRztnQkFDZCxNQUFNLEVBQUUsTUFBTTtnQkFDZCxJQUFJLEVBQ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ICAgICAgICBfLmVhY2goY29sc19mb3VuZCwgY29sX25hbWUgPT4ge1xyXG4gICAgICAgICAgICBsZXQgbWF0Y2hlZF9pdGVtcyA9IF8uZmlsdGVyKGlucHV0ZGF0YSwgbyA9PiB7XHJcbiAgICAgICAgICAgICAgICByZXR1cm4gby5yb3dfbmFtZSA9PT0gcm93X25hbWUgJiYgby5jb2xfbmFtZSA9PT0gY29sX25hbWU7XHJcbiAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICBpZiAoIW1hdGNoZWRfaXRlbXMgfHwgbWF0Y2hlZF9pdGVtcy5sZW5ndGggPT09IDApIHtcclxuICAgICAgICAgICAgICAgIGNvbHMucHVzaCh7XHJcbiAgICAgICAgICAgICAgICAgICAgXCJjb2xfbmFtZVwiOiBjb2xfbmFtZSxcclxuICAgICAgICAgICAgICAgICAgICBcImNvbG9yX2JnXCI6IG9wdGlvbnMubm9uX21hdGNoaW5nX2NlbGxzX2NvbG9yX2JnLFxyXG4gICAgICAgICAgICAgICAgICAgIFwiY29sb3JfdGV4dFwiOiBvcHRpb25zLm5vbl9tYXRjaGluZ19jZWxsc19jb2xvcl90ZXh0LFxyXG4gICAgICAgICAgICAgICAgICAgIFwiZGlzcGxheV92YWx1ZVwiOiByZXBsYWNlVG9rZW5zKG9wdGlvbnMubm9uX21hdGNoaW5nX2NlbGxzX3RleHQpLFxyXG4gICAgICAgICAgICAgICAgICAgIFwiaGlkZGVuXCI6IGZhbHNlLFxyXG4gICAgICAgICAgICAgICAgICAgIFwibGlua1wiOiBcIi1cIixcclxuICAgICAgICAgICAgICAgICAgICBcInJvd19uYW1lXCI6IHJvd19uYW1lLFxyXG4gICAgICAgICAgICAgICAgICAgIFwidG9vbHRpcFwiOiBcIi1cIlxyXG4gICAgICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgIH0gZWxzZSBpZiAobWF0Y2hlZF9pdGVtcyAmJiBtYXRjaGVkX2l0ZW1zLmxlbmd0aCA9PT0gMSkge1xyXG4gICAgICAgICAgICAgICAgY29scy5wdXNoKG1hdGNoZWRfaXRlbXNbMF0pO1xyXG4gICAgICAgICAgICB9IGVsc2UgaWYgKG1hdGNoZWRfaXRlbXMgJiYgbWF0Y2hlZF9pdGVtcy5sZW5ndGggPiAxKSB7XHJcbiAgICAgICAgICAgICAgICBjb2xzLnB1c2goe1xyXG4gICAgICAgICAgICAgICAgICAgIFwiY29sX25hbWVcIjogY29sX25hbWUsXHJcbiAgICAgICAgICAgICAgICAgICAgXCJjb2xvcl9iZ1wiOiBcImRhcmtyZWRcIixcclxuICAgICAgICAgICAgICAgICAgICBcImNvbG9yX3RleHRcIjogXCJ3aGl0ZVwiLFxyXG4gICAgICAgICAgICAgICAgICAgIFwiZGlzcGxheV92YWx1ZVwiOiBcIkR1cGxpY2F0ZSBtYXRjaGVzXCIsXHJcbiAgICAgICAgICAgICAgICAgICAgXCJoaWRkZW5cIjogZmFsc2UsXHJcbiAgICAgICAgICAgICAgICAgICAgXCJsaW5rXCI6IFwiLVwiLFxyXG4gICAgICAgICAgICAgICAgICAgIFwicm93X25hbWVcIjogcm93X25hbWUsXHJcbiAgICAgICAgICAgICAgICAgICAgXCJ0b29sdGlwXCI6IFwiLVwiXHJcbiAgICAgICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH0pO1xyXG4gICAgICAgIG91dHB1dC5wdXNoKGNvbHMpO1xyXG4gICAgfSk7XHJcbiAgICByZXR1cm4ge1xyXG4gICAgICAgIGNvbHNfZm91bmQsXHJcbiAgICAgICAgb3V0cHV0LFxyXG4gICAgICAgIHJvd3NfZm91bmQsXHJcbiAgICB9O1xyXG59O1xyXG5jb25zdCBnZXRSZW5kZXJpbmdIVE1MID0gZnVuY3Rpb24gKGRhdGE6IElCb29tVGFibGUsIG9wdGlvbnM6IElCb29tUmVuZGVyaW5nT3B0aW9ucyk6IElCb29tSFRNTCB7XHJcbiAgICBsZXQgb3V0cHV0OiBJQm9vbUhUTUwgPSB7X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JfdGV4dH08L3RkPlxyXG4gICAgICAgIDwvdHI+XHJcbiAgICAgICAgYDtcclxuICAgIH0pLmpvaW4oYGApO1xyXG4gICAgcmV0dXJuIGRlYnVnZGF0YTtcclxufTtcclxuXHJcbmV4cG9ydCB7XHJcbiAgICBkZWZhdWx0UGF0dGVybixcclxuICAgIGdldFJlbmRlcmluZ0hUTUwsXHJcbiAgICBnZXREZWJ1Z0RhdGEsXHJcbiAgICBzZXJpZXNUb1RhYmxlXHJcbn07XHJcbiJdfQ== \ No newline at end of file diff --git a/dist/app/app.js.map b/dist/app/app.js.map deleted file mode 100644 index 42e116c..0000000 --- a/dist/app/app.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"app.js","sourceRoot":"","sources":["../../src/app/app.ts"],"names":[],"mappings":"AAAA,oFAAoF;;;QAU9E,SAAS,EACT,MAAM;;;;;;;;;;;;;;;;YADN,SAAS,GAAG,6BAA6B,CAAC;YAC1C,MAAM,GAAQ;gBAChB,SAAS,EAAE,SAAS;gBACpB,UAAU,EAAE,KAAK;gBACjB,iBAAiB,EAAG,KAAK;gBACzB,YAAY,EAAG,KAAK;gBACpB,KAAK,EAAE,SAAS;gBAChB,WAAW,EAAE,SAAS;gBACtB,aAAa,EAAE;oBACX,YAAY,EAAE,YAAY;oBAC1B,aAAa,EAAE,WAAW;oBAC1B,QAAQ,EAAE,EAAE;oBACZ,cAAc,EAAE;wBACZ,SAAS,EAAE,GAAG;wBACd,SAAS,EAAE,KAAK;wBAChB,QAAQ,EAAE,UAAU;wBACpB,QAAQ,EAAE,OAAO;wBACjB,UAAU,EAAE,OAAO;wBACnB,qBAAqB,EAAC,EAAE;wBACxB,4BAA4B,EAAE,KAAK;wBACnC,cAAc,EAAE,KAAK;wBACrB,QAAQ,EAAE,kBAAkB;wBAC5B,wBAAwB,EAAG,KAAK;wBAChC,kBAAkB,EAAE,2BAA2B;wBAC/C,gBAAgB,EAAE,KAAK;wBACvB,gBAAgB,EAAE,yBAAyB;w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;YACL,2BAAM"} \ No newline at end of file diff --git a/dist/app/boom/Boom.interface.js b/dist/app/boom/Boom.interface.js new file mode 100644 index 0000000..6db60dc --- /dev/null +++ b/dist/app/boom/Boom.interface.js @@ -0,0 +1,10 @@ +System.register([], function (exports_1, context_1) { + "use strict"; + var __moduleName = context_1 && context_1.id; + return { + setters: [], + execute: function () { + } + }; +}); +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQm9vbS5pbnRlcmZhY2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvYXBwL2Jvb20vQm9vbS5pbnRlcmZhY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsInNvdXJjZXNDb250ZW50IjpbImludGVyZmFjZSBJQm9vbVBhdHRlcm4ge1xyXG4gICAgYmdDb2xvcnM6IHN0cmluZztcclxuICAgIGJnQ29sb3JzX292ZXJyaWRlczogc3RyaW5nO1xyXG4gICAgY2xpY2thYmxlX2NlbGxzX2xpbms6IHN0cmluZztcclxuICAgIGNvbF9uYW1lOiBzdHJpbmc7XHJcbiAgICBkZWNpbWFsczogTnVtYmVyO1xyXG4gICAgZGVsaW1pdGVyOiBzdHJpbmc7XHJcbiAgICBlbmFibGVfYmdDb2xvcjogQm9vbGVhbjtcclxuICAgIGVuYWJsZV9iZ0NvbG9yX292ZXJyaWRlczogQm9vbGVhbjtcclxuICAgIGVuYWJsZV9jbGlja2FibGVfY2VsbHM6IEJvb2xlYW47XHJcbiAgICBlbmFibGVfdGV4dENvbG9yOiBCb29sZWFuO1xyXG4gICAgZW5hYmxlX3RleHRDb2xvcl9vdmVycmlkZXM6IEJvb2xlYW47XHJcbiAgICBlbmFibGVfdGltZV9iYXNlZF90aHJlc2hvbGRzOiBCb29sZWFuO1xyXG4gICAgZW5hYmxlX3RyYW5zZm9ybTogQm9vbGVhbjtcclxuICAgIGVuYWJsZV90cmFuc2Zvcm1fb3ZlcnJp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3NfZm91bmQ6IHN0cmluZ1tdO1xyXG4gICAgY29sc19mb3VuZDogc3RyaW5nW107XHJcbiAgICBvdXRwdXQ6IElCb29tQ2VsbERldGFpbHNbXVtdO1xyXG59XHJcbmludGVyZmFjZSBJQm9vbUhUTUwge1xyXG4gICAgYm9keTogc3RyaW5nO1xyXG4gICAgZm9vdGVyOiBzdHJpbmc7XHJcbiAgICBoZWFkZXJzOiBzdHJpbmc7XHJcbn1cclxuZXhwb3J0IHtcclxuICAgIElCb29tUmVuZGVyaW5nT3B0aW9ucyxcclxuICAgIElCb29tUGF0dGVybixcclxuICAgIElCb29tU2VyaWVzLFxyXG4gICAgSUJvb21UaW1lQmFzZWRUaHJlc2hvbGQsXHJcbiAgICBJQm9vbUhUTUwsXHJcbiAgICBJQm9vbVRhYmxlLFxyXG4gICAgSUJvb21DZWxsRGV0YWlsc1xyXG59O1xyXG4iXX0= \ No newline at end of file diff --git a/dist/app/boom/BoomPattern.js b/dist/app/boom/BoomPattern.js new file mode 100644 index 0000000..f5f4e8f --- /dev/null +++ b/dist/app/boom/BoomPattern.js @@ -0,0 +1,80 @@ +System.register(["./index"], function (exports_1, context_1) { + "use strict"; + var index_1, BoomPattern; + var __moduleName = context_1 && context_1.id; + return { + setters: [ + function (index_1_1) { + index_1 = index_1_1; + } + ], + execute: function () { + BoomPattern = (function () { + function BoomPattern(options) { + this.row_col_wrapper = "_"; + if (options && options.row_col_wrapper) { + this.row_col_wrapper = options.row_col_wrapper; + } + this.bgColors = options && options.bgColors ? options.bgColors : "green|orange|red"; + this.bgColors_overrides = options && options.bgColors_overrides ? options.bgColors_overrides : "0->green|2->red|1->yellow"; + this.textColors = options && options.textColors ? options.textColors : "red|orange|green"; + this.textColors_overrides = options && options.textColors_overrides ? options.textColors_overrides : "0->red|2->green|1->yellow"; + this.clickable_cells_link = options && options.clickable_cells_link ? options.clickable_cells_link : ""; + this.col_name = options && options.col_name ? options.col_name : this.row_col_wrapper + "1" + this.row_col_wrapper; + this.decimals = options && options.decimals ? options.decimals : 2; + this.delimiter = options && options.delimiter ? options.delimiter : "."; + this.enable_bgColor = false; + this.enable_bgColor_overrides = false; + this.enable_textColor = false; + this.enable_textColor_overrides = false; + this.enable_clickable_cells = false; + this.enable_time_based_thresholds = false; + this.enable_transform = false; + this.enable_transform_overrides = false; + this.filter = { + value_above: "", + value_below: "", + }; + this.format = options && options.format ? options.format : "none"; + this.name = options && options.name ? options.name : "New Pattern"; + this.null_color = options && options.null_color ? options.null_color : "darkred"; + this.null_textcolor = options && options.null_Textcolor ? options.null_Textcolor : "black"; + this.null_value = options && options.null_value ? options.null_value : "No data"; + this.pattern = options && options.pattern ? options.pattern : "^server.*cpu$"; + this.row_name = options && options.row_name ? options.row_name : this.row_col_wrapper + "0" + this.row_col_wrapper; + this.thresholds = options && options.thresholds ? options.thresholds : "70,90"; + this.time_based_thresholds = []; + this.transform_values = options && options.transform_values ? options.transform_values : "_value_|_value_|_value_"; + this.transform_values_overrides = options && options.transform_values_overrides ? options.transform_values_overrides : "0->down|1->up"; + this.tooltipTemplate = options && options.tooltipTemplate ? options.tooltipTemplate : "Series : _series_
Row Name : _row_name_
Col Name : _col_name_
Value : _value_"; + this.valueName = options && options.valueName ? options.valueName : "avg"; + } + return BoomPattern; + }()); + exports_1("BoomPattern", BoomPattern); + BoomPattern.prototype.inverseBGColors = function () { + this.bgColors = this.bgColors ? this.bgColors.split("|").reverse().join("|") : ""; + }; + BoomPattern.prototype.inverseTextColors = function () { + this.textColors = this.textColors ? this.textColors.split("|").reverse().join("|") : ""; + }; + BoomPattern.prototype.inverseTransformValues = function () { + this.transform_values = this.transform_values ? this.transform_values.split("|").reverse().join("|") : ""; + }; + BoomPattern.prototype.add_time_based_thresholds = function () { + var new_time_based_threshold = new index_1.BoomTimeBasedThreshold(); + this.time_based_thresholds = this.time_based_thresholds || []; + this.time_based_thresholds.push(new_time_based_threshold); + }; + BoomPattern.prototype.remove_time_based_thresholds = function (index) { + if (this.time_based_thresholds.length > 0) { + this.time_based_thresholds.splice(Number(index), 1); + } + }; + BoomPattern.prototype.setUnitFormat = function (format) { + this.format = format && format.value ? format.value : "none"; + }; + } + }; +}); +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQm9vbVBhdHRlcm4uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvYXBwL2Jvb20vQm9vbVBhdHRlcm4udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7WUFFQTtnQkF5Q0kscUJBQVksT0FBWTtvQkF4Q2hCLG9CQUFlLEdBQUcsR0FBRyxDQUFDO29CQXlDMUIsSUFBSSxPQUFPLElBQUksT0FBTyxDQUFDLGVBQWUsRUFBRTt3QkFDcEMsSUFBSSxDQUFDLGVBQWUsR0FBRyxPQUFPLENBQUMsZUFBZSxDQUFDO3FCQUNsRDtvQkFDRCxJQUFJLENBQUMsUUFBUSxHQUFHLE9BQU8sSUFBSSxPQUFPLENBQUMsUUFBUSxDQUFDLENBQUMsQ0FBQyxPQUFPLENBQUMsUUFBUSxDQUFDLENBQUMsQ0FBQyxrQkFBa0IsQ0FBQztvQkFDcEYsSUFBSSxDQUFDLGtCQUFrQixHQUFHLE9BQU8sSUFBSSxPQUFPLENBQUMsa0JBQWtCLENBQUMsQ0FBQyxDQUFDLE9BQU8sQ0FBQyxrQkFBa0IsQ0FBQyxDQUFDLENBQUMsMkJBQTJCLENBQUM7b0JBQzNILElBQUksQ0FBQyxVQUFVLEdBQUcsT0FBTyxJQUFJLE9BQU8sQ0FBQyxVQUFVLENBQUMsQ0FBQyxDQUFDLE9BQU8sQ0FBQyxVQUFVLENBQUMsQ0FBQyxDQUFDLGtCQUFrQixDQUFDO29CQUMxRixJQUFJLENBQUMsb0JBQW9CLEdBQUcsT0FBTyxJQUFJLE9BQU8sQ0FBQyxvQkFBb0IsQ0FBQyxDQUFDLENBQUMsT0FBTyxDQUFDLG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CA9IG5ldyBCb29tVGltZUJhc2VkVGhyZXNob2xkKCk7XHJcbiAgICB0aGlzLnRpbWVfYmFzZWRfdGhyZXNob2xkcyA9IHRoaXMudGltZV9iYXNlZF90aHJlc2hvbGRzIHx8IFtdO1xyXG4gICAgdGhpcy50aW1lX2Jhc2VkX3RocmVzaG9sZHMucHVzaChuZXdfdGltZV9iYXNlZF90aHJlc2hvbGQpO1xyXG59O1xyXG5cclxuQm9vbVBhdHRlcm4ucHJvdG90eXBlLnJlbW92ZV90aW1lX2Jhc2VkX3RocmVzaG9sZHMgPSBmdW5jdGlvbiAoaW5kZXg6IE51bWJlcik6IHZvaWQge1xyXG4gICAgaWYgKHRoaXMudGltZV9iYXNlZF90aHJlc2hvbGRzLmxlbmd0aCA+IDApIHtcclxuICAgICAgICB0aGlzLnRpbWVfYmFzZWRfdGhyZXNob2xkcy5zcGxpY2UoTnVtYmVyKGluZGV4KSwgMSk7XHJcbiAgICB9XHJcbn07XHJcblxyXG5Cb29tUGF0dGVybi5wcm90b3R5cGUuc2V0VW5pdEZvcm1hdCA9IGZ1bmN0aW9uIChmb3JtYXQ6IGFueSk6IHZvaWQge1xyXG4gICAgdGhpcy5mb3JtYXQgPSBmb3JtYXQgJiYgZm9ybWF0LnZhbHVlID8gZm9ybWF0LnZhbHVlIDogXCJub25lXCI7XHJcbn07XHJcblxyXG5leHBvcnQge1xyXG4gICAgQm9vbVBhdHRlcm5cclxufTtcclxuIl19 \ No newline at end of file diff --git a/dist/app/boom/BoomSeries.js b/dist/app/boom/BoomSeries.js new file mode 100644 index 0000000..ea22af4 --- /dev/null +++ b/dist/app/boom/BoomSeries.js @@ -0,0 +1,242 @@ +System.register(["app/core/utils/kbn", "app/core/time_series2", "lodash", "./index"], function (exports_1, context_1) { + "use strict"; + var kbn_1, time_series2_1, lodash_1, index_1, BoomSeries; + var __moduleName = context_1 && context_1.id; + return { + setters: [ + function (kbn_1_1) { + kbn_1 = kbn_1_1; + }, + function (time_series2_1_1) { + time_series2_1 = time_series2_1_1; + }, + function (lodash_1_1) { + lodash_1 = lodash_1_1; + }, + function (index_1_1) { + index_1 = index_1_1; + } + ], + execute: function () { + BoomSeries = (function () { + function BoomSeries(seriesData, panelDefaultPattern, panelPatterns, options) { + var _this = this; + this.display_value = "-"; + this.tooltip = "-"; + this.value = NaN; + this.value_formatted = "-"; + this.link = "-"; + this.debug_mode = options && options.debug_mode === true ? true : false; + var nullPointMode = options && options.nullPointMode ? options.nullPointMode : "connected"; + this.row_col_wrapper = options && options.row_col_wrapper ? options.row_col_wrapper : "_"; + this.seriesName = ""; + this.template_row_name = ""; + this.template_col_name = ""; + this.template_value = ""; + this.hidden = false; + this.pattern = undefined; + var series = new time_series2_1.default({ + alias: seriesData.target, + datapoints: seriesData.datapoints || [] + }); + series.flotpairs = series.getFlotPairs(nullPointMode); + this.seriesName = series.alias || series.aliasEscaped || series.label || series.id; + this.currentTimeStamp = new Date(); + if (series.dataPoints && series.dataPoints.length > 0 && lodash_1.default.last(series.dataPoints).length === 2) { + this.currentTimeStamp = new Date(lodash_1.default.last(series.dataPoints)[1]); + } + this.pattern = lodash_1.default.find(panelPatterns.filter(function (p) { return p.disabled !== true; }), function (p) { return _this.seriesName.match(p.pattern); }) || panelDefaultPattern; + this.decimals = this.pattern.decimals || panelDefaultPattern.decimals || 2; + if (series.stats) { + this.value = series.stats[this.pattern.valueName]; + if (lodash_1.default.isNaN(this.value) || this.value === null) { + this.display_value = this.pattern.null_value; + } + else { + this.display_value = String(this.value); + } + if (!isNaN(this.value)) { + var decimalInfo = index_1.getDecimalsForValue(this.value, this.decimals); + var formatFunc = kbn_1.default.valueFormats[this.pattern.format]; + this.value_formatted = formatFunc(this.value, decimalInfo.decimals, decimalInfo.scaledDecimals); + this.display_value = String(this.value_formatted); + } + this.template_value = this.display_value; + } + if (this.value && this.pattern && this.pattern.filter && (this.pattern.filter.value_below !== "" || this.pattern.filter.value_above !== "")) { + if (this.pattern.filter.value_below !== "" && this.value < +(this.pattern.filter.value_below)) { + this.hidden = true; + } + if (this.pattern.filter.value_above !== "" && this.value > +(this.pattern.filter.value_above)) { + this.hidden = true; + } + } + this.row_name = this.getRowName(this.pattern, this.row_col_wrapper, this.seriesName.toString()); + this.col_name = this.getColName(this.pattern, this.row_col_wrapper, this.seriesName.toString(), this.row_name); + this.thresholds = this.getThresholds(); + this.color_bg = this.getBGColor(); + this.color_text = this.getTextColor(); + this.template_value = this.getDisplayValueTemplate(); + this.tooltip = this.pattern.tooltipTemplate || "Series : _series_
Row Name : _row_name_
Col Name : _col_name_
Value : _value_"; + this.link = this.pattern.enable_clickable_cells ? this.pattern.clickable_cells_link || "#" : "#"; + this.replaceTokens(); + this.cleanup(); + } + BoomSeries.prototype.getThresholds = function () { + var thresholds = this.pattern.thresholds.split(",").map(function (d) { return +d; }); + if (this.pattern.enable_time_based_thresholds) { + var metricrecivedTimeStamp_1 = this.currentTimeStamp || new Date(); + var metricrecivedTimeStamp_innumber_1 = metricrecivedTimeStamp_1.getHours() * 100 + metricrecivedTimeStamp_1.getMinutes(); + var weekdays_1 = ["sun", "mon", "tue", "wed", "thu", "fri", "sat"]; + lodash_1.default.each(this.pattern.time_based_thresholds, function (tbtx) { + if (tbtx && tbtx.from && tbtx.to && tbtx.enabledDays && + (metricrecivedTimeStamp_innumber_1 >= +(tbtx.from)) && + (metricrecivedTimeStamp_innumber_1 <= +(tbtx.to)) && + (tbtx.enabledDays.toLowerCase().indexOf(weekdays_1[metricrecivedTimeStamp_1.getDay()]) > -1) && + tbtx.threshold) { + thresholds = (tbtx.threshold + "").split(",").map(function (d) { return +d; }); + } + }); + } + return thresholds; + }; + BoomSeries.prototype.getBGColor = function () { + var _this = this; + var bgColor = "transparent"; + if (lodash_1.default.isNaN(this.value) || this.value === null) { + bgColor = this.pattern.null_color || "darkred"; + if (this.pattern.null_color === "") { + bgColor = "transparent"; + } + } + else { + if (this.pattern.enable_bgColor && this.pattern.bgColors) { + var list_of_bgColors_based_on_thresholds = this.pattern.bgColors.split("|"); + bgColor = index_1.getItemBasedOnThreshold(this.thresholds, list_of_bgColors_based_on_thresholds, this.value, bgColor); + } + if (this.pattern.enable_bgColor_overrides && this.pattern.bgColors_overrides !== "") { + var _bgColors_overrides = this.pattern.bgColors_overrides.split("|").filter(function (con) { return con.indexOf("->"); }).map(function (con) { return con.split("->"); }).filter(function (con) { return +(con[0]) === _this.value; }).map(function (con) { return con[1]; }); + if (_bgColors_overrides.length > 0 && _bgColors_overrides[0] !== "") { + bgColor = ("" + _bgColors_overrides[0]).trim(); + } + } + } + return index_1.normalizeColor(bgColor); + }; + BoomSeries.prototype.getTextColor = function () { + var _this = this; + var textColor = "white"; + if (lodash_1.default.isNaN(this.value) || this.value === null) { + textColor = this.pattern.null_textcolor || "white"; + } + else { + if (this.pattern.enable_textColor && this.pattern.textColors) { + var list_of_textColors_based_on_thresholds = this.pattern.textColors.split("|"); + textColor = index_1.getItemBasedOnThreshold(this.thresholds, list_of_textColors_based_on_thresholds, this.value, textColor); + } + if (this.pattern.enable_textColor_overrides && this.pattern.textColors_overrides !== "") { + var _textColors_overrides = this.pattern.textColors_overrides.split("|").filter(function (con) { return con.indexOf("->"); }).map(function (con) { return con.split("->"); }).filter(function (con) { return +(con[0]) === _this.value; }).map(function (con) { return con[1]; }); + if (_textColors_overrides.length > 0 && _textColors_overrides[0] !== "") { + textColor = ("" + _textColors_overrides[0]).trim(); + } + } + } + return index_1.normalizeColor(textColor); + }; + BoomSeries.prototype.getDisplayValueTemplate = function () { + var _this = this; + var template = this.template_value; + if (lodash_1.default.isNaN(this.value) || this.value === null) { + template = this.pattern.null_value || "No data"; + if (this.pattern.null_value === "") { + template = ""; + } + } + else { + if (this.pattern.enable_transform) { + var transform_values = this.pattern.transform_values.split("|"); + template = index_1.getItemBasedOnThreshold(this.thresholds, transform_values, this.value, template); + } + if (this.pattern.enable_transform_overrides && this.pattern.transform_values_overrides !== "") { + var _transform_values_overrides = this.pattern.transform_values_overrides.split("|").filter(function (con) { return con.indexOf("->"); }).map(function (con) { return con.split("->"); }).filter(function (con) { return +(con[0]) === _this.value; }).map(function (con) { return con[1]; }); + if (_transform_values_overrides.length > 0 && _transform_values_overrides[0] !== "") { + template = ("" + _transform_values_overrides[0]).trim(); + } + } + if (this.pattern.enable_transform || this.pattern.enable_transform_overrides) { + template = this.seriesName.split(this.pattern.delimiter || ".").reduce(function (r, it, i) { + return r.replace(new RegExp(_this.row_col_wrapper + i + _this.row_col_wrapper, "g"), it); + }, template); + } + } + return template; + }; + BoomSeries.prototype.cleanup = function () { + if (this.debug_mode !== true) { + delete this.seriesName; + delete this.value; + delete this.pattern; + delete this.thresholds; + delete this.decimals; + delete this.template_col_name; + delete this.template_row_name; + delete this.template_value; + delete this.value_formatted; + delete this.currentTimeStamp; + } + }; + BoomSeries.prototype.getRowName = function (pattern, row_col_wrapper, seriesName) { + var row_name = pattern.row_name; + row_name = seriesName.split(pattern.delimiter || ".").reduce(function (r, it, i) { + return r.replace(new RegExp(row_col_wrapper + i + row_col_wrapper, "g"), it); + }, row_name); + if (seriesName.split(pattern.delimiter || ".").length === 1) { + row_name = seriesName; + } + this.template_row_name = row_name; + return row_name; + }; + BoomSeries.prototype.getColName = function (pattern, row_col_wrapper, seriesName, row_name) { + var col_name = pattern.col_name; + col_name = seriesName.split(pattern.delimiter || ".").reduce(function (r, it, i) { + return r.replace(new RegExp(row_col_wrapper + i + row_col_wrapper, "g"), it); + }, col_name); + if (seriesName.split(pattern.delimiter || ".").length === 1 || row_name === seriesName) { + col_name = pattern.col_name || "Value"; + } + this.template_col_name = col_name; + return col_name; + }; + BoomSeries.prototype.replaceTokens = function () { + this.row_name = this.template_row_name.replace(new RegExp("_series_", "g"), this.seriesName.toString()); + this.col_name = this.template_col_name.replace(new RegExp("_series_", "g"), this.seriesName.toString()); + this.link = this.link.replace(new RegExp("_series_", "g"), this.seriesName.toString().trim()); + this.tooltip = this.tooltip.replace(new RegExp("_series_", "g"), this.seriesName.toString().trim()); + this.display_value = this.template_value.replace(new RegExp("_series_", "g"), this.seriesName.toString()); + this.col_name = this.col_name.replace(new RegExp("_row_name_", "g"), this.row_name.toString()); + this.link = this.link.replace(new RegExp("_row_name_", "g"), index_1.getActualNameWithoutTokens(this.row_name.toString()).trim()); + this.tooltip = this.tooltip.replace(new RegExp("_row_name_", "g"), index_1.getActualNameWithoutTokens(this.row_name.toString()).trim()); + this.display_value = this.display_value.replace(new RegExp("_row_name_", "g"), this.row_name.toString()); + this.row_name = this.row_name.replace(new RegExp("_col_name_", "g"), this.col_name.toString()); + this.link = this.link.replace(new RegExp("_col_name_", "g"), index_1.getActualNameWithoutTokens(this.col_name.toString()).trim()); + this.tooltip = this.tooltip.replace(new RegExp("_col_name_", "g"), index_1.getActualNameWithoutTokens(this.col_name.toString()).trim()); + this.display_value = this.display_value.replace(new RegExp("_col_name_", "g"), this.col_name.toString()); + var value_raw = lodash_1.default.isNaN(this.value) || this.value === null ? "null" : this.value.toString().trim(); + this.link = this.link.replace(new RegExp("_value_raw_", "g"), value_raw); + this.tooltip = this.tooltip.replace(new RegExp("_value_raw_", "g"), value_raw); + this.display_value = this.display_value.replace(new RegExp("_value_raw_", "g"), value_raw); + var value_formatted = lodash_1.default.isNaN(this.value) || this.value === null ? "null" : this.value_formatted.toString().trim(); + this.link = this.link.replace(new RegExp("_value_", "g"), value_formatted); + this.tooltip = this.tooltip.replace(new RegExp("_value_", "g"), value_formatted); + this.display_value = this.display_value.replace(new RegExp("_value_", "g"), value_formatted); + this.row_name = index_1.replaceTokens(this.row_name); + this.col_name = index_1.replaceTokens(this.col_name); + this.display_value = index_1.replaceTokens(this.display_value); + }; + return BoomSeries; + }()); + exports_1("BoomSeries", BoomSeries); + } + }; +}); +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQm9vbVNlcmllcy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9hcHAvYm9vbS9Cb29tU2VyaWVzLn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ZXIgPj0gKyh0YnR4LmZyb20pKSAmJlxyXG4gICAgICAgICAgICAgICAgICAgIChtZXRyaWNyZWNpdmVkVGltZVN0YW1wX2lubnVtYmVyIDw9ICsodGJ0eC50bykpICYmXHJcbiAgICAgICAgICAgICAgICAgICAgKHRidHguZW5hYmxlZERheXMudG9Mb3dlckNhc2UoKS5pbmRleE9mKHdlZWtkYXlzW21ldHJpY3JlY2l2ZWRUaW1lU3RhbXAuZ2V0RGF5KCldKSA+IC0xKSAmJlxyXG4gICAgICAgICAgICAgICAgICAgIHRidHgudGhyZXNob2xkXHJcbiAgICAgICAgICAgICAgICApIHtcclxuICAgICAgICAgICAgICAgICAgICB0aHJlc2hvbGRzID0gKHRidHgudGhyZXNob2xkICsgXCJcIikuc3BsaXQoXCIsXCIpLm1hcChkID0+ICtkKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHJldHVybiB0aHJlc2hvbGRzO1xyXG4gICAgfVxyXG4gICAgcHJpdmF0ZSBnZXRCR0NvbG9yKCk6IHN0cmluZyB7XHJcbiAgICAgICAgbGV0IGJnQ29sb3IgPSBcInRyYW5zcGFyZW50XCI7XHJcbiAgICAgICAgaWYgKF8uaXNOYU4odGhpcy52YWx1ZSkgfHwgdGhpcy52YWx1ZSA9PT0gbnVsbCkge1xyXG4gICAgICAgICAgICBiZ0NvbG9yID0gdGhpcy5wYXR0ZXJuLm51bGxfY29sb3IgfHwgXCJkYXJrcmVkXCI7XHJcbiAgICAgICAgICAgIGlmICh0aGlzLnBhdHRlcm4ubnVsbF9jb2xvciA9PT0gXCJcIikge1xyXG4gICAgICAgICAgICAgICAgYmdDb2xvciA9IFwidHJhbnNwYXJlbnRcIjtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgIGlmICh0aGlzLnBhdHRlcm4uZW5hYmxlX2JnQ29sb3IgJiYgdGhpcy5wY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F0ZSA9IHRoaXMuc2VyaWVzTmFtZS5zcGxpdCh0aGlzLnBhdHRlcm4uZGVsaW1pdGVyIHx8IFwiLlwiKS5yZWR1Y2UoKHIsIGl0LCBpKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHIucmVwbGFjZShuZXcgUmVnRXhwKHRoaXMucm93X2NvbF93cmFwcGVyICsgaSArIHRoaXMucm93X2NvbF93cmFwcGVyLCBcImdcIiksIGl0KTtcclxuICAgICAgICAgICAgICAgIH0sIHRlbXBsYXRlKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICByZXR1cm4gdGVtcGxhdGU7XHJcbiAgICB9XHJcbiAgICBwcml2YXRlIGNsZWFudXAoKSB7XHJcbiAgICAgICAgaWYgKHRoaXMuZGVidWdfbW9kZSAhPT0gdHJ1ZSkge1xyXG4gICAgICAgICAgICBkZWxldGUgdGhpcy5zZXJpZXNOYW1lO1xyXG4gICAgICAgICAgICBkZWxldGUgdGhpcy52YWx1ZTtcclxuICAgICAgICAgICAgZGVsZXRlIHRoaXMucGF0dGVybjtcclxuICAgICAgICAgICAgZGVsZXRlIHRoaXMudGhyZXNob2xkcztcclxuICAgICAgICAgICAgZGVsZXRlIHRoaXMuZGVjaW1hbHM7XHJcbiAgICAgICAgICAgIGRlbGV0ZSB0aGlzLnRlbXBsYXRlX2NvbF9uYW1lO1xyXG4gICAgICAgICAgICBkZWxldGUgdGhpcy50ZW1wbGF0ZV9yb3dfbmFtZTtcclxuICAgICAgICAgICAgZGVsZXRlIHRoaXMudGVtcGxhdGVfdmFsdWU7XHJcbiAgICAgICAgICAgIGRlbGV0ZSB0aGlzLnZhbHVlX2Zvcm1hdHRlZDtcclxuICAgICAgICAgICAgZGVsZXRlIHRoaXMuY3VycmVudFRpbWVTdGFtcDtcclxuICAgICAgICB9XHJcbiAgICB9XHJcbiAgICBwcml2YXRlIGdldFJvd05hbWUocGF0dGVybiwgcm93X2NvbF93cmFwc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B0aGlzLnJvd19uYW1lID0gcmVwbGFjZVRva2Vucyh0aGlzLnJvd19uYW1lKTtcclxuICAgICAgICB0aGlzLmNvbF9uYW1lID0gcmVwbGFjZVRva2Vucyh0aGlzLmNvbF9uYW1lKTtcclxuICAgICAgICB0aGlzLmRpc3BsYXlfdmFsdWUgPSByZXBsYWNlVG9rZW5zKHRoaXMuZGlzcGxheV92YWx1ZSk7XHJcbiAgICB9XHJcbn1cclxuXHJcbmV4cG9ydCB7XHJcbiAgICBCb29tU2VyaWVzXHJcbn07XHJcbiJdfQ== \ No newline at end of file diff --git a/dist/app/boom/BoomTimeBasedThreshold.js b/dist/app/boom/BoomTimeBasedThreshold.js new file mode 100644 index 0000000..254ca0e --- /dev/null +++ b/dist/app/boom/BoomTimeBasedThreshold.js @@ -0,0 +1,22 @@ +System.register([], function (exports_1, context_1) { + "use strict"; + var BoomTimeBasedThreshold; + var __moduleName = context_1 && context_1.id; + return { + setters: [], + execute: function () { + BoomTimeBasedThreshold = (function () { + function BoomTimeBasedThreshold() { + this.enabledDays = "Sun,Mon,Tue,Wed,Thu,Fri,Sat"; + this.from = "0000"; + this.name = "Early morning of everyday"; + this.threshold = "70,90"; + this.to = "0530"; + } + return BoomTimeBasedThreshold; + }()); + exports_1("BoomTimeBasedThreshold", BoomTimeBasedThreshold); + } + }; +}); +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQm9vbVRpbWVCYXNlZFRocmVzaG9sZC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9hcHAvYm9vbS9Cb29tVGltZUJhc2VkVGhyZXNob2xkLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7WUFFQTtnQkFNSTtvQkFDSSxJQUFJLENBQUMsV0FBVyxHQUFHLDZCQUE2QixDQUFDO29CQUNqRCxJQUFJLENBQUMsSUFBSSxHQUFHLE1BQU0sQ0FBQztvQkFDbkIsSUFBSSxDQUFDLElBQUksR0FBRywyQkFBMkIsQ0FBQztvQkFDeEMsSUFBSSxDQUFDLFNBQVMsR0FBRyxPQUFPLENBQUM7b0JBQ3pCLElBQUksQ0FBQyxFQUFFLEdBQUcsTUFBTSxDQUFDO2dCQUNyQixDQUFDO2dCQUNMLDZCQUFDO1lBQUQsQ0FBQyxBQWJELElBYUMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBJQm9vbVRpbWVCYXNlZFRocmVzaG9sZCB9IGZyb20gXCIuL2luZGV4XCI7XHJcblxyXG5jbGFzcyBCb29tVGltZUJhc2VkVGhyZXNob2xkIGltcGxlbWVudHMgSUJvb21UaW1lQmFzZWRUaHJlc2hvbGQge1xyXG4gICAgcHVibGljIGVuYWJsZWREYXlzOiBzdHJpbmc7XHJcbiAgICBwdWJsaWMgZnJvbTogc3RyaW5nO1xyXG4gICAgcHVibGljIG5hbWU6IHN0cmluZztcclxuICAgIHB1YmxpYyB0aHJlc2hvbGQ6IHN0cmluZztcclxuICAgIHB1YmxpYyB0bzogc3RyaW5nO1xyXG4gICAgY29uc3RydWN0b3IoKSB7XHJcbiAgICAgICAgdGhpcy5lbmFibGVkRGF5cyA9IFwiU3VuLE1vbixUdWUsV2VkLFRodSxGcmksU2F0XCI7XHJcbiAgICAgICAgdGhpcy5mcm9tID0gXCIwMDAwXCI7XHJcbiAgICAgICAgdGhpcy5uYW1lID0gXCJFYXJseSBtb3JuaW5nIG9mIGV2ZXJ5ZGF5XCI7XHJcbiAgICAgICAgdGhpcy50aHJlc2hvbGQgPSBcIjcwLDkwXCI7XHJcbiAgICAgICAgdGhpcy50byA9IFwiMDUzMFwiO1xyXG4gICAgfVxyXG59XHJcblxyXG5leHBvcnQge1xyXG4gICAgQm9vbVRpbWVCYXNlZFRocmVzaG9sZFxyXG59O1xyXG4iXX0= \ No newline at end of file diff --git a/dist/app/boom/BoomUtils.js b/dist/app/boom/BoomUtils.js new file mode 100644 index 0000000..07770a7 --- /dev/null +++ b/dist/app/boom/BoomUtils.js @@ -0,0 +1,126 @@ +System.register(["lodash"], function (exports_1, context_1) { + "use strict"; + var lodash_1, normalizeColor, replaceTokens, getActualNameWithoutTokens, getDecimalsForValue, getItemBasedOnThreshold; + var __moduleName = context_1 && context_1.id; + return { + setters: [ + function (lodash_1_1) { + lodash_1 = lodash_1_1; + } + ], + execute: function () { + normalizeColor = function (color) { + if (color.toLowerCase() === "green") { + return "rgba(50, 172, 45, 0.97)"; + } + else if (color.toLowerCase() === "orange") { + return "rgba(237, 129, 40, 0.89)"; + } + else if (color.toLowerCase() === "red") { + return "rgba(245, 54, 54, 0.9)"; + } + else { + return color.toLowerCase(); + } + }; + exports_1("normalizeColor", normalizeColor); + replaceTokens = function (value) { + if (!value) { + return value; + } + value = value + ""; + value = value.split(" ").map(function (a) { + if (a.startsWith("_fa-") && a.endsWith("_")) { + var icon = a.replace(/\_/g, "").split(",")[0]; + var color = a.indexOf(",") > -1 ? " style=\"color:" + normalizeColor(a.replace(/\_/g, "").split(",")[1]) + "\" " : ""; + var repeatCount = a.split(",").length > 2 ? +(a.replace(/\_/g, "").split(",")[2]) : 1; + a = (" ").repeat(repeatCount); + } + else if (a.startsWith("_img-") && a.endsWith("_")) { + a = a.slice(0, -1); + var imgUrl = a.replace("_img-", "").split(",")[0]; + var imgWidth = a.split(",").length > 1 ? a.replace("_img-", "").split(",")[1] : "20px"; + var imgHeight = a.split(",").length > 2 ? a.replace("_img-", "").split(",")[2] : "20px"; + var repeatCount = a.split(",").length > 3 ? +(a.replace("_img-", "").split(",")[3]) : 1; + a = ("").repeat(repeatCount); + } + return a; + }).join(" "); + return value; + }; + exports_1("replaceTokens", replaceTokens); + getActualNameWithoutTokens = function (value) { + if (!value) { + return value + ""; + } + value = value + ""; + return value.split(" ").map(function (a) { + if (a.startsWith("_fa-") && a.endsWith("_")) { + a = ""; + } + else if (a.startsWith("_img-") && a.endsWith("_")) { + a = ""; + } + return a; + }).join(" "); + }; + exports_1("getActualNameWithoutTokens", getActualNameWithoutTokens); + getDecimalsForValue = function (value, _decimals) { + if (lodash_1.default.isNumber(+_decimals)) { + var o = { + decimals: _decimals, + scaledDecimals: null + }; + return o; + } + var delta = value / 2; + var dec = -Math.floor(Math.log(delta) / Math.LN10); + var magn = Math.pow(10, -dec), norm = delta / magn, size; + if (norm < 1.5) { + size = 1; + } + else if (norm < 3) { + size = 2; + if (norm > 2.25) { + size = 2.5; + ++dec; + } + } + else if (norm < 7.5) { + size = 5; + } + else { + size = 10; + } + size *= magn; + if (Math.floor(value) === value) { + dec = 0; + } + var result = { + decimals: Math.max(0, dec), + scaledDecimals: Math.max(0, dec) - Math.floor(Math.log(size) / Math.LN10) + 2 + }; + return result; + }; + exports_1("getDecimalsForValue", getDecimalsForValue); + getItemBasedOnThreshold = function (thresholds, ranges, value, defaultValue) { + var c = defaultValue; + if (thresholds && ranges && typeof value === "number" && thresholds.length + 1 <= ranges.length) { + ranges = lodash_1.default.dropRight(ranges, ranges.length - thresholds.length - 1); + if (ranges[ranges.length - 1] === "") { + ranges[ranges.length - 1] = defaultValue; + } + for (var i = thresholds.length; i > 0; i--) { + if (value >= thresholds[i - 1]) { + return ranges[i]; + } + } + return lodash_1.default.first(ranges); + } + return c; + }; + exports_1("getItemBasedOnThreshold", getItemBasedOnThreshold); + } + }; +}); +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQm9vbVV0aWxzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2FwcC9ib29tL0Jvb21VdGlscy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7OztZQUVNLGNBQWMsR0FBRyxVQUFVLEtBQUs7Z0JBQ2xDLElBQUksS0FBSyxDQUFDLFdBQVcsRUFBRSxLQUFLLE9BQU8sRUFBRTtvQkFDakMsT0FBTyx5QkFBeUIsQ0FBQztpQkFDcEM7cUJ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AgaWYgKHRocmVzaG9sZHMgJiYgcmFuZ2VzICYmIHR5cGVvZiB2YWx1ZSA9PT0gXCJudW1iZXJcIiAmJiB0aHJlc2hvbGRzLmxlbmd0aCArIDEgPD0gcmFuZ2VzLmxlbmd0aCkge1xyXG4gICAgICAgIHJhbmdlcyA9IF8uZHJvcFJpZ2h0KHJhbmdlcywgcmFuZ2VzLmxlbmd0aCAtIHRocmVzaG9sZHMubGVuZ3RoIC0gMSk7XHJcbiAgICAgICAgaWYgKHJhbmdlc1tyYW5nZXMubGVuZ3RoIC0gMV0gPT09IFwiXCIpIHtcclxuICAgICAgICAgICAgcmFuZ2VzW3Jhbmdlcy5sZW5ndGggLSAxXSA9IGRlZmF1bHRWYWx1ZTtcclxuICAgICAgICB9XHJcbiAgICAgICAgZm9yIChsZXQgaSA9IHRocmVzaG9sZHMubGVuZ3RoOyBpID4gMDsgaS0tKSB7XHJcbiAgICAgICAgICAgIGlmICh2YWx1ZSA+PSB0aHJlc2hvbGRzW2kgLSAxXSkge1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuIHJhbmdlc1tpXTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICByZXR1cm4gXy5maXJzdChyYW5nZXMpO1xyXG4gICAgfVxyXG4gICAgcmV0dXJuIGM7XHJcblxyXG59O1xyXG5leHBvcnQge1xyXG4gICAgbm9ybWFsaXplQ29sb3IsXHJcbiAgICByZXBsYWNlVG9rZW5zLFxyXG4gICAgZ2V0QWN0dWFsTmFtZVdpdGhvdXRUb2tlbnMsXHJcbiAgICBnZXREZWNpbWFsc0ZvclZhbHVlLFxyXG4gICAgZ2V0SXRlbUJhc2VkT25UaHJlc2hvbGRcclxufTtcclxuIl19 \ No newline at end of file diff --git a/dist/app/boom/index.js b/dist/app/boom/index.js new file mode 100644 index 0000000..b2efc87 --- /dev/null +++ b/dist/app/boom/index.js @@ -0,0 +1,35 @@ +System.register(["./BoomUtils", "./BoomTimeBasedThreshold", "./BoomPattern", "./BoomSeries"], function (exports_1, context_1) { + "use strict"; + var __moduleName = context_1 && context_1.id; + return { + setters: [ + function (BoomUtils_1_1) { + exports_1({ + "normalizeColor": BoomUtils_1_1["normalizeColor"], + "replaceTokens": BoomUtils_1_1["replaceTokens"], + "getActualNameWithoutTokens": BoomUtils_1_1["getActualNameWithoutTokens"], + "getDecimalsForValue": BoomUtils_1_1["getDecimalsForValue"], + "getItemBasedOnThreshold": BoomUtils_1_1["getItemBasedOnThreshold"] + }); + }, + function (BoomTimeBasedThreshold_1_1) { + exports_1({ + "BoomTimeBasedThreshold": BoomTimeBasedThreshold_1_1["BoomTimeBasedThreshold"] + }); + }, + function (BoomPattern_1_1) { + exports_1({ + "BoomPattern": BoomPattern_1_1["BoomPattern"] + }); + }, + function (BoomSeries_1_1) { + exports_1({ + "BoomSeries": BoomSeries_1_1["BoomSeries"] + }); + } + ], + execute: function () { + } + }; +}); +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvYXBwL2Jvb20vaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCB7IElCb29tUGF0dGVybiwgSUJvb21TZXJpZXMsIElCb29tVGltZUJhc2VkVGhyZXNob2xkLCBJQm9vbVJlbmRlcmluZ09wdGlvbnMsIElCb29tVGFibGUsIElCb29tSFRNTCwgSUJvb21DZWxsRGV0YWlscyB9IGZyb20gXCIuL0Jvb20uaW50ZXJmYWNlXCI7XHJcbmV4cG9ydCB7IG5vcm1hbGl6ZUNvbG9yLCByZXBsYWNlVG9rZW5zLCBnZXRBY3R1YWxOYW1lV2l0aG91dFRva2VucywgZ2V0RGVjaW1hbHNGb3JWYWx1ZSwgZ2V0SXRlbUJhc2VkT25UaHJlc2hvbGQgfSBmcm9tIFwiLi9Cb29tVXRpbHNcIjtcclxuZXhwb3J0IHsgQm9vbVRpbWVCYXNlZFRocmVzaG9sZCB9IGZyb20gXCIuL0Jvb21UaW1lQmFzZWRUaHJlc2hvbGRcIjtcclxuZXhwb3J0IHsgQm9vbVBhdHRlcm4gfSBmcm9tIFwiLi9Cb29tUGF0dGVyblwiO1xyXG5leHBvcnQgeyBCb29tU2VyaWVzIH0gZnJvbSBcIi4vQm9vbVNlcmllc1wiO1xyXG4iXX0= \ No newline at end of file diff --git a/dist/app/config.js b/dist/app/config.js new file mode 100644 index 0000000..a5f8fd2 --- /dev/null +++ b/dist/app/config.js @@ -0,0 +1,35 @@ +System.register([], function (exports_1, context_1) { + "use strict"; + var plugin_id, value_name_options, config; + var __moduleName = context_1 && context_1.id; + return { + setters: [], + execute: function () { + plugin_id = "yesoreyeram-boomtable-panel"; + exports_1("plugin_id", plugin_id); + value_name_options = [ + { text: "Min", value: "min" }, + { text: "Max", value: "max" }, + { text: "Average", value: "avg" }, + { text: "Current", value: "current" }, + { text: "Total", value: "total" } + ]; + exports_1("value_name_options", value_name_options); + config = { + debug_mode: false, + error: undefined, + groupedData: undefined, + hide_first_column: false, + hide_headers: false, + panelDefaults: { + activePatternIndex: -1, + default_title_for_rows: "Metric", + patterns: [], + row_col_wrapper: "_", + } + }; + exports_1("config", config); + } + }; +}); +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uZmlnLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2FwcC9jb25maWcudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7OztZQUFNLFNBQVMsR0FBRyw2QkFBNkIsQ0FBQzs7WUFDMUMsa0JBQWtCLEdBQUc7Z0JBQ3ZCLEVBQUUsSUFBSSxFQUFFLEtBQUssRUFBRSxLQUFLLEVBQUUsS0FBSyxFQUFFO2dCQUM3QixFQUFFLElBQUksRUFBRSxLQUFLLEVBQUUsS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zogYW55ID0ge1xyXG4gICAgZGVidWdfbW9kZTogZmFsc2UsXHJcbiAgICBlcnJvcjogdW5kZWZpbmVkLFxyXG4gICAgZ3JvdXBlZERhdGE6IHVuZGVmaW5lZCxcclxuICAgIGhpZGVfZmlyc3RfY29sdW1uOiBmYWxzZSxcclxuICAgIGhpZGVfaGVhZGVyczogZmFsc2UsXHJcbiAgICBwYW5lbERlZmF1bHRzOiB7XHJcbiAgICAgICAgYWN0aXZlUGF0dGVybkluZGV4OiAtMSxcclxuICAgICAgICBkZWZhdWx0X3RpdGxlX2Zvcl9yb3dzOiBcIk1ldHJpY1wiLFxyXG4gICAgICAgIHBhdHRlcm5zOiBbXSxcclxuICAgICAgICByb3dfY29sX3dyYXBwZXI6IFwiX1wiLFxyXG4gICAgfVxyXG59O1xyXG5cclxuZXhwb3J0IHtcclxuICAgIHBsdWdpbl9pZCxcclxuICAgIHZhbHVlX25hbWVfb3B0aW9ucyxcclxuICAgIGNvbmZpZ1xyXG59O1xyXG4iXX0= \ No newline at end of file diff --git a/dist/app/utils.js b/dist/app/utils.js deleted file mode 100644 index 8a6e977..0000000 --- a/dist/app/utils.js +++ /dev/null @@ -1,32 +0,0 @@ -System.register(["lodash"], function(exports_1) { - var lodash_1; - var getFields, getUniqueFields, normalizeColor; - return { - setters:[ - function (lodash_1_1) { - lodash_1 = lodash_1_1; - }], - execute: function() { - getFields = function (collection, field) { - return lodash_1.default.map(collection, function (d) { return d[field]; }); - }; - getUniqueFields = function (collection, field) { - return lodash_1.default.uniq(lodash_1.default.map(collection, function (d) { return d[field]; })); - }; - normalizeColor = function (color) { - if (color.toLowerCase() === "green") - return "rgba(50, 172, 45, 0.97)"; - else if (color.toLowerCase() === "orange") - return "rgba(237, 129, 40, 0.89)"; - else if (color.toLowerCase() === "red") - return "rgba(245, 54, 54, 0.9)"; - else - return color.toLowerCase(); - }; - exports_1("getFields", getFields); - exports_1("getUniqueFields", getUniqueFields); - exports_1("normalizeColor", normalizeColor); - } - } -}); -//# sourceMappingURL=utils.js.map \ No newline at end of file diff --git a/dist/app/utils.js.map b/dist/app/utils.js.map deleted file mode 100644 index 77a0354..0000000 --- a/dist/app/utils.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/app/utils.ts"],"names":[],"mappings":";;QAEM,SAAS,EAGT,eAAe,EAGf,cAAc;;;;;;;YANd,SAAS,GAAG,UAAU,UAAU,EAAE,KAAK;gBACzC,MAAM,CAAC,gBAAC,CAAC,GAAG,CAAC,UAAU,EAAE,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,KAAK,CAAC,EAAR,CAAQ,CAAC,CAAC;YAC5C,CAAC,CAAC;YACI,eAAe,GAAG,UAAU,UAAU,EAAE,KAAK;gBAC/C,MAAM,CAAC,gBAAC,CAAC,IAAI,CAAC,gBAAC,CAAC,GAAG,CAAC,UAAU,EAAE,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,KAAK,CAAC,EAAR,CAAQ,CAAC,CAAC,CAAC;YACpD,CAAC,CAAC;YACI,cAAc,GAAG,UAAU,KAAK;gBAClC,EAAE,CAAC,CAAC,KAAK,CAAC,WAAW,EAAE,KAAK,OAAO,CAAC;oBAAC,MAAM,CAAC,yBAAyB,CAAC;gBACtE,IAAI,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,WAAW,EAAE,KAAK,QAAQ,CAAC;oBAAC,MAAM,CAAC,0BAA0B,CAAC;gBAC7E,IAAI,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,WAAW,EAAE,KAAK,KAAK,CAAC;oBAAC,MAAM,CAAC,wBAAwB,CAAC;gBACxE,IAAI;oBAAC,MAAM,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;YACpC,CAAC,CAAA;YAEG,iCAAS;YACT,6CAAe;YACf,2CAAc"} \ No newline at end of file diff --git a/dist/css/default.dark.css b/dist/css/default.dark.css index 53fa723..eb482e0 100644 --- a/dist/css/default.dark.css +++ b/dist/css/default.dark.css @@ -1,17 +1,42 @@ -.boom-table .debug{ - margin-top :30px; -} -.boom-table .debug table tr{ - border: 2px solid red; -} +.boom-table .mini-split { + margin-right: 10px; } + +.boom-table .split { + margin-right: 20px; } + +.boom-table .boom-btn { + padding: 10px; + margin-right: 10px; + min-width: 200px; + text-transform: lowercase; } + +.boom-table h6.text-header { + padding: 0 0 10px 0; + font-weight: bolder; } + .boom-table h6.text-header i { + font-weight: 100; } + +.boom-table .debug { + margin-top: 30px; } + +.boom-table .boom-label { + padding-left: 10px; } + +.boom-table .debug table tr { + border: 2px solid red; } + .boom-table .inline-form-control { - display: inline-block; - margin: 10px 20px 10px 0px; - padding:5px; -} + display: inline-block; + margin: 10px 20px 10px 0px; + padding: 5px; } + .boom-table .btn-small { - margin-left: 20px; -} -.boom-table .btn-small .fa{ - margin-right: 5px; -} \ No newline at end of file + margin-left: 20px; } + +.boom-table .btn-small .fa { + margin-right: 5px; } + +.boom-table h6.text-header { + color: cadetblue; } + .boom-table h6.text-header i { + color: darkcyan; } diff --git a/dist/css/default.light.css b/dist/css/default.light.css index 53fa723..86a6186 100644 --- a/dist/css/default.light.css +++ b/dist/css/default.light.css @@ -1,17 +1,42 @@ -.boom-table .debug{ - margin-top :30px; -} -.boom-table .debug table tr{ - border: 2px solid red; -} +.boom-table .mini-split { + margin-right: 10px; } + +.boom-table .split { + margin-right: 20px; } + +.boom-table .boom-btn { + padding: 10px; + margin-right: 10px; + min-width: 200px; + text-transform: lowercase; } + +.boom-table h6.text-header { + padding: 0 0 10px 0; + font-weight: bolder; } + .boom-table h6.text-header i { + font-weight: 100; } + +.boom-table .debug { + margin-top: 30px; } + +.boom-table .boom-label { + padding-left: 10px; } + +.boom-table .debug table tr { + border: 2px solid red; } + .boom-table .inline-form-control { - display: inline-block; - margin: 10px 20px 10px 0px; - padding:5px; -} + display: inline-block; + margin: 10px 20px 10px 0px; + padding: 5px; } + .boom-table .btn-small { - margin-left: 20px; -} -.boom-table .btn-small .fa{ - margin-right: 5px; -} \ No newline at end of file + margin-left: 20px; } + +.boom-table .btn-small .fa { + margin-right: 5px; } + +.boom-table h6.text-header { + color: darkmagenta; } + .boom-table h6.text-header i { + color: darksalmon; } diff --git a/dist/module.js b/dist/module.js index a3d0ae0..68b3fb7 100644 --- a/dist/module.js +++ b/dist/module.js @@ -1,589 +1,160 @@ -System.register(["./app/app", "lodash"], function(exports_1) { - var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - var app_1, lodash_1; - var GrafanaBoomTableCtrl; +System.register(["lodash", "app/core/utils/kbn", "app/plugins/sdk", "./app/boom/index", "./app/config", "./app/app"], function (exports_1, context_1) { + "use strict"; + var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + })(); + var lodash_1, kbn_1, sdk_1, index_1, config_1, app_1, GrafanaBoomTableCtrl; + var __moduleName = context_1 && context_1.id; return { - setters:[ - function (app_1_1) { - app_1 = app_1_1; - }, + setters: [ function (lodash_1_1) { lodash_1 = lodash_1_1; - }], - execute: function() { - app_1.loadPluginCss(app_1.config.list_of_stylesheets); + }, + function (kbn_1_1) { + kbn_1 = kbn_1_1; + }, + function (sdk_1_1) { + sdk_1 = sdk_1_1; + }, + function (index_1_1) { + index_1 = index_1_1; + }, + function (config_1_1) { + config_1 = config_1_1; + }, + function (app_1_1) { + app_1 = app_1_1; + } + ], + execute: function () { + sdk_1.loadPluginCss({ + dark: "plugins/" + config_1.plugin_id + "/css/default.dark.css", + light: "plugins/" + config_1.plugin_id + "/css/default.light.css" + }); GrafanaBoomTableCtrl = (function (_super) { __extends(GrafanaBoomTableCtrl, _super); - function GrafanaBoomTableCtrl($scope, $injector, $sce) { - _super.call(this, $scope, $injector); - this.unitFormats = app_1.kbn.getUnitFormats(); - this.valueNameOptions = app_1.config.valueNameOptions; - lodash_1.default.defaults(this.panel, app_1.config.panelDefaults); - this.events.on("data-received", this.onDataReceived.bind(this)); - this.events.on("init-edit-mode", this.onInitEditMode.bind(this)); + function GrafanaBoomTableCtrl($scope, $injector) { + var _this = _super.call(this, $scope, $injector) || this; + _this.unitFormats = kbn_1.default.getUnitFormats(); + _this.valueNameOptions = config_1.value_name_options; + lodash_1.default.defaults(_this.panel, config_1.config.panelDefaults); + _this.panel.defaultPattern = _this.panel.defaultPattern || app_1.defaultPattern; + _this.updatePrototypes(); + _this.events.on("data-received", _this.onDataReceived.bind(_this)); + _this.events.on("data-snapshot-load", _this.onDataReceived.bind(_this)); + _this.events.on("init-edit-mode", _this.onInitEditMode.bind(_this)); + _this.panel.activePatternIndex = _this.panel.activePatternIndex === -1 ? _this.panel.patterns.length : _this.panel.activePatternIndex; + return _this; } - GrafanaBoomTableCtrl.prototype.onInitEditMode = function () { - var _this = this; - lodash_1.default.each(app_1.config.editorTabs, function (editor) { - _this.addEditorTab(editor.name, "public/plugins/" + app_1.config.plugin_id + editor.template, editor.position); + GrafanaBoomTableCtrl.prototype.updatePrototypes = function () { + Object.setPrototypeOf(this.panel.defaultPattern, index_1.BoomPattern.prototype); + this.panel.patterns.map(function (pattern) { + Object.setPrototypeOf(pattern, index_1.BoomPattern.prototype); + return pattern; }); }; GrafanaBoomTableCtrl.prototype.onDataReceived = function (data) { this.dataReceived = data; this.render(); }; - GrafanaBoomTableCtrl.prototype.seriesHandler = function (seriesData) { - var series = new app_1.TimeSeries({ - datapoints: seriesData.datapoints || [], - alias: seriesData.target - }); - series.flotpairs = series.getFlotPairs(this.panel.nullPointMode); - return series; + GrafanaBoomTableCtrl.prototype.onInitEditMode = function () { + this.addEditorTab("Patterns", "public/plugins/" + config_1.plugin_id + "/partials/patterns.html", 2); + this.addEditorTab("Options", "public/plugins/" + config_1.plugin_id + "/partials/options.html", 3); }; GrafanaBoomTableCtrl.prototype.addPattern = function () { - var newPattern = { - name: "New Pattern", - pattern: "^server.*cpu$", - delimiter: ".", - valueName: "avg", - row_name: this.panel.row_col_wrapper + "0" + this.panel.row_col_wrapper, - col_name: this.panel.row_col_wrapper + "1" + this.panel.row_col_wrapper, - thresholds: "70,90", - time_based_thresholds: [], - enable_time_based_thresholds: false, - enable_bgColor: false, - bgColors: "green|orange|red", - enable_bgColor_overrides: false, - bgColors_overrides: "0->green|2->red|1->yellow", - enable_transform: false, - transform_values: "_value_|_value_|_value_", - enable_transform_overrides: false, - transform_values_overrides: "0->down|1->up", - decimals: 2, - format: "none", - null_color: "darkred", - null_value: "No data", - enable_clickable_cells: false, - clickable_cells_link: "", - filter: { - value_below: "", - value_above: "", - } - }; + var newPattern = new index_1.BoomPattern({ + row_col_wrapper: this.panel.row_col_wrapper + }); this.panel.patterns.push(newPattern); this.panel.activePatternIndex = this.panel.patterns.length - 1; this.render(); }; - GrafanaBoomTableCtrl.prototype.movePattern = function (direction, index) { - var tempElement = this.panel.patterns[index]; - if (direction === "UP") { - this.panel.patterns[index] = this.panel.patterns[index - 1]; - this.panel.patterns[index - 1] = tempElement; - this.panel.activePatternIndex = index - 1; - } - if (direction === "DOWN") { - this.panel.patterns[index] = this.panel.patterns[index + 1]; - this.panel.patterns[index + 1] = tempElement; - this.panel.activePatternIndex = index + 1; - } - this.render(); - }; GrafanaBoomTableCtrl.prototype.removePattern = function (index) { this.panel.patterns.splice(index, 1); this.panel.activePatternIndex = (this.panel.patterns && this.panel.patterns.length > 0) ? (this.panel.patterns.length - 1) : -1; this.render(); }; - GrafanaBoomTableCtrl.prototype.clonePattern = function (index) { - var copiedPattern = Object.assign({}, this.panel.patterns[index]); - this.panel.patterns.push(copiedPattern); - this.render(); - }; - GrafanaBoomTableCtrl.prototype.add_time_based_thresholds = function (index) { - var new_time_based_threshold = { - name: "Early morning of everyday", - from: "0000", - to: "0530", - enabledDays: "Sun,Mon,Tue,Wed,Thu,Fri,Sat", - threshold: "70,90" - }; - if (index === 'default') { - this.panel.defaultPattern.time_based_thresholds = this.panel.defaultPattern.time_based_thresholds || []; - this.panel.defaultPattern.time_based_thresholds.push(new_time_based_threshold); - } - else { - this.panel.patterns[index].time_based_thresholds = this.panel.patterns[index].time_based_thresholds || []; - this.panel.patterns[index].time_based_thresholds.push(new_time_based_threshold); - } - this.render(); - }; - GrafanaBoomTableCtrl.prototype.remove_time_based_thresholds = function (patternIndex, index) { - if (patternIndex === 'default') { - this.panel.defaultPattern.time_based_thresholds.splice(index, 1); - } - else { - this.panel.patterns[patternIndex].time_based_thresholds.splice(index, 1); - } - }; - GrafanaBoomTableCtrl.prototype.inverseBGColors = function (index) { - if (index === -1) { - this.panel.defaultPattern.bgColors = this.panel.defaultPattern.bgColors.split("|").reverse().join("|"); - } - else { - this.panel.patterns[index].bgColors = this.panel.patterns[index].bgColors.split("|").reverse().join("|"); - } - this.render(); - }; - GrafanaBoomTableCtrl.prototype.inverseTransformValues = function (index) { - if (index === -1) { - this.panel.defaultPattern.transform_values = this.panel.defaultPattern.transform_values.split("|").reverse().join("|"); + GrafanaBoomTableCtrl.prototype.movePattern = function (direction, index) { + var tempElement = this.panel.patterns[Number(index)]; + if (direction === "UP") { + this.panel.patterns[Number(index)] = this.panel.patterns[Number(index) - 1]; + this.panel.patterns[Number(index) - 1] = tempElement; + this.panel.activePatternIndex = Number(index) - 1; } - else { - this.panel.patterns[index].transform_values = this.panel.patterns[index].transform_values.split("|").reverse().join("|"); + if (direction === "DOWN") { + this.panel.patterns[Number(index)] = this.panel.patterns[Number(index) + 1]; + this.panel.patterns[Number(index) + 1] = tempElement; + this.panel.activePatternIndex = Number(index) + 1; } this.render(); }; - GrafanaBoomTableCtrl.prototype.computeBgColor = function (thresholds, bgColors, value) { - var c = "transparent"; - if (thresholds && bgColors && typeof value === "number" && thresholds.length + 1 <= bgColors.length) { - bgColors = lodash_1.default.dropRight(bgColors, bgColors.length - thresholds.length - 1); - if (bgColors[bgColors.length - 1] === "") { - bgColors[bgColors.length - 1] = "transparent"; - } - for (var i = thresholds.length; i > 0; i--) { - if (value >= thresholds[i - 1]) { - return app_1.utils.normalizeColor(bgColors[i]); - } - } - return app_1.utils.normalizeColor(lodash_1.default.first(bgColors)); - } - return c; - }; - GrafanaBoomTableCtrl.prototype.transformValue = function (thresholds, transform_values, value, displayValue, row_name, col_name) { - var t = value; - if (thresholds && transform_values && typeof value === "number" && thresholds.length + 1 <= transform_values.length) { - transform_values = lodash_1.default.dropRight(transform_values, transform_values.length - thresholds.length - 1); - if (transform_values[transform_values.length - 1] === "") { - transform_values[transform_values.length - 1] = "_value_"; - } - for (var i = thresholds.length; i > 0; i--) { - if (value >= thresholds[i - 1]) { - return transform_values[i].replace(new RegExp("_value_", "g"), displayValue).replace(new RegExp("_row_name_", "g"), row_name).replace(new RegExp("_col_name_", "g"), col_name); - } - } - return lodash_1.default.first(transform_values).replace(new RegExp("_value_", "g"), displayValue).replace(new RegExp("_row_name_", "g"), row_name).replace(new RegExp("_col_name_", "g"), col_name); - } - return t; - }; - GrafanaBoomTableCtrl.prototype.replaceFontAwesomeIcons = function (value) { - if (!value) - return value; - return (value + "") - .split(" ") - .map(function (a) { - if (a.startsWith("_fa-") && a.endsWith("_")) { - var icon = a.replace(/\_/g, "").split(",")[0]; - var color = a.indexOf(",") > -1 ? " style=\"color:" + app_1.utils.normalizeColor(a.replace(/\_/g, "").split(",")[1]) + "\" " : ""; - var repeatCount = a.split(",").length > 2 ? +(a.replace(/\_/g, "").split(",")[2]) : 1; - a = (" ").repeat(repeatCount); - } - return a; - }) - .join(" "); - }; - GrafanaBoomTableCtrl.prototype.replaceWithImages = function (value) { - if (!value) - return value; - return (value + "") - .split(" ") - .map(function (a) { - if (a.startsWith("_img-") && a.endsWith("_")) { - a = a.slice(0, -1); - var imgUrl = a.replace("_img-", "").split(",")[0]; - var imgWidth = a.split(",").length > 1 ? a.replace("_img-", "").split(",")[1] : "20px"; - var imgHeight = a.split(",").length > 2 ? a.replace("_img-", "").split(",")[2] : "20px"; - var repeatCount = a.split(",").length > 3 ? +(a.replace("_img-", "").split(",")[3]) : 1; - a = ("").repeat(repeatCount); - } - return a; - }) - .join(" "); - }; - GrafanaBoomTableCtrl.prototype.getActualNameWithoutTransformSign = function (value) { - return (value + "") - .split(" ") - .map(function (a) { - if (a.startsWith("_fa-") && a.endsWith("_")) { - a = ""; - } - if (a.startsWith("_img-") && a.endsWith("_")) { - a = ""; - } - return a; - }) - .join(" "); - }; - GrafanaBoomTableCtrl.prototype.getDecimalsForValue = function (value, _decimals) { - if (lodash_1.default.isNumber(+_decimals)) { - var o = { - decimals: _decimals, - scaledDecimals: null - }; - return o; - } - var delta = value / 2; - var dec = -Math.floor(Math.log(delta) / Math.LN10); - var magn = Math.pow(10, -dec), norm = delta / magn, // norm is between 1.0 and 10.0 - size; - if (norm < 1.5) { - size = 1; - } - else if (norm < 3) { - size = 2; - // special case for 2.5, requires an extra decimal - if (norm > 2.25) { - size = 2.5; - ++dec; - } - } - else if (norm < 7.5) { - size = 5; - } - else { - size = 10; - } - size *= magn; - // reduce starting decimals if not needed - if (Math.floor(value) === value) { - dec = 0; - } - var result = { - decimals: Math.max(0, dec), - scaledDecimals: Math.max(0, dec) - Math.floor(Math.log(size) / Math.LN10) + 2 - }; - return result; - }; - GrafanaBoomTableCtrl.prototype.setUnitFormat = function (subItem, index) { - if (index === -1) { - this.panel.defaultPattern.format = subItem.value; - } - else { - this.panel.patterns[index].format = subItem.value; - } + GrafanaBoomTableCtrl.prototype.clonePattern = function (index) { + var copiedPattern = Object.assign({}, this.panel.patterns[Number(index)]); + Object.setPrototypeOf(copiedPattern, index_1.BoomPattern.prototype); + this.panel.patterns.push(copiedPattern); this.render(); }; GrafanaBoomTableCtrl.prototype.limitText = function (text, maxlength) { if (text.split('').length > maxlength) { - text = text.substring(0, maxlength - 3) + "..."; + text = text.substring(0, Number(maxlength) - 3) + "..."; } return text; }; GrafanaBoomTableCtrl.prototype.link = function (scope, elem, attrs, ctrl) { - this.ctrl = ctrl; + this.scope = scope; this.elem = elem; + this.attrs = attrs; + this.ctrl = ctrl; }; GrafanaBoomTableCtrl.templateUrl = "partials/module.html"; return GrafanaBoomTableCtrl; - })(app_1.MetricsPanelCtrl); + }(sdk_1.MetricsPanelCtrl)); + exports_1("PanelCtrl", GrafanaBoomTableCtrl); GrafanaBoomTableCtrl.prototype.render = function () { var _this = this; if (this.dataReceived) { - // Copying the data received - this.dataComputed = this.dataReceived; - this.panel.default_title_for_rows = this.panel.default_title_for_rows || app_1.config.default_title_for_rows; - var metricsReceived = app_1.utils.getFields(this.dataComputed, "target"); - if (metricsReceived.length !== lodash_1.default.uniq(metricsReceived).length) { - var duplicateKeys = lodash_1.default.uniq(metricsReceived.filter(function (v) { - return metricsReceived.filter(function (t) { return t === v; }).length > 1; - })); - var err = new Error(); - err.name = "Duplicate data received"; - err.message = "Duplicate keys :
" + duplicateKeys.join("
"); - this.panel.error = err; - this.panel.data = undefined; - } - else { - this.panel.error = undefined; - // Binding the grafana computations to the metrics received - this.dataComputed = this.dataReceived.map(this.seriesHandler.bind(this)); - // Get Server Time Stamp of the Series for time based thresholds. - this.dataComputed = this.dataComputed.map(function (series) { - series.current_servertimestamp = new Date(); - if (series && series.datapoints && series.datapoints.length > 0) { - if (lodash_1.default.last(series.datapoints).length === 2) { - series.current_servertimestamp = new Date(lodash_1.default.last(series.datapoints)[1]); - } - } - return series; - }); - // Assign pattern - this.dataComputed = this.dataComputed.map(function (series) { - series.pattern = lodash_1.default.find(_this.panel.patterns.filter(function (p) { return p.disabled !== true; }), function (p) { - return series.alias.match(p.pattern); - }); - if (series.pattern === undefined) { - series.pattern = _this.panel.defaultPattern || app_1.config.panelDefaults.defaultPattern; - } - return series; - }); - // Assign Decimal Values - this.dataComputed = this.dataComputed.map(function (series) { - series.decimals = (series.pattern.decimals) || app_1.config.panelDefaults.defaultPattern.decimals; - return series; - }); - // Assign value - this.dataComputed = this.dataComputed.map(function (series) { - if (series.stats) { - series.value = series.stats[series.pattern.valueName || app_1.config.panelDefaults.defaultPattern.valueName]; - var decimalInfo = _this.getDecimalsForValue(series.value, series.decimals); - var formatFunc = app_1.kbn.valueFormats[series.pattern.format || app_1.config.panelDefaults.defaultPattern.format]; - if (series.value === null) { - series.displayValue = series.pattern.null_value || app_1.config.panelDefaults.defaultPattern.null_value || "Null"; - } - else if (!isNaN(series.value)) { - series.valueFormatted = formatFunc(series.value, decimalInfo.decimals, decimalInfo.scaledDecimals); - series.valueRounded = app_1.kbn.roundValue(series.value, decimalInfo.decimals); - series.displayValue = series.valueFormatted; - } - else { - series.displayValue = series.pattern.null_value || app_1.config.panelDefaults.defaultPattern.null_value || "Null"; - } - } - return series; - }); - // Filter Values - this.dataComputed = this.dataComputed.filter(function (series) { - if (!series.pattern.filter) { - series.pattern.filter = {}; - series.pattern.filter.value_below = ""; - series.pattern.filter.value_above = ""; - } - if (series.pattern && series.pattern.filter && (series.pattern.filter.value_below !== "" || series.pattern.filter.value_above !== "")) { - if (series.pattern.filter.value_below !== "" && series.value < +(series.pattern.filter.value_below)) { - return false; - } - if (series.pattern.filter.value_above !== "" && series.value > +(series.pattern.filter.value_above)) { - return false; - } - return true; - } - else { - return true; - } - ; - }); - // Assign Row Name - this.dataComputed = this.dataComputed.map(function (series) { - series.row_name = series.alias.split(series.pattern.delimiter || ".").reduce(function (r, it, i) { - return r.replace(new RegExp(_this.panel.row_col_wrapper + i + _this.panel.row_col_wrapper, "g"), it); - }, series.pattern.row_name.replace(new RegExp(_this.panel.row_col_wrapper + "series" + _this.panel.row_col_wrapper, "g"), series.alias) || app_1.config.panelDefaults.defaultPattern.row_name.replace(new RegExp(_this.panel.row_col_wrapper + "series" + _this.panel.row_col_wrapper, "g"), series.alias)); - if (series.alias.split(series.pattern.delimiter || ".").length === 1) { - series.row_name = series.alias; - } - return series; - }); - // Assign Col Name - this.dataComputed = this.dataComputed.map(function (series) { - series.col_name = series.alias.split(series.pattern.delimiter || ".").reduce(function (r, it, i) { - return r.replace(new RegExp(_this.panel.row_col_wrapper + i + _this.panel.row_col_wrapper, "g"), it); - }, series.pattern.col_name || app_1.config.panelDefaults.defaultPattern.col_name); - if (series.alias.split(series.pattern.delimiter || ".").length === 1 || series.row_name === series.alias) { - series.col_name = series.pattern.col_name || "Value"; - } - return series; - }); - // Assign RowCol Key - this.dataComputed = this.dataComputed.map(function (series) { - series.key_name = series.row_name + "#" + series.col_name; - return series; - }); - // Assign Thresholds - this.dataComputed = this.dataComputed.map(function (series) { - series.thresholds = (series.pattern.thresholds || app_1.config.panelDefaults.defaultPattern.thresholds).split(",").map(function (d) { return +d; }); - if (series.pattern.enable_time_based_thresholds) { - var metricrecivedTimeStamp = series.current_servertimestamp || new Date(); - var metricrecivedTimeStamp_innumber = metricrecivedTimeStamp.getHours() * 100 + metricrecivedTimeStamp.getMinutes(); - var weekdays = ["sun", "mon", "tue", "wed", "thu", "fri", "sat"]; - lodash_1.default.each(series.pattern.time_based_thresholds, function (tbtx) { - if (tbtx && tbtx.from && tbtx.to && tbtx.enabledDays && - (metricrecivedTimeStamp_innumber >= +(tbtx.from)) && - (metricrecivedTimeStamp_innumber <= +(tbtx.to)) && - (tbtx.enabledDays.toLowerCase().indexOf(weekdays[metricrecivedTimeStamp.getDay()]) > -1) && - tbtx.threshold) { - series.thresholds = (tbtx.threshold + "").split(",").map(function (d) { return +d; }); - } - }); - } - return series; - }); - // Assign BG Colors - this.dataComputed = this.dataComputed.map(function (series) { - series.enable_bgColor = series.pattern.enable_bgColor; - series.bgColors = (series.pattern.bgColors || app_1.config.panelDefaults.defaultPattern.bgColors).split("|"); - series.bgColor = series.enable_bgColor === true ? _this.computeBgColor(series.thresholds, series.bgColors, series.value) : "transparent"; - if (series.displayValue === (series.pattern.null_value || app_1.config.panelDefaults.defaultPattern.null_value || "Null")) { - series.bgColor = series.pattern.null_color || app_1.config.panelDefaults.defaultPattern.null_color; - } - return series; - }); - // BG Colors overrides - this.dataComputed = this.dataComputed.map(function (series) { - series.enable_bgColor_overrides = series.pattern.enable_bgColor_overrides; - series.bgColors_overrides = series.pattern.bgColors_overrides || ""; - if (series.enable_bgColor_overrides && series.bgColors_overrides !== "") { - var _bgColors_overrides = series.bgColors_overrides.split("|").filter(function (con) { return con.indexOf("->"); }).map(function (con) { return con.split("->"); }).filter(function (con) { return +(con[0]) === series.value; }).map(function (con) { return con[1]; }); - if (_bgColors_overrides.length > 0 && _bgColors_overrides[0] !== "") { - series.bgColor = app_1.utils.normalizeColor(("" + _bgColors_overrides[0]).trim()); - } - } - return series; - }); - // Value Transform - this.dataComputed = this.dataComputed.map(function (series) { - series.enable_transform = series.pattern.enable_transform; - series.transform_values = (series.pattern.transform_values || app_1.config.panelDefaults.defaultPattern.transform_values).split("|"); - series.displayValue = series.enable_transform === true ? _this.transformValue(series.thresholds, series.transform_values, series.value, series.displayValue, series.row_name, series.col_name) : series.displayValue; - if (series.displayValue === (series.pattern.null_value || app_1.config.panelDefaults.defaultPattern.null_value || "Null")) { - series.displayValue = series.pattern.null_value || app_1.config.panelDefaults.defaultPattern.null_value; - } - else if (isNaN(series.value)) { - series.displayValue = series.pattern.null_value || app_1.config.panelDefaults.defaultPattern.null_value; - } - return series; - }); - // Value Transform Overrides - this.dataComputed = this.dataComputed.map(function (series) { - series.enable_transform_overrides = series.pattern.enable_transform_overrides; - series.transform_values_overrides = series.pattern.transform_values_overrides || ""; - if (series.enable_transform_overrides && series.transform_values_overrides !== "") { - var _transform_values_overrides = series.transform_values_overrides.split("|").filter(function (con) { return con.indexOf("->"); }).map(function (con) { return con.split("->"); }).filter(function (con) { return +(con[0]) === series.value; }).map(function (con) { return con[1]; }); - if (_transform_values_overrides.length > 0 && _transform_values_overrides[0] !== "") { - series.displayValue = ("" + _transform_values_overrides[0]).trim().replace(new RegExp("_value_", "g"), series.displayValue).replace(new RegExp("_row_name_", "g"), series.row_name).replace(new RegExp("_col_name_", "g"), series.col_name); - } - } - return series; - }); - // Font awesome icons - this.dataComputed = this.dataComputed.map(function (series) { - series.actual_displayvalue = series.displayValue; - series.actual_row_name = series.row_name; - series.actual_col_name = series.col_name; - if (series.displayValue && series.displayValue.indexOf("_fa-") > -1) - series.displayValue = _this.replaceFontAwesomeIcons(series.displayValue); - if (series.row_name && series.row_name.indexOf("_fa-") > -1) - series.row_name = _this.replaceFontAwesomeIcons(series.row_name); - if (series.col_name && series.col_name.indexOf("_fa-") > -1) - series.col_name = _this.replaceFontAwesomeIcons(series.col_name); - return series; - }); - // Image transforms - this.dataComputed = this.dataComputed.map(function (series) { - if (series.displayValue && series.displayValue.indexOf("_img-") > -1) - series.displayValue = _this.replaceWithImages(series.displayValue); - if (series.row_name && series.row_name.indexOf("_img-") > -1) - series.row_name = _this.replaceWithImages(series.row_name); - if (series.col_name && series.col_name.indexOf("_img-") > -1) - series.col_name = _this.replaceWithImages(series.col_name); - return series; - }); - // Cell Links - this.dataComputed = this.dataComputed.map(function (series) { - if (series.pattern.enable_clickable_cells) { - var targetLink = series.pattern.clickable_cells_link || "#"; - targetLink = targetLink.replace(new RegExp("_row_name_", "g"), _this.getActualNameWithoutTransformSign(series.actual_row_name).trim()); - targetLink = targetLink.replace(new RegExp("_col_name_", "g"), _this.getActualNameWithoutTransformSign(series.actual_col_name).trim()); - targetLink = targetLink.replace(new RegExp("_value_", "g"), _this.getActualNameWithoutTransformSign(series.value).trim()); - series.displayValue = "" + series.displayValue + ""; - } - return series; - }); - // Grouping - var rows_found = app_1.utils.getFields(this.dataComputed, "row_name"); - var cols_found = app_1.utils.getFields(this.dataComputed, "col_name"); - var keys_found = app_1.utils.getFields(this.dataComputed, "key_name"); - var is_unique_keys = (keys_found.length === lodash_1.default.uniq(keys_found).length); - if (is_unique_keys) { - this.panel.error = undefined; //// - var output = []; - lodash_1.default.each(lodash_1.default.uniq(rows_found), function (row_name) { - var o = {}; - o.row = row_name; - o.cols = []; - lodash_1.default.each(lodash_1.default.uniq(cols_found), function (col_name) { - var matched_value = (lodash_1.default.find(_this.dataComputed, function (e) { - return e.row_name === row_name && e.col_name === col_name; - })); - if (!matched_value) - matched_value = { - value: NaN, - displayValue: "N/A" - }; - o.cols.push({ - "name": col_name, - "value": matched_value.value, - "actual_col_name": matched_value.actual_col_name, - "actual_row_name": matched_value.actual_row_name, - "displayValue": matched_value.displayValue || matched_value.value, - "bgColor": matched_value.bgColor || "transparent" - }); - }); - output.push(o); - }); - //region Output table construction - var boomtable_output_body_headers = this.elem.find("#boomtable_output_body_headers"); - var boomtable_output_body_headers_output = "
"; - if (this.panel.hide_headers !== true) { - boomtable_output_body_headers_output += ""; - if (this.panel.hide_first_column !== true) { - boomtable_output_body_headers_output += "" + this.panel.default_title_for_rows + ""; - } - lodash_1.default.each(lodash_1.default.uniq(cols_found), function (c) { - boomtable_output_body_headers_output += "" + c + ""; - }); - boomtable_output_body_headers_output += ""; - } - boomtable_output_body_headers.html(boomtable_output_body_headers_output); - var boomtable_output_body = this.elem.find('#boomtable_output_body'); - var boomtable_output_body_output = ""; - lodash_1.default.each(output, function (o) { - boomtable_output_body_output += ""; - if (_this.panel.hide_first_column !== true) { - boomtable_output_body_output += "" + o.row + ""; - } - lodash_1.default.each(o.cols, function (c) { - boomtable_output_body_output += "" + c.displayValue + ""; - }); - boomtable_output_body_output += ""; - }); - boomtable_output_body.html(boomtable_output_body_output); - } - else { - var duplicateKeys = lodash_1.default.uniq(keys_found.filter(function (v) { - return keys_found.filter(function (t) { return t === v; }).length > 1; - })); - var err = new Error(); - err.name = "Duplicate keys found"; - err.message = "Duplicate key values :
" + duplicateKeys.join("
"); - this.panel.error = err; - } - //region Debug table body construction - var boomtable_output_body_debug = this.elem.find('#boomtable_output_body_debug'); - var boomtable_output_body_debug_output = ""; - lodash_1.default.each(this.dataComputed, function (d) { - boomtable_output_body_debug_output += "\n \n " + d.alias + "\n " + (d.pattern.pattern || "Default") + "\n " + d.displayValue + "\n " + d.row_name + "\n " + d.col_name + "\n " + d.thresholds + "\n \n "; - }); - boomtable_output_body_debug.html(boomtable_output_body_debug_output); - } + var outputdata = this.dataReceived.map(function (seriesData) { + var seriesOptions = { + debug_mode: _this.panel.debug_mode, + row_col_wrapper: _this.panel.row_col_wrapper || "_" + }; + return new index_1.BoomSeries(seriesData, _this.panel.defaultPattern, _this.panel.patterns, seriesOptions); + }); + var renderingOptions = { + default_title_for_rows: this.panel.default_title_for_rows || config_1.config.default_title_for_rows, + hide_first_column: this.panel.hide_first_column, + hide_headers: this.panel.hide_headers, + non_matching_cells_color_bg: this.panel.non_matching_cells_color_bg, + non_matching_cells_color_text: this.panel.non_matching_cells_color_text, + non_matching_cells_text: this.panel.non_matching_cells_text, + text_alignment_firstcolumn: this.panel.text_alignment_firstcolumn, + text_alignment_header: this.panel.text_alignment_header, + text_alignment_values: this.panel.text_alignment_values + }; + var boomtabledata = app_1.seriesToTable(outputdata, renderingOptions); + var renderingdata = app_1.getRenderingHTML(boomtabledata, renderingOptions); + this.elem.find("#boomtable_output_body_headers").html("
" + renderingdata.headers); + this.elem.find('#boomtable_output_body').html("" + renderingdata.body); + this.elem.find('#boomtable_output_body_debug').html(this.panel.debug_mode ? app_1.getDebugData(outputdata) : ""); + this.elem.find("[data-toggle='tooltip']").tooltip({ + boundary: "scrollParent" + }); var rootElem = this.elem.find('.table-panel-scroll'); - var maxheightofpanel = this.panel.debug_mode ? this.ctrl.height - 71 : this.ctrl.height - 31; + var maxheightofpanel = this.panel.debug_mode ? this.ctrl.height - 111 : this.ctrl.height - 31; rootElem.css({ 'max-height': maxheightofpanel + "px" }); } }; - exports_1("PanelCtrl", GrafanaBoomTableCtrl); } - } + }; }); -//# sourceMappingURL=module.js.map \ No newline at end of file +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibW9kdWxlLmpzIiwic291cmNlUm9vdCI6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ZGVyaW5nT3B0aW9ucyk7XHJcbiAgICB0aGlzLmVsZW0uZmluZChcIiNib29tdGFibGVfb3V0cHV0X2JvZHlfaGVhZGVyc1wiKS5odG1sKGA8YnIvPmAgKyByZW5kZXJpbmdkYXRhLmhlYWRlcnMpO1xyXG4gICAgdGhpcy5lbGVtLmZpbmQoJyNib29tdGFibGVfb3V0cHV0X2JvZHknKS5odG1sKGBgICsgcmVuZGVyaW5nZGF0YS5ib2R5KTtcclxuICAgIHRoaXMuZWxlbS5maW5kKCcjYm9vbXRhYmxlX291dHB1dF9ib2R5X2RlYnVnJykuaHRtbCh0aGlzLnBhbmVsLmRlYnVnX21vZGUgPyBnZXREZWJ1Z0RhdGEob3V0cHV0ZGF0YSkgOiBgYCk7XHJcbiAgICB0aGlzLmVsZW0uZmluZChcIltkYXRhLXRvZ2dsZT0ndG9vbHRpcCddXCIpLnRvb2x0aXAoe1xyXG4gICAgICBib3VuZGFyeTogXCJzY3JvbGxQYXJlbnRcIlxyXG4gICAgfSk7XHJcbiAgICBsZXQgcm9vdEVsZW0gPSB0aGlzLmVsZW0uZmluZCgnLnRhYmxlLXBhbmVsLXNjcm9sbCcpO1xyXG4gICAgbGV0IG1heGhlaWdodG9mcGFuZWwgPSB0aGlzLnBhbmVsLmRlYnVnX21vZGUgPyB0aGlzLmN0cmwuaGVpZ2h0IC0gMTExIDogdGhpcy5jdHJsLmhlaWdodCAtIDMxO1xyXG4gICAgcm9vdEVsZW0uY3NzKHsgJ21heC1oZWlnaHQnOiBtYXhoZWlnaHRvZnBhbmVsICsgXCJweFwiIH0pO1xyXG4gIH1cclxufTtcclxuXHJcbmV4cG9ydCB7XHJcbiAgR3JhZmFuYUJvb21UYWJsZUN0cmwgYXMgUGFuZWxDdHJsXHJcbn07XHJcbiJdfQ== \ No newline at end of file diff --git a/dist/module.js.map b/dist/module.js.map deleted file mode 100644 index 14e4b89..0000000 --- a/dist/module.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"module.js","sourceRoot":"","sources":["../src/module.ts"],"names":["GrafanaBoomTableCtrl","GrafanaBoomTableCtrl.constructor","GrafanaBoomTableCtrl.onInitEditMode","GrafanaBoomTableCtrl.onDataReceived","GrafanaBoomTableCtrl.seriesHandler","GrafanaBoomTableCtrl.addPattern","GrafanaBoomTableCtrl.movePattern","GrafanaBoomTableCtrl.removePattern","GrafanaBoomTableCtrl.clonePattern","GrafanaBoomTableCtrl.add_time_based_thresholds","GrafanaBoomTableCtrl.remove_time_based_thresholds","GrafanaBoomTableCtrl.inverseBGColors","GrafanaBoomTableCtrl.inverseTransformValues","GrafanaBoomTableCtrl.computeBgColor","GrafanaBoomTableCtrl.transformValue","GrafanaBoomTableCtrl.replaceFontAwesomeIcons","GrafanaBoomTableCtrl.replaceWithImages","GrafanaBoomTableCtrl.getActualNameWithoutTransformSign","GrafanaBoomTableCtrl.getDecimalsForValue","GrafanaBoomTableCtrl.setUnitFormat","GrafanaBoomTableCtrl.limitText","GrafanaBoomTableCtrl.link"],"mappings":";;;;;;;;;;;;;;;;;YASA,mBAAa,CAAC,YAAM,CAAC,mBAAmB,CAAC,CAAC;YAE1C;gBAAmCA,wCAAgBA;gBAOjDA,8BAAYA,MAAMA,EAAEA,SAASA,EAAEA,IAAIA;oBACjCC,kBAAMA,MAAMA,EAAEA,SAASA,CAACA,CAACA;oBAN3BA,gBAAWA,GAAQA,SAAGA,CAACA,cAAcA,EAAEA,CAACA;oBACxCA,qBAAgBA,GAAWA,YAAMA,CAACA,gBAAgBA,CAACA;oBAMjDA,gBAACA,CAACA,QAAQA,CAACA,IAAIA,CAACA,KAAKA,EAAEA,YAAMA,CAACA,aAAaA,CAACA,CAACA;oBAC7CA,IAAIA,CAACA,MAAMA,CAACA,EAAEA,CAACA,eAAeA,EAAEA,IAAIA,CAACA,cAAcA,CAACA,IAAIA,CAACA,IAAIA,CAACA,CAACA,CAACA;oBAChEA,IAAIA,CAACA,MAAMA,CAACA,EAAEA,CAACA,gBAAgBA,EAAEA,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AACA;4BAC1CA,IAAIA,IAAIA,GAAIA,CAACA,CAACA,OAAOA,CAACA,KAAKA,EAACA,EAAEA,CAACA,CAACA,KAAKA,CAACA,GAAGA,CAACA,CAACA,CAACA,CAACA,CAACA;4BAC9CA,IAAIA,KAAKA,GAAGA,CAACA,CAACA,OAAOA,CAACA,GAAGA,CAACA,GAAGA,CAACA,CAACA,GAAGA,oBAAkBA,WAAKA,CAACA,cAAcA,CAACA,CAACA,CAACA,OAAOA,CAACA,KAAKA,EAACA,EAAEA,CAACA,CAACA,KAAKA,CAACA,GAAGA,CAACA,CAACA,CAACA,CAACA,CAACA,QAAIA,GAAGA,EAAEA,CAACA;4BACrHA,IAAIA,WAAWA,GAAGA,CAACA,CAACA,KAAKA,CAACA,GAAGA,CAACA,CAACA,MAAMA,GAAGA,CAACA,GAAIA,CAACA,CAACA,CAACA,CAACA,OAAOA,CAACA,KAAKA,EAACA,EAAEA,CAACA,CAACA,KAAKA,CAACA,GAAGA,CAACA,CAACA,CAACA,CAACA,CAACA,GAAGA,CAACA,CAACA;4BACtFA,CAACA,GAAGA,oBAAgBA,IAAIA,WAAKA,KAAKA,YAAQA,CAACA,MAAMA,CAACA,WAAWA,CAACA,CAACA;wBACjEA,CAACA;wBACDA,MAAMA,CAACA,CAACA,CAACA;oBACXA,CAACA,CAACA;yBACDA,IAAIA,CAACA,GAAGA,CAACA,CAACA;gBACbA,CAACA;gBACDf,gDAAiBA,GAAjBA,UAAkBA,KAAKA;oBACrBgB,EAAEA,CAAAA,CAACA,CAACA,KAAKA,CAACA;wBAACA,MAAMA,CAACA,KAAKA,CAACA;oBACxBA,MAAMA,CAACA,CAACA,KAAKA,GAACA,EAAEA,CAACA;yBAChBA,KAAKA,CAACA,GAAGA,CAACA;yBACVA,GAAGA,CAACA,UAAAA,CAACA;wBACJA,EAAEA,CAAAA,CAACA,CAACA,CAACA,UAAUA,CAACA,OAAOA,CAACA,IAAIA,CAACA,CAACA,QAAQA,CAACA,GAAGA,CAACA,CAACA,CAAAA,CAACA;4BAC3CA,CAACA,GAAGA,CAACA,CAACA,KAAKA,CAACA,CAACA,EAAEA,CAACA,CAACA,CAACA,CAACA;4BACnBA,IAAIA,MAAMA,GAAIA,CAACA,CAACA,OAAOA,CAACA,OAAOA,EAACA,EAAEA,CAACA,CAACA,KAAKA,CAACA,GAAGA,CAACA,CAACA,CAACA,CAACA,CAACA;4BAClDA,IAAIA,QAAQA,GAAIA,CAACA,CAACA,KAAKA,CAACA,GAAGA,CAACA,CAACA,MAAMA,GAAGA,CAACA,GAAIA,CAACA,CAACA,OAAOA,CAACA,OAAOA,EAACA,EAAEA,CAACA,CAACA,KAAKA,CAACA,GAAGA,CAACA,CAACA,CAACA,CAACA,GAAGA,MAAMA,CAACA;4BACxFA,IAAIA,SAASA,GAAGA,CAACA,CAACA,KAAKA,CAACA,GAAGA,CAACA,CAACA,MAAMA,GAAGA,CAACA,GAAIA,CAACA,CAACA,OAAOA,CAACA,OAAOA,EAACA,EAAEA,CAACA,CAACA,KAAKA,CAACA,GAAGA,CAACA,CAACA,CAACA,CAACA,GAAGA,MAAMA,CAACA;4BACxFA,IAAIA,WAAWA,GAAGA,CAACA,CAACA,KAAKA,CAACA,GAAGA,CAACA,CAACA,MAAMA,GAAGA,CAACA,GAAIA,CAACA,CAACA,CAACA,CAACA,OAAOA,CAACA,OAAOA,EAACA,EAAEA,CAACA,CAACA,KAAKA,CAACA,GAAGA,CAACA,CAACA,CAACA,CAACA,CAACA,GAAGA,CAACA,CAACA;4BACxFA,CAACA,GAAGA,mBAAeA,QAAQA,oBAAaA,SAASA,iBAAUA,MAAMA,UAAKA,CAACA,MAAMA,CAACA,WAAWA,CAACA,CAACA;wBAC7FA,CAACA;wBACDA,MAAMA,CAACA,CAACA,CAACA;oBACXA,CAACA,CAACA;yBACDA,IAAIA,CAACA,GAAGA,CAACA,CAACA;gBACbA,CAACA;gBACDhB,gEAAiCA,GAAjCA,UAAkCA,KAAKA;oBACrCiB,MAAMA,CAACA,C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,IAAI,EAAG,CAAC,CAAC;gBAC1D,CAAC;YACH,CAAC,CAAC;YAGwB,4CAAS"} \ No newline at end of file diff --git a/dist/partials/module.html b/dist/partials/module.html index e06b3c5..7d03e3d 100644 --- a/dist/partials/module.html +++ b/dist/partials/module.html @@ -2,35 +2,30 @@
WARNING: Panel running in debug mode
-
-

{{ctrl.panel.error.name}}

-

-
-
-
+
+
- + + + + + + + + + + + - +
MetricPatternValueRow NameCol NameThresholdsBG ColorText Color
-
-
WARNING: Panel running in debug mode
- - - - - - - - - - - - - -
MetricPatternValueRow NameCol NameThresholds
-
+ + + + + +
\ No newline at end of file diff --git a/dist/partials/options.html b/dist/partials/options.html index a6a48ab..29dbdf6 100644 --- a/dist/partials/options.html +++ b/dist/partials/options.html @@ -1,52 +1,125 @@ -

Options

-
-
-
- - +
+
+
+
+
+
Options
+
+
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
-
-
-
-
- - -
-
-
-
-
-
- - -
-
-
-
-
-
- - -
-
-
-
-
-
- - -
-
-
-
-
-
- - +
+
+
+
+
Non matching series
+
+
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
\ No newline at end of file diff --git a/dist/partials/patterns-advanced-options.html b/dist/partials/patterns-advanced-options.html deleted file mode 100644 index fa854e2..0000000 --- a/dist/partials/patterns-advanced-options.html +++ /dev/null @@ -1,148 +0,0 @@ -
- -
-
-
-
-
- - -
-
-
-
- - -
-
-
-
-
-
-
WARNING: "Value Filters" is for advance usage. This may hide part of the data based on the input. You - can safely ignore this section if you don't know the behaviour.
-
-
-
-
-
-
- - -
-
-
-
-
-  From : - To : - On : - Threshold : - - -
-
-
- - -
-
-
-
-
-
WARNING: This tab "Time based Thresholds" is for advance usage. You can safely ignore this section if you - don't want to use time based thresholds.
-
-
Note: If multiple matches found last will win; If no match found default threshold will be applicable which - was set in - "Patterns" tab. -
-
-
-
-
-
-
-
-
- - -
-
-
-
- - -
-
-
-
-
-
-
WARNING: "Value Filters" is for advance usage. This may hide part of the data based on the input. You - can safely ignore this section if you don't know the behaviour.
-
-
-
-
-
-
- - -
-
-
-
-
-  From : - To : - On : - Threshold : - - -
-
-
- -
-
-
-
-
-
WARNING: This tab "Time based Thresholds" is for advance usage. You can safely ignore this section if you - don't want to use time based thresholds.
-
-
Note: If multiple matches found last will win; If no match found default threshold will be applicable which - was set in - "Patterns" tab. -
-
-
-
-
\ No newline at end of file diff --git a/dist/partials/patterns.html b/dist/partials/patterns.html index af3d61d..51a8dab 100644 --- a/dist/partials/patterns.html +++ b/dist/partials/patterns.html @@ -8,10 +8,11 @@
Patterns
  • - {{ctrl.limitText(pattern.name || pattern.pattern || 'Default',12)}} + {{ctrl.limitText(pattern.name || + pattern.pattern || 'Default',12)}}
  • -
  • - Default +
  • + Default
  • @@ -20,353 +21,356 @@
    Patterns
  • -
    -
    +
    +
    -
    -
    - - -
    -
    -
    -
    - - -
    -
    -
    -
    - - -
    +
    +
    Warning : This pattern is currently Disabled
    +
    +
    +
    +
    - - +
    Pattern
    - - + + + + + + + + + +
    - - + + + + +
    +
    +
    +
    +
    - - +
    Stats
    - -
    + + + + +
    + + +
    +
    +
    - - +
    Thresholds
    - - + +
    -
    -
    - - - -
    -
    +
    - - -
    -
    -
    -
    - - + + + + + +
    - - + + + + + +
    -
    -
    - - - -
    -
    - - -
    -
    -
    -
    - - + + + + + +
    +
    +
    +
    +
    - - +
    Dynamic Thresholds
    - - + + + +
    -
    -
    -
    -
    -
    -
    - - -
    -
    -
    -
    - - -
    -
    -
    -
    -
    -
    - - -
    -
    -
    -
    - - -
    -
    -
    -
    - - -
    -
    -
    +
    +
    - - - + + + + + + + + + + + + + + + +
    +
    -
    -
    -
    +
    +
    +
    Overrides
    +
    - - + + + + +
    - - + + + + +
    - - + + + + +
    +
    +
    +
    +
    - - +
    Null Handling
    - - + + + + + + + +
    +
    +
    + +
    - - +
    Hide Series
    - - + + + + +
    -
    +
    +
    +
    +
    +
    - - - +
    Pattern Management
    -
    -
    - - -
    -
    -
    -
    - - -
    -
    - - + + + + + Currently Enabled + Currently Disabled
    -
    -
    - - - -
    -
    -
    -
    - - -
    -
    -
    -
    - - -
    -
    - - + + +
    - - + + +
    -
    -
    -
    -
    - - -
    -
    -
    -
    - - -
    -
    -
    - -
    \ No newline at end of file diff --git a/dist/plugin.json b/dist/plugin.json index 8679d20..a2acc65 100644 --- a/dist/plugin.json +++ b/dist/plugin.json @@ -25,7 +25,7 @@ "url": "https://github.com/yesoreyeram/yesoreyeram-boomtable-panel" } ], - "version": "0.5.1" + "version": "1.0.0" }, "dependencies": { "grafanaVersion": "4.x.x", diff --git a/jest.config.js b/jest.config.js new file mode 100644 index 0000000..be6d9cc --- /dev/null +++ b/jest.config.js @@ -0,0 +1,25 @@ +module.exports = { + "verbose": true, + "transform": { + "^.+\\.tsx?$": "ts-jest", + "^.+\\.js$": "./node_modules/babel-jest" + }, + "testRegex": "(\\.|/)(spec|jest)\\.(jsx?|tsx?)$", + "roots": [ + "tests", + "src" + ], + "moduleDirectories": [ + "node_modules", + "bower_components", + "src", + ], + "moduleFileExtensions": [ + "ts", + "tsx", + "js", + "jsx", + "json", + "node" + ] + }; \ No newline at end of file diff --git a/package.json b/package.json index 9547a9b..2d4007a 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,10 @@ { "name": "yesoreyeram-boomtable-panel", - "version": "0.5.1", + "version": "1.0.0", "description": "Boom table panel for Graphite, InfluxDB, Prometheus", "main": "dist/module.js", "scripts": { - "test": "echo \"Warning: no test specified\" && exit 0" + "test": "jest" }, "repository": { "type": "git", @@ -28,19 +28,23 @@ }, "homepage": "https://github.com/yesoreyeram/yesoreyeram-boomtable-panel#readme", "devDependencies": { - "@types/lodash": "^4.14.74", + "@types/jest": "^23.3.10", + "@types/lodash": "^4.14.119", "grafana-sdk-mocks": "github:grafana/grafana-sdk-mocks", - "grunt": "^0.4.5", - "grunt-babel": "^6.0.0", - "grunt-contrib-clean": "^0.6.0", - "grunt-contrib-copy": "^0.8.2", - "grunt-contrib-uglify": "^0.11.1", - "grunt-contrib-watch": "^0.6.1", - "grunt-execute": "^0.2.2", - "grunt-systemjs-builder": "^0.2.7", - "load-grunt-tasks": "^3.2.0", - "grunt-typescript": "^0.8.0", - "plugin-typescript": "^7.1.0" + "grunt": "^1.0.3", + "grunt-contrib-clean": "^2.0.0", + "grunt-contrib-copy": "^1.0.0", + "grunt-contrib-watch": "^1.1.0", + "grunt-run": "^0.8.1", + "grunt-sass": "^3.0.2", + "grunt-ts": "^6.0.0-beta.21", + "grunt-tslint": "^5.0.2", + "jest": "^23.6.0", + "load-grunt-tasks": "^4.0.0", + "node-sass": "^4.11.0", + "ts-jest": "^23.10.5", + "tslint": "^5.12.0", + "typescript": "^3.2.2" }, "dependencies": { "lodash": "^4.17.4" diff --git a/plugin.json b/plugin.json index 8679d20..a2acc65 100644 --- a/plugin.json +++ b/plugin.json @@ -25,7 +25,7 @@ "url": "https://github.com/yesoreyeram/yesoreyeram-boomtable-panel" } ], - "version": "0.5.1" + "version": "1.0.0" }, "dependencies": { "grafanaVersion": "4.x.x", diff --git a/src/app/app.ts b/src/app/app.ts index a0bf2ec..031040c 100644 --- a/src/app/app.ts +++ b/src/app/app.ts @@ -1,102 +1,138 @@ -/// +import _ from "lodash"; +import { IBoomSeries, IBoomRenderingOptions, IBoomHTML, IBoomCellDetails, IBoomTable } from "./boom/index"; +import { BoomPattern, replaceTokens } from './boom/index'; -import kbn from 'app/core/utils/kbn'; -import { - loadPluginCss, - MetricsPanelCtrl -} from "app/plugins/sdk"; -import TimeSeries from "app/core/time_series2"; -import * as utils from "./utils"; - -const plugin_id = "yesoreyeram-boomtable-panel"; -const config: any = { - plugin_id: plugin_id, - debug_mode: false, - hide_first_column : false, - hide_headers : false, - error: undefined, - groupedData: undefined, - panelDefaults: { - plugin_title: "Boom Table", - nullPointMode: "connected", - patterns: [], - defaultPattern: { - delimiter: ".", - valueName: "avg", - row_name: "_series_", - col_name: "Value", - thresholds: "70,90", - time_based_thresholds:[], - enable_time_based_thresholds: false, - enable_bgColor: false, - bgColors: "green|orange|red", - enable_bgColor_overrides : false, - bgColors_overrides: "0->green|2->red|1->yellow", - enable_transform: false, - transform_values: "_value_|_value_|_value_", - enable_transform_overrides : false, - transform_values_overrides: "0->down|1->up", - decimals: 2, - format: "none", - null_color: "darkred", - null_value: "No data", - enable_clickable_cells : false, - clickable_cells_link : "", - filter : { - value_below : "", - value_above : "" +const defaultPattern = new BoomPattern({ + bgColors: "green|orange|red", + bgColors_overrides: "0->green|2->red|1->yellow", + clickable_cells_link: "", + col_name: "Value", + decimals: 2, + delimiter: ".", + format: "none", + name: "Default Pattern", + null_color: "darkred", + null_textcolor: "white", + null_value: "No data", + pattern: "*", + row_name: "_series_", + textColor: "red|orange|green", + textColors_overrides: "0->red|2->green|1->yellow", + thresholds: "70,90", + time_based_thresholds: [], + transform_values: "_value_|_value_|_value_", + transform_values_overrides: "0->down|1->up", + valueName: "avg" +}); +const seriesToTable = function (inputdata: IBoomSeries[], options: IBoomRenderingOptions): IBoomTable { + let rows_found = _.uniq(_.map(inputdata, d => d.row_name)); + let cols_found = _.uniq(_.map(inputdata, d => d.col_name)); + let output: IBoomCellDetails[][] = []; + _.each(rows_found, row_name => { + let cols: IBoomCellDetails[] = []; + _.each(cols_found, col_name => { + let matched_items = _.filter(inputdata, o => { + return o.row_name === row_name && o.col_name === col_name; + }); + if (!matched_items || matched_items.length === 0) { + cols.push({ + "col_name": col_name, + "color_bg": options.non_matching_cells_color_bg, + "color_text": options.non_matching_cells_color_text, + "display_value": replaceTokens(options.non_matching_cells_text), + "hidden": false, + "link": "-", + "row_name": row_name, + "tooltip": "-" + }); + } else if (matched_items && matched_items.length === 1) { + cols.push(matched_items[0]); + } else if (matched_items && matched_items.length > 1) { + cols.push({ + "col_name": col_name, + "color_bg": "darkred", + "color_text": "white", + "display_value": "Duplicate matches", + "hidden": false, + "link": "-", + "row_name": row_name, + "tooltip": "-" + }); } - }, - activePatternIndex: -1, - row_col_wrapper:"_", - default_title_for_rows: "Metric" - }, - list_of_stylesheets: { - dark: "plugins/" + plugin_id + "/css/default.dark.css", - light: "plugins/" + plugin_id + "/css/default.light.css" - }, - editorTabs: [{ - name: "Patterns", - template: "/partials/patterns.html", - position: 2 - }, - { - name: "Time based thresholds & Filters", - template: "/partials/patterns-advanced-options.html", - position: 3 - }, { - name: "Options", - template: "/partials/options.html", - position: 4 - }], - valueNameOptions: [{ - value: "min", - text: "Min" - }, - { - value: "max", - text: "Max" - }, - { - value: "avg", - text: "Average" - }, - { - value: "current", - text: "Current" - }, - { - value: "total", - text: "Total" + }); + output.push(cols); + }); + return { + cols_found, + output, + rows_found, + }; +}; +const getRenderingHTML = function (data: IBoomTable, options: IBoomRenderingOptions): IBoomHTML { + let output: IBoomHTML = { + body: "", + footer: "", + headers: "", + }; + let { default_title_for_rows, hide_headers, hide_first_column } = options; + if (hide_headers !== true) { + output.headers += ""; + if (hide_first_column !== true) { + output.headers += `${default_title_for_rows}`; + } + _.each(data.cols_found, c => { + output.headers += `${c}`; + }); + output.body += ""; } - ], + _.each(data.output, o => { + if (o.map(item => item.hidden.toString()).indexOf("false") > -1) { + output.body += ""; + if (hide_first_column !== true) { + output.body += ` + + ${_.first(o.map(item => item.row_name))} + `; + } + _.each(o, item => { + let item_style = `padding:4px;background-color:${item.color_bg};color:${item.color_text};text-align:${options.text_alignment_values}`; + let item_display = item.link === "#" ? item.display_value : `
    ${item.display_value}`; + let tooltip = !item.tooltip || item.tooltip === "-" ? undefined : ` data-toggle="tooltip" data-html="true" data-placement="auto" title="${item.tooltip}" `; + output.body += ` + + ${tooltip ? `` : ""} + ${item_display} + ${tooltip ? `` : ""} + + `; + }); + output.body += ""; + } + }); + return output; +}; +const getDebugData = function (data: IBoomSeries[]): string { + let debugdata = ``; + debugdata = _.map(data, d => { + return ` + + ${d.seriesName} + ${d.pattern.name || d.pattern.pattern || "Default"} + ${d.display_value} + ${d.row_name} + ${d.col_name} + ${d.thresholds.join(",")} + ${d.color_bg} + ${d.color_text} + + `; + }).join(``); + return debugdata; }; export { - kbn, - loadPluginCss, - MetricsPanelCtrl, - TimeSeries, - utils, - config -} \ No newline at end of file + defaultPattern, + getRenderingHTML, + getDebugData, + seriesToTable +}; diff --git a/src/app/boom/Boom.interface.ts b/src/app/boom/Boom.interface.ts new file mode 100644 index 0000000..a7d73c4 --- /dev/null +++ b/src/app/boom/Boom.interface.ts @@ -0,0 +1,93 @@ +interface IBoomPattern { + bgColors: string; + bgColors_overrides: string; + clickable_cells_link: string; + col_name: string; + decimals: Number; + delimiter: string; + enable_bgColor: Boolean; + enable_bgColor_overrides: Boolean; + enable_clickable_cells: Boolean; + enable_textColor: Boolean; + enable_textColor_overrides: Boolean; + enable_time_based_thresholds: Boolean; + enable_transform: Boolean; + enable_transform_overrides: Boolean; + filter: { + value_above: string; + value_below: string; + }; + format: string; + name: string; + null_color: string; + null_value: string; + null_textcolor: string; + pattern: string; + row_name: string; + textColors: string; + textColors_overrides: string; + thresholds: string; + time_based_thresholds: IBoomTimeBasedThreshold[]; + transform_values: string; + transform_values_overrides: string; + tooltipTemplate: string; + valueName: string; +} +interface IBoomSeries { + hidden: Boolean; + col_name: string; + row_name: string; + display_value: string; + color_bg: string; + color_text: string; + tooltip: string; + value_formatted: string; + link: string; +} +interface IBoomTimeBasedThreshold { + enabledDays: string; + from: string; + name: string; + threshold: string; + to: string; +} +interface IBoomRenderingOptions { + default_title_for_rows: String; + hide_first_column: Boolean; + hide_headers: Boolean; + non_matching_cells_color_bg: string; + non_matching_cells_color_text: string; + non_matching_cells_text: string; + text_alignment_firstcolumn: String; + text_alignment_header: String; + text_alignment_values: String; +} +interface IBoomCellDetails { + hidden: Boolean; + col_name: string; + row_name: string; + color_bg: string; + color_text: string; + display_value: string; + link: string; + tooltip: string; +} +interface IBoomTable { + rows_found: string[]; + cols_found: string[]; + output: IBoomCellDetails[][]; +} +interface IBoomHTML { + body: string; + footer: string; + headers: string; +} +export { + IBoomRenderingOptions, + IBoomPattern, + IBoomSeries, + IBoomTimeBasedThreshold, + IBoomHTML, + IBoomTable, + IBoomCellDetails +}; diff --git a/src/app/boom/BoomPattern.ts b/src/app/boom/BoomPattern.ts new file mode 100644 index 0000000..87ee51b --- /dev/null +++ b/src/app/boom/BoomPattern.ts @@ -0,0 +1,114 @@ +import { IBoomPattern, IBoomTimeBasedThreshold, BoomTimeBasedThreshold } from "./index"; + +class BoomPattern implements IBoomPattern { + private row_col_wrapper = "_"; + public bgColors: string; + public bgColors_overrides: string; + public clickable_cells_link: string; + public col_name: string; + public decimals: Number; + public delimiter: string; + public enable_bgColor: Boolean; + public enable_bgColor_overrides: Boolean; + public enable_clickable_cells: Boolean; + public enable_textColor: Boolean; + public enable_textColor_overrides: Boolean; + public enable_time_based_thresholds: Boolean; + public enable_transform: Boolean; + public enable_transform_overrides: Boolean; + public filter: { + value_above: string; + value_below: string; + }; + public format: string; + public name: string; + public null_color: string; + public null_value: string; + public null_textcolor: string; + public pattern: string; + public row_name: string; + public textColors: string; + public textColors_overrides: string; + public thresholds: string; + public time_based_thresholds: IBoomTimeBasedThreshold[]; + public transform_values: string; + public transform_values_overrides: string; + public tooltipTemplate: string; + public valueName: string; + public inverseBGColors; + public inverseTextColors; + public inverseTransformValues; + public add_time_based_thresholds; + public remove_time_based_thresholds; + public setUnitFormat; + constructor(options: any) { + if (options && options.row_col_wrapper) { + this.row_col_wrapper = options.row_col_wrapper; + } + this.bgColors = options && options.bgColors ? options.bgColors : "green|orange|red"; + this.bgColors_overrides = options && options.bgColors_overrides ? options.bgColors_overrides : "0->green|2->red|1->yellow"; + this.textColors = options && options.textColors ? options.textColors : "red|orange|green"; + this.textColors_overrides = options && options.textColors_overrides ? options.textColors_overrides : "0->red|2->green|1->yellow"; + this.clickable_cells_link = options && options.clickable_cells_link ? options.clickable_cells_link : ""; + this.col_name = options && options.col_name ? options.col_name : this.row_col_wrapper + "1" + this.row_col_wrapper; + this.decimals = options && options.decimals ? options.decimals : 2; + this.delimiter = options && options.delimiter ? options.delimiter : "."; + this.enable_bgColor = false; + this.enable_bgColor_overrides = false; + this.enable_textColor = false; + this.enable_textColor_overrides = false; + this.enable_clickable_cells = false; + this.enable_time_based_thresholds = false; + this.enable_transform = false; + this.enable_transform_overrides = false; + this.filter = { + value_above: "", + value_below: "", + }; + this.format = options && options.format ? options.format : "none"; + this.name = options && options.name ? options.name : "New Pattern"; + this.null_color = options && options.null_color ? options.null_color : "darkred"; + this.null_textcolor = options && options.null_Textcolor ? options.null_Textcolor : "black"; + this.null_value = options && options.null_value ? options.null_value : "No data"; + this.pattern = options && options.pattern ? options.pattern : "^server.*cpu$"; + this.row_name = options && options.row_name ? options.row_name : this.row_col_wrapper + "0" + this.row_col_wrapper; + this.thresholds = options && options.thresholds ? options.thresholds : "70,90"; + this.time_based_thresholds = []; + this.transform_values = options && options.transform_values ? options.transform_values : "_value_|_value_|_value_"; + this.transform_values_overrides = options && options.transform_values_overrides ? options.transform_values_overrides : "0->down|1->up"; + this.tooltipTemplate = options && options.tooltipTemplate ? options.tooltipTemplate : "Series : _series_
    Row Name : _row_name_
    Col Name : _col_name_
    Value : _value_"; + this.valueName = options && options.valueName ? options.valueName : "avg"; + } +} + +BoomPattern.prototype.inverseBGColors = function (): void { + this.bgColors = this.bgColors ? this.bgColors.split("|").reverse().join("|") : ""; +}; + +BoomPattern.prototype.inverseTextColors = function (): void { + this.textColors = this.textColors ? this.textColors.split("|").reverse().join("|") : ""; +}; + +BoomPattern.prototype.inverseTransformValues = function (): void { + this.transform_values = this.transform_values ? this.transform_values.split("|").reverse().join("|") : ""; +}; + +BoomPattern.prototype.add_time_based_thresholds = function (): void { + let new_time_based_threshold: IBoomTimeBasedThreshold = new BoomTimeBasedThreshold(); + this.time_based_thresholds = this.time_based_thresholds || []; + this.time_based_thresholds.push(new_time_based_threshold); +}; + +BoomPattern.prototype.remove_time_based_thresholds = function (index: Number): void { + if (this.time_based_thresholds.length > 0) { + this.time_based_thresholds.splice(Number(index), 1); + } +}; + +BoomPattern.prototype.setUnitFormat = function (format: any): void { + this.format = format && format.value ? format.value : "none"; +}; + +export { + BoomPattern +}; diff --git a/src/app/boom/BoomSeries.ts b/src/app/boom/BoomSeries.ts new file mode 100644 index 0000000..e5701bc --- /dev/null +++ b/src/app/boom/BoomSeries.ts @@ -0,0 +1,242 @@ +/// + +import kbn from 'app/core/utils/kbn'; +import TimeSeries from "app/core/time_series2"; +import _ from "lodash"; +import { IBoomSeries, replaceTokens, getActualNameWithoutTokens, getDecimalsForValue, getItemBasedOnThreshold, normalizeColor } from "./index"; + +class BoomSeries implements IBoomSeries { + private debug_mode: Boolean; + private pattern: any; + private seriesName: string; + private currentTimeStamp: Date; + private template_row_name: string; + private template_col_name: string; + private template_value: string; + private row_col_wrapper: string; + private decimals: Number; + public col_name: string; + public row_name: string; + public color_bg: string; + public color_text: string; + public display_value = "-"; + public tooltip = "-"; + public value = NaN; + public value_formatted = "-"; + public link = "-"; + public thresholds: Number[]; + public hidden: Boolean; + constructor(seriesData: any, panelDefaultPattern: any, panelPatterns: any[], options: any) { + this.debug_mode = options && options.debug_mode === true ? true : false; + let nullPointMode = options && options.nullPointMode ? options.nullPointMode : "connected"; + this.row_col_wrapper = options && options.row_col_wrapper ? options.row_col_wrapper : "_"; + this.seriesName = ""; + this.template_row_name = ""; + this.template_col_name = ""; + this.template_value = ""; + this.hidden = false; + this.pattern = undefined; + let series = new TimeSeries({ + alias: seriesData.target, + datapoints: seriesData.datapoints || [] + }); + series.flotpairs = series.getFlotPairs(nullPointMode); + this.seriesName = series.alias || series.aliasEscaped || series.label || series.id; + this.currentTimeStamp = new Date(); + if (series.dataPoints && series.dataPoints.length > 0 && _.last(series.dataPoints).length === 2) { + this.currentTimeStamp = new Date(_.last(series.dataPoints)[1]); + } + this.pattern = _.find(panelPatterns.filter(p => { return p.disabled !== true; }), p => this.seriesName.match(p.pattern)) || panelDefaultPattern; + this.decimals = this.pattern.decimals || panelDefaultPattern.decimals || 2; + if (series.stats) { + this.value = series.stats[this.pattern.valueName]; + if (_.isNaN(this.value) || this.value === null) { + this.display_value = this.pattern.null_value; + } else { + this.display_value = String(this.value); + } + if (!isNaN(this.value)) { + let decimalInfo: any = getDecimalsForValue(this.value, this.decimals); + let formatFunc = kbn.valueFormats[this.pattern.format]; + this.value_formatted = formatFunc(this.value, decimalInfo.decimals, decimalInfo.scaledDecimals); + this.display_value = String(this.value_formatted); + } + this.template_value = this.display_value; + } + if (this.value && this.pattern && this.pattern.filter && (this.pattern.filter.value_below !== "" || this.pattern.filter.value_above !== "")) { + if (this.pattern.filter.value_below !== "" && this.value < +(this.pattern.filter.value_below)) { + this.hidden = true; + } + if (this.pattern.filter.value_above !== "" && this.value > +(this.pattern.filter.value_above)) { + this.hidden = true; + } + } + this.row_name = this.getRowName(this.pattern, this.row_col_wrapper, this.seriesName.toString()); + this.col_name = this.getColName(this.pattern, this.row_col_wrapper, this.seriesName.toString(), this.row_name); + this.thresholds = this.getThresholds(); + this.color_bg = this.getBGColor(); + this.color_text = this.getTextColor(); + this.template_value = this.getDisplayValueTemplate(); + this.tooltip = this.pattern.tooltipTemplate || "Series : _series_
    Row Name : _row_name_
    Col Name : _col_name_
    Value : _value_"; + this.link = this.pattern.enable_clickable_cells ? this.pattern.clickable_cells_link || "#" : "#"; + this.replaceTokens(); + this.cleanup(); + } + private getThresholds() { + let thresholds = this.pattern.thresholds.split(",").map(d => +d); + if (this.pattern.enable_time_based_thresholds) { + let metricrecivedTimeStamp = this.currentTimeStamp || new Date(); + let metricrecivedTimeStamp_innumber = metricrecivedTimeStamp.getHours() * 100 + metricrecivedTimeStamp.getMinutes(); + let weekdays = ["sun", "mon", "tue", "wed", "thu", "fri", "sat"]; + _.each(this.pattern.time_based_thresholds, (tbtx) => { + if (tbtx && tbtx.from && tbtx.to && tbtx.enabledDays && + (metricrecivedTimeStamp_innumber >= +(tbtx.from)) && + (metricrecivedTimeStamp_innumber <= +(tbtx.to)) && + (tbtx.enabledDays.toLowerCase().indexOf(weekdays[metricrecivedTimeStamp.getDay()]) > -1) && + tbtx.threshold + ) { + thresholds = (tbtx.threshold + "").split(",").map(d => +d); + } + }); + } + return thresholds; + } + private getBGColor(): string { + let bgColor = "transparent"; + if (_.isNaN(this.value) || this.value === null) { + bgColor = this.pattern.null_color || "darkred"; + if (this.pattern.null_color === "") { + bgColor = "transparent"; + } + } else { + if (this.pattern.enable_bgColor && this.pattern.bgColors) { + let list_of_bgColors_based_on_thresholds = this.pattern.bgColors.split("|"); + bgColor = getItemBasedOnThreshold(this.thresholds, list_of_bgColors_based_on_thresholds, this.value, bgColor); + + } + if (this.pattern.enable_bgColor_overrides && this.pattern.bgColors_overrides !== "") { + let _bgColors_overrides = this.pattern.bgColors_overrides.split("|").filter(con => con.indexOf("->")).map(con => con.split("->")).filter(con => +(con[0]) === this.value).map(con => con[1]); + if (_bgColors_overrides.length > 0 && _bgColors_overrides[0] !== "") { + bgColor = ("" + _bgColors_overrides[0]).trim(); + } + } + } + return normalizeColor(bgColor); + } + private getTextColor(): string { + let textColor = "white"; + if (_.isNaN(this.value) || this.value === null) { + textColor = this.pattern.null_textcolor || "white"; + } else { + if (this.pattern.enable_textColor && this.pattern.textColors) { + let list_of_textColors_based_on_thresholds = this.pattern.textColors.split("|"); + textColor = getItemBasedOnThreshold(this.thresholds, list_of_textColors_based_on_thresholds, this.value, textColor); + } + if (this.pattern.enable_textColor_overrides && this.pattern.textColors_overrides !== "") { + let _textColors_overrides = this.pattern.textColors_overrides.split("|").filter(con => con.indexOf("->")).map(con => con.split("->")).filter(con => +(con[0]) === this.value).map(con => con[1]); + if (_textColors_overrides.length > 0 && _textColors_overrides[0] !== "") { + textColor = ("" + _textColors_overrides[0]).trim(); + } + } + } + return normalizeColor(textColor); + } + private getDisplayValueTemplate(): string { + let template = this.template_value; + if (_.isNaN(this.value) || this.value === null) { + template = this.pattern.null_value || "No data"; + if (this.pattern.null_value === "") { + template = ""; + } + } else { + if (this.pattern.enable_transform) { + let transform_values = this.pattern.transform_values.split("|"); + template = getItemBasedOnThreshold(this.thresholds, transform_values, this.value, template); + } + if (this.pattern.enable_transform_overrides && this.pattern.transform_values_overrides !== "") { + let _transform_values_overrides = this.pattern.transform_values_overrides.split("|").filter(con => con.indexOf("->")).map(con => con.split("->")).filter(con => +(con[0]) === this.value).map(con => con[1]); + if (_transform_values_overrides.length > 0 && _transform_values_overrides[0] !== "") { + template = ("" + _transform_values_overrides[0]).trim(); + } + } + if (this.pattern.enable_transform || this.pattern.enable_transform_overrides) { + template = this.seriesName.split(this.pattern.delimiter || ".").reduce((r, it, i) => { + return r.replace(new RegExp(this.row_col_wrapper + i + this.row_col_wrapper, "g"), it); + }, template); + } + } + return template; + } + private cleanup() { + if (this.debug_mode !== true) { + delete this.seriesName; + delete this.value; + delete this.pattern; + delete this.thresholds; + delete this.decimals; + delete this.template_col_name; + delete this.template_row_name; + delete this.template_value; + delete this.value_formatted; + delete this.currentTimeStamp; + } + } + private getRowName(pattern, row_col_wrapper: string, seriesName: string): string { + let row_name = pattern.row_name; + row_name = seriesName.split(pattern.delimiter || ".").reduce((r, it, i) => { + return r.replace(new RegExp(row_col_wrapper + i + row_col_wrapper, "g"), it); + }, row_name); + if (seriesName.split(pattern.delimiter || ".").length === 1) { + row_name = seriesName; + } + this.template_row_name = row_name; + return row_name; + } + private getColName(pattern, row_col_wrapper: string, seriesName: string, row_name: string): string { + let col_name = pattern.col_name; + col_name = seriesName.split(pattern.delimiter || ".").reduce((r, it, i) => { + return r.replace(new RegExp(row_col_wrapper + i + row_col_wrapper, "g"), it); + }, col_name); + if (seriesName.split(pattern.delimiter || ".").length === 1 || row_name === seriesName) { + col_name = pattern.col_name || "Value"; + } + this.template_col_name = col_name; + return col_name; + } + private replaceTokens() { + // _series_ can be specified in Row, Col, Display Value, Tooltip & Link + this.row_name = this.template_row_name.replace(new RegExp("_series_", "g"), this.seriesName.toString()); + this.col_name = this.template_col_name.replace(new RegExp("_series_", "g"), this.seriesName.toString()); + this.link = this.link.replace(new RegExp("_series_", "g"), this.seriesName.toString().trim()); + this.tooltip = this.tooltip.replace(new RegExp("_series_", "g"), this.seriesName.toString().trim()); + this.display_value = this.template_value.replace(new RegExp("_series_", "g"), this.seriesName.toString()); + // _row_name_ can be specified in Col, Display Value, Tooltip & Link + this.col_name = this.col_name.replace(new RegExp("_row_name_", "g"), this.row_name.toString()); + this.link = this.link.replace(new RegExp("_row_name_", "g"), getActualNameWithoutTokens(this.row_name.toString()).trim()); + this.tooltip = this.tooltip.replace(new RegExp("_row_name_", "g"), getActualNameWithoutTokens(this.row_name.toString()).trim()); + this.display_value = this.display_value.replace(new RegExp("_row_name_", "g"), this.row_name.toString()); + // _col_name_ can be specified in Row, Display Value, Tooltip & Link + this.row_name = this.row_name.replace(new RegExp("_col_name_", "g"), this.col_name.toString()); + this.link = this.link.replace(new RegExp("_col_name_", "g"), getActualNameWithoutTokens(this.col_name.toString()).trim()); + this.tooltip = this.tooltip.replace(new RegExp("_col_name_", "g"), getActualNameWithoutTokens(this.col_name.toString()).trim()); + this.display_value = this.display_value.replace(new RegExp("_col_name_", "g"), this.col_name.toString()); + // _value_raw_ can be specified in Display Value, Tooltip & Link + let value_raw = _.isNaN(this.value) || this.value === null ? "null" : this.value.toString().trim(); + this.link = this.link.replace(new RegExp("_value_raw_", "g"), value_raw); + this.tooltip = this.tooltip.replace(new RegExp("_value_raw_", "g"), value_raw); + this.display_value = this.display_value.replace(new RegExp("_value_raw_", "g"), value_raw); + // _value_ can be specified in Display Value, Tooltip & Link + let value_formatted = _.isNaN(this.value) || this.value === null ? "null" : this.value_formatted.toString().trim(); + this.link = this.link.replace(new RegExp("_value_", "g"), value_formatted); + this.tooltip = this.tooltip.replace(new RegExp("_value_", "g"), value_formatted); + this.display_value = this.display_value.replace(new RegExp("_value_", "g"), value_formatted); + // FA & Img transforms can be specified in Row, Col & Display Value + this.row_name = replaceTokens(this.row_name); + this.col_name = replaceTokens(this.col_name); + this.display_value = replaceTokens(this.display_value); + } +} + +export { + BoomSeries +}; diff --git a/src/app/boom/BoomTimeBasedThreshold.ts b/src/app/boom/BoomTimeBasedThreshold.ts new file mode 100644 index 0000000..0c35147 --- /dev/null +++ b/src/app/boom/BoomTimeBasedThreshold.ts @@ -0,0 +1,20 @@ +import { IBoomTimeBasedThreshold } from "./index"; + +class BoomTimeBasedThreshold implements IBoomTimeBasedThreshold { + public enabledDays: string; + public from: string; + public name: string; + public threshold: string; + public to: string; + constructor() { + this.enabledDays = "Sun,Mon,Tue,Wed,Thu,Fri,Sat"; + this.from = "0000"; + this.name = "Early morning of everyday"; + this.threshold = "70,90"; + this.to = "0530"; + } +} + +export { + BoomTimeBasedThreshold +}; diff --git a/src/app/boom/BoomUtils.ts b/src/app/boom/BoomUtils.ts new file mode 100644 index 0000000..dd2b8e5 --- /dev/null +++ b/src/app/boom/BoomUtils.ts @@ -0,0 +1,113 @@ +import _ from "lodash"; + +const normalizeColor = function (color) { + if (color.toLowerCase() === "green") { + return "rgba(50, 172, 45, 0.97)"; + } else if (color.toLowerCase() === "orange") { + return "rgba(237, 129, 40, 0.89)"; + } else if (color.toLowerCase() === "red") { + return "rgba(245, 54, 54, 0.9)"; + } else { return color.toLowerCase(); } +}; +const replaceTokens = function (value) { + if (!value) { return value; } + value = value + ""; + value = value.split(" ").map(a => { + if (a.startsWith("_fa-") && a.endsWith("_")) { + let icon = a.replace(/\_/g, "").split(",")[0]; + let color = a.indexOf(",") > -1 ? ` style="color:${normalizeColor(a.replace(/\_/g, "").split(",")[1])}" ` : ""; + let repeatCount = a.split(",").length > 2 ? +(a.replace(/\_/g, "").split(",")[2]) : 1; + a = ` `.repeat(repeatCount); + } else if (a.startsWith("_img-") && a.endsWith("_")) { + a = a.slice(0, -1); + let imgUrl = a.replace("_img-", "").split(",")[0]; + let imgWidth = a.split(",").length > 1 ? a.replace("_img-", "").split(",")[1] : "20px"; + let imgHeight = a.split(",").length > 2 ? a.replace("_img-", "").split(",")[2] : "20px"; + let repeatCount = a.split(",").length > 3 ? +(a.replace("_img-", "").split(",")[3]) : 1; + a = ``.repeat(repeatCount); + } + return a; + }).join(" "); + return value; +}; +const getActualNameWithoutTokens = function (value) { + if (!value) { return value + ""; } + value = value + ""; + return value.split(" ").map(a => { + if (a.startsWith("_fa-") && a.endsWith("_")) { + a = ``; + } else if (a.startsWith("_img-") && a.endsWith("_")) { + a = ``; + } + return a; + }).join(" "); +}; +const getDecimalsForValue = function (value, _decimals) { + if (_.isNumber(+_decimals)) { + let o: Object = { + decimals: _decimals, + scaledDecimals: null + }; + return o; + } + + let delta = value / 2; + let dec = -Math.floor(Math.log(delta) / Math.LN10); + + let magn = Math.pow(10, -dec), + norm = delta / magn, // norm is between 1.0 and 10.0 + size; + + if (norm < 1.5) { + size = 1; + } else if (norm < 3) { + size = 2; + // special case for 2.5, requires an extra decimal + if (norm > 2.25) { + size = 2.5; + ++dec; + } + } else if (norm < 7.5) { + size = 5; + } else { + size = 10; + } + + size *= magn; + + // reduce starting decimals if not needed + if (Math.floor(value) === value) { + dec = 0; + } + + let result: Object = { + decimals: Math.max(0, dec), + scaledDecimals: Math.max(0, dec) - Math.floor(Math.log(size) / Math.LN10) + 2 + }; + + return result; +}; +const getItemBasedOnThreshold = function (thresholds, ranges, value, defaultValue): string { + let c = defaultValue; + if (thresholds && ranges && typeof value === "number" && thresholds.length + 1 <= ranges.length) { + ranges = _.dropRight(ranges, ranges.length - thresholds.length - 1); + if (ranges[ranges.length - 1] === "") { + ranges[ranges.length - 1] = defaultValue; + } + for (let i = thresholds.length; i > 0; i--) { + if (value >= thresholds[i - 1]) { + return ranges[i]; + } + } + return _.first(ranges); + } + return c; + +}; +export { + normalizeColor, + replaceTokens, + getActualNameWithoutTokens, + getDecimalsForValue, + getItemBasedOnThreshold +}; diff --git a/src/app/boom/index.ts b/src/app/boom/index.ts new file mode 100644 index 0000000..4cfaa2c --- /dev/null +++ b/src/app/boom/index.ts @@ -0,0 +1,5 @@ +export { IBoomPattern, IBoomSeries, IBoomTimeBasedThreshold, IBoomRenderingOptions, IBoomTable, IBoomHTML, IBoomCellDetails } from "./Boom.interface"; +export { normalizeColor, replaceTokens, getActualNameWithoutTokens, getDecimalsForValue, getItemBasedOnThreshold } from "./BoomUtils"; +export { BoomTimeBasedThreshold } from "./BoomTimeBasedThreshold"; +export { BoomPattern } from "./BoomPattern"; +export { BoomSeries } from "./BoomSeries"; diff --git a/src/app/config.ts b/src/app/config.ts new file mode 100644 index 0000000..930818f --- /dev/null +++ b/src/app/config.ts @@ -0,0 +1,27 @@ +const plugin_id = "yesoreyeram-boomtable-panel"; +const value_name_options = [ + { text: "Min", value: "min" }, + { text: "Max", value: "max" }, + { text: "Average", value: "avg" }, + { text: "Current", value: "current" }, + { text: "Total", value: "total" } +]; +const config: any = { + debug_mode: false, + error: undefined, + groupedData: undefined, + hide_first_column: false, + hide_headers: false, + panelDefaults: { + activePatternIndex: -1, + default_title_for_rows: "Metric", + patterns: [], + row_col_wrapper: "_", + } +}; + +export { + plugin_id, + value_name_options, + config +}; diff --git a/src/app/utils.ts b/src/app/utils.ts deleted file mode 100644 index aa1eedd..0000000 --- a/src/app/utils.ts +++ /dev/null @@ -1,19 +0,0 @@ -import _ from "lodash"; - -const getFields = function (collection, field) { - return _.map(collection, d => d[field]); -}; -const getUniqueFields = function (collection, field) { - return _.uniq(_.map(collection, d => d[field])); -}; -const normalizeColor = function (color) { - if (color.toLowerCase() === "green") return "rgba(50, 172, 45, 0.97)"; - else if (color.toLowerCase() === "orange") return "rgba(237, 129, 40, 0.89)"; - else if (color.toLowerCase() === "red") return "rgba(245, 54, 54, 0.9)"; - else return color.toLowerCase(); -} -export { - getFields, - getUniqueFields, - normalizeColor -}; \ No newline at end of file diff --git a/src/css/_boomtable.scss b/src/css/_boomtable.scss new file mode 100644 index 0000000..afe29dc --- /dev/null +++ b/src/css/_boomtable.scss @@ -0,0 +1,47 @@ +.boom-table { + .mini-split { + margin-right: 10px; + } + .split { + margin-right: 20px; + } + .boom-btn { + padding: 10px; + margin-right: 10px; + min-width: 200px; + text-transform: lowercase; + } + h6.text-header { + padding: 0 0 10px 0; + font-weight: bolder; + i { + font-weight: 100; + } + } +} + +.boom-table .debug { + margin-top: 30px; +} + +.boom-table .boom-label { + padding-left: 10px; +} + +.boom-table .debug table tr { + border: 2px solid red; +} + +.boom-table .inline-form-control { + display: inline-block; + margin: 10px 20px 10px 0px; + padding: 5px; +} + +.boom-table .btn-small { + margin-left: 20px; +} + +.boom-table .btn-small .fa { + margin-right: 5px; +} \ No newline at end of file diff --git a/src/css/default.dark.css b/src/css/default.dark.css deleted file mode 100644 index 53fa723..0000000 --- a/src/css/default.dark.css +++ /dev/null @@ -1,17 +0,0 @@ -.boom-table .debug{ - margin-top :30px; -} -.boom-table .debug table tr{ - border: 2px solid red; -} -.boom-table .inline-form-control { - display: inline-block; - margin: 10px 20px 10px 0px; - padding:5px; -} -.boom-table .btn-small { - margin-left: 20px; -} -.boom-table .btn-small .fa{ - margin-right: 5px; -} \ No newline at end of file diff --git a/src/css/default.dark.scss b/src/css/default.dark.scss new file mode 100644 index 0000000..d7461aa --- /dev/null +++ b/src/css/default.dark.scss @@ -0,0 +1,9 @@ +@import 'boomtable'; +.boom-table { + h6.text-header { + color: cadetblue; + i { + color: darkcyan; + } + } +} \ No newline at end of file diff --git a/src/css/default.light.css b/src/css/default.light.css deleted file mode 100644 index 53fa723..0000000 --- a/src/css/default.light.css +++ /dev/null @@ -1,17 +0,0 @@ -.boom-table .debug{ - margin-top :30px; -} -.boom-table .debug table tr{ - border: 2px solid red; -} -.boom-table .inline-form-control { - display: inline-block; - margin: 10px 20px 10px 0px; - padding:5px; -} -.boom-table .btn-small { - margin-left: 20px; -} -.boom-table .btn-small .fa{ - margin-right: 5px; -} \ No newline at end of file diff --git a/src/css/default.light.scss b/src/css/default.light.scss new file mode 100644 index 0000000..e868820 --- /dev/null +++ b/src/css/default.light.scss @@ -0,0 +1,9 @@ +@import 'boomtable'; +.boom-table { + h6.text-header { + color: darkmagenta; + i { + color: darksalmon; + } + } +} \ No newline at end of file diff --git a/src/module.ts b/src/module.ts index 5459b45..569d6e6 100644 --- a/src/module.ts +++ b/src/module.ts @@ -1,589 +1,132 @@ -import { - kbn, - loadPluginCss, - MetricsPanelCtrl, - TimeSeries, - utils, - config -} from "./app/app" +/// + import _ from "lodash"; -loadPluginCss(config.list_of_stylesheets); +import kbn from 'app/core/utils/kbn'; +import { loadPluginCss, MetricsPanelCtrl } from "app/plugins/sdk"; +import { IBoomSeries, IBoomRenderingOptions, IBoomTable, IBoomHTML } from "./app/boom/index"; +import { BoomPattern, BoomSeries } from "./app/boom/index"; +import { plugin_id, value_name_options, config } from "./app/config"; +import { defaultPattern, seriesToTable, getRenderingHTML, getDebugData } from "./app/app"; + +loadPluginCss({ + dark: `plugins/${plugin_id}/css/default.dark.css`, + light: `plugins/${plugin_id}/css/default.light.css` +}); class GrafanaBoomTableCtrl extends MetricsPanelCtrl { - static templateUrl: string = "partials/module.html"; - unitFormats: any = kbn.getUnitFormats(); - valueNameOptions: Object = config.valueNameOptions; - dataReceived: any; - ctrl:any; - elem:any; - constructor($scope, $injector, $sce) { + public static templateUrl = "partials/module.html"; + public unitFormats = kbn.getUnitFormats(); + public valueNameOptions = value_name_options; + public dataReceived: any; + public ctrl: any; + public elem: any; + public attrs: any; + constructor($scope, $injector) { super($scope, $injector); _.defaults(this.panel, config.panelDefaults); + this.panel.defaultPattern = this.panel.defaultPattern || defaultPattern; + this.updatePrototypes(); this.events.on("data-received", this.onDataReceived.bind(this)); + this.events.on("data-snapshot-load", this.onDataReceived.bind(this)); this.events.on("init-edit-mode", this.onInitEditMode.bind(this)); + this.panel.activePatternIndex = this.panel.activePatternIndex === -1 ? this.panel.patterns.length : this.panel.activePatternIndex; } - onInitEditMode() { - _.each(config.editorTabs, editor => { - this.addEditorTab(editor.name, "public/plugins/" + config.plugin_id + editor.template, editor.position); - }) + private updatePrototypes(): void { + Object.setPrototypeOf(this.panel.defaultPattern, BoomPattern.prototype); + this.panel.patterns.map(pattern => { + Object.setPrototypeOf(pattern, BoomPattern.prototype); + return pattern; + }); } - onDataReceived(data) { + public onDataReceived(data: any): void { this.dataReceived = data; this.render(); } - seriesHandler(seriesData) { - var series = new TimeSeries({ - datapoints: seriesData.datapoints || [], - alias: seriesData.target - }); - series.flotpairs = series.getFlotPairs(this.panel.nullPointMode); - return series; + public onInitEditMode(): void { + this.addEditorTab("Patterns", `public/plugins/${plugin_id}/partials/patterns.html`, 2); + this.addEditorTab("Options", `public/plugins/${plugin_id}/partials/options.html`, 3); } - addPattern() { - var newPattern = { - name: "New Pattern", - pattern: "^server.*cpu$", - delimiter: ".", - valueName: "avg", - row_name: this.panel.row_col_wrapper + "0"+ this.panel.row_col_wrapper, - col_name: this.panel.row_col_wrapper + "1"+ this.panel.row_col_wrapper, - thresholds: "70,90", - time_based_thresholds:[], - enable_time_based_thresholds: false, - enable_bgColor: false, - bgColors: "green|orange|red", - enable_bgColor_overrides : false, - bgColors_overrides: "0->green|2->red|1->yellow", - enable_transform: false, - transform_values: "_value_|_value_|_value_", - enable_transform_overrides : false, - transform_values_overrides: "0->down|1->up", - decimals: 2, - format: "none", - null_color: "darkred", - null_value: "No data", - enable_clickable_cells : false, - clickable_cells_link : "", - filter : { - value_below : "", - value_above : "", - } - }; + public addPattern(): void { + let newPattern = new BoomPattern({ + row_col_wrapper: this.panel.row_col_wrapper + }); this.panel.patterns.push(newPattern); this.panel.activePatternIndex = this.panel.patterns.length - 1; this.render(); } - movePattern(direction,index){ - let tempElement = this.panel.patterns[index]; - if(direction==="UP"){ - this.panel.patterns[index] = this.panel.patterns[index-1]; - this.panel.patterns[index-1] = tempElement; - this.panel.activePatternIndex = index - 1; - } - if(direction==="DOWN"){ - this.panel.patterns[index] = this.panel.patterns[index+1]; - this.panel.patterns[index+1] = tempElement; - this.panel.activePatternIndex = index + 1; - } - this.render(); - } - removePattern(index) { + public removePattern(index: Number): void { this.panel.patterns.splice(index, 1); this.panel.activePatternIndex = (this.panel.patterns && this.panel.patterns.length > 0) ? (this.panel.patterns.length - 1) : -1; this.render(); } - clonePattern(index){ - let copiedPattern = Object.assign( {} , this.panel.patterns[index] ); - this.panel.patterns.push(copiedPattern); - this.render(); - } - add_time_based_thresholds(index){ - var new_time_based_threshold = { - name: "Early morning of everyday", - from: "0000", - to:"0530", - enabledDays:"Sun,Mon,Tue,Wed,Thu,Fri,Sat", - threshold:"70,90" - } - if(index==='default'){ - this.panel.defaultPattern.time_based_thresholds = this.panel.defaultPattern.time_based_thresholds || []; - this.panel.defaultPattern.time_based_thresholds.push(new_time_based_threshold); + public movePattern(direction: string, index: Number) { + let tempElement = this.panel.patterns[Number(index)]; + if (direction === "UP") { + this.panel.patterns[Number(index)] = this.panel.patterns[Number(index) - 1]; + this.panel.patterns[Number(index) - 1] = tempElement; + this.panel.activePatternIndex = Number(index) - 1; } - else{ - this.panel.patterns[index].time_based_thresholds = this.panel.patterns[index].time_based_thresholds || []; - this.panel.patterns[index].time_based_thresholds.push(new_time_based_threshold); + if (direction === "DOWN") { + this.panel.patterns[Number(index)] = this.panel.patterns[Number(index) + 1]; + this.panel.patterns[Number(index) + 1] = tempElement; + this.panel.activePatternIndex = Number(index) + 1; } this.render(); } - remove_time_based_thresholds(patternIndex,index){ - if(patternIndex === 'default'){ - this.panel.defaultPattern.time_based_thresholds.splice(index,1); - } - else{ - this.panel.patterns[patternIndex].time_based_thresholds.splice(index, 1); - } - } - inverseBGColors(index){ - if(index === -1){ - this.panel.defaultPattern.bgColors = this.panel.defaultPattern.bgColors.split("|").reverse().join("|"); - } - else{ - this.panel.patterns[index].bgColors = this.panel.patterns[index].bgColors.split("|").reverse().join("|"); - } - this.render(); - } - inverseTransformValues(index){ - if(index===-1){ - this.panel.defaultPattern.transform_values = this.panel.defaultPattern.transform_values.split("|").reverse().join("|"); - } - else { - this.panel.patterns[index].transform_values = this.panel.patterns[index].transform_values.split("|").reverse().join("|"); - } - - this.render(); - } - computeBgColor(thresholds, bgColors, value) { - var c = "transparent"; - if (thresholds && bgColors && typeof value === "number" && thresholds.length + 1 <= bgColors.length) { - bgColors = _.dropRight(bgColors, bgColors.length - thresholds.length - 1); - if (bgColors[bgColors.length - 1] === "") { - bgColors[bgColors.length - 1] = "transparent"; - } - for (var i = thresholds.length; i > 0; i--) { - if (value >= thresholds[i - 1]) { - return utils.normalizeColor(bgColors[i]); - } - } - return utils.normalizeColor(_.first(bgColors)); - } - return c; - } - transformValue(thresholds, transform_values, value, displayValue, row_name, col_name ) { - var t = value; - if (thresholds && transform_values && typeof value === "number" && thresholds.length + 1 <= transform_values.length) { - transform_values = _.dropRight(transform_values, transform_values.length - thresholds.length - 1); - if (transform_values[transform_values.length - 1] === "") { - transform_values[transform_values.length - 1] = "_value_"; - } - for (var i = thresholds.length; i > 0; i--) { - if (value >= thresholds[i - 1]) { - return transform_values[i].replace(new RegExp("_value_", "g"), displayValue).replace(new RegExp("_row_name_", "g"), row_name).replace(new RegExp("_col_name_", "g"), col_name); - } - } - return _.first(transform_values).replace(new RegExp("_value_", "g"), displayValue).replace(new RegExp("_row_name_", "g"), row_name).replace(new RegExp("_col_name_", "g"), col_name); - } - return t; - } - replaceFontAwesomeIcons(value){ - if(!value) return value; - return (value+"") - .split(" ") - .map(a => { - if(a.startsWith("_fa-") && a.endsWith("_")){ - let icon = a.replace(/\_/g,"").split(",")[0]; - let color = a.indexOf(",") > -1 ? ` style="color:${ utils.normalizeColor(a.replace(/\_/g,"").split(",")[1])}" ` : ""; - let repeatCount = a.split(",").length > 2 ? +(a.replace(/\_/g,"").split(",")[2]) : 1; - a = ` `.repeat(repeatCount); - } - return a; - }) - .join(" "); - } - replaceWithImages(value){ - if(!value) return value; - return (value+"") - .split(" ") - .map(a => { - if(a.startsWith("_img-") && a.endsWith("_")){ - a = a.slice(0, -1); - let imgUrl = a.replace("_img-","").split(",")[0]; - let imgWidth = a.split(",").length > 1 ? a.replace("_img-","").split(",")[1] : "20px"; - let imgHeight = a.split(",").length > 2 ? a.replace("_img-","").split(",")[2] : "20px"; - let repeatCount = a.split(",").length > 3 ? +(a.replace("_img-","").split(",")[3]) : 1; - a = ``.repeat(repeatCount); - } - return a; - }) - .join(" "); - } - getActualNameWithoutTransformSign(value){ - return (value+"") - .split(" ") - .map(a => { - if(a.startsWith("_fa-") && a.endsWith("_")){ - a = ``; - } - if(a.startsWith("_img-") && a.endsWith("_")){ - a = ``; - } - return a; - }) - .join(" "); - } - getDecimalsForValue(value, _decimals) { - if (_.isNumber(+_decimals)) { - var o: Object = { - decimals: _decimals, - scaledDecimals: null - }; - return o; - } - - var delta = value / 2; - var dec = -Math.floor(Math.log(delta) / Math.LN10); - - var magn = Math.pow(10, -dec), - norm = delta / magn, // norm is between 1.0 and 10.0 - size; - - if (norm < 1.5) { - size = 1; - } else if (norm < 3) { - size = 2; - // special case for 2.5, requires an extra decimal - if (norm > 2.25) { - size = 2.5; - ++dec; - } - } else if (norm < 7.5) { - size = 5; - } else { - size = 10; - } - - size *= magn; - - // reduce starting decimals if not needed - if (Math.floor(value) === value) { - dec = 0; - } - - var result: Object = { - decimals: Math.max(0, dec), - scaledDecimals: Math.max(0, dec) - Math.floor(Math.log(size) / Math.LN10) + 2 - }; - - return result; - } - setUnitFormat(subItem, index) { - if (index === -1) { - this.panel.defaultPattern.format = subItem.value; - } else { - this.panel.patterns[index].format = subItem.value; - } + public clonePattern(index: Number): void { + let copiedPattern = Object.assign({}, this.panel.patterns[Number(index)]); + Object.setPrototypeOf(copiedPattern, BoomPattern.prototype); + this.panel.patterns.push(copiedPattern); this.render(); } - limitText(text, maxlength) { + public limitText(text: string, maxlength: Number): string { if (text.split('').length > maxlength) { - text = text.substring(0, maxlength - 3) + "..."; + text = text.substring(0, Number(maxlength) - 3) + "..."; } return text; } - link (scope, elem, attrs, ctrl) { - this.ctrl = ctrl; + public link(scope: any, elem: any, attrs: any, ctrl: any): void { + this.scope = scope; this.elem = elem; + this.attrs = attrs; + this.ctrl = ctrl; } } GrafanaBoomTableCtrl.prototype.render = function () { if (this.dataReceived) { - // Copying the data received - this.dataComputed = this.dataReceived; - this.panel.default_title_for_rows = this.panel.default_title_for_rows || config.default_title_for_rows; - const metricsReceived = utils.getFields(this.dataComputed, "target"); - if (metricsReceived.length !== _.uniq(metricsReceived).length) { - var duplicateKeys = _.uniq(metricsReceived.filter(v => { - return metricsReceived.filter(t => t === v).length > 1 - })); - var err = new Error(); - err.name = "Duplicate data received"; - err.message = "Duplicate keys :
    " + duplicateKeys.join("
    "); - this.panel.error = err; - this.panel.data = undefined; - } else { - this.panel.error = undefined; - // Binding the grafana computations to the metrics received - this.dataComputed = this.dataReceived.map(this.seriesHandler.bind(this)); - // Get Server Time Stamp of the Series for time based thresholds. - this.dataComputed = this.dataComputed.map(series => { - series.current_servertimestamp = new Date(); - if(series && series.datapoints && series.datapoints.length > 0){ - if(_.last(series.datapoints).length === 2){ - series.current_servertimestamp = new Date(_.last(series.datapoints)[1]); - } - } - return series; - }); - // Assign pattern - this.dataComputed = this.dataComputed.map(series => { - series.pattern = _.find(this.panel.patterns.filter(p=>{ return p.disabled !== true}), function (p) { - return series.alias.match(p.pattern); - }); - if (series.pattern === undefined) { - series.pattern = this.panel.defaultPattern || config.panelDefaults.defaultPattern; - } - return series; - }); - // Assign Decimal Values - this.dataComputed = this.dataComputed.map(series => { - series.decimals = (series.pattern.decimals) || config.panelDefaults.defaultPattern.decimals; - return series; - }); - // Assign value - this.dataComputed = this.dataComputed.map(series => { - if (series.stats) { - series.value = series.stats[series.pattern.valueName || config.panelDefaults.defaultPattern.valueName]; - let decimalInfo = this.getDecimalsForValue(series.value, series.decimals); - let formatFunc = kbn.valueFormats[series.pattern.format || config.panelDefaults.defaultPattern.format]; - if(series.value === null){ - series.displayValue = series.pattern.null_value || config.panelDefaults.defaultPattern.null_value || "Null"; - } - else if (!isNaN(series.value)) { - series.valueFormatted = formatFunc(series.value, decimalInfo.decimals, decimalInfo.scaledDecimals); - series.valueRounded = kbn.roundValue(series.value, decimalInfo.decimals); - series.displayValue = series.valueFormatted; - } else { - series.displayValue = series.pattern.null_value || config.panelDefaults.defaultPattern.null_value || "Null"; - } - } - return series; - }); - // Filter Values - this.dataComputed = this.dataComputed.filter(series =>{ - if(!series.pattern.filter){ - series.pattern.filter = {}; - series.pattern.filter.value_below = ""; - series.pattern.filter.value_above = ""; - } - if(series.pattern && series.pattern.filter && (series.pattern.filter.value_below !== "" || series.pattern.filter.value_above !== "" )) { - if(series.pattern.filter.value_below !== "" && series.value < +(series.pattern.filter.value_below) ){ - return false - } - if(series.pattern.filter.value_above !== "" && series.value > +(series.pattern.filter.value_above)){ - return false - } - return true - } - else { - return true - }; - }) - // Assign Row Name - this.dataComputed = this.dataComputed.map(series => { - series.row_name = series.alias.split(series.pattern.delimiter || ".").reduce((r, it, i) => { - return r.replace(new RegExp(this.panel.row_col_wrapper + i + this.panel.row_col_wrapper, "g"), it) - }, series.pattern.row_name.replace(new RegExp(this.panel.row_col_wrapper + "series" + this.panel.row_col_wrapper , "g"), series.alias) || config.panelDefaults.defaultPattern.row_name.replace(new RegExp(this.panel.row_col_wrapper +"series"+this.panel.row_col_wrapper, "g"), series.alias)); - if (series.alias.split(series.pattern.delimiter || ".").length === 1) { - series.row_name = series.alias; - } - return series; - }); - // Assign Col Name - this.dataComputed = this.dataComputed.map(series => { - series.col_name = series.alias.split(series.pattern.delimiter || ".").reduce((r, it, i) => { - return r.replace(new RegExp(this.panel.row_col_wrapper+ i + this.panel.row_col_wrapper, "g"), it) - }, series.pattern.col_name || config.panelDefaults.defaultPattern.col_name); - if (series.alias.split(series.pattern.delimiter || ".").length === 1 || series.row_name === series.alias) { - series.col_name = series.pattern.col_name || "Value"; - } - return series; - }); - // Assign RowCol Key - this.dataComputed = this.dataComputed.map(series => { - series.key_name = series.row_name + "#" + series.col_name; - return series; - }); - // Assign Thresholds - this.dataComputed = this.dataComputed.map(series => { - series.thresholds = (series.pattern.thresholds || config.panelDefaults.defaultPattern.thresholds).split(",").map(d => +d); - if(series.pattern.enable_time_based_thresholds){ - let metricrecivedTimeStamp = series.current_servertimestamp || new Date(); - let metricrecivedTimeStamp_innumber = metricrecivedTimeStamp.getHours()*100 + metricrecivedTimeStamp.getMinutes(); - let weekdays = ["sun","mon","tue","wed","thu","fri","sat"]; - _.each(series.pattern.time_based_thresholds,(tbtx)=>{ - if(tbtx && tbtx.from && tbtx.to && tbtx.enabledDays && - ( metricrecivedTimeStamp_innumber >= +(tbtx.from) ) && - ( metricrecivedTimeStamp_innumber <= +(tbtx.to) ) && - ( tbtx.enabledDays.toLowerCase().indexOf(weekdays[metricrecivedTimeStamp.getDay()]) > -1) && - tbtx.threshold - ){ - series.thresholds = (tbtx.threshold +"").split(",").map(d => +d); - } - }) - } - return series; - }); - // Assign BG Colors - this.dataComputed = this.dataComputed.map(series => { - series.enable_bgColor = series.pattern.enable_bgColor; - series.bgColors = (series.pattern.bgColors || config.panelDefaults.defaultPattern.bgColors).split("|"); - series.bgColor = series.enable_bgColor === true ? this.computeBgColor(series.thresholds, series.bgColors, series.value) : "transparent"; - if (series.displayValue === (series.pattern.null_value || config.panelDefaults.defaultPattern.null_value || "Null")) { - series.bgColor = series.pattern.null_color || config.panelDefaults.defaultPattern.null_color; - } - return series; - }); - // BG Colors overrides - this.dataComputed = this.dataComputed.map(series =>{ - series.enable_bgColor_overrides = series.pattern.enable_bgColor_overrides; - series.bgColors_overrides = series.pattern.bgColors_overrides || ""; - if(series.enable_bgColor_overrides && series.bgColors_overrides !== ""){ - let _bgColors_overrides = series.bgColors_overrides.split("|").filter(con=>con.indexOf("->")).map(con=> con.split("->")).filter(con=> +(con[0]) === series.value ).map(con=> con[1]) - if(_bgColors_overrides.length > 0 && _bgColors_overrides[0] !== ""){ - series.bgColor = utils.normalizeColor((""+_bgColors_overrides[0]).trim()); - } - } - return series; - }) - // Value Transform - this.dataComputed = this.dataComputed.map(series => { - series.enable_transform = series.pattern.enable_transform; - series.transform_values = (series.pattern.transform_values || config.panelDefaults.defaultPattern.transform_values).split("|"); - series.displayValue = series.enable_transform === true ? this.transformValue(series.thresholds, series.transform_values, series.value, series.displayValue, series.row_name, series.col_name) : series.displayValue; - if (series.displayValue === (series.pattern.null_value || config.panelDefaults.defaultPattern.null_value || "Null")) { - series.displayValue = series.pattern.null_value || config.panelDefaults.defaultPattern.null_value; - } - else if (isNaN(series.value)) { - series.displayValue = series.pattern.null_value || config.panelDefaults.defaultPattern.null_value; - } - return series; - }); - // Value Transform Overrides - this.dataComputed = this.dataComputed.map(series =>{ - series.enable_transform_overrides = series.pattern.enable_transform_overrides; - series.transform_values_overrides = series.pattern.transform_values_overrides || ""; - if(series.enable_transform_overrides && series.transform_values_overrides !== ""){ - let _transform_values_overrides = series.transform_values_overrides.split("|").filter(con=>con.indexOf("->")).map(con=> con.split("->")).filter(con=> +(con[0]) === series.value ).map(con=> con[1]) - if(_transform_values_overrides.length > 0 && _transform_values_overrides[0] !== ""){ - series.displayValue = (""+_transform_values_overrides[0]).trim().replace(new RegExp("_value_", "g"), series.displayValue).replace(new RegExp("_row_name_", "g"), series.row_name).replace(new RegExp("_col_name_", "g"),series.col_name); - } - } - return series; - }) - // Font awesome icons - this.dataComputed = this.dataComputed.map(series => { - series.actual_displayvalue = series.displayValue - series.actual_row_name = series.row_name - series.actual_col_name = series.col_name - if(series.displayValue && series.displayValue.indexOf("_fa-")>-1) series.displayValue = this.replaceFontAwesomeIcons(series.displayValue) - if(series.row_name && series.row_name.indexOf("_fa-")>-1) series.row_name = this.replaceFontAwesomeIcons(series.row_name) - if(series.col_name && series.col_name.indexOf("_fa-")>-1) series.col_name = this.replaceFontAwesomeIcons(series.col_name) - return series; - }); - // Image transforms - this.dataComputed = this.dataComputed.map(series => { - if(series.displayValue && series.displayValue.indexOf("_img-")>-1) series.displayValue = this.replaceWithImages(series.displayValue) - if(series.row_name && series.row_name.indexOf("_img-")>-1) series.row_name = this.replaceWithImages(series.row_name) - if(series.col_name && series.col_name.indexOf("_img-")>-1) series.col_name = this.replaceWithImages(series.col_name) - return series; - }); - // Cell Links - this.dataComputed = this.dataComputed.map(series => { - if(series.pattern.enable_clickable_cells){ - let targetLink = series.pattern.clickable_cells_link || "#"; - targetLink = targetLink.replace(new RegExp("_row_name_", "g"), this.getActualNameWithoutTransformSign(series.actual_row_name).trim()); - targetLink = targetLink.replace(new RegExp("_col_name_", "g"), this.getActualNameWithoutTransformSign(series.actual_col_name).trim()); - targetLink = targetLink.replace(new RegExp("_value_", "g"), this.getActualNameWithoutTransformSign(series.value).trim()); - series.displayValue = `${series.displayValue}` - } - return series; - }); - // Grouping - const rows_found = utils.getFields(this.dataComputed, "row_name"); - const cols_found = utils.getFields(this.dataComputed, "col_name"); - const keys_found = utils.getFields(this.dataComputed, "key_name"); - const is_unique_keys = (keys_found.length === _.uniq(keys_found).length); - if (is_unique_keys) { - this.panel.error = undefined; //// - var output = []; - _.each(_.uniq(rows_found), (row_name) => { - var o: any = {}; - o.row = row_name; - o.cols = []; - _.each(_.uniq(cols_found), (col_name) => { - var matched_value = (_.find(this.dataComputed, (e) => { - return e.row_name === row_name && e.col_name === col_name - })); - if (!matched_value) matched_value = { - value: NaN, - displayValue: "N/A" - }; - o.cols.push({ - "name": col_name, - "value": matched_value.value, - "actual_col_name":matched_value.actual_col_name, - "actual_row_name":matched_value.actual_row_name, - "displayValue": matched_value.displayValue || matched_value.value, - "bgColor": matched_value.bgColor || "transparent" - }); - }); - output.push(o); - }) - //region Output table construction - var boomtable_output_body_headers = this.elem.find("#boomtable_output_body_headers"); - let boomtable_output_body_headers_output = `
    `; - if(this.panel.hide_headers !== true){ - boomtable_output_body_headers_output += ""; - if(this.panel.hide_first_column !== true){ - boomtable_output_body_headers_output += `${this.panel.default_title_for_rows}`; - } - _.each(_.uniq(cols_found), c=>{ - boomtable_output_body_headers_output += `${c}`; - }) - boomtable_output_body_headers_output += ""; - } - boomtable_output_body_headers.html(boomtable_output_body_headers_output); - var boomtable_output_body = this.elem.find('#boomtable_output_body'); - let boomtable_output_body_output = ``; - _.each(output,o=>{ - boomtable_output_body_output += "" - if(this.panel.hide_first_column !== true){ - boomtable_output_body_output += `${o.row}`; - } - _.each(o.cols, c=>{ - boomtable_output_body_output += `${c.displayValue}`; - }) - boomtable_output_body_output += "" - }) - boomtable_output_body.html(boomtable_output_body_output); - //endregion - } else { - var duplicateKeys = _.uniq(keys_found.filter(v => { - return keys_found.filter(t => t === v).length > 1 - })); - var err = new Error(); - err.name = "Duplicate keys found"; - err.message = "Duplicate key values :
    " + duplicateKeys.join("
    "); - this.panel.error = err; - } - - //region Debug table body construction - var boomtable_output_body_debug = this.elem.find('#boomtable_output_body_debug'); - let boomtable_output_body_debug_output = ``; - _.each(this.dataComputed, d=>{ - boomtable_output_body_debug_output += ` - - ${d.alias} - ${d.pattern.pattern || "Default" } - ${d.displayValue} - ${d.row_name} - ${d.col_name} - ${d.thresholds} - - ` - }) - boomtable_output_body_debug.html(boomtable_output_body_debug_output); - //endregion - } - var rootElem = this.elem.find('.table-panel-scroll'); - var maxheightofpanel = this.panel.debug_mode ? this.ctrl.height - 71 : this.ctrl.height - 31; - rootElem.css({ 'max-height': maxheightofpanel+ "px" }); + let outputdata: IBoomSeries[] = this.dataReceived.map(seriesData => { + let seriesOptions = { + debug_mode: this.panel.debug_mode, + row_col_wrapper: this.panel.row_col_wrapper || "_" + }; + return new BoomSeries(seriesData, this.panel.defaultPattern, this.panel.patterns, seriesOptions); + }); + let renderingOptions: IBoomRenderingOptions = { + default_title_for_rows: this.panel.default_title_for_rows || config.default_title_for_rows, + hide_first_column: this.panel.hide_first_column, + hide_headers: this.panel.hide_headers, + non_matching_cells_color_bg: this.panel.non_matching_cells_color_bg, + non_matching_cells_color_text: this.panel.non_matching_cells_color_text, + non_matching_cells_text: this.panel.non_matching_cells_text, + text_alignment_firstcolumn: this.panel.text_alignment_firstcolumn, + text_alignment_header: this.panel.text_alignment_header, + text_alignment_values: this.panel.text_alignment_values + }; + let boomtabledata: IBoomTable = seriesToTable(outputdata,renderingOptions); + let renderingdata: IBoomHTML = getRenderingHTML(boomtabledata, renderingOptions); + this.elem.find("#boomtable_output_body_headers").html(`
    ` + renderingdata.headers); + this.elem.find('#boomtable_output_body').html(`` + renderingdata.body); + this.elem.find('#boomtable_output_body_debug').html(this.panel.debug_mode ? getDebugData(outputdata) : ``); + this.elem.find("[data-toggle='tooltip']").tooltip({ + boundary: "scrollParent" + }); + let rootElem = this.elem.find('.table-panel-scroll'); + let maxheightofpanel = this.panel.debug_mode ? this.ctrl.height - 111 : this.ctrl.height - 31; + rootElem.css({ 'max-height': maxheightofpanel + "px" }); } }; export { GrafanaBoomTableCtrl as PanelCtrl -}; \ No newline at end of file +}; diff --git a/src/partials/module.html b/src/partials/module.html index e06b3c5..7d03e3d 100644 --- a/src/partials/module.html +++ b/src/partials/module.html @@ -2,35 +2,30 @@
    WARNING: Panel running in debug mode
    -
    -

    {{ctrl.panel.error.name}}

    -

    -
    -
    -
    +
    +
    - + + + + + + + + + + + - +
    MetricPatternValueRow NameCol NameThresholdsBG ColorText Color
    -
    -
    WARNING: Panel running in debug mode
    - - - - - - - - - - - - - -
    MetricPatternValueRow NameCol NameThresholds
    -
    + + + + + +
    \ No newline at end of file diff --git a/src/partials/options.html b/src/partials/options.html index a6a48ab..29dbdf6 100644 --- a/src/partials/options.html +++ b/src/partials/options.html @@ -1,52 +1,125 @@ -

    Options

    -
    -
    -
    - - +
    +
    +
    +
    +
    +
    Options
    +
    +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    + + +
    +
    +
    -
    -
    -
    -
    - - -
    -
    -
    -
    -
    -
    - - -
    -
    -
    -
    -
    -
    - - -
    -
    -
    -
    -
    -
    - - -
    -
    -
    -
    -
    -
    - - +
    +
    +
    +
    +
    Non matching series
    +
    +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    + + +
    +
    +
    \ No newline at end of file diff --git a/src/partials/patterns-advanced-options.html b/src/partials/patterns-advanced-options.html deleted file mode 100644 index fa854e2..0000000 --- a/src/partials/patterns-advanced-options.html +++ /dev/null @@ -1,148 +0,0 @@ -
    - -
    -
    -
    -
    -
    - - -
    -
    -
    -
    - - -
    -
    -
    -
    -
    -
    -
    WARNING: "Value Filters" is for advance usage. This may hide part of the data based on the input. You - can safely ignore this section if you don't know the behaviour.
    -
    -
    -
    -
    -
    -
    - - -
    -
    -
    -
    -
    -  From : - To : - On : - Threshold : - - -
    -
    -
    - - -
    -
    -
    -
    -
    -
    WARNING: This tab "Time based Thresholds" is for advance usage. You can safely ignore this section if you - don't want to use time based thresholds.
    -
    -
    Note: If multiple matches found last will win; If no match found default threshold will be applicable which - was set in - "Patterns" tab. -
    -
    -
    -
    -
    -
    -
    -
    -
    - - -
    -
    -
    -
    - - -
    -
    -
    -
    -
    -
    -
    WARNING: "Value Filters" is for advance usage. This may hide part of the data based on the input. You - can safely ignore this section if you don't know the behaviour.
    -
    -
    -
    -
    -
    -
    - - -
    -
    -
    -
    -
    -  From : - To : - On : - Threshold : - - -
    -
    -
    - -
    -
    -
    -
    -
    -
    WARNING: This tab "Time based Thresholds" is for advance usage. You can safely ignore this section if you - don't want to use time based thresholds.
    -
    -
    Note: If multiple matches found last will win; If no match found default threshold will be applicable which - was set in - "Patterns" tab. -
    -
    -
    -
    -
    \ No newline at end of file diff --git a/src/partials/patterns.html b/src/partials/patterns.html index af3d61d..51a8dab 100644 --- a/src/partials/patterns.html +++ b/src/partials/patterns.html @@ -8,10 +8,11 @@
    Patterns
  • - {{ctrl.limitText(pattern.name || pattern.pattern || 'Default',12)}} + {{ctrl.limitText(pattern.name || + pattern.pattern || 'Default',12)}}
  • -
  • - Default +
  • + Default
  • @@ -20,353 +21,356 @@
    Patterns
  • -
    -
    +
    +
    -
    -
    - - -
    -
    -
    -
    - - -
    -
    -
    -
    - - -
    +
    +
    Warning : This pattern is currently Disabled
    +
    +
    +
    +
    - - +
    Pattern
    - - + + + + + + + + + +
    - - + + + + +
    +
    +
    +
    +
    - - +
    Stats
    - -
    + + + + +
    + + +
    +
    +
    - - +
    Thresholds
    - - + +
    -
    -
    - - - -
    -
    +
    - - -
    -
    -
    -
    - - + + + + + +
    - - + + + + + +
    -
    -
    - - - -
    -
    - - -
    -
    -
    -
    - - + + + + + +
    +
    +
    +
    +
    - - +
    Dynamic Thresholds
    - - + + + +
    -
    -
    -
    -
    -
    -
    - - -
    -
    -
    -
    - - -
    -
    -
    -
    -
    -
    - - -
    -
    -
    -
    - - -
    -
    -
    -
    - - -
    -
    -
    +
    +
    - - - + + + + + + + + + + + + + + + +
    +
    -
    -
    -
    +
    +
    +
    Overrides
    +
    - - + + + + +
    - - + + + + +
    - - + + + + +
    +
    +
    +
    +
    - - +
    Null Handling
    - - + + + + + + + +
    +
    +
    + +
    - - +
    Hide Series
    - - + + + + +
    -
    +
    +
    +
    +
    +
    - - - +
    Pattern Management
    -
    -
    - - -
    -
    -
    -
    - - -
    -
    - - + + + + + Currently Enabled + Currently Disabled
    -
    -
    - - - -
    -
    -
    -
    - - -
    -
    -
    -
    - - -
    -
    - - + + +
    - - + + +
    -
    -
    -
    -
    - - -
    -
    -
    -
    - - -
    -
    -
    - -
    \ No newline at end of file diff --git a/tests/basic.spec.ts b/tests/basic.spec.ts new file mode 100644 index 0000000..9d35836 --- /dev/null +++ b/tests/basic.spec.ts @@ -0,0 +1,13 @@ +import _ from "lodash"; + +let sum = (a, b) => a + b; +let max = (a, b) => _.max([a, b]); + +describe("Basic Tests", () => { + it("Sum of two numbers", () => { + expect(sum(1, 2)).toBe(3); + }); + it("Max of two numbers", () => { + expect(max(1, 2)).toBe(2); + }); +}) \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index c8b0076..154c0b9 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,15 +1,40 @@ { - "compileOnSave": false, - "compilerOptions": { - "target": "ES5", - "module": "system", - "sourceMap": true, - "declaration": false, - "emitDecoratorMetadata": true, - "experimentalDecorators": true, - "noImplicitAny": false - }, - "exclude": [ - "node_modules" - ] + "compileOnSave": false, + "compilerOptions": { + "rootDir": "src", + "outDir": "dist", + "declaration": false, + "sourceMap": false, + "inlineSourceMap": true, + "inlineSources": true, + "target": "ES5", + "module": "system", + "lib": [ + "dom", + "es6" + ], + "allowJs": false, + "allowSyntheticDefaultImports": true, + "alwaysStrict": true, + "esModuleInterop": true, + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "noEmitOnError": false, + "noFallthroughCasesInSwitch": true, + "noImplicitAny": false, + "noImplicitReturns": true, + "noImplicitThis": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "skipLibCheck": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "strictPropertyInitialization": true + }, + "include": [ + "src/**/*.ts" + ], + "exclude": [ + "node_modules" + ] } \ No newline at end of file diff --git a/tslint.json b/tslint.json index 13af9f2..b54d0e8 100644 --- a/tslint.json +++ b/tslint.json @@ -1,61 +1,79 @@ { - "rules": { - "class-name": true, - "comment-format": [false, "check-space"], - "curly": true, - "eofline": true, - "forin": false, - "indent": [true, "spaces"], - "label-position": true, - "label-undefined": true, - "max-line-length": [true, 140], - "member-access": false, - "no-arg": true, - "no-bitwise": true, - "no-console": [true, - "debug", - "info", - "time", - "timeEnd", - "trace" - ], - "no-construct": true, - "no-debugger": true, - "no-duplicate-key": true, - "no-duplicate-variable": true, - "no-empty": false, - "no-eval": true, - "no-inferrable-types": true, - "no-shadowed-variable": false, - "no-string-literal": false, - "no-switch-case-fall-through": false, - "no-trailing-whitespace": true, - "no-unused-expression": false, - "no-unused-variable": false, - "no-unreachable": true, - "no-use-before-declare": true, - "no-var-keyword": false, - "object-literal-sort-keys": false, - "one-line": [true, - "check-open-brace", - "check-catch", - "check-else" - ], - "radix": false, - "semicolon": true, - "triple-equals": [true, "allow-null-check"], - "typedef-whitespace": [true, { + "rules": { + "class-name": true, + "comment-format": [ + true, + "check-space" + ], + "curly": true, + "eofline": true, + "forin": true, + "indent": [ + true, + "spaces" + ], + "label-position": true, + "max-line-length": [ + true, + 280 + ], + "member-access": true, + "no-arg": true, + "no-bitwise": true, + "no-console": [ + true, + "debug", + "info", + "time", + "timeEnd", + "trace" + ], + "no-construct": true, + "no-debugger": true, + "no-duplicate-variable": true, + "no-empty": true, + "no-eval": true, + "no-inferrable-types": true, + "no-shadowed-variable": true, + "no-string-literal": true, + "no-switch-case-fall-through": true, + "no-trailing-whitespace": true, + "no-unused-expression": true, + "no-unused-variable": true, + "no-use-before-declare": true, + "no-var-keyword": true, + "object-literal-sort-keys": true, + "one-line": [ + true, + "check-open-brace", + "check-catch", + "check-else" + ], + "radix": true, + "semicolon": true, + "triple-equals": [ + true, + "allow-null-check" + ], + "typedef-whitespace": [ + true, + { "call-signature": "nospace", "index-signature": "nospace", "parameter": "nospace", "property-declaration": "nospace", "variable-declaration": "nospace" - }], - "variable-name": [true, "ban-keywords"], - "whitespace": [true, - "check-branch", - "check-decl", - "check-type" - ] - } - } \ No newline at end of file + } + ], + "variable-name": [ + true, + "ban-keywords" + ], + "whitespace": [ + true, + "check-branch", + "check-decl", + "check-type" + ] + } +} \ No newline at end of file