Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Fine0830 committed Nov 14, 2024
1 parent 75534fb commit 5adec6d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/hooks/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,4 @@ export const LightChartColors = [
"#c4ccd3",
];

export const MaxQueryLength = 300;
export const MaxQueryLength = 120;
16 changes: 8 additions & 8 deletions src/hooks/useExpressionsProcessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -464,19 +464,19 @@ export function useQueryTopologyExpressionsProcessor(metrics: string[], instance

return { queryStr, conditions };
}
function handleExpressionValues(resp: { [key: string]: any }) {
function handleExpressionValues(partMetrics: string[], resp: { [key: string]: any }) {
const obj: any = {};
for (let idx = 0; idx < instances.length; idx++) {
for (let index = 0; index < metrics.length; index++) {
for (let index = 0; index < partMetrics.length; index++) {
const k = "expression" + idx + index;
if (metrics[index]) {
if (!obj[metrics[index]]) {
obj[metrics[index]] = {
if (partMetrics[index]) {
if (!obj[partMetrics[index]]) {
obj[partMetrics[index]] = {
values: [],
};
}
obj[metrics[index]].values.push({
value: resp[k].results[0] && resp[k].results[0].values[0].value,
obj[partMetrics[index]].values.push({
value: resp[k] && resp[k].results[0] && resp[k].results[0].values[0].value,
id: instances[idx].id,
});
}
Expand All @@ -492,7 +492,7 @@ export function useQueryTopologyExpressionsProcessor(metrics: string[], instance
ElMessage.error(res.errors);
return;
}
return handleExpressionValues(res.data);
return handleExpressionValues(partMetrics, res.data);
}

async function getMetrics() {
Expand Down

0 comments on commit 5adec6d

Please sign in to comment.