Commit 63eb855d authored by Ioannis Tsafaras's avatar Ioannis Tsafaras
Browse files

Add loading status when deleting apps

parent 4ca0a303
......@@ -63,6 +63,7 @@ export default Ember.Controller.extend({
success: function () {
_this.set('delete_success_message', 'Your request to delete the application was successfully sent to the server.');
_this.set('success_delete', true);
_this.get('model.application').set('deleting', true);
Ember.run.later((function () {
_this.set('success_delete', false);
_this.transitionToRoute('dashboard');
......
......@@ -62,6 +62,7 @@ export default Ember.ArrayController.extend({
success: function () {
_this.set('success_delete', true);
_this.set('delete_success_message', 'Your request to delete the application was successfully sent to the server.');
_this.get('model').findBy('id', app_id).set('deleting', true);
Ember.run.later((function () {
_this.set('success_delete', false);
}), ENV.message_dismiss);
......
......@@ -13,7 +13,8 @@ var LambdaApp = DS.Model.extend({
lambda_instances: DS.hasMany('lambda-instance'),
started: DS.attr('boolean'),
deployed: DS.attr('boolean'),
execution_environment_name: DS.attr()
execution_environment_name: DS.attr(),
deleting: DS.attr('boolean')
});
export default LambdaApp;
......@@ -49,8 +49,18 @@
<br> The visible buttons represent the available
actions you may take depending on the <i>status</i> of the Application.
</div>
{{#if model.application.deleting}}
{{#tool-tip}}
<button class="btn btn-danger btn-primary pull-right disabled has-tooltip"
data-tooltip-content="<center>The application is being deleted!</center>">
<i class="fa fa-times"></i> Deleting <i class="fa fa-spinner fa-spin"></i></button>
{{/tool-tip}}
{{else}}
<button name="del-btn" id="del-btn" class="btn btn-danger btn-primary pull-right"
{{action "delete_app" model.application.id}}><i class="fa fa-times"></i> Delete</button>
{{/if}}
<button name="del-btn" id="del-btn" class="btn btn-danger btn-primary pull-right" {{action "delete_app" model.application.id}}><i class="fa fa-times"></i> Delete</button>
{{#if (compare model.application.status_code '==' '0')}}
{{#link-to 'deploy-app-1' model.application.id}}
<button class="btn btn-primary pull-right"
......
......@@ -105,7 +105,7 @@
<button class="btn btn-info btn-xs"><i class="fa fa-file-code-o"></i> Details</button>
{{/link-to}}
</td>
<td>
<td>
{{#if (compare lambda-application.status_code '==' '0')}}
{{#link-to 'deploy-app-1' lambda-application.id}}
<button class="btn btn-primary btn-xs"
......@@ -123,10 +123,20 @@
</button>
{{/tool-tip}}
{{/if}}
</td>
<td>
<button name="del-btn" id="del-btn" class="btn btn-danger btn-xs" {{action "delete_app" lambda-application.id}}><i class="fa fa-times"></i> Delete</button>
</td>
</td>
<td>
{{#if lambda-application.deleting}}
{{#tool-tip}}
<button class="btn btn-danger btn-xs disabled has-tooltip"
data-tooltip-content="<center>The application is being deleted!</center>">
<i class="fa fa-times"></i> Deleting <i class="fa fa-spinner fa-spin"></i></button>
{{/tool-tip}}
{{else}}
<button name="del-btn" id="del-btn" class="btn btn-danger btn-xs"
{{action "delete_app" lambda-application.id}}>
<i class="fa fa-times"></i> Delete</button>
{{/if}}
</td>
</tr>
{{/each}}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment