Add 'closeDetails' field to control responses.

This commit is contained in:
Tom Wilkie
2016-04-21 16:40:21 +01:00
parent 65dbca997c
commit ed555b6780
2 changed files with 15 additions and 6 deletions

View File

@@ -18,10 +18,14 @@ type Request struct {
// Response is the Probe -> App -> UI message type for the control RPCs.
type Response struct {
Value interface{} `json:"value,omitempty"`
Error string `json:"error,omitempty"`
Pipe string `json:"pipe,omitempty"`
RawTTY bool `json:"raw_tty,omitempty"`
Value interface{} `json:"value,omitempty"`
Error string `json:"error,omitempty"`
// Pipe specific fields
Pipe string `json:"pipe,omitempty"`
RawTTY bool `json:"raw_tty,omitempty"`
CloseDetails bool `json:"closeDetails,omitempty"` // True will cause the UI to close the details panel.
}
// Message is the unions of Request, Response and arbitrary Value.

View File

@@ -51,9 +51,14 @@ func (r *registry) unpauseContainer(containerID string, _ xfer.Request) xfer.Res
func (r *registry) removeContainer(containerID string, _ xfer.Request) xfer.Response {
log.Infof("Removing container %s", containerID)
return xfer.ResponseError(r.client.RemoveContainer(docker_client.RemoveContainerOptions{
if err := r.client.RemoveContainer(docker_client.RemoveContainerOptions{
ID: containerID,
}))
}); err != nil {
return xfer.ResponseError(err)
}
return xfer.Response{
CloseDetails: true,
}
}
func (r *registry) attachContainer(containerID string, req xfer.Request) xfer.Response {