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
8bb07124
Commit
8bb07124
authored
Apr 26, 2016
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(gauge): validate min / max range, fixes #4820
parent
bce5c447
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
public/app/plugins/panel/singlestat/editor.html
+7
-2
public/app/plugins/panel/singlestat/module.ts
+7
-0
No files found.
public/app/plugins/panel/singlestat/editor.html
View file @
8bb07124
...
@@ -179,13 +179,18 @@
...
@@ -179,13 +179,18 @@
Min
Min
</li>
</li>
<li>
<li>
<input
type=
"
text
"
class=
"input-small tight-form-input"
ng-model=
"ctrl.panel.gauge.minValue"
ng-blur=
"ctrl.render()"
placeholder=
"0"
></input>
<input
type=
"
number
"
class=
"input-small tight-form-input"
ng-model=
"ctrl.panel.gauge.minValue"
ng-blur=
"ctrl.render()"
placeholder=
"0"
></input>
</li>
</li>
<li
class=
"tight-form-item last"
>
<li
class=
"tight-form-item last"
>
Max
Max
</li>
</li>
<li>
<li>
<input
type=
"text"
class=
"input-small tight-form-input last"
ng-model=
"ctrl.panel.gauge.maxValue"
ng-blur=
"ctrl.render()"
placeholder=
"100"
></input>
<input
type=
"number"
class=
"input-small tight-form-input last"
ng-model=
"ctrl.panel.gauge.maxValue"
ng-blur=
"ctrl.render()"
placeholder=
"100"
></input>
<span
class=
"alert-state-critical"
ng-show=
"ctrl.invalidGaugeRange"
>
<i
class=
"fa fa-warning"
></i>
Min value is bigger than max.
</span>
</li>
</li>
</ul>
</ul>
<div
class=
"clearfix"
></div>
<div
class=
"clearfix"
></div>
...
...
public/app/plugins/panel/singlestat/module.ts
View file @
8bb07124
...
@@ -18,6 +18,7 @@ class SingleStatCtrl extends MetricsPanelCtrl {
...
@@ -18,6 +18,7 @@ class SingleStatCtrl extends MetricsPanelCtrl {
data
:
any
;
data
:
any
;
fontSizes
:
any
[];
fontSizes
:
any
[];
unitFormats
:
any
[];
unitFormats
:
any
[];
invalidGaugeRange
:
boolean
;
// Set and populate defaults
// Set and populate defaults
panelDefaults
=
{
panelDefaults
=
{
...
@@ -287,6 +288,12 @@ class SingleStatCtrl extends MetricsPanelCtrl {
...
@@ -287,6 +288,12 @@ class SingleStatCtrl extends MetricsPanelCtrl {
}
}
function
addGauge
()
{
function
addGauge
()
{
ctrl
.
invalidGaugeRange
=
false
;
if
(
panel
.
gauge
.
minValue
>
panel
.
gauge
.
maxValue
)
{
ctrl
.
invalidGaugeRange
=
true
;
return
;
}
var
plotCanvas
=
$
(
'<div></div>'
);
var
plotCanvas
=
$
(
'<div></div>'
);
var
plotCss
=
{
var
plotCss
=
{
top
:
'10px'
,
top
:
'10px'
,
...
...
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