feat(bots): update runner data in html page

This commit is contained in:
fuxiaohei
2022-10-11 21:28:58 +08:00
committed by Jason Song
parent 848a1ae309
commit 5b989e2a11
6 changed files with 51 additions and 11 deletions

View File

@ -74,6 +74,18 @@ func (r *Runner) OwnType() string {
return r.Repo.FullName()
}
func (r *Runner) StatusType() string {
switch r.Status {
case runnerv1.RunnerStatus_RUNNER_STATUS_OFFLINE:
return "offline"
case runnerv1.RunnerStatus_RUNNER_STATUS_IDLE:
return "online"
case runnerv1.RunnerStatus_RUNNER_STATUS_ACTIVE:
return "online"
}
return "unknown"
}
// AllLabels returns agent and custom labels
func (r *Runner) AllLabels() []string {
return append(r.AgentLabels, r.CustomLabels...)