BigW Consortium Gitlab

Commit d8c73e3e by Regis

conditional render to have running - branches - tags be HAML

parent ea71e327
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
//= require ./pipelines.vue.js.es6 //= require ./pipelines.vue.js.es6
(() => { (() => {
if (~window.location.href.indexOf('scope')) return null;
const project = document.querySelector('.pipelines'); const project = document.querySelector('.pipelines');
Vue.use(VueResource); Vue.use(VueResource);
......
...@@ -80,7 +80,6 @@ ...@@ -80,7 +80,6 @@
<vue-gl-pagination <vue-gl-pagination
:pagenum='pagenum' :pagenum='pagenum'
:changepage='changepage' :changepage='changepage'
:pages='pipelines.length'
:count='count' :count='count'
> >
</vue-gl-pagination> </vue-gl-pagination>
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
// eventually clearInterval(this.intervalId) // eventually clearInterval(this.intervalId)
this.intervalId = setInterval(() => { this.intervalId = setInterval(() => {
goFetch(); goFetch();
}, 30000); }, 60000);
} }
}; };
})(window.gl || (window.gl = {})); })(window.gl || (window.gl = {}));
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
}, },
computed: { computed: {
last() { last() {
return Math.ceil(+this.count / 5) return Math.ceil(+this.count / 5);
}, },
lastpage() { lastpage() {
return `pipelines?p=${this.last}`; return `pipelines?p=${this.last}`;
...@@ -43,6 +43,11 @@ ...@@ -43,6 +43,11 @@
<li :class='pagenumberstatus(n)' v-else> <li :class='pagenumberstatus(n)' v-else>
<a @click='changepage($event)'>{{(n - 1)}}</a> <a @click='changepage($event)'>{{(n - 1)}}</a>
</li> </li>
<!--
take a slice of current array (up to 5)
if at end make dots dissapear
if in second slice or more make dots appear in the front
-->
<li v-if='n === upcount'> <li v-if='n === upcount'>
<span class="gap">…</span> <span class="gap">…</span>
</li> </li>
......
/* global gl, Flash */
/* eslint-disable no-param-reassign */
((gl) => {
const api = '/api/v3/projects';
const paginate = '?per_page=5&page=';
gl.PipelineStore = class {
fetchDataLoop(Vue, pageNum) {
const goFetch = () =>
this.$http.get(`${api}/${this.scope}/pipelines${paginate}${pageNum}`)
.then((response) => {
Vue.set(this, 'pipelines', JSON.parse(response.body));
}, () => new Flash(
'Something went wrong on our end.'
));
// inital fetch and then start timeout loop
goFetch();
// eventually clearInterval(this.intervalId)
this.intervalId = setInterval(() => {
goFetch();
}, 30000);
}
};
})(window.gl || (window.gl = {}));
...@@ -41,6 +41,19 @@ ...@@ -41,6 +41,19 @@
- if @pipelines.blank? - if @pipelines.blank?
%div %div
.nothing-here-block No pipelines to show .nothing-here-block No pipelines to show
- elsif @scope == 'branches' || @scope == 'tags' || @scope == 'running'
.table-holder
%table.table.ci-table
%thead
%th Status
%th Pipeline
%th Commit
%th Stages
%th
%th.hidden-xs
= render @pipelines, commit_sha: true, stage: true, allow_retry: true, stages: stages
= paginate @pipelines, theme: 'gitlab'
- else - else
.vue-pipelines-index .vue-pipelines-index
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment