2018-12-09 13:21:20 +00:00
|
|
|
<template>
|
|
|
|
|
<div>
|
2022-02-23 15:13:44 +00:00
|
|
|
<projbreadcrumbs
|
|
|
|
|
:ownertype="ownertype"
|
|
|
|
|
:ownername="ownername"
|
|
|
|
|
:projectref="projectref"
|
|
|
|
|
/>
|
2019-05-06 22:27:44 +00:00
|
|
|
|
2019-05-21 10:13:21 +00:00
|
|
|
<div class="mb-8">
|
2022-02-23 15:13:44 +00:00
|
|
|
<span class="text-3xl">{{ projectName() }}</span>
|
2019-05-06 22:27:44 +00:00
|
|
|
</div>
|
|
|
|
|
|
2019-05-21 10:13:21 +00:00
|
|
|
<div class="flex justify-between">
|
|
|
|
|
<ul class="flex-grow tab">
|
2019-07-05 14:55:24 +00:00
|
|
|
<li class="tab-element-disabled">
|
2019-07-10 15:11:03 +00:00
|
|
|
<i class="mr-1 mdi mdi-run-fast" />
|
2019-05-06 11:43:15 +00:00
|
|
|
<span>Runs</span>
|
|
|
|
|
</li>
|
|
|
|
|
<li>
|
2019-07-10 15:11:03 +00:00
|
|
|
<tabarrow />
|
2019-05-06 11:43:15 +00:00
|
|
|
</li>
|
2018-12-09 13:21:20 +00:00
|
|
|
<li
|
2019-05-21 10:13:21 +00:00
|
|
|
class="tab-element"
|
2022-02-23 15:13:44 +00:00
|
|
|
:class="[
|
|
|
|
|
{
|
|
|
|
|
'tab-element-selected':
|
|
|
|
|
$route.name.match('project runs') ||
|
|
|
|
|
$route.name.endsWith('project'),
|
|
|
|
|
},
|
|
|
|
|
]"
|
2018-12-09 13:21:20 +00:00
|
|
|
>
|
2019-05-06 11:43:15 +00:00
|
|
|
<router-link :to="projectRunsLink(ownertype, ownername, projectref)">
|
2019-07-10 15:11:03 +00:00
|
|
|
<i class="mr-1 mdi mdi-asterisk" />
|
2019-05-06 11:43:15 +00:00
|
|
|
<span>All</span>
|
|
|
|
|
</router-link>
|
2019-03-27 14:41:29 +00:00
|
|
|
</li>
|
2019-05-21 10:13:21 +00:00
|
|
|
<li
|
|
|
|
|
class="tab-element"
|
2022-02-23 15:13:44 +00:00
|
|
|
:class="[
|
|
|
|
|
{
|
|
|
|
|
'tab-element-selected': $route.name.match(
|
|
|
|
|
'project branches runs'
|
|
|
|
|
),
|
|
|
|
|
},
|
|
|
|
|
]"
|
2019-05-21 10:13:21 +00:00
|
|
|
>
|
2022-02-23 15:13:44 +00:00
|
|
|
<router-link
|
|
|
|
|
:to="projectBranchesRunsLink(ownertype, ownername, projectref)"
|
|
|
|
|
>
|
2019-07-10 15:11:03 +00:00
|
|
|
<i class="mr-1 mdi mdi-source-branch" />
|
2019-05-06 11:43:15 +00:00
|
|
|
<span>Branches</span>
|
|
|
|
|
</router-link>
|
2019-03-27 14:41:29 +00:00
|
|
|
</li>
|
2019-05-21 10:13:21 +00:00
|
|
|
<li
|
|
|
|
|
class="tab-element"
|
2022-02-23 15:13:44 +00:00
|
|
|
:class="[
|
|
|
|
|
{ 'tab-element-selected': $route.name.match('project tags runs') },
|
|
|
|
|
]"
|
2019-05-21 10:13:21 +00:00
|
|
|
>
|
2022-02-23 15:13:44 +00:00
|
|
|
<router-link
|
|
|
|
|
:to="projectTagsRunsLink(ownertype, ownername, projectref)"
|
|
|
|
|
>
|
2019-07-10 15:11:03 +00:00
|
|
|
<i class="mr-1 mdi mdi-tag" />
|
2019-05-06 11:43:15 +00:00
|
|
|
<span>Tags</span>
|
|
|
|
|
</router-link>
|
2019-03-27 14:41:29 +00:00
|
|
|
</li>
|
2019-05-21 10:13:21 +00:00
|
|
|
<li
|
|
|
|
|
class="tab-element"
|
2022-02-23 15:13:44 +00:00
|
|
|
:class="[
|
|
|
|
|
{
|
|
|
|
|
'tab-element-selected': $route.name.match(
|
|
|
|
|
'project pull requests runs'
|
|
|
|
|
),
|
|
|
|
|
},
|
|
|
|
|
]"
|
2019-05-21 10:13:21 +00:00
|
|
|
>
|
2022-02-23 15:13:44 +00:00
|
|
|
<router-link
|
|
|
|
|
:to="projectPRsRunsLink(ownertype, ownername, projectref)"
|
|
|
|
|
>
|
2019-07-10 15:11:03 +00:00
|
|
|
<i class="mr-1 mdi mdi-source-pull" />
|
2019-05-06 11:43:15 +00:00
|
|
|
<span>Pull Requests</span>
|
|
|
|
|
</router-link>
|
2018-12-09 13:21:20 +00:00
|
|
|
</li>
|
2019-07-10 15:11:03 +00:00
|
|
|
<li
|
2022-02-23 15:13:44 +00:00
|
|
|
v-if="
|
|
|
|
|
run &&
|
|
|
|
|
($route.name.endsWith('project run') ||
|
|
|
|
|
$route.name.endsWith('project run task'))
|
|
|
|
|
"
|
2019-07-10 15:11:03 +00:00
|
|
|
>
|
|
|
|
|
<tabarrow />
|
2018-12-09 13:21:20 +00:00
|
|
|
</li>
|
|
|
|
|
<li
|
2019-05-21 10:13:21 +00:00
|
|
|
class="tab-element"
|
2022-02-23 15:13:44 +00:00
|
|
|
v-if="
|
|
|
|
|
run &&
|
|
|
|
|
($route.name.endsWith('project run') ||
|
|
|
|
|
$route.name.endsWith('project run task'))
|
|
|
|
|
"
|
|
|
|
|
:class="[
|
|
|
|
|
{ 'tab-element-selected': $route.name.endsWith('project run') },
|
|
|
|
|
]"
|
2018-12-09 13:21:20 +00:00
|
|
|
>
|
2022-02-23 15:13:44 +00:00
|
|
|
<router-link
|
|
|
|
|
:to="
|
|
|
|
|
projectRunLink(
|
|
|
|
|
ownertype,
|
|
|
|
|
ownername,
|
|
|
|
|
projectref,
|
|
|
|
|
$route.params.runid
|
|
|
|
|
)
|
|
|
|
|
"
|
|
|
|
|
>
|
2019-07-10 15:11:03 +00:00
|
|
|
<p>
|
2019-03-27 14:41:29 +00:00
|
|
|
Run
|
2022-02-23 15:13:44 +00:00
|
|
|
<strong>#{{ run.counter }}</strong>
|
2019-03-27 14:41:29 +00:00
|
|
|
</p>
|
|
|
|
|
</router-link>
|
2018-12-09 13:21:20 +00:00
|
|
|
</li>
|
2019-07-10 15:11:03 +00:00
|
|
|
<li v-if="run && $route.name.endsWith('project run task')">
|
|
|
|
|
<tabarrow />
|
2018-12-09 13:21:20 +00:00
|
|
|
</li>
|
2019-07-10 15:11:03 +00:00
|
|
|
<li
|
|
|
|
|
class="tab-element"
|
|
|
|
|
v-if="run && $route.name.endsWith('project run task')"
|
2022-02-23 15:13:44 +00:00
|
|
|
:class="[
|
|
|
|
|
{
|
|
|
|
|
'tab-element-selected': $route.name.endsWith('project run task'),
|
|
|
|
|
},
|
|
|
|
|
]"
|
2019-07-10 15:11:03 +00:00
|
|
|
>
|
2018-12-09 13:21:20 +00:00
|
|
|
<router-link
|
2022-02-23 15:13:44 +00:00
|
|
|
:to="
|
|
|
|
|
projectRunTaskLink(
|
|
|
|
|
ownertype,
|
|
|
|
|
ownername,
|
|
|
|
|
projectref,
|
|
|
|
|
$route.params.runid,
|
|
|
|
|
$route.params.taskid
|
|
|
|
|
)
|
|
|
|
|
"
|
2019-03-27 14:41:29 +00:00
|
|
|
>
|
2019-07-10 15:11:03 +00:00
|
|
|
<p>
|
2019-03-27 14:41:29 +00:00
|
|
|
Task
|
2022-02-23 15:13:44 +00:00
|
|
|
<strong>{{ run.tasks[$route.params.taskid].name }}</strong>
|
2019-03-27 14:41:29 +00:00
|
|
|
</p>
|
|
|
|
|
</router-link>
|
2018-12-09 13:21:20 +00:00
|
|
|
</li>
|
2019-05-21 10:13:21 +00:00
|
|
|
<li
|
2019-05-21 12:55:43 +00:00
|
|
|
v-if="$route.name.endsWith('project settings')"
|
2019-05-21 10:13:21 +00:00
|
|
|
class="tab-element"
|
2022-02-23 15:13:44 +00:00
|
|
|
:class="[
|
|
|
|
|
{
|
|
|
|
|
'tab-element-selected': $route.name.endsWith('project settings'),
|
|
|
|
|
},
|
|
|
|
|
]"
|
2019-05-21 10:13:21 +00:00
|
|
|
>
|
2022-02-23 15:13:44 +00:00
|
|
|
<router-link
|
|
|
|
|
:to="projectSettingsLink(ownertype, ownername, projectref)"
|
|
|
|
|
>
|
2019-07-10 15:11:03 +00:00
|
|
|
<i class="mr-1 mdi mdi-settings" />
|
2019-05-06 11:43:15 +00:00
|
|
|
<span>Project Settings</span>
|
|
|
|
|
</router-link>
|
2019-03-22 07:39:03 +00:00
|
|
|
</li>
|
|
|
|
|
</ul>
|
2019-05-21 12:55:43 +00:00
|
|
|
<ul class="flex tab">
|
|
|
|
|
<li>
|
|
|
|
|
<div class="relative">
|
|
|
|
|
<div
|
|
|
|
|
class="flex -mt-3"
|
2022-02-23 15:13:44 +00:00
|
|
|
v-click-outside="() => (dropdownActive = false)"
|
2019-05-21 12:55:43 +00:00
|
|
|
@click="dropdownActive = !dropdownActive"
|
|
|
|
|
>
|
|
|
|
|
<button
|
|
|
|
|
class="relative flex items-center focus:outline-none bg-transparent hover:bg-gray-300 text-dark font-semibold hover:text-dark py-1 px-4 border border-gray-500 rounded"
|
|
|
|
|
>
|
2019-07-10 15:11:03 +00:00
|
|
|
<i class="mr-4 mdi mdi-settings" />
|
2019-05-21 12:55:43 +00:00
|
|
|
<i class="mdi mdi-chevron-down"></i>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
<div
|
|
|
|
|
v-if="dropdownActive"
|
|
|
|
|
class="z-10 origin-top-right absolute right-0 mt-2 w-64 bg-white rounded-lg border shadow-md py-2"
|
|
|
|
|
>
|
|
|
|
|
<ul>
|
|
|
|
|
<li>
|
|
|
|
|
<router-link
|
|
|
|
|
class="block px-4 py-2 hover:bg-blue-500 hover:text-white"
|
|
|
|
|
:to="projectSettingsLink(ownertype, ownername, projectref)"
|
|
|
|
|
>
|
2019-07-10 15:11:03 +00:00
|
|
|
<i class="mr-1 mdi mdi-settings" />
|
2019-05-21 12:55:43 +00:00
|
|
|
<span>Project Settings</span>
|
|
|
|
|
</router-link>
|
|
|
|
|
</li>
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</li>
|
|
|
|
|
</ul>
|
2018-12-09 13:21:20 +00:00
|
|
|
</div>
|
2019-05-21 10:13:21 +00:00
|
|
|
<router-view class="mt-8"></router-view>
|
2018-12-09 13:21:20 +00:00
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
2022-02-23 15:13:44 +00:00
|
|
|
import * as vClickOutside from 'v-click-outside-x';
|
2019-05-21 12:55:43 +00:00
|
|
|
|
2018-12-09 13:21:20 +00:00
|
|
|
import {
|
|
|
|
|
projectLink,
|
|
|
|
|
projectRunsLink,
|
2019-03-27 14:41:29 +00:00
|
|
|
projectBranchesRunsLink,
|
|
|
|
|
projectTagsRunsLink,
|
|
|
|
|
projectPRsRunsLink,
|
2018-12-09 13:21:20 +00:00
|
|
|
projectRunLink,
|
2019-03-22 07:39:03 +00:00
|
|
|
projectRunTaskLink,
|
2022-02-23 15:13:44 +00:00
|
|
|
projectSettingsLink,
|
|
|
|
|
} from '@/util/link.js';
|
2018-12-09 13:21:20 +00:00
|
|
|
|
2022-02-23 15:13:44 +00:00
|
|
|
import { fetchRun } from '@/util/data.js';
|
2019-03-27 14:41:29 +00:00
|
|
|
|
2022-02-23 15:13:44 +00:00
|
|
|
import projbreadcrumbs from '@/components/projbreadcrumbs.vue';
|
|
|
|
|
import tabarrow from '@/components/tabarrow.vue';
|
2018-12-09 13:21:20 +00:00
|
|
|
|
|
|
|
|
export default {
|
2022-02-23 15:13:44 +00:00
|
|
|
name: 'Project',
|
2019-04-02 16:08:03 +00:00
|
|
|
components: { projbreadcrumbs, tabarrow },
|
2019-05-21 12:55:43 +00:00
|
|
|
directives: {
|
2022-02-23 15:13:44 +00:00
|
|
|
clickOutside: vClickOutside.directive,
|
2019-05-21 12:55:43 +00:00
|
|
|
},
|
2018-12-09 13:21:20 +00:00
|
|
|
props: {
|
|
|
|
|
ownertype: String,
|
|
|
|
|
ownername: String,
|
2022-02-23 15:13:44 +00:00
|
|
|
projectref: Array,
|
2018-12-09 13:21:20 +00:00
|
|
|
},
|
2019-03-27 14:41:29 +00:00
|
|
|
data() {
|
|
|
|
|
return {
|
2019-09-20 07:37:43 +00:00
|
|
|
fetchAbort: null,
|
|
|
|
|
|
2019-05-21 12:55:43 +00:00
|
|
|
dropdownActive: false,
|
2022-02-23 15:13:44 +00:00
|
|
|
run: null,
|
2019-03-27 14:41:29 +00:00
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
watch: {
|
2022-02-23 15:13:44 +00:00
|
|
|
$route: async function (route) {
|
2019-09-20 07:37:43 +00:00
|
|
|
if (this.fetchAbort) {
|
|
|
|
|
this.fetchAbort.abort();
|
|
|
|
|
}
|
|
|
|
|
this.fetchAbort = new AbortController();
|
|
|
|
|
|
2019-07-10 15:11:03 +00:00
|
|
|
this.run = null;
|
2019-03-27 14:41:29 +00:00
|
|
|
if (route.params.runid) {
|
2019-09-20 07:37:43 +00:00
|
|
|
let { data, error, aborted } = await fetchRun(
|
|
|
|
|
route.params.runid,
|
|
|
|
|
this.fetchAbort.signal
|
|
|
|
|
);
|
|
|
|
|
if (aborted) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
2019-05-13 14:29:47 +00:00
|
|
|
if (error) {
|
2022-02-23 15:13:44 +00:00
|
|
|
this.$store.dispatch('setError', error);
|
2019-05-13 14:29:47 +00:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
this.run = data;
|
2019-03-27 14:41:29 +00:00
|
|
|
}
|
2022-02-23 15:13:44 +00:00
|
|
|
},
|
2019-03-27 14:41:29 +00:00
|
|
|
},
|
2018-12-09 13:21:20 +00:00
|
|
|
methods: {
|
|
|
|
|
projectLink: projectLink,
|
|
|
|
|
projectRunsLink: projectRunsLink,
|
2019-03-27 14:41:29 +00:00
|
|
|
projectBranchesRunsLink: projectBranchesRunsLink,
|
|
|
|
|
projectTagsRunsLink: projectTagsRunsLink,
|
|
|
|
|
projectPRsRunsLink: projectPRsRunsLink,
|
2018-12-09 13:21:20 +00:00
|
|
|
projectRunLink: projectRunLink,
|
2019-03-22 07:39:03 +00:00
|
|
|
projectRunTaskLink: projectRunTaskLink,
|
2019-05-06 22:27:44 +00:00
|
|
|
projectSettingsLink: projectSettingsLink,
|
|
|
|
|
projectName() {
|
|
|
|
|
return this.projectref[this.projectref.length - 1];
|
2022-02-23 15:13:44 +00:00
|
|
|
},
|
2019-03-27 14:41:29 +00:00
|
|
|
},
|
2022-02-23 15:13:44 +00:00
|
|
|
created: async function () {
|
2019-09-20 07:37:43 +00:00
|
|
|
this.fetchAbort = new AbortController();
|
|
|
|
|
|
2019-03-27 14:41:29 +00:00
|
|
|
if (this.$route.params.runid) {
|
2019-09-23 08:17:58 +00:00
|
|
|
let { data, error, aborted } = await fetchRun(
|
2019-09-20 07:37:43 +00:00
|
|
|
this.$route.params.runid,
|
|
|
|
|
this.fetchAbort.signal
|
|
|
|
|
);
|
|
|
|
|
if (aborted) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
2019-05-13 14:29:47 +00:00
|
|
|
if (error) {
|
2022-02-23 15:13:44 +00:00
|
|
|
this.$store.dispatch('setError', error);
|
2019-05-13 14:29:47 +00:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
this.run = data;
|
2019-03-27 14:41:29 +00:00
|
|
|
}
|
2019-09-20 07:37:43 +00:00
|
|
|
},
|
|
|
|
|
beforeDestroy() {
|
|
|
|
|
if (this.fetchAbort) {
|
|
|
|
|
this.fetchAbort.abort();
|
|
|
|
|
}
|
2022-02-23 15:13:44 +00:00
|
|
|
},
|
2018-12-09 13:21:20 +00:00
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
|
2022-02-23 15:13:44 +00:00
|
|
|
<style scoped lang="scss"></style>
|