Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
25714603
Commit
25714603
authored
Oct 31, 2016
by
Regis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
begin pagination logic - add Flash to error - refactor
parent
87d4d235
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
14 deletions
+13
-14
app/assets/javascripts/vue_pipelines_index/index.js.es6
app/assets/javascripts/vue_pipelines_index/index.js.es6
+1
-1
app/assets/javascripts/vue_pipelines_index/pipelines.vue.js.es6
...sets/javascripts/vue_pipelines_index/pipelines.vue.js.es6
+6
-3
app/assets/javascripts/vue_pipelines_index/store.js.es6
app/assets/javascripts/vue_pipelines_index/store.js.es6
+6
-10
No files found.
app/assets/javascripts/vue_pipelines_index/index.js.es6
View file @
25714603
...
...
@@ -13,7 +13,7 @@
Vue.use(VueResource);
new Vue({
return
new Vue({
el: '.vue-pipelines-index',
data: {
scope: project.dataset.projectId,
...
...
app/assets/javascripts/vue_pipelines_index/pipelines.vue.js.es6
View file @
25714603
...
...
@@ -11,6 +11,7 @@
pipelines: [],
currentPage: '',
intervalId: '',
pageNum: 'page=1',
};
},
props: [
...
...
@@ -18,7 +19,10 @@
'store',
],
created() {
this.store.fetchDataLoop.call(this, Vue);
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);
},
methods: {
shortSha(pipeline) {
...
...
@@ -26,8 +30,7 @@
},
changePage() {
// clearInterval(this.intervalId);
// this.store.fetchCommits.call(this, Vue);
// this.store.fetchDataLoop.call(this, Vue);
// this.store.fetchDataLoop.call(this, Vue, this.pageNum);
},
},
template: `
...
...
app/assets/javascripts/vue_pipelines_index/store.js.es6
View file @
25714603
/* global gl */
/* global gl
, Flash
*/
/* eslint-disable no-param-reassign */
((gl) => {
const api = '/api/v3/projects';
gl.PipelineStore = class {
fetchDataLoop(Vue) {
fetchDataLoop(Vue
, pageNum
) {
const goFetch = () =>
this.$http.get(
`${api}/${this.scope}/pipelines?per_page=5&page=1`
)
this.$http.get(`${api}/${this.scope}/pipelines?per_page=30&${pageNum}`)
.then((response) => {
Vue.set(this, 'pipelines', JSON.parse(response.body));
}, () => {
console.error('API Error for Pipelines');
});
}, () => new Flash('Something went wrong on our end.'));
// inital fetch and then start timeout loop
goFetch();
// eventually clearInterval(this.intervalId)
this.intervalId = setInterval(() => {
console.log('DID IT');
goFetch();
},
3
0000);
},
6
0000);
}
};
})(window.gl || (window.gl = {}));
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment