diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-13 21:16:51 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-13 21:16:51 +0300 |
commit | aa072fd68cfe366c0d5968c65e9b42aecb2a75b5 (patch) | |
tree | a7b51bab61941464115c84beff0d11ecf2a582ee /app/assets/javascripts/runner | |
parent | bd5ff5cb6553dd8f168b28c97175a63250fe2ab2 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/runner')
-rw-r--r-- | app/assets/javascripts/runner/admin_runners/admin_runners_app.vue | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/app/assets/javascripts/runner/admin_runners/admin_runners_app.vue b/app/assets/javascripts/runner/admin_runners/admin_runners_app.vue index 69b3e543ed5..3366942f6ad 100644 --- a/app/assets/javascripts/runner/admin_runners/admin_runners_app.vue +++ b/app/assets/javascripts/runner/admin_runners/admin_runners_app.vue @@ -3,6 +3,7 @@ import { GlBadge, GlLink } from '@gitlab/ui'; import { createAlert } from '~/flash'; import { fetchPolicies } from '~/lib/graphql'; import { updateHistory } from '~/lib/utils/url_utility'; +import { formatNumber } from '~/locale'; import RegistrationDropdown from '../components/registration/registration_dropdown.vue'; import RunnerFilteredSearchBar from '../components/runner_filtered_search_bar.vue'; @@ -172,18 +173,27 @@ export default { }, methods: { tabCount({ runnerType }) { + let count; switch (runnerType) { case null: - return this.allRunnersCount; + count = this.allRunnersCount; + break; case INSTANCE_TYPE: - return this.instanceRunnersCount; + count = this.instanceRunnersCount; + break; case GROUP_TYPE: - return this.groupRunnersCount; + count = this.groupRunnersCount; + break; case PROJECT_TYPE: - return this.projectRunnersCount; + count = this.projectRunnersCount; + break; default: return null; } + if (typeof count === 'number') { + return formatNumber(count); + } + return ''; }, reportToSentry(error) { captureException({ error, component: this.$options.name }); @@ -208,7 +218,7 @@ export default { > <template #title="{ tab }"> {{ tab.title }} - <gl-badge v-if="typeof tabCount(tab) == 'number'" class="gl-ml-1" size="sm"> + <gl-badge v-if="tabCount(tab)" class="gl-ml-1" size="sm"> {{ tabCount(tab) }} </gl-badge> </template> |