@@ -149,6 +149,7 @@ func GetShortcuts() []string {
149149 common .FormatSCHeader ("p" , "Ps" ),
150150 common .FormatSCHeader ("d" , "Describe" ),
151151 common .FormatSCHeader ("s" , "Scale" ),
152+ common .FormatSCHeader ("r" , "Restart" ),
152153 common .FormatSCHeader ("z" , "No Replica" ),
153154 common .FormatSCHeader ("shift-x" , "Attach Secrets" ),
154155 common .FormatSCHeader ("shift-n" , "Attach Networks" ),
@@ -195,6 +196,9 @@ func InputHandler(v *view.ResourceView, event *tcell.EventKey) *tcell.EventKey {
195196 case 'p' :
196197 Ps (app , v )
197198 return nil
199+ case 'r' :
200+ RestartAction (app , v )
201+ return nil
198202 case 'z' :
199203 ScaleZero (app , v )
200204 return nil
@@ -331,6 +335,20 @@ func ScaleAction(app common.AppController, v *view.ResourceView) {
331335 Scale (app , id , currentReplicas )
332336}
333337
338+ func RestartAction (app common.AppController , v * view.ResourceView ) {
339+ ids , err := v .GetSelectedIDs ()
340+ if err != nil {
341+ return
342+ }
343+
344+ dialogs .ShowConfirmation (app , "RESTART" , fmt .Sprintf ("%d services" , len (ids )), func (force bool ) {
345+ restartAction := func (id string ) error {
346+ return app .GetDocker ().RestartService (id )
347+ }
348+ app .PerformAction (restartAction , "restarting" , styles .ColorStatusOrange )
349+ })
350+ }
351+
334352func ScaleZero (app common.AppController , v * view.ResourceView ) {
335353 ids , err := v .GetSelectedIDs ()
336354 if err != nil { return }
0 commit comments