Skip to content

Commit

Permalink
Merge pull request #759 from josejulio/move_security_protocol
Browse files Browse the repository at this point in the history
Move security protocol
  • Loading branch information
h-kataria committed Mar 27, 2017
2 parents e809b39 + 81b93e2 commit 942730d
Showing 1 changed file with 66 additions and 65 deletions.
131 changes: 66 additions & 65 deletions app/views/layouts/angular-bootstrap/_endpoints_angular.html.haml
Expand Up @@ -3,6 +3,64 @@
- ng_reqd_hostname ||= true
- ng_reqd_api_port ||= true

%div{"ng-if" => defined?(security_protocol_hide) ? false : true}
.form-group{"ng-class" => "{'has-error': angularForm.#{prefix}_security_protocol.$invalid}",
"ng-if" => "emsCommonModel.emstype == 'openstack' || " + |
"emsCommonModel.emstype == 'openstack_infra' || " + |
"emsCommonModel.emstype == 'nuage_network' || " + |
"(emsCommonModel.emstype == 'vmware_cloud' && '#{prefix}' === 'amqp') || " |
"emsCommonModel.emstype == 'scvmm' || " + |
"emsCommonModel.ems_controller == 'ems_container' || " + |
"emsCommonModel.emstype == 'hawkular'"} |
%label.col-md-2.control-label{"for" => "#{prefix}_security_protocol"}
= _('Security Protocol')
.col-md-8{"ng-if" => "emsCommonModel.emstype == 'openstack' || emsCommonModel.emstype == 'openstack_infra' || emsCommonModel.emstype == 'vmware_cloud'"}
- prefix == "amqp" ? security_protocols = @amqp_security_protocols : security_protocols = @openstack_security_protocols
= select_tag("#{prefix}_security_protocol",
options_for_select([["<#{_('Choose')}>", nil]] + security_protocols, :disabled => ["<#{_('Choose')}>", nil]),
"ng-model" => "#{ng_model}.#{prefix}_security_protocol",
"checkchange" => "",
"ng-required" => true,
"ng-change" => "openstackSecurityProtocolChanged()",
"selectpicker-for-select-tag" => "",
"prefix" => prefix.to_s,
"reset-validation-status" => "#{prefix}_auth_status")
.col-md-8{"ng-if" => "emsCommonModel.emstype == 'nuage_network'"}
= select_tag("#{prefix}_security_protocol",
options_for_select([["<#{_('Choose')}>", nil]] + @nuage_security_protocols, :disabled => ["<#{_('Choose')}>", nil]),
"ng-model" => "#{ng_model}.#{prefix}_security_protocol",
"checkchange" => "",
"required" => defined?(security_protocol_not_required) ? false : true,
"selectpicker-for-select-tag" => "")
.col-md-8{"ng-if" => "emsCommonModel.emstype == 'scvmm'"}
= select_tag("#{prefix}_security_protocol",
options_for_select([["<#{_('Choose')}>", nil]] + @scvmm_security_protocols, :disabled => ["<#{_('Choose')}>", nil]),
"ng-model" => "#{ng_model}.#{prefix}_security_protocol",
"checkchange" => "",
"required" => "",
"selectpicker-for-select-tag" => "",
"prefix" => prefix.to_s,
"reset-validation-status" => "#{prefix}_auth_status")
.col-md-8{"ng-if" => "emsCommonModel.ems_controller == 'ems_container'"}
= select_tag("#{prefix}_security_protocol",
options_for_select([["<#{_('Choose')}>", nil]] + @container_security_protocols, :disabled => ["<#{_('Choose')}>", nil]),
"ng-model" => "#{ng_model}.#{prefix}_security_protocol",
"checkchange" => "",
"required" => "",
"selectpicker-for-select-tag" => "",
"prefix" => prefix.to_s,
"reset-validation-status" => "#{prefix}_auth_status")
.col-md-8{"ng-if" => "emsCommonModel.emstype == 'hawkular'"}
= select_tag("#{prefix}_security_protocol",
options_for_select([["<#{_('Choose')}>", nil]] + @hawkular_security_protocols, "disabled" => ["<#{_('Choose')}>", nil]),
"ng-model" => "#{ng_model}.#{prefix}_security_protocol",
"checkchange" => "",
"required" => "",
"ng-change" => "hawkularSecurityProtocolChanged()",
"selectpicker-for-select-tag" => "",
"prefix" => prefix.to_s,
"reset-validation-status" => "#{prefix}_auth_status")

