Process

/app/controller/cmenu/exec.go (640 B)

 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package cmenu

import (
"github.com/samber/lo"

"{{{ .Package }}}/app/lib/exec"
"{{{ .Package }}}/app/lib/menu"
)

func processMenu(processes exec.Execs) *menu.Item {
ret := make(menu.Items, 0, len(processes))
lo.ForEach(processes, func(p *exec.Exec, _ int) {
title := p.String()
if p.Completed != nil {
title += "*"
}
ret = append(ret, &menu.Item{Key: p.String(), Title: title, Icon: "bolt", Description: p.String(), Route: p.WebPath()})
})
desc := "process executions managed by this system"
return &menu.Item{Key: "exec", Title: "Processes", Description: desc, Icon: "terminal", Route: "/admin/exec", Children: ret}
}