Skip to content
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

Introduce UI for Nuage events #2186

Merged
merged 1 commit into from Oct 25, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -394,6 +394,10 @@ ManageIQ.angular.app.controller('emsCommonFormController', ['$http', '$scope', '
if ($scope.emsCommonModel.emstype === 'openstack') {
$scope.emsCommonModel.tenant_mapping_enabled = false;
}
} else if ($scope.emsCommonModel.emstype === 'nuage_network') {
$scope.emsCommonModel.default_api_port = $scope.getDefaultApiPort($scope.emsCommonModel.emstype);
$scope.emsCommonModel.event_stream_selection = 'none';
$scope.emsCommonModel.amqp_security_protocol = 'non-ssl';
} else if ($scope.emsCommonModel.emstype === 'scvmm') {
$scope.emsCommonModel.default_security_protocol = 'ssl';
} else if ($scope.emsCommonModel.emstype === 'rhevm') {
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/ems_common.rb
Expand Up @@ -482,7 +482,7 @@ def retrieve_vmware_cloud_api_versions
end

def retrieve_nuage_api_versions
[['Version 3.2', 'v3_2'], ['Version 4.0', 'v4_0']]
[['Version 3.2', 'v3_2'], ['Version 4.0', 'v4_0'], ['Version 5.0', 'v5.0']]
end

def retrieve_security_protocols
Expand Down
1 change: 1 addition & 0 deletions app/controllers/mixins/ems_common_angular.rb
Expand Up @@ -537,6 +537,7 @@ def set_ems_record_vars(ems, mode = nil)

if ems.kind_of?(ManageIQ::Providers::Nuage::NetworkManager)
default_endpoint = {:role => :default, :hostname => hostname, :port => port, :security_protocol => ems.security_protocol}
amqp_endpoint = {:role => :amqp, :hostname => amqp_hostname, :port => amqp_port, :security_protocol => amqp_security_protocol}
end

if ems.kind_of?(ManageIQ::Providers::Lenovo::PhysicalInfraManager)
Expand Down
Expand Up @@ -28,8 +28,9 @@
"prefix" => prefix.to_s,
"reset-validation-status" => "#{prefix}_auth_status")
.col-md-8{"ng-if" => "emsCommonModel.emstype == 'nuage_network'"}
- prefix == "amqp" ? security_protocols = @amqp_security_protocols : security_protocols = @nuage_security_protocols
= select_tag("#{prefix}_security_protocol",
options_for_select([["<#{_('Choose')}>", nil]] + @nuage_security_protocols, :disabled => ["<#{_('Choose')}>", nil]),
options_for_select([["<#{_('Choose')}>", nil]] + security_protocols, :disabled => ["<#{_('Choose')}>", nil]),
"ng-model" => "#{ng_model}.#{prefix}_security_protocol",
"checkchange" => "",
"required" => defined?(security_protocol_not_required) ? false : true,
Expand Down
18 changes: 15 additions & 3 deletions app/views/layouts/angular/_multi_auth_credentials.html.haml
Expand Up @@ -33,6 +33,10 @@
= _("Web Services")
= miq_tab_header('ipmi', nil, {'ng-click' => "changeAuthTab('ipmi')"}) do
= _("IPMI")
- elsif %w(ems_network).include?(controller_name)
= miq_tab_header('amqp', nil, {'ng-click' => "changeAuthTab('amqp')"}) do
%i{"error-on-tab" => "amqp", :style => "color:#cc0000"}
= _("Events")

.tab-content
= miq_tab_content('default', 'default') do
Expand Down Expand Up @@ -141,7 +145,7 @@
%span{:style => "color:black"}
= _("Required. Used to gather Utilization data.")

- if %w(ems_cloud ems_infra).include?(params[:controller])
- if %w(ems_cloud ems_infra ems_network).include?(params[:controller])
= miq_tab_content('metrics', 'default') do
.form-group
.col-md-12{"ng-if" => "#{ng_model}" == "emsCommonModel" && "#{ng_model}.emstype == 'rhevm'"}
Expand Down Expand Up @@ -171,8 +175,8 @@
= _("Used to gather Capacity & Utilization metrics.")
= miq_tab_content('amqp', 'default') do
.form-group
.col-md-12{"ng-if" => "#{ng_model}" == "emsCommonModel" && "#{ng_model}.emstype == 'openstack' || #{ng_model}.emstype == 'openstack_infra' || #{ng_model}.emstype == 'vmware_cloud'"}
%label.radio-inline.control-label{"for" => "none_radio", "ng-show" => "#{ng_model}.emstype == 'vmware_cloud'"}
.col-md-12{"ng-if" => "#{ng_model}" == "emsCommonModel" && "#{ng_model}.emstype == 'openstack' || #{ng_model}.emstype == 'openstack_infra' || #{ng_model}.emstype == 'vmware_cloud' || #{ng_model}.emstype == 'nuage_network'"}
%label.radio-inline.control-label{"for" => "none_radio", "ng-show" => "#{ng_model}.emstype == 'vmware_cloud' || #{ng_model}.emstype == 'nuage_network'"}
%input{:type => "radio",
:name => "event_stream_selection",
:id => "none_radio",
Expand Down Expand Up @@ -230,6 +234,12 @@
= _("Enable event monitoring. Used to automatically resync state when changes are performed on VMware vCloud Director directly.")
%div{"ng-if" => "emsCommonModel.event_stream_selection == 'none'"}
= _("Disable event monitoring.")
.col-md-12{"ng-if" => "#{ng_model}" == "emsCommonModel" && "#{ng_model}.emstype == 'nuage_network'"}
%span{:style => "color:black"}
%div{"ng-if" => "emsCommonModel.event_stream_selection == 'amqp'"}
= _("Used to authenticate with Nuage AMQP Messaging Bus for event handling.")
%div{"ng-if" => "emsCommonModel.event_stream_selection == 'none'"}
= _("Disable event monitoring.")
= miq_tab_content('ssh_keypair', 'default') do
.form-group
.col-md-12.col-md-12{"ng-if" => "#{ng_model}" == "emsCommonModel" && "#{ng_model}.emstype == 'openstack_infra'"}
Expand Down Expand Up @@ -408,6 +418,8 @@
$('#auth_tabs').show();
%div{"ng-if" => "#{ng_model}.emstype == 'nuage_network'"}
:javascript
miq_tabs_show_hide("#amqp_tab", true);
miq_tabs_show_hide("#metrics_tab", false);
miq_tabs_init('#auth_tabs');
$('#auth_tabs').show();
%div{"ng-if" => "#{ng_model}.ems_controller == 'ems_container'"}
Expand Down