Skip to content

Commit a5bfa93

Browse files
author
Bernard Valentin
committed
Added user column in pipeline executions table only for admins
1 parent 9eb3af2 commit a5bfa93

1 file changed

Lines changed: 17 additions & 3 deletions

File tree

frontend/src/components/PipelineExecutionList.vue

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
<v-data-table
6161
v-model:items-per-page="itemsPerPage"
6262
v-model:sort-by="sortBy"
63-
:headers="headers"
63+
:headers="_headers"
6464
:items="store.executions"
6565
:filter-keys="['pipeline']"
6666
:custom-filter="filterOnPipelineId"
@@ -77,6 +77,7 @@
7777
<td>
7878
{{ item.pipeline && store.pipelineById(item.pipeline).version }}
7979
</td>
80+
<td v-if="this.authStore.isAdmin">{{ item.started_by }}</td>
8081
<td>{{ formatDate(item.start_time) }}</td>
8182
<td>{{ formatDate(item.completion_time) }}</td>
8283
<td class="first-letter">{{ item.status || 'Unknown' }}</td>
@@ -89,7 +90,7 @@
8990
:max="progressMax(item)"
9091
:indeterminate="item.status.toLowerCase() == 'starting'"
9192
>
92-
<strong>{{ progress(item) }} / {{ progressMax(item) }}</strong>
93+
Reports:&nbsp;<strong>{{ progress(item) }}</strong>
9394
</v-progress-linear>
9495
</td>
9596
<td class="text-right nowrap">
@@ -116,7 +117,6 @@
116117
v-if="settings.isGrafanaEnabled()"
117118
color="secondary"
118119
variant="text"
119-
:disabled="item.job_reports_count == 0"
120120
v-tooltip:bottom-end="'View execution dashboard (new page)'"
121121
@click="viewPipelineExecutionDashboard(item)"
122122
>
@@ -215,6 +215,13 @@ export default {
215215
key: 'version',
216216
sortable: true,
217217
},
218+
{
219+
// Only shown to admins using computed property, below
220+
title: 'User',
221+
key: 'started_by',
222+
sortable: true,
223+
admins_only: true,
224+
},
218225
{
219226
title: 'Started',
220227
key: 'start_time',
@@ -266,6 +273,13 @@ export default {
266273
const seconds = Math.floor((Date.now() - this.lastPollTime) / 1000);
267274
return `${seconds}s ago`;
268275
},
276+
277+
_headers() {
278+
// Filter out columns restricted to admins if necessary
279+
return this.headers.filter(
280+
(x) => !x.admins_only || this.authStore.isAdmin,
281+
);
282+
},
269283
},
270284
271285
mounted() {

0 commit comments

Comments
 (0)