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
05e57a07
Commit
05e57a07
authored
Nov 09, 2016
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds rollback and stop component
parent
32784d21
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
105 additions
and
12 deletions
+105
-12
app/assets/javascripts/environments/components/environment_external_url.js.es6
...s/environments/components/environment_external_url.js.es6
+1
-1
app/assets/javascripts/environments/components/environment_item.js.es6
...vascripts/environments/components/environment_item.js.es6
+45
-10
app/assets/javascripts/environments/components/environment_rollback.js.es6
...ripts/environments/components/environment_rollback.js.es6
+31
-0
app/assets/javascripts/environments/components/environment_stop.js.es6
...vascripts/environments/components/environment_stop.js.es6
+26
-0
app/assets/stylesheets/pages/environments.scss
app/assets/stylesheets/pages/environments.scss
+2
-1
No files found.
app/assets/javascripts/environments/components/environment_external_url.js.es6
View file @
05e57a07
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
},
},
template: `
template: `
<a class="btn external_url":href="external_url" :target="_blank">
<a class="btn external_url"
:href="external_url" :target="_blank">
<i class="fa fa-external-link"></i>
<i class="fa fa-external-link"></i>
</a>
</a>
`,
`,
...
...
app/assets/javascripts/environments/components/environment_item.js.es6
View file @
05e57a07
/*= require vue_common_component/commit
/*= require vue_common_component/commit
/*= require ./environment_actions
/*= require ./environment_actions
/*= require ./environment_external_url
/*= require ./environment_external_url
/*= require ./environment_stop
/*= require ./environment_rollback
/* globals Vue, timeago */
/* globals Vue, timeago */
(() => {
(() => {
...
@@ -24,6 +27,8 @@
...
@@ -24,6 +27,8 @@
'commit-component': window.gl.CommitComponent,
'commit-component': window.gl.CommitComponent,
'actions-component': window.gl.environmentsList.ActionsComponent,
'actions-component': window.gl.environmentsList.ActionsComponent,
'external-url-component': window.gl.environmentsList.ExternalUrlComponent,
'external-url-component': window.gl.environmentsList.ExternalUrlComponent,
'stop-component': window.gl.environmentsList.StopComponent,
'rollback-component': window.gl.environmentsList.RollbackComponent,
},
},
props: ['model', 'can-create-deployment', 'can-create-deployment', 'can-read-environment'],
props: ['model', 'can-create-deployment', 'can-create-deployment', 'can-read-environment'],
...
@@ -248,11 +253,26 @@
...
@@ -248,11 +253,26 @@
return undefined;
return undefined;
},
},
retryUrl() {
if (this.model.last_deployment &&
this.model.last_deployment.deployable &&
this.model.last_deployment.deployable.retry_url) {
return this.model.last_deployment.deployable.retry_url;
}
return undefined;
},
isLastDeployment() {
return this.model.last_deployment && this.model.last_deployment['last?'];
},
canReadEnvironmentParsed() {
canReadEnvironmentParsed() {
return true;
return this.$options.convertPermissionToBoolean(this.canReadEnvironment);
return this.$options.convertPermissionToBoolean(this.canReadEnvironment);
},
},
canCreateDeploymentParsed() {
canCreateDeploymentParsed() {
return true;
return this.$options.convertPermissionToBoolean(this.canCreateDeployment);
return this.$options.convertPermissionToBoolean(this.canCreateDeployment);
},
},
},
},
...
@@ -295,7 +315,7 @@
...
@@ -295,7 +315,7 @@
template: `
template: `
<tr>
<tr>
<td v-bind:class="
rowClass
">
<td v-bind:class="
{ 'children-row': isChildren}" class="col-sm-2
">
<a v-if="!isFolder" class="environment-name" :href="model.environment_url">
<a v-if="!isFolder" class="environment-name" :href="model.environment_url">
{{model.name}}
{{model.name}}
</a>
</a>
...
@@ -313,7 +333,7 @@
...
@@ -313,7 +333,7 @@
</span>
</span>
</td>
</td>
<td class="deployment-column">
<td class="deployment-column
col-sm-2
">
<span v-if="!isFolder && model.last_deployment && model.last_deployment.iid">
<span v-if="!isFolder && model.last_deployment && model.last_deployment.iid">
#{{model.last_deployment.iid}}
#{{model.last_deployment.iid}}
...
@@ -329,7 +349,7 @@
...
@@ -329,7 +349,7 @@
</span>
</span>
</td>
</td>
<td>
<td
class="col-sm-2"
>
<a v-if="!isFolder && model.last_deployment && model.last_deployment.deployable"
<a v-if="!isFolder && model.last_deployment && model.last_deployment.deployable"
class="build-link"
class="build-link"
:href="model.last_deployment.deployable.build_url">
:href="model.last_deployment.deployable.build_url">
...
@@ -337,7 +357,7 @@
...
@@ -337,7 +357,7 @@
</a>
</a>
</td>
</td>
<td>
<td
class="col-sm-2"
>
<div v-if="!isFolder && model.last_deployment">
<div v-if="!isFolder && model.last_deployment">
<commit-component
<commit-component
:tag="commitTag"
:tag="commitTag"
...
@@ -353,23 +373,38 @@
...
@@ -353,23 +373,38 @@
</p>
</p>
</td>
</td>
<td>
<td
class="col-sm-1"
>
<span v-if="!isFolder && model.last_deployment" class="environment-created-date-timeago">
<span v-if="!isFolder && model.last_deployment" class="environment-created-date-timeago">
{{createdDate}}
{{createdDate}}
</span>
</span>
</td>
</td>
<td class="hidden-xs">
<td class="hidden-xs
col-sm-3
">
<div v-if="!isFolder">
<div v-if="!isFolder">
<div v-if="hasManualActions && canCreateDeploymentParsed">
<div v-if="hasManualActions && canCreateDeploymentParsed" class="inline">
<actions-component :actions="manualActions"></actions-component>
<actions-component
:actions="manualActions">
</actions-component>
</div>
</div>
<div v-if="model.external_url && canReadEnvironmentParsed">
<div v-if="model.external_url && canReadEnvironmentParsed"
class="inline"
>
<external-url-component
<external-url-component
:external_url="model.external_url">
:external_url="model.external_url">
</external_url-component>
</external_url-component>
</div>
</div>
<div v-if="isStoppable && canCreateDeploymentParsed" class="inline">
<stop-component
:stop_url="model.environment_url">
</stop-component>
</div>
<div v-if="canRetry && canCreateDeploymentParsed" class="inline">
<rollback-component
:is_last_deployment="isLastDeployment"
:retry_url="retryUrl">
</rollback-component>
</div>
</div>
</div>
</td>
</td>
</tr>
</tr>
...
...
app/assets/javascripts/environments/components/environment_rollback.js.es6
0 → 100644
View file @
05e57a07
/*= require vue
/* global Vue */
(() => {
window.gl = window.gl || {};
window.gl.environmentsList = window.gl.environmentsList || {};
window.gl.environmentsList.RollbackComponent = Vue.component('rollback-component', {
props: {
retry_url: {
type: String,
default: '',
},
is_last_deployment: {
type: Boolean,
default: true,
},
},
template: `
<a class="btn" :href="retry_url" data-method="post" rel="nofollow">
<span v-if="is_last_deployment">
Re-deploy
</span>
<span v-else>
Rollback
</span>
</a>
`,
});
})();
app/assets/javascripts/environments/components/environment_stop.js.es6
0 → 100644
View file @
05e57a07
/*= require vue
/* global Vue */
(() => {
window.gl = window.gl || {};
window.gl.environmentsList = window.gl.environmentsList || {};
window.gl.environmentsList.StopComponent = Vue.component('stop-component', {
props: {
stop_url: {
type: String,
default: '',
},
},
template: `
<a class="btn stop-env-link"
:href="stop_url"
method="post"
rel="nofollow",
data-confirm="Are you sure you want to stop this environment?">
<i class="fa fa-stop stop-env-icon"></i>
</a>
`,
});
})();
app/assets/stylesheets/pages/environments.scss
View file @
05e57a07
...
@@ -47,7 +47,8 @@
...
@@ -47,7 +47,8 @@
color
:
$gl-dark-link-color
;
color
:
$gl-dark-link-color
;
}
}
.stop-env-link
{
.stop-env-link
,
.external-url
{
color
:
$table-text-gray
;
color
:
$table-text-gray
;
.stop-env-icon
{
.stop-env-icon
{
...
...
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