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
c2b72083
Commit
c2b72083
authored
Apr 27, 2018
by
Mitsuhiro Tanda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix to match table column name and order
parent
afce0feb
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
3 deletions
+9
-3
public/app/plugins/datasource/prometheus/datasource.ts
+1
-0
public/app/plugins/datasource/prometheus/result_transformer.ts
+3
-3
public/app/plugins/panel/table/module.ts
+5
-0
No files found.
public/app/plugins/datasource/prometheus/datasource.ts
View file @
c2b72083
...
...
@@ -153,6 +153,7 @@ export class PrometheusDatasource {
end: end,
responseListLength: responseList.length,
responseIndex: index,
refId: activeTargets[index].refId,
};
this.resultTransformer.transform(result, response, transformerOptions);
...
...
public/app/plugins/datasource/prometheus/result_transformer.ts
View file @
c2b72083
...
...
@@ -8,7 +8,7 @@ export class ResultTransformer {
let
prometheusResult
=
response
.
data
.
data
.
result
;
if
(
options
.
format
===
'table'
)
{
result
.
push
(
this
.
transformMetricDataToTable
(
prometheusResult
,
options
.
responseListLength
,
options
.
re
sponseIndex
));
result
.
push
(
this
.
transformMetricDataToTable
(
prometheusResult
,
options
.
responseListLength
,
options
.
re
fId
));
}
else
if
(
options
.
format
===
'heatmap'
)
{
let
seriesList
=
[];
prometheusResult
.
sort
(
sortSeriesByLabel
);
...
...
@@ -58,7 +58,7 @@ export class ResultTransformer {
return
{
target
:
metricLabel
,
datapoints
:
dps
};
}
transformMetricDataToTable
(
md
,
resultCount
:
number
,
re
sultIndex
:
number
)
{
transformMetricDataToTable
(
md
,
resultCount
:
number
,
re
fId
:
string
)
{
var
table
=
new
TableModel
();
var
i
,
j
;
var
metricLabels
=
{};
...
...
@@ -83,7 +83,7 @@ export class ResultTransformer {
metricLabels
[
label
]
=
labelIndex
+
1
;
table
.
columns
.
push
({
text
:
label
});
});
let
valueText
=
resultCount
>
1
?
`Value #
${
String
.
fromCharCode
(
65
+
resultIndex
)
}
`
:
'Value'
;
let
valueText
=
resultCount
>
1
?
`Value #
${
refId
}
`
:
'Value'
;
table
.
columns
.
push
({
text
:
valueText
});
// Populate rows, set value to empty string when label not present.
...
...
public/app/plugins/panel/table/module.ts
View file @
c2b72083
...
...
@@ -154,6 +154,11 @@ class TablePanelCtrl extends MetricsPanelCtrl {
this
.
render
();
}
moveQuery
(
target
,
direction
)
{
super
.
moveQuery
(
target
,
direction
);
super
.
refresh
();
}
exportCsv
()
{
var
scope
=
this
.
$scope
.
$new
(
true
);
scope
.
tableData
=
this
.
renderer
.
render_values
();
...
...
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