diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-23 18:08:47 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-23 18:08:47 +0000 |
commit | 82f12c20905e97952cf673e74ec05267fee0b43b (patch) | |
tree | a0e49d069165ef4227537b129e43825fb4689c51 /app/helpers/ci | |
parent | 16dbaf57bc4d87aa8a2bca8bf9db7cab26d841c4 (diff) | |
download | gitlab-ce-82f12c20905e97952cf673e74ec05267fee0b43b.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/helpers/ci')
-rw-r--r-- | app/helpers/ci/runners_helper.rb | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/app/helpers/ci/runners_helper.rb b/app/helpers/ci/runners_helper.rb index f84b42209da..28e4056daac 100644 --- a/app/helpers/ci/runners_helper.rb +++ b/app/helpers/ci/runners_helper.rb @@ -6,7 +6,7 @@ module Ci def runner_status_icon(runner, size: 16, icon_class: '') status = runner.status - active = runner.active + contacted_at = runner.contacted_at title = '' icon = 'warning-solid' @@ -14,22 +14,20 @@ module Ci case status when :online - if active - title = s_("Runners|Runner is online, last contact was %{runner_contact} ago") % { runner_contact: time_ago_in_words(runner.contacted_at) } - icon = 'status-active' - span_class = 'gl-text-green-500' - else - title = s_("Runners|Runner is paused, last contact was %{runner_contact} ago") % { runner_contact: time_ago_in_words(runner.contacted_at) } - icon = 'status-paused' - span_class = 'gl-text-gray-600' - end + title = s_("Runners|Runner is online; last contact was %{runner_contact} ago") % { runner_contact: time_ago_in_words(contacted_at) } + icon = 'status-active' + span_class = 'gl-text-green-500' when :not_connected, :never_contacted - title = s_("Runners|New runner, has not contacted yet") + title = s_("Runners|Runner has never contacted this instance") icon = 'warning-solid' when :offline - title = s_("Runners|Runner is offline, last contact was %{runner_contact} ago") % { runner_contact: time_ago_in_words(runner.contacted_at) } + title = s_("Runners|Runner is offline; last contact was %{runner_contact} ago") % { runner_contact: time_ago_in_words(contacted_at) } icon = 'status-failed' span_class = 'gl-text-red-500' + when :stale + # runner may have contacted (or not) and be stale: consider both cases. + title = contacted_at ? s_("Runners|Runner is stale; last contact was %{runner_contact} ago") % { runner_contact: time_ago_in_words(contacted_at) } : s_("Runners|Runner is stale; it has never contacted this instance") + icon = 'warning-solid' end content_tag(:span, class: span_class, title: title, data: { toggle: 'tooltip', container: 'body', testid: 'runner_status_icon', qa_selector: "runner_status_#{status}_content" }) do |