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
eb2de72c
Commit
eb2de72c
authored
Jun 27, 2018
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prettifies pipeline's javascript code
parent
07de43a7
Changes
16
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
824 additions
and
817 deletions
+824
-817
app/assets/javascripts/pipelines/components/blank_state.vue
app/assets/javascripts/pipelines/components/blank_state.vue
+12
-12
app/assets/javascripts/pipelines/components/empty_state.vue
app/assets/javascripts/pipelines/components/empty_state.vue
+16
-16
app/assets/javascripts/pipelines/components/graph/action_component.vue
...vascripts/pipelines/components/graph/action_component.vue
+2
-2
app/assets/javascripts/pipelines/components/graph/job_name_component.vue
...scripts/pipelines/components/graph/job_name_component.vue
+20
-20
app/assets/javascripts/pipelines/components/header_component.vue
...ets/javascripts/pipelines/components/header_component.vue
+62
-62
app/assets/javascripts/pipelines/components/nav_controls.vue
app/assets/javascripts/pipelines/components/nav_controls.vue
+31
-31
app/assets/javascripts/pipelines/components/pipeline_url.vue
app/assets/javascripts/pipelines/components/pipeline_url.vue
+32
-32
app/assets/javascripts/pipelines/components/pipelines.vue
app/assets/javascripts/pipelines/components/pipelines.vue
+253
-253
app/assets/javascripts/pipelines/components/pipelines_actions.vue
...ts/javascripts/pipelines/components/pipelines_actions.vue
+34
-34
app/assets/javascripts/pipelines/components/pipelines_artifacts.vue
.../javascripts/pipelines/components/pipelines_artifacts.vue
+15
-15
app/assets/javascripts/pipelines/components/pipelines_table.vue
...sets/javascripts/pipelines/components/pipelines_table.vue
+69
-61
app/assets/javascripts/pipelines/components/pipelines_table_row.vue
.../javascripts/pipelines/components/pipelines_table_row.vue
+222
-224
app/assets/javascripts/pipelines/components/time_ago.vue
app/assets/javascripts/pipelines/components/time_ago.vue
+46
-48
app/assets/javascripts/pipelines/mixins/pipelines.js
app/assets/javascripts/pipelines/mixins/pipelines.js
+6
-5
app/assets/javascripts/pipelines/pipeline_details_bundle.js
app/assets/javascripts/pipelines/pipeline_details_bundle.js
+2
-1
app/assets/javascripts/pipelines/pipeline_details_mediator.js
...assets/javascripts/pipelines/pipeline_details_mediator.js
+2
-1
No files found.
app/assets/javascripts/pipelines/components/blank_state.vue
View file @
eb2de72c
<
script
>
<
script
>
export
default
{
export
default
{
name
:
'
PipelinesSvgState
'
,
name
:
'
PipelinesSvgState
'
,
props
:
{
props
:
{
svgPath
:
{
svgPath
:
{
type
:
String
,
type
:
String
,
required
:
true
,
required
:
true
,
},
},
message
:
{
message
:
{
type
:
String
,
type
:
String
,
required
:
true
,
required
:
true
,
},
},
},
};
},
};
</
script
>
</
script
>
<
template
>
<
template
>
...
...
app/assets/javascripts/pipelines/components/empty_state.vue
View file @
eb2de72c
<
script
>
<
script
>
export
default
{
export
default
{
name
:
'
PipelinesEmptyState
'
,
name
:
'
PipelinesEmptyState
'
,
props
:
{
props
:
{
helpPagePath
:
{
helpPagePath
:
{
type
:
String
,
type
:
String
,
required
:
true
,
required
:
true
,
},
emptyStateSvgPath
:
{
type
:
String
,
required
:
true
,
},
canSetCi
:
{
type
:
Boolean
,
required
:
true
,
},
},
},
};
emptyStateSvgPath
:
{
type
:
String
,
required
:
true
,
},
canSetCi
:
{
type
:
Boolean
,
required
:
true
,
},
},
};
</
script
>
</
script
>
<
template
>
<
template
>
<div
class=
"row empty-state js-empty-state"
>
<div
class=
"row empty-state js-empty-state"
>
...
...
app/assets/javascripts/pipelines/components/graph/action_component.vue
View file @
eb2de72c
...
@@ -41,7 +41,6 @@ export default {
...
@@ -41,7 +41,6 @@ export default {
type
:
String
,
type
:
String
,
required
:
true
,
required
:
true
,
},
},
},
},
data
()
{
data
()
{
return
{
return
{
...
@@ -67,7 +66,8 @@ export default {
...
@@ -67,7 +66,8 @@ export default {
this
.
isDisabled
=
true
;
this
.
isDisabled
=
true
;
axios
.
post
(
`
${
this
.
link
}
.json`
)
axios
.
post
(
`
${
this
.
link
}
.json`
)
.
then
(()
=>
{
.
then
(()
=>
{
this
.
isDisabled
=
false
;
this
.
isDisabled
=
false
;
this
.
$emit
(
'
pipelineActionRequestComplete
'
);
this
.
$emit
(
'
pipelineActionRequestComplete
'
);
...
...
app/assets/javascripts/pipelines/components/graph/job_name_component.vue
View file @
eb2de72c
<
script
>
<
script
>
import
ciIcon
from
'
../../../vue_shared/components/ci_icon.vue
'
;
import
ciIcon
from
'
../../../vue_shared/components/ci_icon.vue
'
;
/**
/**
* Component that renders both the CI icon status and the job name.
* Component that renders both the CI icon status and the job name.
* Used in
* Used in
* - Badge component
* - Badge component
* - Dropdown badge components
* - Dropdown badge components
*/
*/
export
default
{
export
default
{
components
:
{
components
:
{
ciIcon
,
ciIcon
,
},
props
:
{
name
:
{
type
:
String
,
required
:
true
,
},
},
props
:
{
name
:
{
type
:
String
,
required
:
true
,
},
status
:
{
status
:
{
type
:
Object
,
type
:
Object
,
required
:
true
,
required
:
true
,
},
},
},
};
},
};
</
script
>
</
script
>
<
template
>
<
template
>
<span
class=
"ci-job-name-component"
>
<span
class=
"ci-job-name-component"
>
...
...
app/assets/javascripts/pipelines/components/header_component.vue
View file @
eb2de72c
<
script
>
<
script
>
import
ciHeader
from
'
../../vue_shared/components/header_ci_component.vue
'
;
import
ciHeader
from
'
../../vue_shared/components/header_ci_component.vue
'
;
import
eventHub
from
'
../event_hub
'
;
import
eventHub
from
'
../event_hub
'
;
import
loadingIcon
from
'
../../vue_shared/components/loading_icon.vue
'
;
import
loadingIcon
from
'
../../vue_shared/components/loading_icon.vue
'
;
export
default
{
export
default
{
name
:
'
PipelineHeaderSection
'
,
name
:
'
PipelineHeaderSection
'
,
components
:
{
components
:
{
ciHeader
,
ciHeader
,
loadingIcon
,
loadingIcon
,
},
props
:
{
pipeline
:
{
type
:
Object
,
required
:
true
,
},
},
props
:
{
isLoading
:
{
pipeline
:
{
type
:
Boolean
,
type
:
Object
,
required
:
true
,
required
:
true
,
},
isLoading
:
{
type
:
Boolean
,
required
:
true
,
},
},
data
()
{
return
{
actions
:
this
.
getActions
(),
};
},
},
},
data
()
{
return
{
actions
:
this
.
getActions
(),
};
},
computed
:
{
computed
:
{
status
()
{
status
()
{
return
this
.
pipeline
.
details
&&
this
.
pipeline
.
details
.
status
;
return
this
.
pipeline
.
details
&&
this
.
pipeline
.
details
.
status
;
},
},
shouldRenderContent
()
{
shouldRenderContent
()
{
return
!
this
.
isLoading
&&
Object
.
keys
(
this
.
pipeline
).
length
;
return
!
this
.
isLoading
&&
Object
.
keys
(
this
.
pipeline
).
length
;
},
},
},
},
watch
:
{
watch
:
{
pipeline
()
{
pipeline
()
{
this
.
actions
=
this
.
getActions
();
this
.
actions
=
this
.
getActions
();
},
},
},
},
methods
:
{
methods
:
{
postAction
(
action
)
{
postAction
(
action
)
{
const
index
=
this
.
actions
.
indexOf
(
action
);
const
index
=
this
.
actions
.
indexOf
(
action
);
this
.
$set
(
this
.
actions
[
index
],
'
isLoading
'
,
true
);
this
.
$set
(
this
.
actions
[
index
],
'
isLoading
'
,
true
);
eventHub
.
$emit
(
'
headerPostAction
'
,
action
);
eventHub
.
$emit
(
'
headerPostAction
'
,
action
);
},
},
getActions
()
{
getActions
()
{
const
actions
=
[];
const
actions
=
[];
if
(
this
.
pipeline
.
retry_path
)
{
if
(
this
.
pipeline
.
retry_path
)
{
actions
.
push
({
actions
.
push
({
label
:
'
Retry
'
,
label
:
'
Retry
'
,
path
:
this
.
pipeline
.
retry_path
,
path
:
this
.
pipeline
.
retry_path
,
cssClass
:
'
js-retry-button btn btn-inverted-secondary
'
,
cssClass
:
'
js-retry-button btn btn-inverted-secondary
'
,
type
:
'
button
'
,
type
:
'
button
'
,
isLoading
:
false
,
isLoading
:
false
,
});
});
}
}
if
(
this
.
pipeline
.
cancel_path
)
{
if
(
this
.
pipeline
.
cancel_path
)
{
actions
.
push
({
actions
.
push
({
label
:
'
Cancel running
'
,
label
:
'
Cancel running
'
,
path
:
this
.
pipeline
.
cancel_path
,
path
:
this
.
pipeline
.
cancel_path
,
cssClass
:
'
js-btn-cancel-pipeline btn btn-danger
'
,
cssClass
:
'
js-btn-cancel-pipeline btn btn-danger
'
,
type
:
'
button
'
,
type
:
'
button
'
,
isLoading
:
false
,
isLoading
:
false
,
});
});
}
}
return
actions
;
return
actions
;
},
},
},
};
},
};
</
script
>
</
script
>
<
template
>
<
template
>
<div
class=
"pipeline-header-container"
>
<div
class=
"pipeline-header-container"
>
...
...
app/assets/javascripts/pipelines/components/nav_controls.vue
View file @
eb2de72c
<
script
>
<
script
>
import
LoadingButton
from
'
../../vue_shared/components/loading_button.vue
'
;
import
LoadingButton
from
'
../../vue_shared/components/loading_button.vue
'
;
export
default
{
export
default
{
name
:
'
PipelineNavControls
'
,
name
:
'
PipelineNavControls
'
,
components
:
{
components
:
{
LoadingButton
,
LoadingButton
,
},
props
:
{
newPipelinePath
:
{
type
:
String
,
required
:
false
,
default
:
null
,
},
},
props
:
{
newPipelinePath
:
{
type
:
String
,
required
:
false
,
default
:
null
,
},
resetCachePath
:
{
resetCachePath
:
{
type
:
String
,
type
:
String
,
required
:
false
,
required
:
false
,
default
:
null
,
default
:
null
,
},
},
ciLintPath
:
{
ciLintPath
:
{
type
:
String
,
type
:
String
,
required
:
false
,
required
:
false
,
default
:
null
,
default
:
null
,
},
},
isResetCacheButtonLoading
:
{
isResetCacheButtonLoading
:
{
type
:
Boolean
,
type
:
Boolean
,
required
:
false
,
required
:
false
,
default
:
false
,
default
:
false
,
},
},
},
methods
:
{
},
onClickResetCache
()
{
methods
:
{
this
.
$emit
(
'
resetRunnersCache
'
,
this
.
resetCachePath
);
onClickResetCache
()
{
},
this
.
$emit
(
'
resetRunnersCache
'
,
this
.
resetCachePath
);
},
},
};
},
};
</
script
>
</
script
>
<
template
>
<
template
>
<div
class=
"nav-controls"
>
<div
class=
"nav-controls"
>
...
...
app/assets/javascripts/pipelines/components/pipeline_url.vue
View file @
eb2de72c
<
script
>
<
script
>
import
userAvatarLink
from
'
../../vue_shared/components/user_avatar/user_avatar_link.vue
'
;
import
userAvatarLink
from
'
../../vue_shared/components/user_avatar/user_avatar_link.vue
'
;
import
tooltip
from
'
../../vue_shared/directives/tooltip
'
;
import
tooltip
from
'
../../vue_shared/directives/tooltip
'
;
import
popover
from
'
../../vue_shared/directives/popover
'
;
import
popover
from
'
../../vue_shared/directives/popover
'
;
export
default
{
export
default
{
components
:
{
components
:
{
userAvatarLink
,
userAvatarLink
,
},
directives
:
{
tooltip
,
popover
,
},
props
:
{
pipeline
:
{
type
:
Object
,
required
:
true
,
},
},
directives
:
{
autoDevopsHelpPath
:
{
t
ooltip
,
t
ype
:
String
,
popover
,
required
:
true
,
},
},
props
:
{
},
pipeline
:
{
computed
:
{
type
:
Object
,
user
()
{
required
:
true
,
return
this
.
pipeline
.
user
;
},
autoDevopsHelpPath
:
{
type
:
String
,
required
:
true
,
},
},
},
computed
:
{
popoverOptions
()
{
user
()
{
return
{
return
this
.
pipeline
.
user
;
html
:
true
,
},
trigger
:
'
focus
'
,
popoverOptions
()
{
placement
:
'
top
'
,
return
{
title
:
`<div class="autodevops-title">
html
:
true
,
trigger
:
'
focus
'
,
placement
:
'
top
'
,
title
:
`<div class="autodevops-title">
This pipeline makes use of a predefined CI/CD configuration enabled by <b>Auto DevOps.</b>
This pipeline makes use of a predefined CI/CD configuration enabled by <b>Auto DevOps.</b>
</div>`
,
</div>`
,
content
:
`<a
content
:
`<a
class="autodevops-link"
class="autodevops-link"
href="
${
this
.
autoDevopsHelpPath
}
"
href="
${
this
.
autoDevopsHelpPath
}
"
target="_blank"
target="_blank"
rel="noopener noreferrer nofollow">
rel="noopener noreferrer nofollow">
Learn more about Auto DevOps
Learn more about Auto DevOps
</a>`
,
</a>`
,
};
};
},
},
},
};
},
};
</
script
>
</
script
>
<
template
>
<
template
>
<div
class=
"table-section section-15 d-none d-sm-none d-md-block pipeline-tags"
>
<div
class=
"table-section section-15 d-none d-sm-none d-md-block pipeline-tags"
>
...
...
app/assets/javascripts/pipelines/components/pipelines.vue
View file @
eb2de72c
This diff is collapsed.
Click to expand it.
app/assets/javascripts/pipelines/components/pipelines_actions.vue
View file @
eb2de72c
<
script
>
<
script
>
import
eventHub
from
'
../event_hub
'
;
import
eventHub
from
'
../event_hub
'
;
import
loadingIcon
from
'
../../vue_shared/components/loading_icon.vue
'
;
import
loadingIcon
from
'
../../vue_shared/components/loading_icon.vue
'
;
import
icon
from
'
../../vue_shared/components/icon.vue
'
;
import
icon
from
'
../../vue_shared/components/icon.vue
'
;
import
tooltip
from
'
../../vue_shared/directives/tooltip
'
;
import
tooltip
from
'
../../vue_shared/directives/tooltip
'
;
export
default
{
export
default
{
directives
:
{
directives
:
{
tooltip
,
tooltip
,
},
components
:
{
loadingIcon
,
icon
,
},
props
:
{
actions
:
{
type
:
Array
,
required
:
true
,
},
},
components
:
{
},
loadingIcon
,
data
()
{
icon
,
return
{
},
isLoading
:
false
,
props
:
{
};
actions
:
{
},
type
:
Array
,
methods
:
{
required
:
true
,
onClickAction
(
endpoint
)
{
},
this
.
isLoading
=
true
;
},
data
()
{
return
{
isLoading
:
false
,
};
},
methods
:
{
onClickAction
(
endpoint
)
{
this
.
isLoading
=
true
;
eventHub
.
$emit
(
'
postAction
'
,
endpoint
);
eventHub
.
$emit
(
'
postAction
'
,
endpoint
);
},
},
isActionDisabled
(
action
)
{
isActionDisabled
(
action
)
{
if
(
action
.
playable
===
undefined
)
{
if
(
action
.
playable
===
undefined
)
{
return
false
;
return
false
;
}
}
return
!
action
.
playable
;
return
!
action
.
playable
;
},
},
},
};
},
};
</
script
>
</
script
>
<
template
>
<
template
>
<div
class=
"btn-group"
>
<div
class=
"btn-group"
>
...
...
app/assets/javascripts/pipelines/components/pipelines_artifacts.vue
View file @
eb2de72c
<
script
>
<
script
>
import
tooltip
from
'
../../vue_shared/directives/tooltip
'
;
import
tooltip
from
'
../../vue_shared/directives/tooltip
'
;
import
icon
from
'
../../vue_shared/components/icon.vue
'
;
import
icon
from
'
../../vue_shared/components/icon.vue
'
;
export
default
{
export
default
{
directives
:
{
directives
:
{
tooltip
,
tooltip
,
},
components
:
{
icon
,
},
props
:
{
artifacts
:
{
type
:
Array
,
required
:
true
,
},
},
components
:
{
},
icon
,
};
},
props
:
{
artifacts
:
{
type
:
Array
,
required
:
true
,
},
},
};
</
script
>
</
script
>
<
template
>
<
template
>
<div
<div
...
...
app/assets/javascripts/pipelines/components/pipelines_table.vue
View file @
eb2de72c
<
script
>
<
script
>
import
Modal
from
'
~/vue_shared/components/gl_modal.vue
'
;
import
Modal
from
'
~/vue_shared/components/gl_modal.vue
'
;
import
{
s__
,
sprintf
}
from
'
~/locale
'
;
import
{
s__
,
sprintf
}
from
'
~/locale
'
;
import
PipelinesTableRowComponent
from
'
./pipelines_table_row.vue
'
;
import
PipelinesTableRowComponent
from
'
./pipelines_table_row.vue
'
;
import
eventHub
from
'
../event_hub
'
;
import
eventHub
from
'
../event_hub
'
;
/**
/**
* Pipelines Table Component.
* Pipelines Table Component.
*
*
* Given an array of objects, renders a table.
* Given an array of objects, renders a table.
*/
*/
export
default
{
export
default
{
components
:
{
components
:
{
PipelinesTableRowComponent
,
PipelinesTableRowComponent
,
Modal
,
Modal
,
},
props
:
{
pipelines
:
{
type
:
Array
,
required
:
true
,
},
},
props
:
{
updateGraphDropdown
:
{
pipelines
:
{
type
:
Boolean
,
type
:
Array
,
required
:
false
,
required
:
true
,
default
:
false
,
},
updateGraphDropdown
:
{
type
:
Boolean
,
required
:
false
,
default
:
false
,
},
autoDevopsHelpPath
:
{
type
:
String
,
required
:
true
,
},
viewType
:
{
type
:
String
,
required
:
true
,
},
},
},
data
()
{
autoDevopsHelpPath
:
{
return
{
type
:
String
,
pipelineId
:
''
,
required
:
true
,
endpoint
:
''
,
cancelingPipeline
:
null
,
};
},
},
computed
:
{
viewType
:
{
modalTitle
()
{
type
:
String
,
return
sprintf
(
s__
(
'
Pipeline|Stop pipeline #%{pipelineId}?
'
),
{
required
:
true
,
},
},
data
()
{
return
{
pipelineId
:
''
,
endpoint
:
''
,
cancelingPipeline
:
null
,
};
},
computed
:
{
modalTitle
()
{
return
sprintf
(
s__
(
'
Pipeline|Stop pipeline #%{pipelineId}?
'
),
{
pipelineId
:
`
${
this
.
pipelineId
}
`
,
pipelineId
:
`
${
this
.
pipelineId
}
`
,
},
false
);
},
},
false
,
modalText
()
{
);
return
sprintf
(
s__
(
'
Pipeline|You’re about to stop pipeline %{pipelineId}.
'
),
{
pipelineId
:
`<strong>#
${
this
.
pipelineId
}
</strong>`
,
},
false
);
},
},
},
created
()
{
modalText
()
{
eventHub
.
$on
(
'
openConfirmationModal
'
,
this
.
setModalData
);
return
sprintf
(
s__
(
'
Pipeline|You’re about to stop pipeline %{pipelineId}.
'
),
{
pipelineId
:
`<strong>#
${
this
.
pipelineId
}
</strong>`
,
},
false
,
);
},
},
beforeDestroy
()
{
},
eventHub
.
$off
(
'
openConfirmationModal
'
,
this
.
setModalData
);
created
()
{
eventHub
.
$on
(
'
openConfirmationModal
'
,
this
.
setModalData
);
},
beforeDestroy
()
{
eventHub
.
$off
(
'
openConfirmationModal
'
,
this
.
setModalData
);
},
methods
:
{
setModalData
(
data
)
{
this
.
pipelineId
=
data
.
pipelineId
;
this
.
endpoint
=
data
.
endpoint
;
},
},
methods
:
{
onSubmit
()
{
setModalData
(
data
)
{
eventHub
.
$emit
(
'
postAction
'
,
this
.
endpoint
);
this
.
pipelineId
=
data
.
pipelineId
;
this
.
cancelingPipeline
=
this
.
pipelineId
;
this
.
endpoint
=
data
.
endpoint
;
},
onSubmit
()
{
eventHub
.
$emit
(
'
postAction
'
,
this
.
endpoint
);
this
.
cancelingPipeline
=
this
.
pipelineId
;
},
},
},
};
},
};
</
script
>
</
script
>
<
template
>
<
template
>
<div
class=
"ci-table"
>
<div
class=
"ci-table"
>
...
...
app/assets/javascripts/pipelines/components/pipelines_table_row.vue
View file @
eb2de72c
This diff is collapsed.
Click to expand it.
app/assets/javascripts/pipelines/components/time_ago.vue
View file @
eb2de72c
<
script
>
<
script
>
import
iconTimerSvg
from
'
icons/_icon_timer.svg
'
;
import
iconTimerSvg
from
'
icons/_icon_timer.svg
'
;
import
'
../../lib/utils/datetime_utility
'
;
import
'
../../lib/utils/datetime_utility
'
;
import
tooltip
from
'
../../vue_shared/directives/tooltip
'
;
import
tooltip
from
'
../../vue_shared/directives/tooltip
'
;
import
timeagoMixin
from
'
../../vue_shared/mixins/timeago
'
;
import
timeagoMixin
from
'
../../vue_shared/mixins/timeago
'
;
export
default
{
export
default
{
directives
:
{
directives
:
{
tooltip
,
tooltip
,
},
mixins
:
[
timeagoMixin
],
props
:
{
finishedTime
:
{
type
:
String
,
required
:
true
,
},
},
mixins
:
[
duration
:
{
timeagoMixin
,
type
:
Number
,
],
required
:
true
,
props
:
{
finishedTime
:
{
type
:
String
,
required
:
true
,
},
duration
:
{
type
:
Number
,
required
:
true
,
},
},
},
data
()
{
},
return
{
data
()
{
iconTimerSvg
,
return
{
};
iconTimerSvg
,
};
},
computed
:
{
hasDuration
()
{
return
this
.
duration
>
0
;
},
},
computed
:
{
hasFinishedTime
()
{
hasDuration
()
{
return
this
.
finishedTime
!==
''
;
return
this
.
duration
>
0
;
},
},
durationFormated
()
{
hasFinishedTime
()
{
const
date
=
new
Date
(
this
.
duration
*
1000
);
return
this
.
finishedTime
!==
''
;
},
durationFormated
()
{
const
date
=
new
Date
(
this
.
duration
*
1000
);
let
hh
=
date
.
getUTCHours
();
let
hh
=
date
.
getUTCHours
();
let
mm
=
date
.
getUTCMinutes
();
let
mm
=
date
.
getUTCMinutes
();
let
ss
=
date
.
getSeconds
();
let
ss
=
date
.
getSeconds
();
// left pad
// left pad
if
(
hh
<
10
)
{
if
(
hh
<
10
)
{
hh
=
`0
${
hh
}
`
;
hh
=
`0
${
hh
}
`
;
}
}
if
(
mm
<
10
)
{
if
(
mm
<
10
)
{
mm
=
`0
${
mm
}
`
;
mm
=
`0
${
mm
}
`
;
}
}
if
(
ss
<
10
)
{
if
(
ss
<
10
)
{
ss
=
`0
${
ss
}
`
;
ss
=
`0
${
ss
}
`
;
}
}
return
`
${
hh
}
:
${
mm
}
:
${
ss
}
`
;
return
`
${
hh
}
:
${
mm
}
:
${
ss
}
`
;
},
},
},
};
},
};
</
script
>
</
script
>
<
template
>
<
template
>
<div
class=
"table-section section-15 pipelines-time-ago"
>
<div
class=
"table-section section-15 pipelines-time-ago"
>
...
...
app/assets/javascripts/pipelines/mixins/pipelines.js
View file @
eb2de72c
...
@@ -75,8 +75,7 @@ export default {
...
@@ -75,8 +75,7 @@ export default {
// Stop polling
// Stop polling
this
.
poll
.
stop
();
this
.
poll
.
stop
();
// Update the table
// Update the table
return
this
.
getPipelines
()
return
this
.
getPipelines
().
then
(()
=>
this
.
poll
.
restart
());
.
then
(()
=>
this
.
poll
.
restart
());
},
},
fetchPipelines
()
{
fetchPipelines
()
{
if
(
!
this
.
isMakingRequest
)
{
if
(
!
this
.
isMakingRequest
)
{
...
@@ -86,9 +85,10 @@ export default {
...
@@ -86,9 +85,10 @@ export default {
}
}
},
},
getPipelines
()
{
getPipelines
()
{
return
this
.
service
.
getPipelines
(
this
.
requestData
)
return
this
.
service
.
getPipelines
(
this
.
requestData
)
.
then
(
response
=>
this
.
successCallback
(
response
))
.
then
(
response
=>
this
.
successCallback
(
response
))
.
catch
(
(
error
)
=>
this
.
errorCallback
(
error
));
.
catch
(
error
=>
this
.
errorCallback
(
error
));
},
},
setCommonData
(
pipelines
)
{
setCommonData
(
pipelines
)
{
this
.
store
.
storePipelines
(
pipelines
);
this
.
store
.
storePipelines
(
pipelines
);
...
@@ -118,7 +118,8 @@ export default {
...
@@ -118,7 +118,8 @@ export default {
}
}
},
},
postAction
(
endpoint
)
{
postAction
(
endpoint
)
{
this
.
service
.
postAction
(
endpoint
)
this
.
service
.
postAction
(
endpoint
)
.
then
(()
=>
this
.
fetchPipelines
())
.
then
(()
=>
this
.
fetchPipelines
())
.
catch
(()
=>
Flash
(
__
(
'
An error occurred while making the request.
'
)));
.
catch
(()
=>
Flash
(
__
(
'
An error occurred while making the request.
'
)));
},
},
...
...
app/assets/javascripts/pipelines/pipeline_details_bundle.js
View file @
eb2de72c
...
@@ -31,7 +31,8 @@ export default () => {
...
@@ -31,7 +31,8 @@ export default () => {
requestRefreshPipelineGraph
()
{
requestRefreshPipelineGraph
()
{
// When an action is clicked
// When an action is clicked
// (wether in the dropdown or in the main nodes, we refresh the big graph)
// (wether in the dropdown or in the main nodes, we refresh the big graph)
this
.
mediator
.
refreshPipeline
()
this
.
mediator
.
refreshPipeline
()
.
catch
(()
=>
Flash
(
__
(
'
An error occurred while making the request.
'
)));
.
catch
(()
=>
Flash
(
__
(
'
An error occurred while making the request.
'
)));
},
},
},
},
...
...
app/assets/javascripts/pipelines/pipeline_details_mediator.js
View file @
eb2de72c
...
@@ -52,7 +52,8 @@ export default class pipelinesMediator {
...
@@ -52,7 +52,8 @@ export default class pipelinesMediator {
refreshPipeline
()
{
refreshPipeline
()
{
this
.
poll
.
stop
();
this
.
poll
.
stop
();
return
this
.
service
.
getPipeline
()
return
this
.
service
.
getPipeline
()
.
then
(
response
=>
this
.
successCallback
(
response
))
.
then
(
response
=>
this
.
successCallback
(
response
))
.
catch
(()
=>
this
.
errorCallback
())
.
catch
(()
=>
this
.
errorCallback
())
.
finally
(()
=>
this
.
poll
.
restart
());
.
finally
(()
=>
this
.
poll
.
restart
());
...
...
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