New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow advanced modifications of Amazon cloud volumes #676
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
.form-group{"ng-class" => "{'has-error': angularForm.name.$invalid}"} | ||
%label.col-md-2.control-label | ||
= _('Volume Name') | ||
.col-md-8 | ||
%input.form-control{:type => "text", | ||
:name => "name", | ||
'ng-model' => "cloudVolumeModel.name", | ||
'ng-maxlength' => 128, | ||
:required => "", | ||
:checkchange => true} | ||
%span.help-block{"ng-show" => "angularForm.name.$error.required"} | ||
= _("Required") | ||
|
||
.form-group{"ng-class" => "{'has-error': angularForm.aws_volume_type.$invalid}", | ||
"ng-if" => "cloudVolumeModel.emstype == 'ManageIQ::Providers::Amazon::StorageManager::Ebs'"} | ||
%label.col-md-2.control-label | ||
= _('Cloud Volume Type') | ||
.col-md-8 | ||
%select{"name" => "aws_volume_type", | ||
"ng-model" => "cloudVolumeModel.aws_volume_type", | ||
"ng-options" => "voltype.type as voltype.name for voltype in awsVolumeTypes", | ||
"ng-change" => "awsVolumeTypeChanged(cloudVolumeModel.aws_volume_type)", | ||
"ng-disabled" => "formId != 'new' && cloudVolumeModel.aws_volume_type == 'standard'", | ||
"required" => "", | ||
:checkchange => true, | ||
"selectpicker-for-select-tag" => ""} | ||
%option{"value" => "", "disabled" => ""} | ||
= "<#{_('Choose')}>" | ||
%span.help-block{"ng-show" => "angularForm.aws_volume_type.$error.required"} | ||
= _("Required") | ||
|
||
.form-group{"ng-class" => "{'has-error': angularForm.size.$invalid}"} | ||
%label.col-md-2.control-label | ||
= _('Size (in gigabytes)') | ||
.col-md-8 | ||
%input.form-control{:type => "text", | ||
:name => "size", | ||
'ng-model' => "cloudVolumeModel.size", | ||
'ng-maxlength' => 10, | ||
'ng-change' => "sizeChanged(cloudVolumeModel.size)", | ||
'ng-disabled' => "formId != 'new' && (cloudVolumeModel.emstype != 'ManageIQ::Providers::Amazon::StorageManager::Ebs' || cloudVolumeModel.aws_volume_type == 'standard')", | ||
:required => "", | ||
:checkchange => true} | ||
%span.help-block{"ng-show" => "angularForm.size.$error.required"} | ||
= _("Required") | ||
|
||
.form-group{"ng-class" => "{'has-error': angularForm.aws_iops.$invalid}", | ||
"ng-if" => "cloudVolumeModel.emstype == 'ManageIQ::Providers::Amazon::StorageManager::Ebs'"} | ||
%label.col-md-2.control-label | ||
= _('IOPS') | ||
.col-md-8 | ||
%input.form-control{:type => "text", | ||
:name => "aws_iops", | ||
'ng-model' => "cloudVolumeModel.aws_iops", | ||
'ng-maxlength' => 50, | ||
'ng-disabled' => "cloudVolumeModel.aws_volume_type != 'io1'", | ||
"ng-required" => "cloudVolumeModel.aws_volume_type == 'io1'", | ||
:checkchange => true} | ||
%span.help-block{"ng-show" => "cloudVolumeModel.aws_volume_type == 'io1' && angularForm.aws_iops.$error.required"} | ||
= _("Required") |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,9 @@ | ||
%form#form_div{:name => "angularForm", 'ng-controller' => "cloudVolumeFormController"} | ||
%form#form_div{:name => "angularForm", 'ng-controller' => "cloudVolumeFormController", "ng-cloak" => ""} | ||
= render :partial => "layouts/flash_msg" | ||
%h3 | ||
= _('Edit Volume') | ||
.form-horizontal | ||
.form-group | ||
%label.col-md-2.control-label | ||
= _('Volume Name') | ||
.col-md-8 | ||
%input.form-control{:type => "text", | ||
:name => "name", | ||
'ng-model' => "cloudVolumeModel.name", | ||
'ng-maxlength' => 128, | ||
:miqrequired => false, | ||
:checkchange => true} | ||
= render :partial => "common_new_edit" | ||
|
||
%table{:width => '100%'} | ||
%tr | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In this haml, down below, can you use this partial to render the buttons? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, sure - I didn't know about this before. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @AparnaKarve I noticed there are some differences between the way how the button table is created for "new volume" than in the about partial layout. For example, in cloud volume case it checks if I guess we should update the whole controller/view to make it compliant with the partial layout. Perhaps in a separate PR. What do you think? |
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,64 +47,7 @@ | |
%span.help-block{"ng-show" => "angularForm.aws_availability_zone_id.$error.required"} | ||
= _("Required") | ||
|
||
.form-group{"ng-class" => "{'has-error': angularForm.name.$invalid}"} | ||
%label.col-md-2.control-label | ||
= _('Volume Name') | ||
.col-md-8 | ||
%input.form-control{:type => "text", | ||
:name => "name", | ||
'ng-model' => "cloudVolumeModel.name", | ||
'ng-maxlength' => 128, | ||
:required => "", | ||
:checkchange => true} | ||
%span.help-block{"ng-show" => "angularForm.name.$error.required"} | ||
= _("Required") | ||
|
||
.form-group{"ng-class" => "{'has-error': angularForm.aws_volume_type.$invalid}", | ||
"ng-if" => "cloudVolumeModel.emstype == 'ManageIQ::Providers::Amazon::StorageManager::Ebs'"} | ||
%label.col-md-2.control-label | ||
= _('Cloud Volume Type') | ||
.col-md-8 | ||
%select{"name" => "aws_volume_type", | ||
"ng-model" => "cloudVolumeModel.aws_volume_type", | ||
"ng-options" => "voltype.type as voltype.name for voltype in awsVolumeTypes", | ||
"ng-change" => "awsVolumeTypeChanged(cloudVolumeModel.aws_volume_type)", | ||
"required" => "", | ||
:checkchange => true, | ||
"selectpicker-for-select-tag" => ""} | ||
%option{"value" => "", "disabled" => ""} | ||
= "<#{_('Choose')}>" | ||
%span.help-block{"ng-show" => "angularForm.aws_volume_type.$error.required"} | ||
= _("Required") | ||
|
||
.form-group{"ng-class" => "{'has-error': angularForm.size.$invalid}"} | ||
%label.col-md-2.control-label | ||
= _('Size (in gigabytes)') | ||
.col-md-8 | ||
%input.form-control{:type => "text", | ||
:name => "size", | ||
'ng-model' => "cloudVolumeModel.size", | ||
'ng-maxlength' => 10, | ||
'ng-change' => "sizeChanged(cloudVolumeModel.size)", | ||
:required => "", | ||
:checkchange => true} | ||
%span.help-block{"ng-show" => "angularForm.size.$error.required"} | ||
= _("Required") | ||
|
||
.form-group{"ng-class" => "{'has-error': angularForm.aws_iops.$invalid}", | ||
"ng-if" => "cloudVolumeModel.emstype == 'ManageIQ::Providers::Amazon::StorageManager::Ebs'"} | ||
%label.col-md-2.control-label | ||
= _('IOPS') | ||
.col-md-8 | ||
%input.form-control{:type => "text", | ||
:name => "aws_iops", | ||
'ng-model' => "cloudVolumeModel.aws_iops", | ||
'ng-maxlength' => 50, | ||
'ng-disabled' => "cloudVolumeModel.aws_volume_type != 'io1'", | ||
"required" => "", | ||
:checkchange => true} | ||
%span.help-block{"ng-show" => "cloudVolumeModel.aws_volume_type == 'io1' && angularForm.aws_iops.$error.required"} | ||
= _("Required") | ||
= render :partial => "common_new_edit" | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same comment as above for the button partial |
||
.form-group{"ng-if" => "cloudVolumeModel.emstype == 'ManageIQ::Providers::Amazon::StorageManager::Ebs'"} | ||
%label.col-md-2.control-label | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -481,7 +481,6 @@ | |
backup_select | ||
snapshot_new | ||
edit | ||
cloud_volume_form_fields | ||
cloud_volume_tenants | ||
index | ||
new | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would have really liked if we could fetch this list on-the-fly using some API (AWS API perhaps?)
But don't worry about it, if that's not doable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AWS does not provide an API for this; we initially thought about making
CloudVolumeType
model where storage managers would be able to list their options (for example in OpenStack admins are allowed to define different volume types so it would make sense).My concern is that there are specific rules in the UI that need to be handled with regards to the chosen volume type, so I am not sure if providing it through API/backend would benefit much. Still, we could use something like this for regions or instance types. Would that make any sense?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, yes. I know you mentioned this even before.