2022-01-06 16:15:26 -05:00
|
|
|
<script>
|
2022-01-20 19:12:56 -05:00
|
|
|
import { GlIcon, GlSprintf, GlTooltipDirective } from '@gitlab/ui';
|
2022-01-06 16:15:26 -05:00
|
|
|
import { sprintf } from '~/locale';
|
|
|
|
import TimeAgo from '~/vue_shared/components/time_ago_tooltip.vue';
|
|
|
|
import { getIdFromGraphQLId } from '~/graphql_shared/utils';
|
2022-01-20 19:12:56 -05:00
|
|
|
import { I18N_DETAILS_TITLE, I18N_LOCKED_RUNNER_DESCRIPTION } from '../constants';
|
2022-01-06 16:15:26 -05:00
|
|
|
import RunnerTypeBadge from './runner_type_badge.vue';
|
|
|
|
import RunnerStatusBadge from './runner_status_badge.vue';
|
|
|
|
|
|
|
|
export default {
|
|
|
|
components: {
|
2022-01-20 19:12:56 -05:00
|
|
|
GlIcon,
|
2022-01-06 16:15:26 -05:00
|
|
|
GlSprintf,
|
|
|
|
TimeAgo,
|
|
|
|
RunnerTypeBadge,
|
|
|
|
RunnerStatusBadge,
|
|
|
|
},
|
2022-01-20 19:12:56 -05:00
|
|
|
directives: {
|
|
|
|
GlTooltip: GlTooltipDirective,
|
|
|
|
},
|
2022-01-06 16:15:26 -05:00
|
|
|
props: {
|
|
|
|
runner: {
|
|
|
|
type: Object,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
paused() {
|
|
|
|
return !this.runner.active;
|
|
|
|
},
|
|
|
|
heading() {
|
|
|
|
const id = getIdFromGraphQLId(this.runner.id);
|
|
|
|
return sprintf(I18N_DETAILS_TITLE, { runner_id: id });
|
|
|
|
},
|
|
|
|
},
|
2022-01-20 19:12:56 -05:00
|
|
|
I18N_LOCKED_RUNNER_DESCRIPTION,
|
2022-01-06 16:15:26 -05:00
|
|
|
};
|
|
|
|
</script>
|
|
|
|
<template>
|
2022-01-20 19:12:56 -05:00
|
|
|
<div
|
|
|
|
class="gl-display-flex gl-align-items-center gl-py-5 gl-border-b-1 gl-border-b-solid gl-border-b-gray-100"
|
|
|
|
>
|
|
|
|
<div>
|
|
|
|
<runner-status-badge :runner="runner" />
|
|
|
|
<runner-type-badge v-if="runner" :type="runner.runnerType" />
|
|
|
|
<template v-if="runner.createdAt">
|
|
|
|
<gl-sprintf :message="__('%{runner} created %{timeago}')">
|
|
|
|
<template #runner>
|
|
|
|
<strong>{{ heading }}</strong>
|
|
|
|
<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>
|
|
|
|
</template>
|
|
|
|
<template v-else>
|
|
|
|
<strong>{{ heading }}</strong>
|
|
|
|
</template>
|
|
|
|
</div>
|
2022-01-27 10:14:51 -05:00
|
|
|
<div class="gl-ml-auto gl-flex-shrink-0"><slot name="actions"></slot></div>
|
2022-01-06 16:15:26 -05:00
|
|
|
</div>
|
|
|
|
</template>
|