topology: operator-driven move-agent via set_parent (#486)
This commit is contained in:
parent
501a86b725
commit
5456377622
5 changed files with 245 additions and 0 deletions
|
|
@ -185,6 +185,17 @@ async fn dispatch(req: &HostRequest, coord: Arc<Coordinator>) -> HostResponse {
|
|||
actions::deny(&coord, *id, None).await?;
|
||||
HostResponse::success()
|
||||
}
|
||||
HostRequest::SetParent { child, new_parent } => {
|
||||
tracing::info!(%child, ?new_parent, "set_parent");
|
||||
crate::topology::set_parent(child, new_parent.as_deref())
|
||||
.map_err(anyhow::Error::msg)?;
|
||||
// ContainerView.parent is read from topology.json — a
|
||||
// change here means every container row potentially
|
||||
// moves in the dashboard tree. Rescan + diff-emit so
|
||||
// open viewers repaint without polling.
|
||||
coord.rescan_containers_and_emit().await;
|
||||
HostResponse::success()
|
||||
}
|
||||
})
|
||||
}
|
||||
.await;
|
||||
|
|
|
|||
Loading…
Reference in a new issue