-
Notifications
You must be signed in to change notification settings - Fork 358
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
Network router gateway setup #716
Merged
h-kataria
merged 4 commits into
ManageIQ:master
from
gildub:network_router-gateway-setup
Mar 20, 2017
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
%h3 | ||
= _('Basic Information') | ||
.form-horizontal | ||
.form-group{"ng-class" => "{'has-error': angularForm.name.$invalid}"} | ||
%label.col-md-2.control-label | ||
= _('Router Name') | ||
.col-md-8 | ||
%input.form-control{:type => "text", | ||
:name => "name", | ||
"ng-model" => "networkRouterModel.name", | ||
"ng-maxlength" => 128, | ||
"required" => "", | ||
:checkchange => true} | ||
%span.help-block{"ng-show" => "angularForm.name.$error.required"} | ||
= _("Required") | ||
%h3 | ||
= _('External Gateway') | ||
.form-horizontal | ||
.form-group | ||
%label.col-md-2.control-label{"for" => "network_router_enable_snat"} | ||
.col-md-8 | ||
%input{"bs-switch" => "", | ||
:data => {:on_text => _('Yes'), :off_text => _('No'), :size => 'mini'}, | ||
"type" => "checkbox", | ||
"id" => "network_router_external_gateway", | ||
"name" => "external_gateway", | ||
"checkchange" => "true", | ||
"ng-model" => "networkRouterModel.external_gateway"} | ||
|
||
.form-horizontal{"ng-if" => "networkRouterModel.external_gateway"} | ||
.form-group{"ng-if" => "networkRouterModel.ems_id"} | ||
%label.col-md-2.control-label{"for" => "network_router_enable_snat"} | ||
= _('Enable Source NAT') | ||
.col-md-8 | ||
%input{"bs-switch" => "", | ||
:data => {:on_text => _('Yes'), :off_text => _('No'), :size => 'mini'}, | ||
"type" => "checkbox", | ||
"id" => "network_router_enable_snat", | ||
"name" => "enable_snat", | ||
"checkchange" => "true", | ||
"ng-model" => "networkRouterModel.enable_snat"} | ||
|
||
.form-group{"ng-class" => "{'has-error': angularForm.cloud_network_id.$invalid}"} | ||
%label.col-md-2.control-label | ||
= _('Network') | ||
.col-md-8 | ||
%select{"name" => "cloud_network_id", | ||
"ng-model" => "networkRouterModel.cloud_network_id", | ||
:checkchange => true, | ||
"ng-options" => "network.id as network.name for network in available_networks", | ||
"ng-change" => "filterCloudNetworkChanged(networkRouterModel.cloud_network_id)", | ||
"pf-select" => true, | ||
"ng-selected" => "networkRouterModel.cloud_network_id", | ||
"ng-required" => "networkRouterModel.enable_snat == true", | ||
"selectpicker-for-select-tag" => ""} | ||
%option{"value" => ""} | ||
= "<#{_('Choose')}>" | ||
%span.help-block{"ng-show" => "angularForm.cloud_network_id.$error.required"} | ||
= _("Required") | ||
|
||
%h2 | ||
.form-horizontal{"ng-if" => "networkRouterModel.cloud_network_id"} | ||
= _('Fixed IPs') | ||
.form-group | ||
%label.col-md-2.control-label | ||
= _('Subnet') | ||
.col-md-8 | ||
%select{"name" => "cloud_subnet_id", | ||
"ng-model" => "networkRouterModel.cloud_subnet_id", | ||
:checkchange => true, | ||
"ng-options" => "subnet.id as subnet.name for subnet in available_subnets", | ||
"pf-select" => true, | ||
"ng-selected" => "networkRouterModel.cloud_subnet_id", | ||
"selectpicker-for-select-tag" => ""} | ||
%option{"value" => ""} | ||
= "<#{_('Choose')}>" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@gildub I see that you have added a new controller route and action --
network_router_subnets_by_network
Currently we have a new practice in place for all our angular forms, which is --
Use REST API calls and avoid creating new controller actions/routes, especially true for any new functionality being added in the forms.
Hence I recommend using an API call here.
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.
I checked that currently an API for
network_routers
does not exist, but it should not be too hard to add.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.
I missed the fact that this is an RFE BZ for 5.7... so maybe the REST API implementation can wait for now.
Can you create a follow-up PR later to call the REST API?
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.
@AparnaKarve,
Ack to create PR for REST API, I created following issue as a tracker:
#737
Thanks
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.
@gildub Thanks for creating the issue. We can work on this once this PR is merged.