diff --git a/CommonServer/Utils/AnalyticsDatabase/StatementGenerator.ts b/CommonServer/Utils/AnalyticsDatabase/StatementGenerator.ts index 9268af5b95..4a07378816 100644 --- a/CommonServer/Utils/AnalyticsDatabase/StatementGenerator.ts +++ b/CommonServer/Utils/AnalyticsDatabase/StatementGenerator.ts @@ -429,7 +429,7 @@ export default class StatementGenerator { ) { whereStatement.append( SQL`AND JSONExtractString(${key}, ${{ - value: key, + value: objKey, type: TableColumnType.Text, }}) = ${{ value: flatValue[objKey] as string, @@ -445,7 +445,7 @@ export default class StatementGenerator { ) { whereStatement.append( SQL`AND JSONExtractInt(${key}, ${{ - value: key, + value: objKey, type: TableColumnType.Text, }}) = ${{ value: flatValue[objKey] as number, @@ -454,9 +454,23 @@ export default class StatementGenerator { ); continue; } - } - + if ( + flatValue[objKey] && + typeof flatValue[objKey] === 'boolean' + ) { + whereStatement.append( + SQL`AND JSONExtractBool(${key}, ${{ + value: objKey, + type: TableColumnType.Text, + }}) = ${{ + value: flatValue[objKey] as number, + type: TableColumnType.Boolean, + }}` + ); + continue; + } + } } else { whereStatement.append( SQL`AND ${key} = ${{ value, type: tableColumn.type }}` diff --git a/Dashboard/src/Pages/Telemetry/Services/View/Metrics/Index.tsx b/Dashboard/src/Pages/Telemetry/Services/View/Metrics/Index.tsx index c87e909dc9..9dc21d0610 100644 --- a/Dashboard/src/Pages/Telemetry/Services/View/Metrics/Index.tsx +++ b/Dashboard/src/Pages/Telemetry/Services/View/Metrics/Index.tsx @@ -55,6 +55,13 @@ const ServiceDelete: FunctionComponent = ( title: 'Name', type: FieldType.Text, }, + { + field: { + attributes: true, + }, + type: FieldType.JSON, + title: 'Attributes', + }, ]} columns={[ {