diff --git a/web/ui/react-app/src/pages/graph/DataTable.tsx b/web/ui/react-app/src/pages/graph/DataTable.tsx index d82d88cf9..4e0f4e61d 100644 --- a/web/ui/react-app/src/pages/graph/DataTable.tsx +++ b/web/ui/react-app/src/pages/graph/DataTable.tsx @@ -5,6 +5,8 @@ import { Alert, Table } from 'reactstrap'; import SeriesName from './SeriesName'; import { Metric } from '../../types/types'; +import moment from 'moment'; + export interface QueryResult { data: | null @@ -24,6 +26,7 @@ export interface QueryResult { resultType: 'string'; result: string; }; + useLocalTime: boolean; } interface InstantSample { @@ -47,7 +50,7 @@ const limitSeries = (series: S[]): S[] = return series; }; -const DataTable: FC = ({ data }) => { +const DataTable: FC = ({ data, useLocalTime }) => { if (data === null) { return No data queried yet; } @@ -76,17 +79,21 @@ const DataTable: FC = ({ data }) => { break; case 'matrix': rows = (limitSeries(data.result) as RangeSamples[]).map((s, index) => { - const valueText = s.values - .map((v) => { - return v[1] + ' @' + v[0]; - }) - .join('\n'); + const valuesAndTimes = s.values.map((v) => { + const printedDatetime = moment.unix(v[0]).toISOString(useLocalTime); + return ( + + {v[1]} @{{v[0]}} +
+
+ ); + }); return ( - {valueText} + {valuesAndTimes} ); }); diff --git a/web/ui/react-app/src/pages/graph/Panel.tsx b/web/ui/react-app/src/pages/graph/Panel.tsx index 1cb0c1fde..244a7606e 100644 --- a/web/ui/react-app/src/pages/graph/Panel.tsx +++ b/web/ui/react-app/src/pages/graph/Panel.tsx @@ -325,7 +325,7 @@ class Panel extends Component { onChangeTime={this.handleChangeEndTime} /> - + )}