Browse Source

todo

pull/3/head
rozetko 9 months ago
parent
commit
59d02583c4
  1. 3
      src/components/Panel.tsx

3
src/components/Panel.tsx

@ -83,12 +83,13 @@ export function Panel({ options, data, width, height, timeRange, onChangeTimeRan
let additionalInfo; let additionalInfo;
const additionalInfoConfig = options.gauge.additionalInfo; const additionalInfoConfig = options.gauge.additionalInfo;
if (additionalInfoConfig.display) { if (additionalInfoConfig.display) {
// TODO: move `useMetric` handling to utils, as it's duplicated in gaugeOptions.ts
let value: number | undefined = undefined; let value: number | undefined = undefined;
if (!additionalInfoConfig.value?.useMetric) { if (!additionalInfoConfig.value?.useMetric) {
value = additionalInfoConfig.value.value; value = additionalInfoConfig.value.value;
} else { } else {
if (!_.isEmpty(additionalInfoConfig.value.metricName)) { if (!_.isEmpty(additionalInfoConfig.value.metricName)) {
const aggregatedValue = getLastMetricValue(grafanaSeriesList, additionalInfoConfig.value.metricName, 'Max'); const aggregatedValue = getLastMetricValue(grafanaSeriesList, additionalInfoConfig.value.metricName, 'Additional Info');
value = aggregatedValue !== null ? aggregatedValue : undefined; value = aggregatedValue !== null ? aggregatedValue : undefined;
} }
} }

Loading…
Cancel
Save