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
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
18 deletions
+21
-18
public/app/plugins/panel/graph/jquery.flot.alerts.ts
+19
-16
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';
...
@@ -6,18 +6,24 @@ import _ from 'lodash';
var
options
=
{};
var
options
=
{};
function
getHandle
Template
(
type
,
op
,
value
)
{
function
getHandle
InnerHtml
(
type
,
op
,
value
)
{
if
(
op
===
'>'
)
{
op
=
'>'
;
}
if
(
op
===
'>'
)
{
op
=
'>'
;
}
if
(
op
===
'<'
)
{
op
=
'<'
;
}
if
(
op
===
'<'
)
{
op
=
'<'
;
}
return
`
return
`
<div class="alert-handle-line">
</div>
<div class="alert-handle">
<i class="icon-gf icon-gf-
${
type
}
alert-icon-
${
type
}
"></i>
${
op
}
${
value
}
</div>`
;
}
function
getFullHandleHtml
(
type
,
op
,
value
)
{
var
innerTemplate
=
getHandleInnerHtml
(
type
,
op
,
value
);
return
`
<div class="alert-handle-wrapper alert-handle-wrapper--
${
type
}
">
<div class="alert-handle-wrapper alert-handle-wrapper--
${
type
}
">
<div class="alert-handle-line">
${
innerTemplate
}
</div>
<div class="alert-handle">
<i class="icon-gf icon-gf-
${
type
}
alert-icon-
${
type
}
"></i>
${
op
}
${
value
}
</div>
</div>
</div>
`
;
`
;
}
}
...
@@ -32,14 +38,12 @@ function dragEndHandler() {
...
@@ -32,14 +38,12 @@ function dragEndHandler() {
console
.
log
(
'drag end'
);
console
.
log
(
'drag end'
);
}
}
var
past
;
function
drawAlertHandles
(
plot
)
{
function
drawAlertHandles
(
plot
)
{
var
options
=
plot
.
getOptions
();
var
options
=
plot
.
getOptions
();
var
$placeholder
=
plot
.
getPlaceholder
();
var
$placeholder
=
plot
.
getPlaceholder
();
if
(
!
options
.
alerting
.
editing
)
{
if
(
!
options
.
alerting
.
editing
)
{
$placeholder
.
find
(
".alert-handle"
).
remove
();
$placeholder
.
find
(
".alert-handle
-wrapper
"
).
remove
();
return
;
return
;
}
}
...
@@ -55,16 +59,15 @@ function drawAlertHandles(plot) {
...
@@ -55,16 +59,15 @@ function drawAlertHandles(plot) {
}
}
if
(
$handle
.
length
===
0
)
{
if
(
$handle
.
length
===
0
)
{
console
.
log
(
'
not found
'
);
console
.
log
(
'
creating handle
'
);
$handle
=
$
(
get
HandleTemplate
(
type
,
model
.
op
,
model
.
level
));
$handle
=
$
(
get
FullHandleHtml
(
type
,
model
.
op
,
model
.
level
));
$handle
.
attr
(
'draggable'
,
true
);
$handle
.
attr
(
'draggable'
,
true
);
$handle
.
bind
(
'dragend'
,
dragEndHandler
);
$handle
.
bind
(
'dragend'
,
dragEndHandler
);
$handle
.
bind
(
'dragstart'
,
dragStartHandler
);
$handle
.
bind
(
'dragstart'
,
dragStartHandler
);
$placeholder
.
append
(
$handle
);
$placeholder
.
append
(
$handle
);
console
.
log
(
'registering drag events'
);
}
else
{
}
else
{
console
.
log
(
'reusing!'
);
console
.
log
(
'reusing
handle
!'
);
$handle
.
html
(
getHandle
Template
(
type
,
model
.
op
,
model
.
level
));
$handle
.
html
(
getHandle
InnerHtml
(
type
,
model
.
op
,
model
.
level
));
}
}
var
levelCanvasPos
=
plot
.
p2c
({
x
:
0
,
y
:
model
.
level
});
var
levelCanvasPos
=
plot
.
p2c
({
x
:
0
,
y
:
model
.
level
});
...
...
public/sass/components/_panel_graph.scss
View file @
5b6fb3b1
...
@@ -320,7 +320,7 @@
...
@@ -320,7 +320,7 @@
user-select
:
none
;
user-select
:
none
;
&
--warn
{
&
--warn
{
right
:
-
111
px
;
right
:
-
222
px
;
width
:
238px
;
width
:
238px
;
.alert-handle-line
{
.alert-handle-line
{
...
@@ -335,7 +335,7 @@
...
@@ -335,7 +335,7 @@
}
}
&
--critical
{
&
--critical
{
right
:
-
54
px
;
right
:
-
105
px
;
width
:
123px
;
width
:
123px
;
.alert-handle-line
{
.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