mirror of
https://github.com/timberjoegithub/grafana-statusmap.git
synced 2026-07-22 15:53:09 +00:00
ref: one codebase for hover tooltip and freezed tooltip
- rename variables for URL template, use templateSrv to render URL links - fix visibility of tooltip items and url template help popup whe the light theme is used - rework Tooltip settings pane, organize tooltip editor fields - rename properties in panel config, implement migration logic for legacy configuration - close button for the frozen tooltip - use relative positioning for proper page scrolling
This commit is contained in:
Vendored
+98
-3
@@ -13,7 +13,8 @@ System.register(["app/core/utils/kbn"], function (_export, _context) {
|
||||
|
||||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
|
||||
function statusHeatmapOptionsEditor() {
|
||||
/** @ngInject */
|
||||
function optionsEditorCtrl() {
|
||||
'use strict';
|
||||
|
||||
return {
|
||||
@@ -24,7 +25,7 @@ System.register(["app/core/utils/kbn"], function (_export, _context) {
|
||||
};
|
||||
}
|
||||
|
||||
_export("statusHeatmapOptionsEditor", statusHeatmapOptionsEditor);
|
||||
_export("optionsEditorCtrl", optionsEditorCtrl);
|
||||
|
||||
return {
|
||||
setters: [function (_appCoreUtilsKbn) {
|
||||
@@ -34,6 +35,9 @@ System.register(["app/core/utils/kbn"], function (_export, _context) {
|
||||
_export("StatusHeatmapOptionsEditorCtrl", StatusHeatmapOptionsEditorCtrl =
|
||||
/*#__PURE__*/
|
||||
function () {
|
||||
StatusHeatmapOptionsEditorCtrl.$inject = ["$scope"];
|
||||
|
||||
/** @ngInject */
|
||||
function StatusHeatmapOptionsEditorCtrl($scope) {
|
||||
_classCallCheck(this, StatusHeatmapOptionsEditorCtrl);
|
||||
|
||||
@@ -47,7 +51,6 @@ System.register(["app/core/utils/kbn"], function (_export, _context) {
|
||||
this.panelCtrl = $scope.ctrl;
|
||||
this.panel = this.panelCtrl.panel;
|
||||
this.unitFormats = kbn.getUnitFormats();
|
||||
this.panelCtrl.render();
|
||||
}
|
||||
|
||||
_createClass(StatusHeatmapOptionsEditorCtrl, [{
|
||||
@@ -56,6 +59,98 @@ System.register(["app/core/utils/kbn"], function (_export, _context) {
|
||||
this.panel.data.unitFormat = subItem.value;
|
||||
this.panelCtrl.render();
|
||||
}
|
||||
}, {
|
||||
key: "render",
|
||||
value: function render() {
|
||||
this.panelCtrl.render();
|
||||
}
|
||||
}, {
|
||||
key: "onAddThreshold",
|
||||
value: function onAddThreshold() {
|
||||
this.panel.color.thresholds.push({
|
||||
color: this.panel.defaultColor
|
||||
});
|
||||
this.render();
|
||||
}
|
||||
}, {
|
||||
key: "onRemoveThreshold",
|
||||
value: function onRemoveThreshold(index) {
|
||||
this.panel.color.thresholds.splice(index, 1);
|
||||
this.render();
|
||||
}
|
||||
}, {
|
||||
key: "onRemoveThresholds",
|
||||
value: function onRemoveThresholds() {
|
||||
this.panel.color.thresholds = [];
|
||||
this.render();
|
||||
}
|
||||
}, {
|
||||
key: "onAddThreeLights",
|
||||
value: function onAddThreeLights() {
|
||||
this.panel.color.thresholds.push({
|
||||
color: "red",
|
||||
value: 2,
|
||||
tooltip: "error"
|
||||
});
|
||||
this.panel.color.thresholds.push({
|
||||
color: "yellow",
|
||||
value: 1,
|
||||
tooltip: "warning"
|
||||
});
|
||||
this.panel.color.thresholds.push({
|
||||
color: "green",
|
||||
value: 0,
|
||||
tooltip: "ok"
|
||||
});
|
||||
this.render();
|
||||
}
|
||||
/* https://ethanschoonover.com/solarized/ */
|
||||
|
||||
}, {
|
||||
key: "onAddSolarized",
|
||||
value: function onAddSolarized() {
|
||||
this.panel.color.thresholds.push({
|
||||
color: "#b58900",
|
||||
value: 0,
|
||||
tooltip: "yellow"
|
||||
});
|
||||
this.panel.color.thresholds.push({
|
||||
color: "#cb4b16",
|
||||
value: 1,
|
||||
tooltip: "orange"
|
||||
});
|
||||
this.panel.color.thresholds.push({
|
||||
color: "#dc322f",
|
||||
value: 2,
|
||||
tooltip: "red"
|
||||
});
|
||||
this.panel.color.thresholds.push({
|
||||
color: "#d33682",
|
||||
value: 3,
|
||||
tooltip: "magenta"
|
||||
});
|
||||
this.panel.color.thresholds.push({
|
||||
color: "#6c71c4",
|
||||
value: 4,
|
||||
tooltip: "violet"
|
||||
});
|
||||
this.panel.color.thresholds.push({
|
||||
color: "#268bd2",
|
||||
value: 5,
|
||||
tooltip: "blue"
|
||||
});
|
||||
this.panel.color.thresholds.push({
|
||||
color: "#2aa198",
|
||||
value: 6,
|
||||
tooltip: "cyan"
|
||||
});
|
||||
this.panel.color.thresholds.push({
|
||||
color: "#859900",
|
||||
value: 7,
|
||||
tooltip: "green"
|
||||
});
|
||||
this.render();
|
||||
}
|
||||
}]);
|
||||
|
||||
return StatusHeatmapOptionsEditorCtrl;
|
||||
|
||||
Reference in New Issue
Block a user