fix(workbench): suppress unconfigured demo alerts
The not_configured branch previously promoted mock task failures into critical alerts. Return an explicit empty alert source so the exception badge reflects only actionable backend state.
This commit is contained in:
@@ -142,7 +142,7 @@ export function WorkbenchTopBar({
|
||||
open={openMenu === "alerts"}
|
||||
onOpenChange={createMenuOpenChange("alerts")}
|
||||
alerts={alerts}
|
||||
sourceLabel={alertDataSource === "mock" ? "工况演示回退" : "后端运行态"}
|
||||
sourceLabel={getAlertSourceLabel(alertDataSource)}
|
||||
conditionFeedVisible={conditionFeedVisible}
|
||||
onSelectAlert={onSelectAlert}
|
||||
onToggleConditionFeed={onToggleConditionFeed}
|
||||
@@ -239,7 +239,7 @@ export function WorkbenchTopBar({
|
||||
open={openMenu === "compact-alerts"}
|
||||
onOpenChange={createMenuOpenChange("compact-alerts")}
|
||||
alerts={alerts}
|
||||
sourceLabel={alertDataSource === "mock" ? "工况演示回退" : "后端运行态"}
|
||||
sourceLabel={getAlertSourceLabel(alertDataSource)}
|
||||
conditionFeedVisible={conditionFeedVisible}
|
||||
onSelectAlert={onSelectAlert}
|
||||
onToggleConditionFeed={onToggleConditionFeed}
|
||||
@@ -261,6 +261,12 @@ export function WorkbenchTopBar({
|
||||
);
|
||||
}
|
||||
|
||||
function getAlertSourceLabel(source: WorkbenchAlertDataSource) {
|
||||
if (source === "backend") return "后端运行态";
|
||||
if (source === "mock") return "工况演示回退";
|
||||
return "未配置告警源";
|
||||
}
|
||||
|
||||
function getAnalysisOriginLabel(origin: AnalysisArtifact["origin"]) {
|
||||
if (origin === "backend") return "后端分析运行";
|
||||
if (origin === "demo") return "演示成果";
|
||||
|
||||
Reference in New Issue
Block a user