feat: refs #8847 If unhautorized no exit processs
This commit is contained in:
parent
71975cf941
commit
31a474b3e3
|
@ -1 +1,2 @@
|
|||
node_modules
|
||||
.grafana-find.*.json
|
12
main.js
12
main.js
|
@ -49,7 +49,11 @@ const configPaths = [
|
|||
];
|
||||
for (const configPath of configPaths) {
|
||||
const configFile = `${configPath}/.grafana-find.json`;
|
||||
if (fs.existsSync(configFile)) {
|
||||
const configFileDev = `${configPath}/.grafana-find.dev.json`;
|
||||
if (fs.existsSync(configFileDev)) {
|
||||
config = require(configFileDev);
|
||||
break;
|
||||
} else if (fs.existsSync(configFile)) {
|
||||
config = require(configFile);
|
||||
break;
|
||||
}
|
||||
|
@ -155,6 +159,7 @@ async function main(){
|
|||
console.log(colors.red.bold(`🏢 Organization: ${AllOrganizations[x].name} 🏢\n`.underline));
|
||||
response = await fetch(`${urlDashboards}${AllOrganizations[x].id}`, {
|
||||
method: "GET",
|
||||
redirect: 'manual',
|
||||
headers: {
|
||||
Authorization: credentials
|
||||
},
|
||||
|
@ -173,9 +178,10 @@ async function main(){
|
|||
let allUID = await response.json();
|
||||
|
||||
if (allUID.message === 'Unauthorized') {
|
||||
console.log(colors.red.bold(allUID.message))
|
||||
process.exit();
|
||||
console.log(colors.red.bold(`${allUID.message}\n`));
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
for (let i in allUID) {
|
||||
let url = `${urlUID}${allUID[i].uid}`;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "grafana-find",
|
||||
"version": "1.0.5",
|
||||
"version": "1.0.6",
|
||||
"author": "Verdnatura Levante SL",
|
||||
"description": "Grafana Find Tool",
|
||||
"license": "GPL-3.0",
|
||||
|
|
Loading…
Reference in New Issue