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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
|
<script>
import { GlIntersperse, GlLink, GlSprintf } from '@gitlab/ui';
import { helpPagePath } from '~/helpers/help_page_helper';
import { s__ } from '~/locale';
import HelpPopover from '~/vue_shared/components/help_popover.vue';
import TimeAgo from '~/vue_shared/components/time_ago_tooltip.vue';
import { timeIntervalInWords } from '~/lib/utils/datetime_utility';
import {
ACCESS_LEVEL_REF_PROTECTED,
GROUP_TYPE,
PROJECT_TYPE,
RUNNER_MANAGERS_HELP_URL,
I18N_STATUS_NEVER_CONTACTED,
} from '../constants';
import RunnerDetail from './runner_detail.vue';
import RunnerGroups from './runner_groups.vue';
import RunnerProjects from './runner_projects.vue';
import RunnerTags from './runner_tags.vue';
import RunnerManagersDetail from './runner_managers_detail.vue';
export default {
components: {
GlIntersperse,
GlLink,
GlSprintf,
HelpPopover,
RunnerDetail,
RunnerMaintenanceNoteDetail: () =>
import('ee_component/ci/runner/components/runner_maintenance_note_detail.vue'),
RunnerGroups,
RunnerProjects,
RunnerUpgradeStatusBadge: () =>
import('ee_component/ci/runner/components/runner_upgrade_status_badge.vue'),
RunnerUpgradeStatusAlert: () =>
import('ee_component/ci/runner/components/runner_upgrade_status_alert.vue'),
RunnerTags,
RunnerManagersDetail,
TimeAgo,
},
props: {
runner: {
type: Object,
required: false,
default: null,
},
},
computed: {
maximumTimeout() {
const { maximumTimeout } = this.runner;
if (typeof maximumTimeout !== 'number') {
return null;
}
return timeIntervalInWords(maximumTimeout);
},
configTextProtected() {
if (this.runner.accessLevel === ACCESS_LEVEL_REF_PROTECTED) {
return s__('Runners|Protected');
}
return null;
},
configTextUntagged() {
if (this.runner.runUntagged) {
return s__('Runners|Runs untagged jobs');
}
return null;
},
tagList() {
return this.runner.tagList || [];
},
isGroupRunner() {
return this.runner?.runnerType === GROUP_TYPE;
},
isProjectRunner() {
return this.runner?.runnerType === PROJECT_TYPE;
},
tokenExpirationHelpPopoverOptions() {
return {
title: s__('Runners|Runner authentication token expiration'),
};
},
tokenExpirationHelpUrl() {
return helpPagePath('ci/runners/configure_runners', {
anchor: 'authentication-token-security',
});
},
},
ACCESS_LEVEL_REF_PROTECTED,
RUNNER_MANAGERS_HELP_URL,
I18N_STATUS_NEVER_CONTACTED,
};
</script>
<template>
<div>
<runner-upgrade-status-alert class="gl-my-4" :runner="runner" />
<div class="gl-pt-4">
<dl
class="gl-mb-0 gl-display-grid runner-details-grid-template"
data-testid="runner-details-list"
>
<runner-detail :label="s__('Runners|Description')" :value="runner.description" />
<runner-detail
:label="s__('Runners|Last contact')"
:empty-value="$options.I18N_STATUS_NEVER_CONTACTED"
>
<template v-if="runner.contactedAt" #value>
<time-ago :time="runner.contactedAt" />
</template>
</runner-detail>
<runner-detail :label="s__('Runners|Version')">
<template v-if="runner.version" #value>
{{ runner.version }}
<runner-upgrade-status-badge size="sm" :runner="runner" />
</template>
</runner-detail>
<runner-detail :label="s__('Runners|IP Address')" :value="runner.ipAddress" />
<runner-detail :label="s__('Runners|Executor')" :value="runner.executorName" />
<runner-detail :label="s__('Runners|Architecture')" :value="runner.architectureName" />
<runner-detail :label="s__('Runners|Platform')" :value="runner.platformName" />
<runner-detail :label="s__('Runners|Configuration')">
<template v-if="configTextProtected || configTextUntagged" #value>
<gl-intersperse>
<span v-if="configTextProtected">{{ configTextProtected }}</span>
<span v-if="configTextUntagged">{{ configTextUntagged }}</span>
</gl-intersperse>
</template>
</runner-detail>
<runner-detail :label="s__('Runners|Maximum job timeout')" :value="maximumTimeout" />
<runner-detail :empty-value="s__('Runners|Never expires')">
<template #label>
{{ s__('Runners|Token expiry') }}
<help-popover :options="tokenExpirationHelpPopoverOptions">
<p>
{{
s__(
'Runners|Runner authentication tokens will expire based on a set interval. They will automatically rotate once expired.',
)
}}
</p>
<p class="gl-mb-0">
<gl-link
:href="tokenExpirationHelpUrl"
target="_blank"
class="gl-reset-font-size"
>{{ __('Learn more') }}</gl-link
>
</p>
</help-popover>
</template>
<template v-if="runner.tokenExpiresAt" #value>
<time-ago :time="runner.tokenExpiresAt" />
</template>
</runner-detail>
<runner-detail :label="s__('Runners|Tags')">
<template v-if="tagList.length" #value>
<runner-tags class="gl-vertical-align-middle" :tag-list="tagList" size="sm" />
</template>
</runner-detail>
<runner-maintenance-note-detail
class="gl-pt-4 gl-border-t-gray-100 gl-border-t-1 gl-border-t-solid"
:value="runner.maintenanceNoteHtml"
/>
<runner-detail>
<template #label>
{{ s__('Runners|Runners') }}
<help-popover>
<gl-sprintf
:message="
s__(
'Runners|Runners are grouped when they have the same authentication token. This happens when you re-use a runner configuration in more than one runner manager. %{linkStart}How does this work?%{linkEnd}',
)
"
>
<template #link="{ content }"
><gl-link
:href="$options.RUNNER_MANAGERS_HELP_URL"
target="_blank"
class="gl-reset-font-size"
>{{ content }}</gl-link
></template
>
</gl-sprintf>
</help-popover>
</template>
<template #value>
<runner-managers-detail :runner="runner" />
</template>
</runner-detail>
</dl>
</div>
<runner-groups v-if="isGroupRunner" :runner="runner" />
<runner-projects v-if="isProjectRunner" :runner="runner" />
</div>
</template>
|