Welcome to mirror list, hosted at ThFree Co, Russian Federation.

runner_type_badge.vue « components « runner « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: dd4fff3a77a1d0bbd3166a1dddff9fccb90b455a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<script>
import { GlBadge } from '@gitlab/ui';
import { s__ } from '~/locale';
import { INSTANCE_TYPE, GROUP_TYPE, PROJECT_TYPE } from '../constants';

const badge = {
  [INSTANCE_TYPE]: {
    variant: 'success',
    text: s__('Runners|shared'),
  },
  [GROUP_TYPE]: {
    variant: 'success',
    text: s__('Runners|group'),
  },
  [PROJECT_TYPE]: {
    variant: 'info',
    text: s__('Runners|specific'),
  },
};

export default {
  components: {
    GlBadge,
  },
  props: {
    type: {
      type: String,
      required: true,
    },
  },
  computed: {
    variant() {
      return badge[this.type]?.variant;
    },
    text() {
      return badge[this.type]?.text;
    },
  },
};
</script>
<template>
  <gl-badge v-if="text" :variant="variant" v-bind="$attrs">
    {{ text }}
  </gl-badge>
</template>