From 30de58519188ae252187129da9cf236415a674b6 Mon Sep 17 00:00:00 2001 From: dashuser1 Date: Tue, 12 May 2026 20:07:57 +0530 Subject: [PATCH] Added custom column for legend display --- plugins/eginnovations/v1/data_streams.json | 16 +++++++++------- plugins/eginnovations/v1/metadata.json | 2 +- .../v1/readDataSource/getHistoricalData.js | 6 +++++- .../v1/readDataSource/getLiveMeasure.js | 8 ++++++-- 4 files changed, 21 insertions(+), 11 deletions(-) diff --git a/plugins/eginnovations/v1/data_streams.json b/plugins/eginnovations/v1/data_streams.json index 2e9c298..98f6a85 100644 --- a/plugins/eginnovations/v1/data_streams.json +++ b/plugins/eginnovations/v1/data_streams.json @@ -9,7 +9,7 @@ { "map": { "unmonitored": [], - "unknown": [], + "unknown": ["unknown"], "error": ["critical"], "warning": ["major"], "success": ["minor"] @@ -35,6 +35,7 @@ { "name": "HistoricalData", "metadata": [ + { "name": "legend", "displayName": "Legend", "shape": "string", "role": "label" }, { "name": "date", "displayName": "Date", @@ -88,7 +89,7 @@ { "map": { "unmonitored": [], - "unknown": [], + "unknown": ["Unknown"], "error": ["Critical"], "warning": ["Major"], "success": ["Minor"] @@ -174,10 +175,10 @@ "state", { "map": { - "unmonitored": ["Minor"], + "unmonitored": [], "unknown": ["Unknown"], - "error": ["Critical"], - "warning": ["Major"], + "error": ["Critical", "Major"], + "warning": ["Minor"], "success": ["Normal"] } } @@ -220,14 +221,15 @@ "map": { "unmonitored": [], "unknown": ["Unknown"], - "error": ["Critical"], - "warning": ["Major"], + "error": ["Critical", "Major"], + "warning": ["Minor"], "success": ["Normal"] } } ], "name": "priority" }, + { "name": "legend", "displayName": "Legend", "shape": "string", "role": "label" }, { "name": "priority", "displayName": "Priority", diff --git a/plugins/eginnovations/v1/metadata.json b/plugins/eginnovations/v1/metadata.json index 20f5a7f..cb43976 100644 --- a/plugins/eginnovations/v1/metadata.json +++ b/plugins/eginnovations/v1/metadata.json @@ -1,7 +1,7 @@ { "name": "eGInnovations", "displayName": "eG Enterprise", - "version": "1.1.9", + "version": "1.2.0", "author": "eG Innovations Pvt Ltd", "description": "Monitor key application metrics from your eG environment", "category": "APM", diff --git a/plugins/eginnovations/v1/readDataSource/getHistoricalData.js b/plugins/eginnovations/v1/readDataSource/getHistoricalData.js index 6ba65d9..0b58260 100644 --- a/plugins/eginnovations/v1/readDataSource/getHistoricalData.js +++ b/plugins/eginnovations/v1/readDataSource/getHistoricalData.js @@ -67,7 +67,11 @@ export async function getHistoricalData(context) { let data = await response.json(); - return data.data; + // return data.data; + return data.data.map((component) => ({ + ...component, + legend: `${component.componentType} / ${component.componentName} / ${component.test}/ ${component.descriptor}/ ${component.measure}` + })); } catch (error) { // Catch and log any errors context.log.error(`Error in getHistoricalData: ${error.message}`); diff --git a/plugins/eginnovations/v1/readDataSource/getLiveMeasure.js b/plugins/eginnovations/v1/readDataSource/getLiveMeasure.js index 31f4729..f2d32a0 100644 --- a/plugins/eginnovations/v1/readDataSource/getLiveMeasure.js +++ b/plugins/eginnovations/v1/readDataSource/getLiveMeasure.js @@ -14,7 +14,7 @@ export async function getLiveMeasure(context) { if (context.dataSourceConfig.descriptor != 'All' && context.dataSourceConfig.descriptor != 'Not Applicable') { info = context.dataSourceConfig.descriptor; - }else{ + } else { info = ''; } @@ -59,7 +59,11 @@ export async function getLiveMeasure(context) { let data = await response.json(); - return data; + // return data; + return data.map((component) => ({ + ...component, + legend: `${component.componentType} / ${component.componentName} / ${component.test}/ ${component.descriptor}/ ${component.measure}` + })); } catch (error) { // Catch and log any errors context.log.error(`Error in getLiveMeasure: ${error.message}`);