11// import _ from 'lodash';
2- import fetch from 'node-fetch' ;
32import https from 'https' ;
3+ import fetch from 'node-fetch' ;
44
55export async function getLiveMeasure ( context ) {
66 const serverUrl = context . pluginConfig . serverUrl ;
@@ -13,11 +13,11 @@ export async function getLiveMeasure(context) {
1313
1414 // Define the body of the request
1515 const body = {
16-
17- 'componentName' : context . dataSourceConfig . componentName , //'172.16.8.112:7077' ,
18- 'componentType' : context . dataSourceConfig . componentType , //'eG Manager'
19- 'from' : 'squaredup '
20-
16+ componentName : context . dataSourceConfig . componentName , //'172.16.8.112:7077',
17+ componentType : context . dataSourceConfig . componentType ,
18+ test : context . dataSourceConfig . test ,
19+ measure : context . dataSourceConfig . measure , //'eG Manager '
20+ from : 'squaredup'
2121 } ;
2222 context . log . info ( JSON . stringify ( context . dataSourceConfig ) ) ;
2323 const headers = {
@@ -27,7 +27,7 @@ export async function getLiveMeasure(context) {
2727 managerurl : `${ serverUrl } ` ,
2828 accessID : context . pluginConfig . accessID
2929 } ;
30-
30+
3131 try {
3232 // Await the fetch request
3333 const response = await fetch ( url , {
@@ -49,9 +49,8 @@ export async function getLiveMeasure(context) {
4949 }
5050
5151 let data = await response . json ( ) ;
52-
53- return data ;
5452
53+ return data ;
5554 } catch ( error ) {
5655 // Catch and log any errors
5756 context . log . error ( `Error in getLiveMeasure: ${ error . message } ` ) ;
0 commit comments