Capability report: PUT /devices/{id}/report, a Capabilities section, offline devices degraded
A device reports its board, screen, camera and ports from its own credential (16 KB, schema 1, replacing the last report), and the flows are validated against it again. The node panel turns a reported port's config schema into a form, a reported screen is a canvas preset and a touch screen's first report turns Touch friendly on. An offline device node is degraded: amber on the canvas, a warning on Home, never a fault. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0138N7k5PT4dcR1iEqXaaQ9k
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
a9d453c9d9
commit
ad76200d3d
@@ -424,18 +424,26 @@ function FlowEditorInner({
|
||||
[nodeTypeInfo],
|
||||
)
|
||||
|
||||
const issuesByNode = useMemo(() => {
|
||||
const map = new Map<string, string[]>()
|
||||
const [issuesByNode, warningsByNode] = useMemo(() => {
|
||||
const faults = new Map<string, string[]>()
|
||||
const warnings = new Map<string, string[]>()
|
||||
for (const issue of issues) {
|
||||
// A node's dot and border are its status channel, and status has no
|
||||
// warning tier — an advisory is not a fault, so it says its piece in the
|
||||
// dock rather than painting the node red.
|
||||
if (!issue.node || issue.advisory) continue
|
||||
// A node's dot and border are its status channel. An advisory is not a
|
||||
// fault, so it says its piece in the dock rather than painting the node
|
||||
// red. A degraded node, a device that is offline, is the one warning
|
||||
// the node itself wears, in amber.
|
||||
if (!issue.node) continue
|
||||
const map = !issue.advisory
|
||||
? faults
|
||||
: issue.code === "node_degraded"
|
||||
? warnings
|
||||
: null
|
||||
if (!map) continue
|
||||
const list = map.get(issue.node) ?? []
|
||||
list.push(issue.message)
|
||||
map.set(issue.node, list)
|
||||
}
|
||||
return map
|
||||
return [faults, warnings]
|
||||
}, [issues])
|
||||
|
||||
const showLogs = useCallback((nodeId: string) => {
|
||||
@@ -449,6 +457,7 @@ function FlowEditorInner({
|
||||
canvasNodes.map((node) => {
|
||||
const definition = definitions.find((entry) => entry.id === node.id)
|
||||
const nodeIssues = issuesByNode.get(`${flowName}.${node.id}`) ?? []
|
||||
const nodeWarnings = warningsByNode.get(`${flowName}.${node.id}`) ?? []
|
||||
return {
|
||||
...node,
|
||||
selected: node.selected || node.id === selectedId,
|
||||
@@ -459,6 +468,7 @@ function FlowEditorInner({
|
||||
typeLabels.get(definition?.type ?? "") ?? definition?.type ?? "",
|
||||
isPlugin: pluginTypes.has(definition?.type ?? ""),
|
||||
issueText: nodeIssues.join("\n"),
|
||||
warningText: nodeWarnings.join("\n"),
|
||||
onShowLogs: showLogs,
|
||||
} satisfies FlowNodeData,
|
||||
}
|
||||
@@ -468,6 +478,7 @@ function FlowEditorInner({
|
||||
definitions,
|
||||
flowName,
|
||||
issuesByNode,
|
||||
warningsByNode,
|
||||
pluginTypes,
|
||||
selectedId,
|
||||
showLogs,
|
||||
|
||||
Reference in New Issue
Block a user