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
73fc6590
Commit
73fc6590
authored
Oct 11, 2016
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(graph): fixed issue with old threshold to new threshold model migration, fixes #6236
parent
f1905a84
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
10 deletions
+14
-10
public/app/features/dashboard/dashboard_srv.ts
+9
-5
public/app/features/dashboard/specs/dashboard_srv_specs.ts
+5
-5
No files found.
public/app/features/dashboard/dashboard_srv.ts
View file @
73fc6590
...
...
@@ -514,9 +514,11 @@ export class DashboardModel {
if
(
panel
.
grid
.
thresholdLine
)
{
t1
.
line
=
true
;
t1
.
lineColor
=
panel
.
grid
.
threshold1Color
;
t1
.
colorMode
=
'custom'
;
}
else
{
t1
.
fill
=
true
;
t1
.
fillColor
=
panel
.
grid
.
threshold1Color
;
t1
.
colorMode
=
'custom'
;
}
}
...
...
@@ -525,25 +527,27 @@ export class DashboardModel {
if
(
panel
.
grid
.
thresholdLine
)
{
t2
.
line
=
true
;
t2
.
lineColor
=
panel
.
grid
.
threshold2Color
;
t2
.
colorMode
=
'custom'
;
}
else
{
t2
.
fill
=
true
;
t2
.
fillColor
=
panel
.
grid
.
threshold2Color
;
t2
.
colorMode
=
'custom'
;
}
}
if
(
_
.
isNumber
(
t1
.
value
))
{
if
(
_
.
isNumber
(
t2
.
value
))
{
if
(
t1
.
value
>
t2
.
value
)
{
t1
.
op
=
t2
.
op
=
'<'
;
panel
.
thresholds
.
push
(
t2
);
t1
.
op
=
t2
.
op
=
'lt'
;
panel
.
thresholds
.
push
(
t1
);
}
else
{
t1
.
op
=
t2
.
op
=
'>'
;
panel
.
thresholds
.
push
(
t2
);
}
else
{
t1
.
op
=
t2
.
op
=
'gt'
;
panel
.
thresholds
.
push
(
t1
);
panel
.
thresholds
.
push
(
t2
);
}
}
else
{
t1
.
op
=
'
>
'
;
t1
.
op
=
'
gt
'
;
panel
.
thresholds
.
push
(
t1
);
}
}
...
...
public/app/features/dashboard/specs/dashboard_srv_specs.ts
View file @
73fc6590
...
...
@@ -221,11 +221,11 @@ describe('dashboardSrv', function() {
it
(
'graph thresholds should be migrated'
,
function
()
{
expect
(
graph
.
thresholds
.
length
).
to
.
be
(
2
);
expect
(
graph
.
thresholds
[
0
].
op
).
to
.
be
(
'
>
'
);
expect
(
graph
.
thresholds
[
0
].
value
).
to
.
be
(
4
00
);
expect
(
graph
.
thresholds
[
0
].
fillColor
).
to
.
be
(
'
red
'
);
expect
(
graph
.
thresholds
[
1
].
value
).
to
.
be
(
2
00
);
expect
(
graph
.
thresholds
[
1
].
fillColor
).
to
.
be
(
'
yellow
'
);
expect
(
graph
.
thresholds
[
0
].
op
).
to
.
be
(
'
gt
'
);
expect
(
graph
.
thresholds
[
0
].
value
).
to
.
be
(
2
00
);
expect
(
graph
.
thresholds
[
0
].
fillColor
).
to
.
be
(
'
yellow
'
);
expect
(
graph
.
thresholds
[
1
].
value
).
to
.
be
(
4
00
);
expect
(
graph
.
thresholds
[
1
].
fillColor
).
to
.
be
(
'
red
'
);
});
});
...
...
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