%div{"ng-if" => defined?(hostname_hide) ? false : true}
.form-group{"ng-class" => "{'has-error': angularForm.#{prefix}_hostname.$invalid}"}
%label.col-md-2.control-label{"for" => "#{prefix}_hostname"}
Expand All @@ -12,12 +70,12 @@
"id" => "#{prefix}_hostname",
"name" => "#{prefix}_hostname",
"ng-model" => "#{ng_model}.#{prefix}_hostname",
"maxlength" => "#{MAX_NAME_LEN}",
"ng-required" => "#{ng_reqd_hostname}",
"maxlength" => MAX_NAME_LEN.to_s,
"ng-required" => ng_reqd_hostname.to_s,
"ng-trim" => false,
"detect-spaces" => "",
"checkchange" => "",
"prefix" => "#{prefix}",
"prefix" => prefix.to_s,
"reset-validation-status" => "#{prefix}_auth_status"}
%span.help-block{"ng-show" => "angularForm.#{prefix}_hostname.$error.required"}
= _("Required")
Expand All @@ -43,11 +101,11 @@
"name" => "#{prefix}_api_port",
"ng-model" => "#{ng_model}.#{prefix}_api_port",
"maxlength" => 15,
"ng-required" => "#{ng_reqd_api_port}",
"ng-required" => ng_reqd_api_port.to_s,
"checkchange" => "",
"ng-trim" => false,
"detect-spaces" => "",
"prefix" => "#{prefix}",
"prefix" => prefix.to_s,
"reset-validation-depends-on" => %w(hawkular metrics).include?(prefix) ? "#{prefix}_hostname" : "",
"reset-validation-status" => "#{prefix}_auth_status",
"pattern" => "^[1-9]\\d*$"}
Expand Down Expand Up @@ -78,63 +136,6 @@
%span.help-block{"ng-show" => "angularForm.#{prefix}_database_name.$error.detectedSpaces"}
= _("Spaces are prohibited")

