From f2d1727336ec65816eca19ff309083f4786b22cb Mon Sep 17 00:00:00 2001 From: guillermo Date: Tue, 21 Jun 2022 18:23:33 +0200 Subject: [PATCH] Bug fixes --- main.js | 13 +++++++------ package.json | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/main.js b/main.js index 45feb68..56d34d4 100644 --- a/main.js +++ b/main.js @@ -78,6 +78,7 @@ const urlOrganizations = `${grafanaUrl}/api/orgs`; const urlDashboards = `${grafanaApi}/search?orgId=`; const urlUID = `${grafanaApi}/dashboards/uid/`; let numberOfDashboards = 0; +let totalDashboards = 0; let numberOfPanels = 0; let numberOfVariables = 0; let numberOfObjects = 0; @@ -249,17 +250,17 @@ async function main(){ titlePanels = []; nameVariables= []; - numberOfObjects = numberOfPanels + numberOfVariables + numberOfObjects - numberOfPanels=0; - numberOfVariables=0; + numberOfObjects = numberOfPanels + numberOfVariables + numberOfObjects; + numberOfPanels = 0; + numberOfVariables = 0; } - + totalDashboards = numberOfDashboards + totalDashboards; if (!numberOfDashboards) console.log(`No results found\n`.green); - + numberOfDashboards = 0; }; - console.log(colors.green.bold(`-------- Have been found ${numberOfObjects} results in ${numberOfDashboards} dashboards -------\n`)); + console.log(colors.green.bold(`-------- Have been found ${numberOfObjects} results in ${totalDashboards} dashboards -------\n`)); process.exit(); } diff --git a/package.json b/package.json index 63fbdfb..dde33c0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "grafana-find", - "version": "1.0.0", + "version": "1.0.1", "author": "Verdnatura Levante SL", "description": "Grafana Find Tool", "license": "GPL-3.0",