Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
5b6fb3b1
Commit
5b6fb3b1
authored
Jun 11, 2016
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(alerting): level handle progress
parent
ec640bd5
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
13 deletions
+16
-13
public/app/plugins/panel/graph/jquery.flot.alerts.ts
+14
-11
public/sass/components/_panel_graph.scss
+2
-2
No files found.
public/app/plugins/panel/graph/jquery.flot.alerts.ts
View file @
5b6fb3b1
...
...
@@ -6,18 +6,24 @@ import _ from 'lodash';
var
options
=
{};
function
getHandle
Template
(
type
,
op
,
value
)
{
function
getHandle
InnerHtml
(
type
,
op
,
value
)
{
if
(
op
===
'>'
)
{
op
=
'>'
;
}
if
(
op
===
'<'
)
{
op
=
'<'
;
}
return
`
<div class="alert-handle-wrapper alert-handle-wrapper--
${
type
}
">
<div class="alert-handle-line">
</div>
<div class="alert-handle">
<i class="icon-gf icon-gf-
${
type
}
alert-icon-
${
type
}
"></i>
${
op
}
${
value
}
</div>
</div>`
;
}
function
getFullHandleHtml
(
type
,
op
,
value
)
{
var
innerTemplate
=
getHandleInnerHtml
(
type
,
op
,
value
);
return
`
<div class="alert-handle-wrapper alert-handle-wrapper--
${
type
}
">
${
innerTemplate
}
</div>
`
;
}
...
...
@@ -32,14 +38,12 @@ function dragEndHandler() {
console
.
log
(
'drag end'
);
}
var
past
;
function
drawAlertHandles
(
plot
)
{
var
options
=
plot
.
getOptions
();
var
$placeholder
=
plot
.
getPlaceholder
();
if
(
!
options
.
alerting
.
editing
)
{
$placeholder
.
find
(
".alert-handle"
).
remove
();
$placeholder
.
find
(
".alert-handle
-wrapper
"
).
remove
();
return
;
}
...
...
@@ -55,16 +59,15 @@ function drawAlertHandles(plot) {
}
if
(
$handle
.
length
===
0
)
{
console
.
log
(
'
not found
'
);
$handle
=
$
(
get
HandleTemplate
(
type
,
model
.
op
,
model
.
level
));
console
.
log
(
'
creating handle
'
);
$handle
=
$
(
get
FullHandleHtml
(
type
,
model
.
op
,
model
.
level
));
$handle
.
attr
(
'draggable'
,
true
);
$handle
.
bind
(
'dragend'
,
dragEndHandler
);
$handle
.
bind
(
'dragstart'
,
dragStartHandler
);
$placeholder
.
append
(
$handle
);
console
.
log
(
'registering drag events'
);
}
else
{
console
.
log
(
'reusing!'
);
$handle
.
html
(
getHandle
Template
(
type
,
model
.
op
,
model
.
level
));
console
.
log
(
'reusing
handle
!'
);
$handle
.
html
(
getHandle
InnerHtml
(
type
,
model
.
op
,
model
.
level
));
}
var
levelCanvasPos
=
plot
.
p2c
({
x
:
0
,
y
:
model
.
level
});
...
...
public/sass/components/_panel_graph.scss
View file @
5b6fb3b1
...
...
@@ -320,7 +320,7 @@
user-select
:
none
;
&
--warn
{
right
:
-
111
px
;
right
:
-
222
px
;
width
:
238px
;
.alert-handle-line
{
...
...
@@ -335,7 +335,7 @@
}
&
--critical
{
right
:
-
54
px
;
right
:
-
105
px
;
width
:
123px
;
.alert-handle-line
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment