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

runner_cell.vue « cells « components « jobs_table « admin « ci « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e44f756a5c55ac2174122729b3d69dad5e6df459 (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
46
47
48
<script>
import { GlLink, GlTooltipDirective } from '@gitlab/ui';
import RunnerTypeIcon from '~/ci/runner/components/runner_type_icon.vue';
import { RUNNER_EMPTY_TEXT, RUNNER_NO_DESCRIPTION } from '../../constants';

export default {
  i18n: {
    emptyRunnerText: RUNNER_EMPTY_TEXT,
    noRunnerDescription: RUNNER_NO_DESCRIPTION,
  },
  components: {
    GlLink,
    RunnerTypeIcon,
  },
  directives: {
    GlTooltip: GlTooltipDirective,
  },
  props: {
    job: {
      type: Object,
      required: true,
    },
  },
  computed: {
    adminUrl() {
      return this.job.runner?.adminUrl;
    },
    description() {
      return this.job.runner?.description
        ? this.job.runner.description
        : this.$options.i18n.noRunnerDescription;
    },
    runnerType() {
      return this.job.runner?.runnerType;
    },
  },
};
</script>

<template>
  <div class="gl-text-truncate">
    <span v-if="adminUrl">
      <runner-type-icon :type="runnerType" class="gl-vertical-align-middle" />
      <gl-link :href="adminUrl" data-testid="job-runner-link"> {{ description }} </gl-link>
    </span>
    <span v-else data-testid="empty-runner-text"> {{ $options.i18n.emptyRunnerText }}</span>
  </div>
</template>