add "ci start" button on ci host

This commit is contained in:
Aaron Bieber 2024-06-25 21:42:42 -06:00
parent 6fe81226cb
commit 58068c6d4a
No known key found for this signature in database

14
main.go
View File

@ -121,6 +121,7 @@ type Config struct {
Repo string `json:"repo"` Repo string `json:"repo"`
PrivKeyPath string `json:"priv_key_path"` PrivKeyPath string `json:"priv_key_path"`
FlakeRSS string `json:"flake_rss"` FlakeRSS string `json:"flake_rss"`
CIHost string `json:"ci_host"`
} }
func (c *commit) getInfo(repo string) error { func (c *commit) getInfo(repo string) error {
@ -325,6 +326,19 @@ func (x *xinStatus) updateHostInfo() error {
if len(s.buttonBox.Objects) == 0 { if len(s.buttonBox.Objects) == 0 {
s.buttonBox.Add(restartButton) s.buttonBox.Add(restartButton)
s.buttonBox.Add(updateButton) s.buttonBox.Add(updateButton)
log.Println(s.Host, x.config.CIHost)
if s.Host == x.config.CIHost {
ciStart := widget.NewButton("CI Start", func() {
go func() {
err := s.RunCmd("xin ci start", x)
if err != nil {
log.Println(err)
}
}()
})
s.buttonBox.Add(ciStart)
}
} }
} }