ui: fix timeseries table format
This commit is contained in:
parent
63aeb103e6
commit
24419712b0
2 changed files with 5 additions and 7 deletions
|
|
@ -153,11 +153,9 @@ function WidgetChart(props: Props) {
|
|||
}
|
||||
prevMetricRef.current = metric;
|
||||
const timestmaps = drillDownPeriod.toTimestamps();
|
||||
const isTimeseries = metric.metricType === TIMESERIES;
|
||||
const payload = isSaved
|
||||
// TODO: remove after backend adds support for more view types
|
||||
? { ...metricParams, viewType: isTimeseries ? 'lineChart' : metric.viewType }
|
||||
: { ...params, ...timestmaps, ...metric.toJson(), viewType: isTimeseries ? 'lineChart' : metric.viewType };
|
||||
? { ...metricParams }
|
||||
: { ...params, ...timestmaps, ...metric.toJson() };
|
||||
debounceRequest(
|
||||
metric,
|
||||
payload,
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ function WidgetDatatable(props: Props) {
|
|||
* + average for each row
|
||||
* [ { seriesName: 'series1', mon: 1, tue: 2, wed: 3, average: 2 }, ... ]
|
||||
* */
|
||||
const series = Object.keys(data.chart[0]).filter(
|
||||
const series = !data.chart[0] ? [] : Object.keys(data.chart[0]).filter(
|
||||
(key) => key !== 'time' && key !== 'timestamp'
|
||||
);
|
||||
React.useEffect(() => {
|
||||
|
|
@ -107,7 +107,7 @@ function WidgetDatatable(props: Props) {
|
|||
}),
|
||||
type: 'checkbox',
|
||||
};
|
||||
return hasMultipleSeries ? (
|
||||
return (
|
||||
<div className={cn('relative -mx-4 px-2', showTable ? 'pt-6' : '')}>
|
||||
<div
|
||||
className={
|
||||
|
|
@ -154,7 +154,7 @@ function WidgetDatatable(props: Props) {
|
|||
</div>
|
||||
) : null}
|
||||
</div>
|
||||
) : null;
|
||||
)
|
||||
}
|
||||
|
||||
export default WidgetDatatable;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue