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

runner_header.vue « components « runner « ci « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 55a33ef2074e0da2b13dfbf4cbb6f9290865daa3 (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
49
50
51
52
53
54
55
56
57
58
59
60
<script>
import { GlIcon, GlSprintf, GlTooltipDirective } from '@gitlab/ui';
import TimeAgo from '~/vue_shared/components/time_ago_tooltip.vue';
import { I18N_LOCKED_RUNNER_DESCRIPTION } from '../constants';
import { formatRunnerName } from '../utils';
import RunnerTypeBadge from './runner_type_badge.vue';
import RunnerStatusBadge from './runner_status_badge.vue';

export default {
  components: {
    GlIcon,
    GlSprintf,
    TimeAgo,
    RunnerTypeBadge,
    RunnerStatusBadge,
  },
  directives: {
    GlTooltip: GlTooltipDirective,
  },
  props: {
    runner: {
      type: Object,
      required: true,
    },
  },
  computed: {
    name() {
      return formatRunnerName(this.runner);
    },
  },
  I18N_LOCKED_RUNNER_DESCRIPTION,
};
</script>
<template>
  <div class="gl-py-5">
    <div class="gl-display-flex gl-justify-content-space-between">
      <h1 class="gl-font-size-h-display gl-my-0">{{ name }}</h1>
      <slot name="actions"></slot>
    </div>
    <div class="gl-display-flex gl-align-items-flex-start gl-gap-3 gl-flex-wrap gl-mt-3">
      <runner-status-badge :contacted-at="runner.contactedAt" :status="runner.status" />
      <runner-type-badge :type="runner.runnerType" />
      <span v-if="runner.createdAt">
        <gl-sprintf :message="__('%{locked} created %{timeago}')">
          <template #locked>
            <gl-icon
              v-if="runner.locked"
              v-gl-tooltip="$options.I18N_LOCKED_RUNNER_DESCRIPTION"
              name="lock"
              :aria-label="$options.I18N_LOCKED_RUNNER_DESCRIPTION"
            />
          </template>
          <template #timeago>
            <time-ago :time="runner.createdAt" />
          </template>
        </gl-sprintf>
      </span>
    </div>
  </div>
</template>