Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
okeanos-LoD
Commits
fd3e4ed0
Commit
fd3e4ed0
authored
Mar 31, 2016
by
Georgios Ouzounis
Browse files
Initialize enoughQuotas on create-lambda-instance route
parent
03da3cc4
Changes
2
Hide whitespace changes
Inline
Side-by-side
webapp/frontend/app/routes/create-lambda-instance.js
View file @
fd3e4ed0
...
...
@@ -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
'
]
&&
...
...
webapp/frontend/app/routes/lambda-apps/upload.js
View file @
fd3e4ed0
...
...
@@ -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
.
controller
For
(
'
lambda-apps.upload
'
)
.
get
(
'
enoughQuotas
'
)){
this
.
controller
For
(
'
lambda-apps.upload
'
)
.
set
(
'
enoughQuotas
'
,
true
);
if
(
!
controller
.
get
(
'
enoughQuotas
'
)){
controller
.
set
(
'
enoughQuotas
'
,
true
);
}
}
else
{
...
...
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