2016-10-26 14:43:58 -04:00
|
|
|
/* global Vue, gl */
|
|
|
|
/* eslint-disable no-param-reassign */
|
2016-10-25 18:00:38 -04:00
|
|
|
|
2016-10-26 14:43:58 -04:00
|
|
|
((gl) => {
|
2016-10-25 18:00:38 -04:00
|
|
|
gl.VuePipeLines = Vue.extend({
|
2016-10-30 16:46:31 -04:00
|
|
|
components: {
|
|
|
|
'vue-running-pipeline': gl.VueRunningPipeline,
|
2016-10-31 19:17:29 -04:00
|
|
|
'vue-stages': gl.VueStages,
|
2016-11-01 14:35:03 -04:00
|
|
|
'vue-pipeline-actions': gl.VuePipelineActions,
|
2016-10-30 16:46:31 -04:00
|
|
|
},
|
2016-10-29 15:50:08 -04:00
|
|
|
data() {
|
|
|
|
return {
|
2016-10-30 03:28:57 -04:00
|
|
|
pipelines: [],
|
2016-10-31 15:02:34 -04:00
|
|
|
currentPage: '',
|
|
|
|
intervalId: '',
|
2016-10-31 17:51:24 -04:00
|
|
|
pageNum: 'page=1',
|
2016-10-29 15:50:08 -04:00
|
|
|
};
|
|
|
|
},
|
2016-10-30 16:46:31 -04:00
|
|
|
props: [
|
|
|
|
'scope',
|
|
|
|
'store',
|
|
|
|
],
|
2016-10-30 03:28:57 -04:00
|
|
|
created() {
|
2016-10-31 17:51:24 -04:00
|
|
|
const url = window.location.href;
|
|
|
|
if (url.includes('?')) this.pageNum = url.split('?')[1];
|
|
|
|
// now fetch page appropriate data
|
|
|
|
this.store.fetchDataLoop.call(this, Vue, this.pageNum);
|
2016-10-30 03:28:57 -04:00
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
shortSha(pipeline) {
|
|
|
|
return pipeline.sha.slice(0, 8);
|
|
|
|
},
|
2016-10-31 15:02:34 -04:00
|
|
|
changePage() {
|
|
|
|
// clearInterval(this.intervalId);
|
2016-10-31 17:51:24 -04:00
|
|
|
// this.store.fetchDataLoop.call(this, Vue, this.pageNum);
|
2016-10-31 15:02:34 -04:00
|
|
|
},
|
2016-10-30 03:28:57 -04:00
|
|
|
},
|
2016-10-25 18:00:38 -04:00
|
|
|
template: `
|
2016-10-27 17:53:29 -04:00
|
|
|
<thead>
|
2016-10-27 18:24:33 -04:00
|
|
|
<tr>
|
|
|
|
<th>Status</th>
|
|
|
|
<th>Pipeline</th>
|
|
|
|
<th>Commit</th>
|
|
|
|
<th>Stages</th>
|
|
|
|
<th></th>
|
|
|
|
<th class="hidden-xs"></th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
2016-10-27 18:18:55 -04:00
|
|
|
<tbody v-for='pipeline in pipelines'>
|
2016-10-27 18:24:33 -04:00
|
|
|
<tr class="commit">
|
2016-10-30 16:46:31 -04:00
|
|
|
<td class="commit-link" v-if="pipeline.status === 'running'">
|
|
|
|
<vue-running-pipeline :pipe='pipeline'></vue-running-pipeline>
|
2016-10-27 18:24:33 -04:00
|
|
|
</td>
|
|
|
|
<td>
|
2016-10-30 16:46:31 -04:00
|
|
|
<a href="pipelines/{{pipeline.id}}">
|
|
|
|
<span class="pipeline-id">#{{pipeline.id}}</span>
|
|
|
|
</a>
|
|
|
|
<span>by</span>
|
|
|
|
<span class="api monospace">{{pipeline.user}}</span>
|
2016-10-27 18:24:33 -04:00
|
|
|
</td>
|
|
|
|
<td class="branch-commit">
|
|
|
|
<div class="icon-container">
|
|
|
|
<i class="fa fa-code-fork"></i>
|
2016-10-27 17:53:29 -04:00
|
|
|
</div>
|
2016-11-01 12:38:17 -04:00
|
|
|
<!--
|
|
|
|
I need to know which branch things are comming from
|
|
|
|
-->
|
|
|
|
<a class="monospace branch-name" href="./commits/master">master</a>
|
2016-10-27 18:24:33 -04:00
|
|
|
<div class="icon-container commit-icon">
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 40 40">
|
|
|
|
<path fill="#8F8F8F" fill-rule="evenodd" d="M28.7769836,18 C27.8675252,13.9920226 24.2831748,11 20,11 C15.7168252,11 12.1324748,13.9920226 11.2230164,18 L4.0085302,18 C2.90195036,18 2,18.8954305 2,20 C2,21.1122704 2.8992496,22 4.0085302,22 L11.2230164,22 C12.1324748,26.0079774 15.7168252,29 20,29 C24.2831748,29 27.8675252,26.0079774 28.7769836,22 L35.9914698,22 C37.0980496,22 38,21.1045695 38,20 C38,18.8877296 37.1007504,18 35.9914698,18 L28.7769836,18 L28.7769836,18 Z M20,25 C22.7614237,25 25,22.7614237 25,20 C25,17.2385763 22.7614237,15 20,15 C17.2385763,15 15,17.2385763 15,20 C15,22.7614237 17.2385763,25 20,25 L20,25 Z"></path>
|
|
|
|
</svg>
|
|
|
|
</div>
|
2016-10-31 00:11:57 -04:00
|
|
|
<a
|
|
|
|
class="commit-id monospace"
|
2016-10-31 02:55:10 -04:00
|
|
|
href="./commit/{{pipeline.sha}}">{{shortSha(pipeline)}}
|
2016-10-31 00:11:57 -04:00
|
|
|
</a>
|
2016-10-27 18:24:33 -04:00
|
|
|
<p class="commit-title">
|
2016-10-31 00:11:57 -04:00
|
|
|
<a
|
|
|
|
href="mailto:james@jameslopez.es"
|
|
|
|
>
|
2016-11-01 12:38:17 -04:00
|
|
|
<!--
|
|
|
|
need Author Name
|
|
|
|
need Plural Version of Author Name: Rails has this built in
|
|
|
|
need gravatar HASH for author
|
|
|
|
need authors email
|
|
|
|
-->
|
2016-10-31 00:11:57 -04:00
|
|
|
<img
|
|
|
|
class="avatar has-tooltip s20 hidden-xs"
|
|
|
|
alt="James Lopez's avatar"
|
|
|
|
title="James Lopez"
|
|
|
|
data-container="body"
|
|
|
|
src="http://www.gravatar.com/avatar/80d3b651b4be1f1db39435c2d11f1f23?s=40&d=identicon"
|
|
|
|
>
|
|
|
|
</a>
|
|
|
|
<a
|
|
|
|
class="commit-row-message"
|
2016-10-31 02:55:10 -04:00
|
|
|
href="./commit/{{pipeline.sha}}"
|
2016-10-31 00:11:57 -04:00
|
|
|
>
|
2016-11-01 12:38:17 -04:00
|
|
|
<!--
|
|
|
|
need commit message/title for SHA
|
|
|
|
-->
|
2016-10-31 00:11:57 -04:00
|
|
|
fix broken repo 500 errors in UI and added relevant specs
|
|
|
|
</a>
|
2016-10-27 18:24:33 -04:00
|
|
|
</p>
|
|
|
|
</td>
|
|
|
|
<td class="stage-cell">
|
2016-11-01 12:38:17 -04:00
|
|
|
<!--
|
|
|
|
Need Stages Array:
|
|
|
|
ex: stage status per element as well as build name
|
|
|
|
|
|
|
|
Why I need it:
|
|
|
|
title="Prepare: failed" href="pipelines#prepare"
|
|
|
|
title="Notify Build: success" href="pipelines#notify_build"
|
|
|
|
title="Post Test: failed" href="pipelines#post-test"
|
|
|
|
|
|
|
|
How I would solve it once I have the data:
|
|
|
|
title="Prepare: {{stage.status}}"
|
|
|
|
href="pipelines#{{stage.title}}"
|
|
|
|
|
|
|
|
this way I can pass it as a prop to
|
|
|
|
ex: <vue-stages :stages='stages'>
|
|
|
|
-->
|
2016-10-31 19:17:29 -04:00
|
|
|
<vue-stages></vue-stages>
|
2016-10-27 18:24:33 -04:00
|
|
|
</td>
|
2016-10-31 19:17:29 -04:00
|
|
|
<td></td>
|
2016-10-27 18:24:33 -04:00
|
|
|
<td class="pipeline-actions hidden-xs">
|
2016-11-01 14:35:03 -04:00
|
|
|
<!-- will need to pass builds info and have v-if's for icons -->
|
|
|
|
<vue-pipeline-actions></vue-pipeline-actions>
|
2016-10-27 18:24:33 -04:00
|
|
|
</td>
|
|
|
|
</tr>
|
2016-10-27 17:53:29 -04:00
|
|
|
</tbody>
|
2016-10-25 18:00:38 -04:00
|
|
|
`,
|
2016-10-26 14:43:58 -04:00
|
|
|
});
|
|
|
|
})(window.gl || (window.gl = {}));
|