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
synnefo
Commits
87954ee6
Commit
87954ee6
authored
Jan 10, 2014
by
Kostas Papadimitriou
Browse files
ui: Conditionally disable suggested flavors in create wizard
based on user quota limits
parent
39249a2b
Changes
1
Hide whitespace changes
Inline
Side-by-side
snf-cyclades-app/synnefo/ui/static/snf/js/ui/web/ui_create_view.js
View file @
87954ee6
...
...
@@ -609,8 +609,13 @@
update_valid_predefined
:
function
()
{
this
.
update_unavailable_values
();
var
self
=
this
;
this
.
valid_predefined
=
_
.
select
(
_
.
map
(
this
.
predefined_flavors
,
function
(
flv
,
key
){
var
existing
=
storage
.
flavors
.
get_flavor
(
flv
.
cpu
,
flv
.
ram
,
flv
.
disk
,
flv
.
disk_template
,
self
.
flavors
);
this
.
valid_predefined
=
_
.
select
(
_
.
map
(
this
.
predefined_flavors
,
function
(
flv
,
key
){
var
existing
=
storage
.
flavors
.
get_flavor
(
flv
.
cpu
,
flv
.
ram
,
flv
.
disk
,
flv
.
disk_template
,
self
.
flavors
);
// non existing
if
(
!
existing
)
{
return
false
;
...
...
@@ -621,7 +626,18 @@
existing
.
get
(
"
disk
"
))
>
-
1
)
{
return
false
}
// quota check
var
quotas
=
synnefo
.
storage
.
quotas
.
get_available_for_vm
();
var
unavailable_check
=
synnefo
.
storage
.
flavors
.
unavailable_values_for_quotas
;
var
unavailable
=
unavailable_check
(
quotas
,
[
existing
]);
if
((
_
.
filter
(
unavailable
,
function
(
values
,
flvkey
)
{
return
values
.
length
>
0
})).
length
>
0
)
{
return
false
;
}
return
key
;
}),
function
(
ret
)
{
return
ret
});
...
...
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