add scan duration label

This commit is contained in:
Jeff Carr 2024-02-20 14:44:12 -06:00
parent b15f8fa80e
commit 2b0f489855
3 changed files with 38 additions and 22 deletions

View File

@ -82,7 +82,6 @@ func globalDisplayOptions(vbox *gui.Node) {
log.Info("re-scanning repos done", i, s) log.Info("re-scanning repos done", i, s)
me.duration.SetText(s) me.duration.SetText(s)
}) })
me.duration = scanbox.NewLabel("")
var tagsW *tagWindow var tagsW *tagWindow
group1.NewButton("git tags Window", func() { group1.NewButton("git tags Window", func() {

View File

@ -60,6 +60,9 @@ func makeRepoView() *repoWindow {
showncount := r.View.MirrorShownCount() showncount := r.View.MirrorShownCount()
r.topbox.Append(showncount) r.topbox.Append(showncount)
duration := r.View.MirrorScanDuration()
r.topbox.Append(duration)
r.View.RegisterHideFunction(hideFunction) r.View.RegisterHideFunction(hideFunction)
return r return r
} }

View File

@ -6,6 +6,7 @@ import (
"go.wit.com/gui" "go.wit.com/gui"
"go.wit.com/lib/gadgets" "go.wit.com/lib/gadgets"
"go.wit.com/lib/gui/gowit"
"go.wit.com/lib/gui/repolist" "go.wit.com/lib/gui/repolist"
"go.wit.com/lib/gui/shell" "go.wit.com/lib/gui/shell"
"go.wit.com/log" "go.wit.com/log"
@ -42,7 +43,7 @@ type patchSummary struct {
totalMasterPatches *gui.Node totalMasterPatches *gui.Node
// patch set generation // patch set generation
unknownOL *gadgets.OneLiner unknownOL *gadgets.BasicEntry
unknownSubmitB *gui.Node unknownSubmitB *gui.Node
reason *gadgets.BasicEntry reason *gadgets.BasicEntry
submitB *gui.Node submitB *gui.Node
@ -125,7 +126,6 @@ func submitPatchesBox(box *gui.Node) *patchSummary {
s.totalMasterRepos = s.grid.NewLabel("x go repos") s.totalMasterRepos = s.grid.NewLabel("x go repos")
s.grid.NextRow() s.grid.NextRow()
s.totalPatchesOL = gadgets.NewOneLiner(s.grid, "total commits") s.totalPatchesOL = gadgets.NewOneLiner(s.grid, "total commits")
s.totalUserPatches = s.grid.NewLabel("x patches") s.totalUserPatches = s.grid.NewLabel("x patches")
s.totalDevelPatches = s.grid.NewLabel("") s.totalDevelPatches = s.grid.NewLabel("")
@ -167,27 +167,29 @@ func submitPatchesBox(box *gui.Node) *patchSummary {
s.grid.NextRow() s.grid.NextRow()
// map a path to gitea // map a path to gitea
s.unknownOL = gadgets.NewOneLiner(s.grid, "Unknown Repo:") s.unknownOL = gadgets.NewBasicEntry(s.grid, "Unknown Repo:")
s.unknownSubmitB = s.grid.NewButton("map new repo path", func() { s.unknownSubmitB = s.grid.NewButton("map new repo path", func() {
/* log.Info("Submit repo:", s.unknownOL.String())
log.Info("Submit repo:", s.unknownOL.String()) repo := me.repos.View.FindRepo(s.unknownOL.String())
if repolist.Exists(s.unknownOL.String()) { if repo == nil {
log.Info("found repo:", repo.String(), "with giturl", repo.giturl) log.Info("could not find repo:", s.unknownOL.String(), "in ~/go/src")
localurl := repo.status.GitURL() return
if localurl == "" { }
log.Info("local repo check failed. repo is not uploaded?")
} else { localurl := repo.Status.GitURL()
log.Info("local repo has", localurl) log.Info("found repo:", repo.GoPath(), "with giturl", localurl)
// attempts to register the unknown repo if localurl == "" {
if gowit.Register(repo.String(), localurl) { log.Info("local repo check failed. repo")
s.unknownOL.Hide() } else {
s.unknownSubmitB.Hide() log.Info("local repo has", localurl)
} // check if go.wit.com works, if not, add it
} // attempts to register the unknown repo
} else { if gowit.Register(repo.GoPath(), localurl) {
log.Info("what is this?", s.unknownOL.String()) // todo: check if this works
// s.unknownOL.Hide()
// s.unknownSubmitB.Hide()
} }
*/ }
}) })
s.unknownOL.Disable() s.unknownOL.Disable()
s.unknownSubmitB.Disable() s.unknownSubmitB.Disable()
@ -238,4 +240,16 @@ func (s *patchSummary) Update() {
s.totalUserRepos.SetText(strconv.Itoa(userT) + " repos") s.totalUserRepos.SetText(strconv.Itoa(userT) + " repos")
s.totalDevelRepos.SetText(strconv.Itoa(develT) + " repos") s.totalDevelRepos.SetText(strconv.Itoa(develT) + " repos")
s.totalMasterRepos.SetText(strconv.Itoa(masterT) + " repos") s.totalMasterRepos.SetText(strconv.Itoa(masterT) + " repos")
if dirty == 0 {
s.reason.Enable()
s.submitB.Enable()
s.unknownOL.Enable()
s.unknownSubmitB.Enable()
} else {
s.reason.Disable()
s.submitB.Enable()
s.unknownOL.Enable()
s.unknownSubmitB.Enable()
}
} }