gui: agent tree dot uses ollie.agentState() like top indicator
This commit is contained in:
parent
457a6a55dc
commit
dbd2606ed2
13
gui/main.qml
13
gui/main.qml
|
|
@ -1125,22 +1125,19 @@ ApplicationWindow {
|
|||
Layout.alignment: Qt.AlignVCenter
|
||||
radius: 4
|
||||
visible: type !== "header"
|
||||
property string agentState: (type === "agent") ? (state || "idle") : ""
|
||||
property bool isPaused: (type === "agent") ? (parentPaused === true) : false
|
||||
color: {
|
||||
if (type === "session") {
|
||||
// Session: RPC connection health
|
||||
var cc = connectionColor || "gray"
|
||||
if (cc === "green") return "#4caf50"
|
||||
if (cc === "yellow") return "#ffca28"
|
||||
if (cc === "red") return "#f44336"
|
||||
return "#9e9e9e"
|
||||
}
|
||||
// Agent: gray if parent session is paused
|
||||
if (isPaused) return "#9e9e9e"
|
||||
// Agent: use state role from model
|
||||
if (agentState === "idle") return "#4caf50"
|
||||
if (agentState.startsWith("calling")) return "#ff9800"
|
||||
// Agent: use same logic as top indicator
|
||||
if (ollie.isSessionPaused(parentId)) return "#9e9e9e"
|
||||
var s = ollie.agentState(parentId, agentId)
|
||||
if (s === "idle") return "#4caf50"
|
||||
if (s.startsWith("calling")) return "#ff9800"
|
||||
return "#2196f3"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Reference in New Issue