mirror of
https://github.com/weaveworks/scope.git
synced 2026-03-04 02:30:45 +00:00
Add 'closeDetails' field to control responses.
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user