mirror of
https://github.com/bcicen/ctop.git
synced 2025-12-06 15:16:41 +08:00
add displayitems override, padding updates to menu
This commit is contained in:
@@ -14,7 +14,6 @@ func NewContainerMap() *ContainerMap {
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
cm := &ContainerMap{
|
||||
client: client,
|
||||
containers: make(map[string]*Container),
|
||||
@@ -46,6 +45,15 @@ func (cm *ContainerMap) Refresh() {
|
||||
}
|
||||
}
|
||||
|
||||
// Kill a container by ID
|
||||
func (cm *ContainerMap) Kill(id string, sig docker.Signal) error {
|
||||
opts := docker.KillContainerOptions{
|
||||
ID: id,
|
||||
Signal: sig,
|
||||
}
|
||||
return cm.client.KillContainer(opts)
|
||||
}
|
||||
|
||||
// Return number of containers/rows
|
||||
func (cm *ContainerMap) Len() uint {
|
||||
return uint(len(cm.containers))
|
||||
|
||||
Reference in New Issue
Block a user