fix: refs #6164 Fix search in rows
This commit is contained in:
parent
4a1df1c1bf
commit
58028afc45
27
main.js
27
main.js
|
@ -204,6 +204,7 @@ async function main(){
|
||||||
if (dashboard) {
|
if (dashboard) {
|
||||||
if (dashboard.panels)
|
if (dashboard.panels)
|
||||||
for (const panel of dashboard.panels) {
|
for (const panel of dashboard.panels) {
|
||||||
|
// Panels
|
||||||
if (panel.targets)
|
if (panel.targets)
|
||||||
for (const target of panel.targets) {
|
for (const target of panel.targets) {
|
||||||
isFound = regexRawSQL.test(target.rawSql);
|
isFound = regexRawSQL.test(target.rawSql);
|
||||||
|
@ -219,6 +220,25 @@ async function main(){
|
||||||
isFoundSomething=true;
|
isFoundSomething=true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Rows
|
||||||
|
if (panel.panels)
|
||||||
|
for (const subpanel of panel.panels) {
|
||||||
|
if (subpanel.targets)
|
||||||
|
for (const target of subpanel.targets) {
|
||||||
|
isFound = regexRawSQL.test(target.rawSql);
|
||||||
|
if (isFound) {
|
||||||
|
if (subpanel.title)
|
||||||
|
if (subpanel.title==' ')
|
||||||
|
titlePanels.push(`(null)`.italic);
|
||||||
|
else
|
||||||
|
titlePanels.push(subpanel.title);
|
||||||
|
else
|
||||||
|
titlePanels.push(`(undefined)`.italic);
|
||||||
|
numberOfPanels++;
|
||||||
|
isFoundSomething=true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dashboard.templating)
|
if (dashboard.templating)
|
||||||
|
@ -283,7 +303,9 @@ async function main(){
|
||||||
let allAlerts = await response.json();
|
let allAlerts = await response.json();
|
||||||
|
|
||||||
isFound = isFoundSomething = false;
|
isFound = isFoundSomething = false;
|
||||||
|
if (allAlerts.title === 'Access denied')
|
||||||
|
console.log(`${allAlerts.title}\n`.red);
|
||||||
|
else {
|
||||||
for (const alert of allAlerts)
|
for (const alert of allAlerts)
|
||||||
for (const data of alert.data)
|
for (const data of alert.data)
|
||||||
if (data?.model?.rawSql) {
|
if (data?.model?.rawSql) {
|
||||||
|
@ -306,9 +328,10 @@ async function main(){
|
||||||
|
|
||||||
if (!isFoundSomething)
|
if (!isFoundSomething)
|
||||||
console.log(`No results found\n`.gray);
|
console.log(`No results found\n`.gray);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
console.log(colors.green.bold(`──────── Have been found ${numberOfObjects} similarities in ${totalObjects} objects ────────\n`));
|
console.log(colors.green.bold(`─────── Have been found ${numberOfObjects} similarities in ${totalObjects} objects ───────\n`));
|
||||||
|
|
||||||
if (!response) {
|
if (!response) {
|
||||||
console.log(`${error}The server don't exists`);
|
console.log(`${error}The server don't exists`);
|
||||||
|
|
Loading…
Reference in New Issue