mirror of
https://github.com/grafana/grafana.git
synced 2025-01-19 21:13:35 -06:00
mend
This commit is contained in:
parent
0b919c752b
commit
f387e39b67
39
public/app/plugins/panel/graph/jquery.flot.alerts.ts
Normal file
39
public/app/plugins/panel/graph/jquery.flot.alerts.ts
Normal file
@ -0,0 +1,39 @@
|
||||
///<reference path="../../../headers/common.d.ts" />
|
||||
|
||||
import 'jquery.flot';
|
||||
import $ from 'jquery';
|
||||
|
||||
var options = {};
|
||||
|
||||
function getHandleTemplate(type) {
|
||||
return `
|
||||
<div class="alert-handle" style="position: absolute; top: 100px; right: -50px;">
|
||||
<i class="icon-gf icon-gf-${type} alert-icon-${type}"></i>
|
||||
> 100
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
|
||||
function drawAlertHandles(plot, canvascontext) {
|
||||
var $warnHandle = $(getHandleTemplate('warn'));
|
||||
|
||||
var $placeholder = plot.getPlaceholder();
|
||||
$placeholder.find(".alert-warn-handle").remove();
|
||||
$placeholder.append($warnHandle);
|
||||
}
|
||||
|
||||
function shutdown() {
|
||||
}
|
||||
|
||||
function init(plot, classes) {
|
||||
plot.hooks.draw.push(drawAlertHandles);
|
||||
plot.hooks.shutdown.push(shutdown);
|
||||
}
|
||||
|
||||
$.plot.plugins.push({
|
||||
init: init,
|
||||
options: options,
|
||||
name: 'navigationControl',
|
||||
version: '1.4'
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user