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
5e487508
Commit
5e487508
authored
Apr 10, 2019
by
Ryan McKinley
Committed by
Torkel Ödegaard
Apr 11, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Panels: Add types for DataList and range (#16500)
parent
ef44a05b
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
8 deletions
+10
-8
public/app/features/dashboard/dashgrid/DataPanel.tsx
+2
-1
public/app/features/panel/metrics_panel_ctrl.ts
+6
-5
public/app/plugins/panel/heatmap/heatmap_ctrl.ts
+2
-2
No files found.
public/app/features/dashboard/dashgrid/DataPanel.tsx
View file @
5e487508
...
@@ -15,6 +15,7 @@ import {
...
@@ -15,6 +15,7 @@ import {
ScopedVars
,
ScopedVars
,
toSeriesData
,
toSeriesData
,
guessFieldTypes
,
guessFieldTypes
,
DataQuery
,
}
from
'@grafana/ui'
;
}
from
'@grafana/ui'
;
interface
RenderProps
{
interface
RenderProps
{
...
@@ -24,7 +25,7 @@ interface RenderProps {
...
@@ -24,7 +25,7 @@ interface RenderProps {
export
interface
Props
{
export
interface
Props
{
datasource
:
string
|
null
;
datasource
:
string
|
null
;
queries
:
an
y
[];
queries
:
DataQuer
y
[];
panelId
:
number
;
panelId
:
number
;
dashboardId
?:
number
;
dashboardId
?:
number
;
isVisible
?:
boolean
;
isVisible
?:
boolean
;
...
...
public/app/features/panel/metrics_panel_ctrl.ts
View file @
5e487508
...
@@ -6,7 +6,8 @@ import { PanelCtrl } from 'app/features/panel/panel_ctrl';
...
@@ -6,7 +6,8 @@ import { PanelCtrl } from 'app/features/panel/panel_ctrl';
import
{
getExploreUrl
}
from
'app/core/utils/explore'
;
import
{
getExploreUrl
}
from
'app/core/utils/explore'
;
import
{
applyPanelTimeOverrides
,
getResolution
}
from
'app/features/dashboard/utils/panel'
;
import
{
applyPanelTimeOverrides
,
getResolution
}
from
'app/features/dashboard/utils/panel'
;
import
{
ContextSrv
}
from
'app/core/services/context_srv'
;
import
{
ContextSrv
}
from
'app/core/services/context_srv'
;
import
{
toLegacyResponseData
,
isSeriesData
}
from
'@grafana/ui'
;
import
{
toLegacyResponseData
,
isSeriesData
,
LegacyResponseData
,
TimeRange
}
from
'@grafana/ui'
;
import
{
Unsubscribable
}
from
'rxjs'
;
class
MetricsPanelCtrl
extends
PanelCtrl
{
class
MetricsPanelCtrl
extends
PanelCtrl
{
scope
:
any
;
scope
:
any
;
...
@@ -17,15 +18,15 @@ class MetricsPanelCtrl extends PanelCtrl {
...
@@ -17,15 +18,15 @@ class MetricsPanelCtrl extends PanelCtrl {
datasourceSrv
:
any
;
datasourceSrv
:
any
;
timeSrv
:
any
;
timeSrv
:
any
;
templateSrv
:
any
;
templateSrv
:
any
;
range
:
any
;
range
:
TimeRange
;
interval
:
any
;
interval
:
any
;
intervalMs
:
any
;
intervalMs
:
any
;
resolution
:
any
;
resolution
:
any
;
timeInfo
:
any
;
timeInfo
?:
string
;
skipDataOnInit
:
boolean
;
skipDataOnInit
:
boolean
;
dataStream
:
any
;
dataStream
:
any
;
dataSubscription
:
any
;
dataSubscription
?:
Unsubscribable
;
dataList
:
any
;
dataList
:
LegacyResponseData
[]
;
constructor
(
$scope
,
$injector
)
{
constructor
(
$scope
,
$injector
)
{
super
(
$scope
,
$injector
);
super
(
$scope
,
$injector
);
...
...
public/app/plugins/panel/heatmap/heatmap_ctrl.ts
View file @
5e487508
...
@@ -164,7 +164,7 @@ export class HeatmapCtrl extends MetricsPanelCtrl {
...
@@ -164,7 +164,7 @@ export class HeatmapCtrl extends MetricsPanelCtrl {
const
logBase
=
this
.
panel
.
yAxis
.
logBase
;
const
logBase
=
this
.
panel
.
yAxis
.
logBase
;
const
xBucketNumber
=
this
.
panel
.
xBucketNumber
||
X_BUCKET_NUMBER_DEFAULT
;
const
xBucketNumber
=
this
.
panel
.
xBucketNumber
||
X_BUCKET_NUMBER_DEFAULT
;
const
xBucketSizeByNumber
=
Math
.
floor
((
this
.
range
.
to
-
this
.
range
.
from
)
/
xBucketNumber
);
const
xBucketSizeByNumber
=
Math
.
floor
((
this
.
range
.
to
.
valueOf
()
-
this
.
range
.
from
.
valueOf
()
)
/
xBucketNumber
);
// Parse X bucket size (number or interval)
// Parse X bucket size (number or interval)
const
isIntervalString
=
kbn
.
interval_regex
.
test
(
this
.
panel
.
xBucketSize
);
const
isIntervalString
=
kbn
.
interval_regex
.
test
(
this
.
panel
.
xBucketSize
);
...
@@ -333,7 +333,7 @@ export class HeatmapCtrl extends MetricsPanelCtrl {
...
@@ -333,7 +333,7 @@ export class HeatmapCtrl extends MetricsPanelCtrl {
if
(
datapoints
&&
datapoints
.
length
>
0
)
{
if
(
datapoints
&&
datapoints
.
length
>
0
)
{
const
last
=
datapoints
[
datapoints
.
length
-
1
][
1
];
const
last
=
datapoints
[
datapoints
.
length
-
1
][
1
];
const
from
=
this
.
range
.
from
;
const
from
=
this
.
range
.
from
;
if
(
last
-
from
<
-
10000
)
{
if
(
last
-
from
.
valueOf
()
<
-
10000
)
{
series
.
isOutsideRange
=
true
;
series
.
isOutsideRange
=
true
;
}
}
}
}
...
...
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