mirror of
https://github.com/timberjoegithub/grafana-statusmap.git
synced 2026-07-22 15:53:09 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
021633670a | ||
|
|
b6213efff2 | ||
|
|
0f64d36b42 | ||
|
|
b7c525252e | ||
|
|
c20eb9e1d3 | ||
|
|
7cc09175f0 | ||
|
|
3b0d119113 | ||
|
|
ce18758cd1 | ||
|
|
1793f12a1f | ||
|
|
012bcac0ef | ||
|
|
f037ad082e |
@@ -0,0 +1,2 @@
|
|||||||
|
/dist linguist-generated
|
||||||
|
/src/libs/d3-scale-chromatic linguist-vendored
|
||||||
@@ -1,5 +1,19 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## v0.3.4
|
||||||
|
|
||||||
|
- Fix to work in Grafana 7.2.0,7.2.1
|
||||||
|
- Fix 'name' in tooltip for opacity and gradient modes
|
||||||
|
- Fix color scale for opacity and gradient modes
|
||||||
|
|
||||||
|
## v0.3.3
|
||||||
|
|
||||||
|
- Fix fallback to string events for older versions of Grafana
|
||||||
|
|
||||||
|
## v0.3.2
|
||||||
|
|
||||||
|
- Fix plugin metadata for Grafana repository
|
||||||
|
|
||||||
## v0.3.1
|
## v0.3.1
|
||||||
|
|
||||||
- Fix to work in Grafana 7.1.0
|
- Fix to work in Grafana 7.1.0
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
[](https://github.com/flant/grafana-statusmap/releases/latest)
|
<p align="center">
|
||||||
[](https://t.me/statusmap_ru)
|
<a href="https://github.com/flant/grafana-statusmap/releases/latest"><img src="https://img.shields.io/github/tag-date/flant/grafana-statusmap.svg?logo=github&label=latest" alt="Download from Github"/></a>
|
||||||
[](https://cloud-native.slack.com/messages/CHGSGTAHY)
|
<a href="https://community.flant.com/c/grafana-statusmap/8"><img src="https://img.shields.io/discourse/status?server=https%3A%2F%2Fcommunity.flant.com" alt="Discourse forum for discussions"/></a>
|
||||||
|
<a href="https://t.me/statusmap_ru"><img src="https://img.shields.io/badge/@statusmap_ru-RU-informational.svg?logo=telegram" alt="Telegram chat RU"/></a>
|
||||||
|
</p>
|
||||||
|
|
||||||
# Statusmap panel for Grafana
|
# Statusmap panel for Grafana
|
||||||
|
|
||||||
@@ -26,9 +28,9 @@
|
|||||||
- InfluxDB
|
- InfluxDB
|
||||||
- Mysql
|
- Mysql
|
||||||
* Tested with Grafana:
|
* Tested with Grafana:
|
||||||
- 5.4.3
|
- 7.0, 7.1, 7.2
|
||||||
- 6.3, 6.6, 6.7
|
- 6.3, 6.6, 6.7
|
||||||
- 7.0, 7.1
|
- 5.4.3
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
|
|||||||
Vendored
+14
@@ -1,5 +1,19 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## v0.3.4
|
||||||
|
|
||||||
|
- Fix to work in Grafana 7.2.0,7.2.1
|
||||||
|
- Fix 'name' in tooltip for opacity and gradient modes
|
||||||
|
- Fix color scale for opacity and gradient modes
|
||||||
|
|
||||||
|
## v0.3.3
|
||||||
|
|
||||||
|
- Fix fallback to string events for older versions of Grafana
|
||||||
|
|
||||||
|
## v0.3.2
|
||||||
|
|
||||||
|
- Fix plugin metadata for Grafana repository
|
||||||
|
|
||||||
## v0.3.1
|
## v0.3.1
|
||||||
|
|
||||||
- Fix to work in Grafana 7.1.0
|
- Fix to work in Grafana 7.1.0
|
||||||
|
|||||||
Vendored
+7
-5
@@ -1,6 +1,8 @@
|
|||||||
[](https://github.com/flant/grafana-statusmap/releases/latest)
|
<p align="center">
|
||||||
[](https://t.me/statusmap_ru)
|
<a href="https://github.com/flant/grafana-statusmap/releases/latest"><img src="https://img.shields.io/github/tag-date/flant/grafana-statusmap.svg?logo=github&label=latest" alt="Download from Github"/></a>
|
||||||
[](https://cloud-native.slack.com/messages/CHGSGTAHY)
|
<a href="https://community.flant.com/c/grafana-statusmap/8"><img src="https://img.shields.io/discourse/status?server=https%3A%2F%2Fcommunity.flant.com" alt="Discourse forum for discussions"/></a>
|
||||||
|
<a href="https://t.me/statusmap_ru"><img src="https://img.shields.io/badge/@statusmap_ru-RU-informational.svg?logo=telegram" alt="Telegram chat RU"/></a>
|
||||||
|
</p>
|
||||||
|
|
||||||
# Statusmap panel for Grafana
|
# Statusmap panel for Grafana
|
||||||
|
|
||||||
@@ -26,9 +28,9 @@
|
|||||||
- InfluxDB
|
- InfluxDB
|
||||||
- Mysql
|
- Mysql
|
||||||
* Tested with Grafana:
|
* Tested with Grafana:
|
||||||
- 5.4.3
|
- 7.0, 7.1, 7.2
|
||||||
- 6.3, 6.6, 6.7
|
- 6.3, 6.6, 6.7
|
||||||
- 7.0, 7.1
|
- 5.4.3
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
|
|||||||
Vendored
+4
-4
@@ -366,17 +366,17 @@ System.register(["lodash", "jquery", "d3", "./libs/d3-scale-chromatic/index", "a
|
|||||||
if (ctrl.bucketMatrix) {
|
if (ctrl.bucketMatrix) {
|
||||||
var rangeFrom = ctrl.bucketMatrix.minValue;
|
var rangeFrom = ctrl.bucketMatrix.minValue;
|
||||||
var rangeTo = ctrl.bucketMatrix.maxValue;
|
var rangeTo = ctrl.bucketMatrix.maxValue;
|
||||||
var maxValue = panel.color.max || rangeTo;
|
var maxValue = panel.color.max != null ? panel.color.max : rangeTo;
|
||||||
var minValue = panel.color.min || rangeFrom;
|
var minValue = panel.color.min != null ? panel.color.min : rangeFrom;
|
||||||
|
|
||||||
if (ctrl.bucketMatrix.noDatapoints) {
|
if (ctrl.bucketMatrix.noDatapoints) {
|
||||||
if (!panel.color.max) {
|
if (panel.color.max != null) {
|
||||||
rangeTo = maxValue = 100;
|
rangeTo = maxValue = 100;
|
||||||
} else {
|
} else {
|
||||||
rangeTo = 100;
|
rangeTo = 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!panel.color.min) {
|
if (panel.color.min != null) {
|
||||||
rangeFrom = minValue = 0;
|
rangeFrom = minValue = 0;
|
||||||
} else {
|
} else {
|
||||||
rangeFrom = 0;
|
rangeFrom = 0;
|
||||||
|
|||||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+7
-3
@@ -157,8 +157,7 @@ System.register(["lodash", "./color_legend", "./options_editor", "./tooltip_edit
|
|||||||
|
|
||||||
_export("renderComplete", renderComplete = {
|
_export("renderComplete", renderComplete = {
|
||||||
name: 'statusmap-render-complete'
|
name: 'statusmap-render-complete'
|
||||||
}); // eventFactory('statusmap-render-complete');
|
});
|
||||||
|
|
||||||
|
|
||||||
_export("PanelCtrl", _export("StatusHeatmapCtrl", StatusHeatmapCtrl =
|
_export("PanelCtrl", _export("StatusHeatmapCtrl", StatusHeatmapCtrl =
|
||||||
/*#__PURE__*/
|
/*#__PURE__*/
|
||||||
@@ -267,7 +266,12 @@ System.register(["lodash", "./color_legend", "./options_editor", "./tooltip_edit
|
|||||||
CoreEvents.fallbackToStringEvents();
|
CoreEvents.fallbackToStringEvents();
|
||||||
PanelEvents.fallbackToStringEvents();
|
PanelEvents.fallbackToStringEvents();
|
||||||
|
|
||||||
_export("renderComplete", renderComplete = renderComplete.name);
|
_export("renderComplete", renderComplete = 'statusmap-render-complete');
|
||||||
|
} // Grafana 7.2 workaround
|
||||||
|
|
||||||
|
|
||||||
|
if (typeof kbn["intervalToMs"] === "function") {
|
||||||
|
kbn.interval_to_ms = kbn.intervalToMs;
|
||||||
}
|
}
|
||||||
|
|
||||||
migratePanelConfig(_this.panel);
|
migratePanelConfig(_this.panel);
|
||||||
|
|||||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+2
-2
@@ -24,8 +24,8 @@
|
|||||||
{"name": "Color mapping", "path": "img/color-mapping.png"},
|
{"name": "Color mapping", "path": "img/color-mapping.png"},
|
||||||
{"name": "Queries example", "path": "img/queries-example.png"}
|
{"name": "Queries example", "path": "img/queries-example.png"}
|
||||||
],
|
],
|
||||||
"version": "0.3.2",
|
"version": "0.3.4",
|
||||||
"updated": "2020-08-13"
|
"updated": "2020-09-12"
|
||||||
},
|
},
|
||||||
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
Vendored
+2
-2
@@ -462,8 +462,8 @@ System.register(["lodash", "jquery", "moment", "app/core/utils/kbn", "app/core/c
|
|||||||
value: function addStatusmap() {
|
value: function addStatusmap() {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
|
|
||||||
var maxValue = this.panel.color.max || this.bucketMatrix.maxValue;
|
var maxValue = this.panel.color.max != null ? this.panel.color.max : this.bucketMatrix.maxValue;
|
||||||
var minValue = this.panel.color.min || this.bucketMatrix.minValue;
|
var minValue = this.panel.color.min != null ? this.panel.color.min : this.bucketMatrix.minValue;
|
||||||
|
|
||||||
if (this.panel.color.mode !== 'discrete') {
|
if (this.panel.color.mode !== 'discrete') {
|
||||||
this.colorScale = this.getColorScale(maxValue, minValue);
|
this.colorScale = this.getColorScale(maxValue, minValue);
|
||||||
|
|||||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+2
-2
@@ -186,9 +186,9 @@ System.register(["d3", "jquery", "lodash"], function (_export, _context) {
|
|||||||
}), ""), "\n </ul>\n </div>");
|
}), ""), "\n </ul>\n </div>");
|
||||||
} else {
|
} else {
|
||||||
if (values.length === 1) {
|
if (values.length === 1) {
|
||||||
tooltipHtml += "<div> \n name: <b>".concat(name, "</b> <br>\n value: <b>").concat(value, "</b> <br>\n </div>");
|
tooltipHtml += "<div> \n name: <b>".concat(yLabel, "</b> <br>\n value: <b>").concat(value, "</b> <br>\n </div>");
|
||||||
} else {
|
} else {
|
||||||
tooltipHtml += "<div>\n name: <b>".concat(name, "</b> <br>\n values:\n <ul>\n ").concat(_.join(_.map(values, function (v) {
|
tooltipHtml += "<div>\n name: <b>".concat(yLabel, "</b> <br>\n values:\n <ul>\n ").concat(_.join(_.map(values, function (v) {
|
||||||
return "<li>".concat(v, "</li>");
|
return "<li>".concat(v, "</li>");
|
||||||
}), ""), "\n </ul>\n </div>");
|
}), ""), "\n </ul>\n </div>");
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "flant-statusmap-panel",
|
"name": "flant-statusmap-panel",
|
||||||
"version": "0.2.0",
|
"version": "0.3.4",
|
||||||
"description": "Grafana panel plugin to visualize status of multiple objects over time",
|
"description": "Grafana panel plugin to visualize status of multiple objects over time",
|
||||||
"main": "README.md",
|
"main": "README.md",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
+4
-4
@@ -68,16 +68,16 @@ coreModule.directive('statusHeatmapLegend', function() {
|
|||||||
if (ctrl.bucketMatrix) {
|
if (ctrl.bucketMatrix) {
|
||||||
let rangeFrom = ctrl.bucketMatrix.minValue;
|
let rangeFrom = ctrl.bucketMatrix.minValue;
|
||||||
let rangeTo = ctrl.bucketMatrix.maxValue;
|
let rangeTo = ctrl.bucketMatrix.maxValue;
|
||||||
let maxValue = panel.color.max || rangeTo;
|
let maxValue = panel.color.max != null ? panel.color.max : rangeTo;
|
||||||
let minValue = panel.color.min || rangeFrom;
|
let minValue = panel.color.min != null ? panel.color.min : rangeFrom;
|
||||||
|
|
||||||
if (ctrl.bucketMatrix.noDatapoints) {
|
if (ctrl.bucketMatrix.noDatapoints) {
|
||||||
if (!panel.color.max) {
|
if (panel.color.max != null) {
|
||||||
rangeTo = maxValue = 100;
|
rangeTo = maxValue = 100;
|
||||||
} else {
|
} else {
|
||||||
rangeTo = 100;
|
rangeTo = 100;
|
||||||
}
|
}
|
||||||
if (!panel.color.min) {
|
if (panel.color.min != null) {
|
||||||
rangeFrom = minValue = 0;
|
rangeFrom = minValue = 0;
|
||||||
} else {
|
} else {
|
||||||
rangeFrom = 0;
|
rangeFrom = 0;
|
||||||
|
|||||||
+7
-2
@@ -63,7 +63,7 @@ loadPluginCss({
|
|||||||
light: 'plugins/flant-statusmap-panel/css/statusmap.light.css'
|
light: 'plugins/flant-statusmap-panel/css/statusmap.light.css'
|
||||||
});
|
});
|
||||||
|
|
||||||
export var renderComplete:any = {name:'statusmap-render-complete'}; // eventFactory('statusmap-render-complete');
|
export var renderComplete:any = {name:'statusmap-render-complete'};
|
||||||
|
|
||||||
class StatusHeatmapCtrl extends MetricsPanelCtrl {
|
class StatusHeatmapCtrl extends MetricsPanelCtrl {
|
||||||
static templateUrl = 'module.html';
|
static templateUrl = 'module.html';
|
||||||
@@ -150,7 +150,12 @@ class StatusHeatmapCtrl extends MetricsPanelCtrl {
|
|||||||
if(!Polygrafill.hasAppEventCompatibleEmitter(this.events)){
|
if(!Polygrafill.hasAppEventCompatibleEmitter(this.events)){
|
||||||
CoreEvents.fallbackToStringEvents();
|
CoreEvents.fallbackToStringEvents();
|
||||||
PanelEvents.fallbackToStringEvents();
|
PanelEvents.fallbackToStringEvents();
|
||||||
renderComplete = renderComplete.name;
|
renderComplete = 'statusmap-render-complete';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Grafana 7.2 workaround
|
||||||
|
if (typeof kbn["intervalToMs"] === "function") {
|
||||||
|
kbn.interval_to_ms = kbn.intervalToMs;
|
||||||
}
|
}
|
||||||
|
|
||||||
migratePanelConfig(this.panel);
|
migratePanelConfig(this.panel);
|
||||||
|
|||||||
+2
-2
@@ -24,8 +24,8 @@
|
|||||||
{"name": "Color mapping", "path": "img/color-mapping.png"},
|
{"name": "Color mapping", "path": "img/color-mapping.png"},
|
||||||
{"name": "Queries example", "path": "img/queries-example.png"}
|
{"name": "Queries example", "path": "img/queries-example.png"}
|
||||||
],
|
],
|
||||||
"version": "0.3.2",
|
"version": "0.3.4",
|
||||||
"updated": "2020-08-13"
|
"updated": "2020-09-12"
|
||||||
},
|
},
|
||||||
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
+2
-2
@@ -364,8 +364,8 @@ export class StatusmapRenderer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
addStatusmap():void {
|
addStatusmap():void {
|
||||||
let maxValue = this.panel.color.max || this.bucketMatrix.maxValue;
|
let maxValue = this.panel.color.max != null ? this.panel.color.max : this.bucketMatrix.maxValue;
|
||||||
let minValue = this.panel.color.min || this.bucketMatrix.minValue;
|
let minValue = this.panel.color.min != null ? this.panel.color.min : this.bucketMatrix.minValue;
|
||||||
|
|
||||||
if (this.panel.color.mode !== 'discrete') {
|
if (this.panel.color.mode !== 'discrete') {
|
||||||
this.colorScale = this.getColorScale(maxValue, minValue);
|
this.colorScale = this.getColorScale(maxValue, minValue);
|
||||||
|
|||||||
+2
-2
@@ -154,12 +154,12 @@ export class StatusmapTooltip {
|
|||||||
} else {
|
} else {
|
||||||
if (values.length === 1) {
|
if (values.length === 1) {
|
||||||
tooltipHtml += `<div>
|
tooltipHtml += `<div>
|
||||||
name: <b>${name}</b> <br>
|
name: <b>${yLabel}</b> <br>
|
||||||
value: <b>${value}</b> <br>
|
value: <b>${value}</b> <br>
|
||||||
</div>`;
|
</div>`;
|
||||||
} else {
|
} else {
|
||||||
tooltipHtml += `<div>
|
tooltipHtml += `<div>
|
||||||
name: <b>${name}</b> <br>
|
name: <b>${yLabel}</b> <br>
|
||||||
values:
|
values:
|
||||||
<ul>
|
<ul>
|
||||||
${_.join(_.map(values, v => `<li>${v}</li>`), "")}
|
${_.join(_.map(values, v => `<li>${v}</li>`), "")}
|
||||||
|
|||||||
Reference in New Issue
Block a user