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)
me.duration.SetText(s)
})
me.duration = scanbox.NewLabel("")
var tagsW *tagWindow
group1.NewButton("git tags Window", func() {

View File

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

View File

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