feat: add scan terminal dashboard components, monitoring panels, and associated utility hooks

This commit is contained in:
2569718930@qq.com
2026-05-15 12:52:39 +08:00
parent 1a284c9990
commit e7fc3c97cb
13 changed files with 316 additions and 68 deletions
@@ -76,7 +76,7 @@ type AiCityReadOptions = {
signal?: AbortSignal;
};
const AI_CITY_READ_MAX_CONCURRENT_STREAMS = 2;
const AI_CITY_READ_MAX_CONCURRENT_STREAMS = 4;
const pendingAiCityReadRequests = new Map<string, Promise<AiCityForecastPayload>>();
const queuedAiCityReadTasks: Array<() => void> = [];
let activeAiCityReadStreams = 0;
@@ -329,7 +329,7 @@ function runQueuedAiCityReadTask<T>(task: () => Promise<T>, onQueued?: () => voi
.then(resolve, reject)
.finally(() => {
activeAiCityReadStreams = Math.max(0, activeAiCityReadStreams - 1);
const next = queuedAiCityReadTasks.shift();
const next = queuedAiCityReadTasks.pop();
if (next) next();
});
};
@@ -337,7 +337,7 @@ function runQueuedAiCityReadTask<T>(task: () => Promise<T>, onQueued?: () => voi
run();
} else {
onQueued?.();
queuedAiCityReadTasks.push(run);
queuedAiCityReadTasks.unshift(run);
}
});
}