diff --git a/app/assets/javascripts/vue_pipelines_index/index.js.es6 b/app/assets/javascripts/vue_pipelines_index/index.js.es6 index 3666155344464ce2b56c30f7f87aa672e3891ead..fcf91107da5d12145fbc4982e723f497a4b71f34 100644 --- a/app/assets/javascripts/vue_pipelines_index/index.js.es6 +++ b/app/assets/javascripts/vue_pipelines_index/index.js.es6 @@ -4,5 +4,4 @@ //= require ./store.js.es6 //= require ./running_icon.vue.js.es6 //= require ./running.vue.js.es6 -//= require ./status_data_icons.js.es6 //= require ./pipelines.vue.js.es6 diff --git a/app/assets/javascripts/vue_pipelines_index/pipelines.vue.js.es6 b/app/assets/javascripts/vue_pipelines_index/pipelines.vue.js.es6 index ba6ef3011ab355cba010ba9309c9bbce82bcf83e..1ff7b117223cb90bfbf0b33f3aa1f510c8a1f2b6 100644 --- a/app/assets/javascripts/vue_pipelines_index/pipelines.vue.js.es6 +++ b/app/assets/javascripts/vue_pipelines_index/pipelines.vue.js.es6 @@ -9,7 +9,7 @@ data() { return { pipelines: [], - runnerStats: new gl.RunnerStats(), + commits: [], }; }, props: [ @@ -17,6 +17,7 @@ 'store', ], created() { + this.store.fetchCommits.call(this, Vue); this.store.fetchDataLoop.call(this, Vue); }, methods: { @@ -57,10 +58,28 @@ - {{shortSha(pipeline)}} + {{shortSha(pipeline)}} +

- - fix broken repo 500 errors in UI and added relevant specs + + + + + fix broken repo 500 errors in UI and added relevant specs +

diff --git a/app/assets/javascripts/vue_pipelines_index/store.js.es6 b/app/assets/javascripts/vue_pipelines_index/store.js.es6 index f1cd991994df78c1ab7f7ef195d9e0ce075c9a5f..f9e802714dfe465d6f7519b92062b41e0269b4eb 100644 --- a/app/assets/javascripts/vue_pipelines_index/store.js.es6 +++ b/app/assets/javascripts/vue_pipelines_index/store.js.es6 @@ -12,11 +12,28 @@ console.error('API Error for Pipelines'); }); - goFetch(Vue); setInterval(() => { console.log('DID IT'); goFetch(Vue); - }, 3000); + }, 30000); + } + + fetchCommits(vue) { + const goFetch = vueSet => + this.$http.get(`/api/v3/projects/${this.scope}/pipelines`) + .then((response) => { + vueSet.set(this, 'pipelines', JSON.parse(response.body)); + }, () => { + console.error('API Error for Pipelines'); + }); + + this.$http.get(`/api/v3/projects/${this.scope}/repository/commits`) + .then((response) => { + vue.set(this, 'commits', JSON.parse(response.body)); + }, () => { + console.error('API Error for Pipelines'); + }) + .then(() => goFetch(vue)); } }; })(window.gl || (window.gl = {})); diff --git a/app/views/projects/pipelines/index.html.haml b/app/views/projects/pipelines/index.html.haml index 6309de5140921efddab10c93625a59ce8921d145..718e6b73c936ebadfcc6b91d257bc20913cc8406 100644 --- a/app/views/projects/pipelines/index.html.haml +++ b/app/views/projects/pipelines/index.html.haml @@ -53,6 +53,7 @@ el: ".app", data:{ scope: "#{@project.id}", + commits: "#{@commit}", store: new gl.PipelineStore(), }, components: {