fix(assets): publish controllable traffic signal runtime

This commit is contained in:
2026-08-12 10:17:34 +08:00
parent 41a0e81a6f
commit f13d890ffb
16 changed files with 88 additions and 31 deletions

View File

@@ -177,7 +177,16 @@
category: asset.category,
semantic: asset.role === "layer",
}));
return staticAssets.concat(metadata.previewAssets || []);
const runtimeAssets = (metadata.runtime || []).filter((asset) => asset.type !== "traffic-signal-anchors").map((asset) => ({
id: asset.id,
label: asset.id,
type: "model",
url: new URL(asset.uri, new URL(config.metadataName, window.location.href)).href,
enabled: true,
category: asset.type === "traffic-signal-lenses" ? "dynamic" : asset.type === "traffic-signal-countdown" ? "countdown" : asset.type,
phaseGroup: asset.phaseGroup,
}));
return staticAssets.concat(runtimeAssets, metadata.previewAssets || []);
}
const assets = Array.isArray(metadata.assets) && metadata.assets.length
? metadata.assets