Skip to content

Commit

Permalink
Add 'closeDetails' field to control responses.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Wilkie committed Apr 21, 2016
1 parent 65dbca9 commit ed555b6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
12 changes: 8 additions & 4 deletions common/xfer/controls.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
9 changes: 7 additions & 2 deletions probe/docker/controls.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit ed555b6

Please sign in to comment.