Skip to content

Commit

Permalink
feat: add more task info
Browse files Browse the repository at this point in the history
  • Loading branch information
leg100 committed Jun 15, 2024
1 parent bda279d commit 26d25c8
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions internal/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ func startApp(cfg config, stdout io.Writer) (*app, error) {
Workdir: workdir,
MaxTasks: cfg.MaxTasks,
Debug: cfg.Debug,
Program: cfg.Program,
})
if err != nil {
return nil, err
Expand Down
8 changes: 7 additions & 1 deletion internal/tui/task/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ type Maker struct {
Spinner *spinner.Model
Helpers *tui.Helpers
Logger *logging.Logger
Program string

disableAutoscroll bool
showInfo bool
Expand Down Expand Up @@ -61,6 +62,7 @@ func (mm *Maker) makeWithID(res resource.Resource, width, height int, makerID Ma
showInfo: mm.showInfo,
border: border,
width: width,
program: mm.Program,
}
m.setHeight(height)

Expand Down Expand Up @@ -114,6 +116,7 @@ type model struct {

showInfo bool
border bool
program string

viewport tui.Viewport
spinner *spinner.Model
Expand Down Expand Up @@ -242,11 +245,14 @@ func (m model) View() string {
m.task.ID.String(),
"",
tui.Bold.Render("Command"),
m.task.CommandString(),
fmt.Sprintf("%s %s", m.program, m.task.CommandString()),
"",
tui.Bold.Render("Arguments"),
args,
"",
tui.Bold.Render("Path"),
m.task.Path,
"",
tui.Bold.Render("Environment variables"),
envs,
"",
Expand Down
1 change: 1 addition & 0 deletions internal/tui/top/makers.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ func makeMakers(opts Options, spinner *spinner.Model) map[tui.Kind]tui.Maker {
Spinner: spinner,
Helpers: helpers,
Logger: opts.Logger,
Program: opts.Program,
}
taskListMaker := tasktui.NewListMaker(
opts.TaskService,
Expand Down
1 change: 1 addition & 0 deletions internal/tui/top/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ type Options struct {
FirstPage string
MaxTasks int
Debug bool
Program string
}

// New constructs the top-level TUI model.
Expand Down

0 comments on commit 26d25c8

Please sign in to comment.