%div{"ng-if" => defined?(security_protocol_hide) ? false : true}
.form-group{"ng-class" => "{'has-error': angularForm.#{prefix}_security_protocol.$invalid}",
"ng-if" => "emsCommonModel.emstype == 'openstack' || " + |
"emsCommonModel.emstype == 'openstack_infra' || " + |
"emsCommonModel.emstype == 'nuage_network' || " + |
"(emsCommonModel.emstype == 'vmware_cloud' && '#{prefix}' === 'amqp') || " |
"emsCommonModel.emstype == 'scvmm' || " + |
"emsCommonModel.ems_controller == 'ems_container' || " + |
"emsCommonModel.emstype == 'hawkular'"} |
%label.col-md-2.control-label{"for" => "#{prefix}_security_protocol"}
= _('Security Protocol')
.col-md-8{"ng-if" => "emsCommonModel.emstype == 'openstack' || emsCommonModel.emstype == 'openstack_infra' || emsCommonModel.emstype == 'vmware_cloud'"}
- prefix == "amqp" ? security_protocols = @amqp_security_protocols : security_protocols = @openstack_security_protocols
= select_tag("#{prefix}_security_protocol",
options_for_select([["<#{_('Choose')}>", nil]] + security_protocols, disabled: ["<#{_('Choose')}>", nil]),
"ng-model" => "#{ng_model}.#{prefix}_security_protocol",
"checkchange" => "",
"ng-required" => true,
"ng-change" => "openstackSecurityProtocolChanged()",
"selectpicker-for-select-tag" => "",
"prefix" => "#{prefix}",
"reset-validation-status" => "#{prefix}_auth_status")
.col-md-8{"ng-if" => "emsCommonModel.emstype == 'nuage_network'"}
= select_tag("#{prefix}_security_protocol",
options_for_select([["<#{_('Choose')}>", nil]] + @nuage_security_protocols, disabled: ["<#{_('Choose')}>", nil]),
"ng-model" => "#{ng_model}.#{prefix}_security_protocol",
"checkchange" => "",
"required" => defined?(security_protocol_not_required) ? false : true,
"selectpicker-for-select-tag" => "")
.col-md-8{"ng-if" => "emsCommonModel.emstype == 'scvmm'"}
= select_tag("#{prefix}_security_protocol",
options_for_select([["<#{_('Choose')}>", nil]] + @scvmm_security_protocols, disabled: ["<#{_('Choose')}>", nil]),
"ng-model" => "#{ng_model}.#{prefix}_security_protocol",
"checkchange" => "",
"required" => "",
"selectpicker-for-select-tag" => "",
"prefix" => "#{prefix}",
"reset-validation-status" => "#{prefix}_auth_status")
.col-md-8{"ng-if" => "emsCommonModel.ems_controller == 'ems_container'"}
= select_tag("#{prefix}_security_protocol",
options_for_select([["<#{_('Choose')}>", nil]] + @container_security_protocols, disabled: ["<#{_('Choose')}>", nil]),
"ng-model" => "#{ng_model}.#{prefix}_security_protocol",
"checkchange" => "",
"required" => "",
"selectpicker-for-select-tag" => "",
"prefix" => "#{prefix}",
"reset-validation-status" => "#{prefix}_auth_status")
.col-md-8{"ng-if" => "emsCommonModel.emstype == 'hawkular'"}
= select_tag("#{prefix}_security_protocol",
options_for_select([["<#{_('Choose')}>", nil]] + @hawkular_security_protocols, "disabled" => ["<#{_('Choose')}>", nil]),
"ng-model" => "#{ng_model}.#{prefix}_security_protocol",
"checkchange" => "",
"required" => "",
"ng-change" => "hawkularSecurityProtocolChanged()",
"selectpicker-for-select-tag" => "",
"prefix" => prefix.to_s,
"reset-validation-status" => "#{prefix}_auth_status")

%div{"ng-if" => defined?(tls_verify_hide) ? false : true}
.form-group{"ng-if"=> "emsCommonModel.emstype == 'rhevm'"}
Expand All @@ -150,7 +151,7 @@
"ng-true-value" => "true",
"ng-false-value" => "false",
"ng-model" => "#{ng_model}.#{prefix}_tls_verify",
"prefix" => "#{prefix}"}
"prefix" => prefix.to_s}

%div{"ng-if" => defined?(tls_ca_certs_hide) ? false : true}
.form-group{"ng-if"=> "emsCommonModel.emstype == 'rhevm' || " + |
Expand All @@ -167,7 +168,7 @@
"ng-disabled" => "emsCommonModel.emstype == 'rhevm' && !#{ng_model}.#{prefix}_tls_verify",
"ng-required" => false,
"ng-trim" => false,
"prefix" => "#{prefix}",
"prefix" => prefix.to_s,
"reset-validation-status" => "#{prefix}_auth_status"}
%span.help-block
= _("Paste here the trusted CA certificates, in PEM format.")
Expand All @@ -181,7 +182,7 @@
"id" => "realm",
"name" => "realm",
"ng-model" => "emsCommonModel.realm",
"maxlength" => "#{MAX_NAME_LEN}",
"maxlength" => MAX_NAME_LEN.to_s,
"required" => "",
"checkchange" => "",
"auto-focus" => "",
Expand Down

0 comments on commit 942730d

Please sign in to comment.