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
Léo-Paul Géneau
gitlab-ce
Commits
908c6772
Commit
908c6772
authored
Mar 13, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed breakpoint
disable stop button when loading
parent
3dcfb6cb
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
46 deletions
+62
-46
app/assets/javascripts/vue_merge_request_widget/components/deployment.vue
...cripts/vue_merge_request_widget/components/deployment.vue
+59
-44
app/assets/stylesheets/pages/merge_requests.scss
app/assets/stylesheets/pages/merge_requests.scss
+3
-2
No files found.
app/assets/javascripts/vue_merge_request_widget/components/deployment.vue
View file @
908c6772
<
script
>
<
script
>
import
timeagoMixin
from
'
../../vue_shared/mixins/timeago
'
;
import
timeagoMixin
from
'
../../vue_shared/mixins/timeago
'
;
import
tooltip
from
'
../../vue_shared/directives/tooltip
'
;
import
tooltip
from
'
../../vue_shared/directives/tooltip
'
;
import
LoadingButton
from
'
../../vue_shared/components/loading_button.vue
'
;
import
{
visitUrl
}
from
'
../../lib/utils/url_utility
'
;
import
{
visitUrl
}
from
'
../../lib/utils/url_utility
'
;
import
createFlash
from
'
../../flash
'
;
import
createFlash
from
'
../../flash
'
;
import
MemoryUsage
from
'
./memory_usage.vue
'
;
import
MemoryUsage
from
'
./memory_usage.vue
'
;
...
@@ -10,6 +11,7 @@ import MRWidgetService from '../services/mr_widget_service';
...
@@ -10,6 +11,7 @@ import MRWidgetService from '../services/mr_widget_service';
export
default
{
export
default
{
name
:
'
Deployment
'
,
name
:
'
Deployment
'
,
components
:
{
components
:
{
LoadingButton
,
MemoryUsage
,
MemoryUsage
,
StatusIcon
,
StatusIcon
,
},
},
...
@@ -25,6 +27,11 @@ export default {
...
@@ -25,6 +27,11 @@ export default {
required
:
true
,
required
:
true
,
},
},
},
},
data
()
{
return
{
isStopping
:
false
,
};
},
computed
:
{
computed
:
{
deployTimeago
()
{
deployTimeago
()
{
return
this
.
timeFormated
(
this
.
deployment
.
deployed_at
);
return
this
.
timeFormated
(
this
.
deployment
.
deployed_at
);
...
@@ -43,19 +50,26 @@ export default {
...
@@ -43,19 +50,26 @@ export default {
},
},
},
},
methods
:
{
methods
:
{
stopEnvironment
(
deployment
)
{
stopEnvironment
()
{
const
msg
=
'
Are you sure you want to stop this environment?
'
;
const
msg
=
'
Are you sure you want to stop this environment?
'
;
const
isConfirmed
=
confirm
(
msg
);
// eslint-disable-line
const
isConfirmed
=
confirm
(
msg
);
// eslint-disable-line
if
(
isConfirmed
)
{
if
(
isConfirmed
)
{
MRWidgetService
.
stopEnvironment
(
deployment
.
stop_url
)
this
.
isStopping
=
true
;
MRWidgetService
.
stopEnvironment
(
this
.
deployment
.
stop_url
)
.
then
(
res
=>
res
.
data
)
.
then
(
res
=>
res
.
data
)
.
then
((
data
)
=>
{
.
then
((
data
)
=>
{
if
(
data
.
redirect_url
)
{
if
(
data
.
redirect_url
)
{
visitUrl
(
data
.
redirect_url
);
visitUrl
(
data
.
redirect_url
);
}
}
this
.
isStopping
=
false
;
})
})
.
catch
(()
=>
createFlash
(
'
Something went wrong while stopping this environment. Please try again.
'
));
.
catch
(()
=>
{
createFlash
(
'
Something went wrong while stopping this environment. Please try again.
'
);
this
.
isStopping
=
false
;
});
}
}
},
},
},
},
...
@@ -72,33 +86,32 @@ export default {
...
@@ -72,33 +86,32 @@ export default {
</div>
</div>
<div
class=
"media-body"
>
<div
class=
"media-body"
>
<div
class=
"deploy-body"
>
<div
class=
"deploy-body"
>
<span
<template
v-if=
"hasDeploymentMeta"
>
v-if=
"hasDeploymentMeta"
<span>
>
Deployed to
Deployed to
</span>
</span>
<span
class=
"deploy-link"
>
<span
class=
"deploy-link"
>
<a
<a
v-if=
"hasDeploymentMeta"
:href=
"deployment.url"
:href=
"deployment.url"
target=
"_blank"
target=
"_blank"
rel=
"noopener noreferrer nofollow"
rel=
"noopener noreferrer nofollow"
class=
"js-deploy-meta"
>
class=
"js-deploy-meta"
>
{{
deployment
.
name
}}
{{
deployment
.
name
}}
</a>
</a>
</span>
</span>
<
span
<
/
template
>
v-if=
"hasExternalUrls"
<
template
v-if=
"hasExternalUrls"
>
>
<span
>
on
on
</span>
</span>
<span
class=
"deploy-link"
>
<span
class=
"deploy-link"
>
<a
<a
v-if=
"hasExternalUrls"
:href=
"deployment.external_url"
:href=
"deployment.external_url"
target=
"_blank"
target=
"_blank"
rel=
"noopener noreferrer nofollow"
rel=
"noopener noreferrer nofollow"
class=
"js-deploy-url"
>
class=
"js-deploy-url"
>
<i
<i
class=
"fa fa-external-link"
class=
"fa fa-external-link"
aria-hidden=
"true"
aria-hidden=
"true"
...
@@ -107,21 +120,23 @@ export default {
...
@@ -107,21 +120,23 @@ export default {
{{
deployment
.
external_url_formatted
}}
{{
deployment
.
external_url_formatted
}}
</a>
</a>
</span>
</span>
</
template
>
<span
<span
v-if=
"hasDeploymentTime"
v-if=
"hasDeploymentTime"
:data-title=
"deployment.deployed_at_formatted"
:data-title=
"deployment.deployed_at_formatted"
class=
"js-deploy-time"
class=
"js-deploy-time"
data-toggle=
"tooltip"
data-toggle=
"tooltip"
data-placement=
"top"
>
data-placement=
"top"
>
{{ deployTimeago }}
{{ deployTimeago }}
</span>
</span>
<button
<loading-button
type=
"button"
v-if=
"deployment.stop_url"
v-if=
"deployment.stop_url"
@
click=
"stopEnvironment(deployment)"
container-class=
"btn btn-default btn-xs"
class=
"btn btn-default btn-xs"
>
label=
"Stop environment"
Stop environment
:loading=
"isStopping"
</button>
@
click=
"stopEnvironment"
/>
</div>
</div>
<memory-usage
<memory-usage
v-if=
"hasMetrics"
v-if=
"hasMetrics"
...
...
app/assets/stylesheets/pages/merge_requests.scss
View file @
908c6772
...
@@ -740,7 +740,7 @@
...
@@ -740,7 +740,7 @@
display
:
flex
;
display
:
flex
;
flex-wrap
:
wrap
;
flex-wrap
:
wrap
;
@media
(
min-width
:
$screen-
md-min
)
{
@media
(
min-width
:
$screen-
xs
)
{
flex-wrap
:
nowrap
;
flex-wrap
:
nowrap
;
white-space
:
nowrap
;
white-space
:
nowrap
;
}
}
...
@@ -761,7 +761,8 @@
...
@@ -761,7 +761,8 @@
min-width
:
100px
;
min-width
:
100px
;
max-width
:
150px
;
max-width
:
150px
;
@media
(
min-width
:
$screen-md-min
)
{
@media
(
min-width
:
$screen-xs
)
{
min-width
:
0
;
max-width
:
100%
;
max-width
:
100%
;
}
}
}
}
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