summaryrefslogtreecommitdiff
path: root/app/helpers/ci/jobs_helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/helpers/ci/jobs_helper.rb')
-rw-r--r--app/helpers/ci/jobs_helper.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/app/helpers/ci/jobs_helper.rb b/app/helpers/ci/jobs_helper.rb
index ec17eccf693..a0d169c1358 100644
--- a/app/helpers/ci/jobs_helper.rb
+++ b/app/helpers/ci/jobs_helper.rb
@@ -18,6 +18,21 @@ module Ci
"retry_outdated_job_docs_url" => help_page_path('ci/pipelines/settings', anchor: 'retry-outdated-jobs')
}
end
+
+ def job_counts
+ {
+ "all" => limited_counter_with_delimiter(@all_builds),
+ "pending" => limited_counter_with_delimiter(@all_builds.pending),
+ "running" => limited_counter_with_delimiter(@all_builds.running),
+ "finished" => limited_counter_with_delimiter(@all_builds.finished)
+ }
+ end
+
+ def job_statuses
+ statuses = Ci::HasStatus::AVAILABLE_STATUSES
+
+ statuses.to_h { |status| [status, status.upcase] }
+ end
end
end