From 82f12c20905e97952cf673e74ec05267fee0b43b Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Wed, 23 Mar 2022 18:08:47 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- app/helpers/ci/runners_helper.rb | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'app/helpers/ci') 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 -- cgit v1.2.1