mirror of https://github.com/prometheus/prometheus
React UI: Fixed data table for matrix always showing 1 as value (#6896)
Signed-off-by: Simon Kirsten <1972314+skirsten@users.noreply.github.com> React UI: Fixed data table for matrix always showing 1 as valuepull/6902/head
parent
0e78908407
commit
45fbed94d6
|
@ -246,26 +246,26 @@ describe('DataTable', () => {
|
|||
const rows = table.find('tr');
|
||||
expect(table.find('tr')).toHaveLength(3);
|
||||
const row = rows.at(0);
|
||||
expect(row.text()).toEqual(`<SeriesName />1 @1572097950.93
|
||||
1 @1572097965.931
|
||||
1 @1572097980.929
|
||||
1 @1572097995.931
|
||||
1 @1572098010.932
|
||||
1 @1572098025.933
|
||||
1 @1572098040.93
|
||||
1 @1572098055.93
|
||||
1 @1572098070.93
|
||||
1 @1572098085.936
|
||||
1 @1572098100.936
|
||||
1 @1572098115.933
|
||||
1 @1572098130.932
|
||||
1 @1572098145.932
|
||||
1 @1572098160.933
|
||||
1 @1572098175.934
|
||||
1 @1572098190.937
|
||||
1 @1572098205.934
|
||||
1 @1572098220.933
|
||||
1 @1572098235.934`);
|
||||
expect(row.text()).toEqual(`<SeriesName />9 @1572097950.93
|
||||
10 @1572097965.931
|
||||
11 @1572097980.929
|
||||
12 @1572097995.931
|
||||
13 @1572098010.932
|
||||
14 @1572098025.933
|
||||
15 @1572098040.93
|
||||
16 @1572098055.93
|
||||
17 @1572098070.93
|
||||
18 @1572098085.936
|
||||
19 @1572098100.936
|
||||
20 @1572098115.933
|
||||
21 @1572098130.932
|
||||
22 @1572098145.932
|
||||
23 @1572098160.933
|
||||
24 @1572098175.934
|
||||
25 @1572098190.937
|
||||
26 @1572098205.934
|
||||
27 @1572098220.933
|
||||
28 @1572098235.934`);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -80,7 +80,7 @@ const DataTable: FC<QueryResult> = ({ data }) => {
|
|||
rows = (limitSeries(data.result) as RangeSamples[]).map((s, index) => {
|
||||
const valueText = s.values
|
||||
.map(v => {
|
||||
return [1] + ' @' + v[0];
|
||||
return v[1] + ' @' + v[0];
|
||||
})
|
||||
.join('\n');
|
||||
return (
|
||||
|
|
Loading…
Reference in New Issue