|
|
@ -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; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|