feat(bots): update runner data in html page

This commit is contained in:
fuxiaohei authored and Jason Song committed 2022-11-25 17:48:45 +08:00
1 parent 848a1ae309
commit 5b989e2a11
6 files changed
+51 -11

No files matched your search

+12
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...)