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
675a031b
Commit
675a031b
authored
Jul 27, 2018
by
Tobias Skarhed
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
All except one passing
parent
fc06f8bf
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletions
+8
-1
public/app/plugins/panel/singlestat/module.ts
+4
-1
public/app/plugins/panel/singlestat/specs/singlestat.jest.ts
+4
-0
No files found.
public/app/plugins/panel/singlestat/module.ts
View file @
675a031b
...
@@ -310,11 +310,14 @@ class SingleStatCtrl extends MetricsPanelCtrl {
...
@@ -310,11 +310,14 @@ class SingleStatCtrl extends MetricsPanelCtrl {
data
.
valueRounded
=
data
.
value
;
data
.
valueRounded
=
data
.
value
;
data
.
valueFormatted
=
formatFunc
(
data
.
value
,
this
.
dashboard
.
isTimezoneUtc
());
data
.
valueFormatted
=
formatFunc
(
data
.
value
,
this
.
dashboard
.
isTimezoneUtc
());
}
else
{
}
else
{
console
.
log
(
lastPoint
,
lastValue
);
// console.log(lastPoint, lastValue);
// console.log(this.panel.valueName);
// console.log(this.panel);
data
.
value
=
this
.
series
[
0
].
stats
[
this
.
panel
.
valueName
];
data
.
value
=
this
.
series
[
0
].
stats
[
this
.
panel
.
valueName
];
data
.
flotpairs
=
this
.
series
[
0
].
flotpairs
;
data
.
flotpairs
=
this
.
series
[
0
].
flotpairs
;
let
decimalInfo
=
this
.
getDecimalsForValue
(
data
.
value
);
let
decimalInfo
=
this
.
getDecimalsForValue
(
data
.
value
);
console
.
log
(
decimalInfo
);
let
formatFunc
=
kbn
.
valueFormats
[
this
.
panel
.
format
];
let
formatFunc
=
kbn
.
valueFormats
[
this
.
panel
.
format
];
data
.
valueFormatted
=
formatFunc
(
data
.
value
,
decimalInfo
.
decimals
,
decimalInfo
.
scaledDecimals
);
data
.
valueFormatted
=
formatFunc
(
data
.
value
,
decimalInfo
.
decimals
,
decimalInfo
.
scaledDecimals
);
data
.
valueRounded
=
kbn
.
roundValue
(
data
.
value
,
decimalInfo
.
decimals
);
data
.
valueRounded
=
kbn
.
roundValue
(
data
.
value
,
decimalInfo
.
decimals
);
...
...
public/app/plugins/panel/singlestat/specs/singlestat.jest.ts
View file @
675a031b
...
@@ -192,6 +192,8 @@ describe('SingleStatCtrl', function() {
...
@@ -192,6 +192,8 @@ describe('SingleStatCtrl', function() {
)
{
)
{
ctx
.
setup
(
function
()
{
ctx
.
setup
(
function
()
{
ctx
.
data
=
[{
target
:
'test.cpu1'
,
datapoints
:
[[
99.999
,
1
],
[
99.99999
,
2
]]
}];
ctx
.
data
=
[{
target
:
'test.cpu1'
,
datapoints
:
[[
99.999
,
1
],
[
99.99999
,
2
]]
}];
ctx
.
ctrl
.
panel
.
valueName
=
'avg'
;
ctx
.
ctrl
.
panel
.
format
=
'none'
;
});
});
it
(
'Should be rounded'
,
function
()
{
it
(
'Should be rounded'
,
function
()
{
...
@@ -259,7 +261,9 @@ describe('SingleStatCtrl', function() {
...
@@ -259,7 +261,9 @@ describe('SingleStatCtrl', function() {
singleStatScenario
(
'with default values'
,
function
(
ctx
)
{
singleStatScenario
(
'with default values'
,
function
(
ctx
)
{
ctx
.
setup
(
function
()
{
ctx
.
setup
(
function
()
{
ctx
.
data
=
tableData
;
ctx
.
data
=
tableData
;
ctx
.
ctrl
.
panel
=
{};
ctx
.
ctrl
.
panel
.
tableColumn
=
'mean'
;
ctx
.
ctrl
.
panel
.
tableColumn
=
'mean'
;
ctx
.
ctrl
.
panel
.
format
=
'none'
;
});
});
it
(
'Should use first rows value as default main value'
,
function
()
{
it
(
'Should use first rows value as default main value'
,
function
()
{
...
...
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