fix: web-probe 报警阈值强制走 YAML (#731)
* fix(hwlab): show runtime blockers in node status * fix: require yaml web-probe alert thresholds --------- Co-authored-by: Codex <codex@noreply.local>
This commit is contained in:
@@ -8731,15 +8731,16 @@ function renderWebObserveAnalyzeTable(value: Record<string, unknown>): string {
|
||||
const pagePerformance = record(analysis?.pagePerformance);
|
||||
const pagePerformanceSummary = record(pagePerformance?.summary);
|
||||
const alertThresholds = record(analysis?.alertThresholds ?? pagePerformanceSummary?.alertThresholds ?? value.alertThresholds);
|
||||
const budgetLabel = (rawValue: unknown, fallbackMs: number): string => {
|
||||
const budgetLabel = (rawValue: unknown): string => {
|
||||
const parsed = Number(rawValue);
|
||||
const ms = Number.isFinite(parsed) && parsed > 0 ? parsed : fallbackMs;
|
||||
if (!Number.isFinite(parsed) || parsed <= 0) return "unconfigured";
|
||||
const ms = parsed;
|
||||
return ms % 1000 === 0 ? `${Math.round(ms / 1000)}s` : `${ms}ms`;
|
||||
};
|
||||
const sameOriginApiBudgetLabel = budgetLabel(alertThresholds?.sameOriginApiSlowMs ?? pagePerformanceSummary?.budgetMs, 10000);
|
||||
const partialApiBudgetLabel = budgetLabel(alertThresholds?.partialApiSlowMs, 10000);
|
||||
const streamOpenBudgetLabel = budgetLabel(alertThresholds?.longLivedStreamOpenSlowMs, 10000);
|
||||
const loadingBudgetLabel = budgetLabel(alertThresholds?.visibleLoadingSlowMs, 10000);
|
||||
const sameOriginApiBudgetLabel = budgetLabel(alertThresholds?.sameOriginApiSlowMs ?? pagePerformanceSummary?.budgetMs);
|
||||
const partialApiBudgetLabel = budgetLabel(alertThresholds?.partialApiSlowMs);
|
||||
const streamOpenBudgetLabel = budgetLabel(alertThresholds?.longLivedStreamOpenSlowMs);
|
||||
const loadingBudgetLabel = budgetLabel(alertThresholds?.visibleLoadingSlowMs);
|
||||
const promptNetwork = record(analysis?.promptNetwork);
|
||||
const loading = record(sampleMetrics?.loading);
|
||||
const loadingSummary = record(loading?.summary);
|
||||
|
||||
Reference in New Issue
Block a user