@@ -12,7 +12,6 @@ import (
1212 dmConfig "github.com/DataManager-Go/libdatamanager/config"
1313 librb "github.com/JojiiOfficial/LibRemotebuild"
1414 "github.com/fatih/color"
15- humanTime "github.com/sbani/go-humanizer/time"
1615 clitable "gopkg.in/benweidig/cli-table.v2"
1716)
1817
@@ -42,7 +41,7 @@ func (cData *CommandData) ListJobs(limit int) {
4241 header = append (header , headingColor .Sprint ("Pos" ))
4342 jobWithPos = true
4443 }
45- header = append (header , []interface {}{headingColor .Sprint ("Job Type" ), headingColor .Sprint ("Upload Type" ), headingColor .Sprint ("Status" )}... )
44+ header = append (header , []interface {}{headingColor .Sprint ("Job Type" ), headingColor .Sprint ("Upload Type" ), headingColor .Sprint ("Status" ), headingColor . Sprint ( "Duration" ) }... )
4645
4746 table .AddRow (header ... )
4847
@@ -54,7 +53,11 @@ func (cData *CommandData) ListJobs(limit int) {
5453 }
5554
5655 if jobWithPos {
57- rowitems = append (rowitems , job .Position )
56+ if job .Position > 0 {
57+ rowitems = append (rowitems , job .Position )
58+ } else {
59+ rowitems = append (rowitems , "-" )
60+ }
5861 }
5962
6063 rowitems = append (rowitems , []interface {}{
@@ -63,9 +66,15 @@ func (cData *CommandData) ListJobs(limit int) {
6366 }... )
6467
6568 if job .Status == librb .JobRunning {
66- rowitems = append (rowitems , "Started " + humanTime .Difference (time .Now (), job .RunningSince ))
69+ rowitems = append (rowitems , "Running" )
70+ rowitems = append (rowitems , time .Since (job .RunningSince ))
6771 } else {
6872 rowitems = append (rowitems , job .Status )
73+ if job .Duration .Seconds () > 0 {
74+ rowitems = append (rowitems , job .Duration .String ())
75+ } else {
76+ rowitems = append (rowitems , "-" )
77+ }
6978 }
7079
7180 table .AddRow (rowitems ... )
0 commit comments