BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
90fc9237
Unverified
Commit
90fc9237
authored
Mar 24, 2017
by
Filipa Lacerda
Committed by
Kamil Trzcinski
Apr 06, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updates polling function to guarantee we won't make a request while polling
parent
6f9fdebc
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
4 deletions
+13
-4
pipelines.js
app/assets/javascripts/vue_pipelines_index/pipelines.js
+13
-4
No files found.
app/assets/javascripts/vue_pipelines_index/pipelines.js
View file @
90fc9237
...
@@ -49,6 +49,7 @@ export default {
...
@@ -49,6 +49,7 @@ export default {
pagenum
:
1
,
pagenum
:
1
,
isLoading
:
false
,
isLoading
:
false
,
hasError
:
false
,
hasError
:
false
,
isMakingRequest
:
false
,
};
};
},
},
...
@@ -136,6 +137,7 @@ export default {
...
@@ -136,6 +137,7 @@ export default {
data
:
{
page
:
pageNumber
,
scope
},
data
:
{
page
:
pageNumber
,
scope
},
successCallback
:
this
.
successCallback
,
successCallback
:
this
.
successCallback
,
errorCallback
:
this
.
errorCallback
,
errorCallback
:
this
.
errorCallback
,
notificationCallback
:
this
.
setIsMakingRequest
,
});
});
if
(
!
Visibility
.
hidden
())
{
if
(
!
Visibility
.
hidden
())
{
...
@@ -143,8 +145,8 @@ export default {
...
@@ -143,8 +145,8 @@ export default {
poll
.
makeRequest
();
poll
.
makeRequest
();
}
}
Visibility
.
change
((
e
,
state
)
=>
{
Visibility
.
change
(()
=>
{
if
(
state
===
'visible'
)
{
if
(
!
Visibility
.
hidden
()
)
{
poll
.
restart
();
poll
.
restart
();
}
else
{
}
else
{
poll
.
stop
();
poll
.
stop
();
...
@@ -155,7 +157,7 @@ export default {
...
@@ -155,7 +157,7 @@ export default {
},
},
beforeUpdate
()
{
beforeUpdate
()
{
if
(
this
.
state
.
pipelines
.
length
&&
this
.
$children
)
{
if
(
this
.
state
.
pipelines
.
length
&&
this
.
$children
&&
!
this
.
isMakingRequest
)
{
this
.
store
.
startTimeAgoLoops
.
call
(
this
,
Vue
);
this
.
store
.
startTimeAgoLoops
.
call
(
this
,
Vue
);
}
}
},
},
...
@@ -181,10 +183,13 @@ export default {
...
@@ -181,10 +183,13 @@ export default {
const
pageNumber
=
gl
.
utils
.
getParameterByName
(
'page'
)
||
this
.
pagenum
;
const
pageNumber
=
gl
.
utils
.
getParameterByName
(
'page'
)
||
this
.
pagenum
;
const
scope
=
gl
.
utils
.
getParameterByName
(
'scope'
)
||
this
.
apiScope
;
const
scope
=
gl
.
utils
.
getParameterByName
(
'scope'
)
||
this
.
apiScope
;
if
(
!
this
.
isMakingRequest
)
{
this
.
isLoading
=
true
;
this
.
isLoading
=
true
;
return
this
.
service
.
getPipelines
({
scope
,
page
:
pageNumber
})
this
.
service
.
getPipelines
({
scope
,
page
:
pageNumber
})
.
then
(
response
=>
this
.
successCallback
(
response
))
.
then
(
response
=>
this
.
successCallback
(
response
))
.
catch
(()
=>
this
.
errorCallback
());
.
catch
(()
=>
this
.
errorCallback
());
}
},
},
successCallback
(
resp
)
{
successCallback
(
resp
)
{
...
@@ -204,6 +209,10 @@ export default {
...
@@ -204,6 +209,10 @@ export default {
this
.
hasError
=
true
;
this
.
hasError
=
true
;
this
.
isLoading
=
false
;
this
.
isLoading
=
false
;
},
},
setIsMakingRequest
(
isMakingRequest
)
{
this
.
isMakingRequest
=
isMakingRequest
;
},
},
},
template
:
`
template
:
`
...
...
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