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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
f2893b77
Commit
f2893b77
authored
Nov 15, 2016
by
Regis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update running and total pipeline count
parent
a623add8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
app/assets/javascripts/vue_pipelines_index/store.js.es6
app/assets/javascripts/vue_pipelines_index/store.js.es6
+8
-0
No files found.
app/assets/javascripts/vue_pipelines_index/store.js.es6
View file @
f2893b77
...
...
@@ -29,6 +29,11 @@
gl.PipelineStore = class {
fetchDataLoop(Vue, pageNum, url) {
Vue.activeResources = 0;
const updateNumberOfPipelines = (total, running) => {
document.querySelector('.js-totalbuilds-count').innerHTML = total;
document.querySelector('.js-running-count').innerHTML = running;
};
const resourceChecker = () => {
if (Vue.activeResources === 0) {
Vue.activeResources = 1;
...
...
@@ -44,6 +49,7 @@
Vue.set(this, 'updatedAt', res.updated_at);
Vue.set(this, 'pipelines', res.pipelines);
Vue.set(this, 'count', res.count);
updateNumberOfPipelines(this.count.all, this.count.running_or_pending);
this.pageRequest = false;
Vue.activeResources -= 1;
}, () => new Flash(
...
...
@@ -58,6 +64,7 @@
Vue.set(this, 'updatedAt', res.updated_at);
Vue.set(this, 'pipelines', p.updatePipelines(res));
Vue.set(this, 'count', res.count);
updateNumberOfPipelines(this.count.all, this.count.running_or_pending);
Vue.activeResources -= 1;
}, () => new Flash(
'Something went wrong on our end.'
...
...
@@ -69,6 +76,7 @@
this.intervalId = setInterval(() => {
if (this.updatedAt) {
resourceChecker();
if (Vue.activeResources > 1) return;
goUpdate();
}
}, 3000);
...
...
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