Commit fd3e4ed0 authored by Georgios Ouzounis's avatar Georgios Ouzounis
Browse files

Initialize enoughQuotas on create-lambda-instance route

parent 03da3cc4
......@@ -18,6 +18,8 @@ export default Ember.Route.extend(AuthenticatedRouteMixin, {
var controller = this.controllerFor('create-lambda-instance');
var minQuotasPerProject = controller.get('minQuotasPerProject');
controller.set('enoughQuotas', false);
for (var i = 0;i < model.userOkeanosProjects.get('length');i++){
if (model.userOkeanosProjects.objectAt(i).get('vm') >= minQuotasPerProject['vms'] &&
model.userOkeanosProjects.objectAt(i).get('cpu') >= minQuotasPerProject['cpus'] &&
......
......@@ -22,10 +22,14 @@ var UploadRoute = Ember.Route.extend(AuthenticatedRouteMixin, {
// After the models are loaded, check each project's quotas. If a least one project
// has enough quotas to upload a Lambda Application, set enoughQuotas to true.
// Delete every project that has no quotas on Pithos+.
var controller = this.controllerFor('lambda-apps.upload');
controller.set('enoughQuotas', false);
for (var i = 0;i < model.userOkeanosProjects.get('length');i++){
if (model.userOkeanosProjects.objectAt(i).get('pithos_space') > 0) {
if(!this.controllerFor('lambda-apps.upload').get('enoughQuotas')){
this.controllerFor('lambda-apps.upload').set('enoughQuotas', true);
if(!controller.get('enoughQuotas')){
controller.set('enoughQuotas', true);
}
}
else{
......
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