crowbar/crowbar-ha

View on GitHub
crowbar_framework/app/views/barclamp/pacemaker/_edit_attributes.html.haml

Summary

Maintainability
Test Coverage
= attributes_for @proposal do
  .panel-sub
    = header show_raw_deployment?, true

  .panel-body
    %fieldset
      %legend
        = t(".corosync_rings_header")

      = select_field %w(corosync transport), :collection => :transport_for_pacemaker, "data-showit" => ["udp", "udpu"].join(";"), "data-showit-target" => ".ring_udp_container;.ring_udpu_container", "data-showit-direct" => "true"

      %script#ring-entries{ :type => "text/x-handlebars-template" }
        #corosync-rings
          {{#each entries}}
          %ul.list-group{ :id => "ring-index-{{@index}}" }
            %li.list-group-item.active
              %h3.list-group-item-heading
                = t('.corosync.ring_header', :index => "{{inc @index}}")
                {{#if ../at_min_entries }}
                {{else}}
                = link_to icon_tag("trash"), "#", :class => "corosync-ring-delete pull-right delete", "data-ringid" => "{{@index}}"
                {{/if}}
            %li.list-group-item
              = string_field %w(corosync rings {{@index}} network), :placeholder => t(".corosync.rings.network_placeholder")
              %div{ :class => "ring_udp_container" }
                = string_field %w(corosync rings {{@index}} mcast_addr), :placeholder => t(".corosync.rings.mcast_placeholder")
          {{/each}}

      #corosync-rings
        = t(".corosync.loading_text")

      %ul.list-group{ :id => "ring-add" }
        %li.list-group-item.active
          %h3.list-group-item-heading
            = t('.corosync.add_header', :index => "{{inc @index}}")
            .form-group.pull-right
              %input{ :id => "add-ring-button", :class => "form-control btn-default", :type => "button", :value => t('.corosync.add_button') }
        %li.list-group-item
          = string_field %w(corosync rings index network), :placeholder => t(".corosync.rings.network_placeholder")
          %div{ :class => "ring_udp_container" }
            = string_field %w(corosync rings index mcast_addr), :placeholder => t(".corosync.rings.mcast_placeholder")

    %fieldset
      %legend
        = t(".pacemaker_header")

      = select_field %w(crm no_quorum_policy), :collection => :no_quorum_policy_for_pacemaker
      %span.help-block
        = t('.crm.no_quorum_policy_hint_html')

    %fieldset
      %legend
        = t(".stonith_header")

      = select_field %w(stonith mode), :collection => :stonith_mode_for_pacemaker, "data-showit" => ["sbd", "shared", "per_node"].join(";"), "data-showit-target" => "#stonith_sbd_container;#stonith_shared_container;#stonith_per_node_container", "data-showit-direct" => "true"

      #stonith_sbd_container{ "data-nodes" => node_aliases.to_json }
        .alert.alert-info
          = t(".stonith.sbd.info_html")

        = string_field %w(stonith sbd watchdog_module)
        %span.help-block
          = t('.stonith.sbd.watchdog_module_hint')

        %table.table.table-middle
          %thead
            %tr
              %th.col-sm-3
                = t ".stonith.sbd.name"
              %th.col-sm-9
                = t ".stonith.sbd.devices"
          %tbody
        %span.help-block
          = t('.stonith.sbd.devices_hint')

      #stonith_shared_container
        = string_field %w(stonith shared agent)
        = string_field %w(stonith shared params)

      #stonith_per_node_container{ "data-nodes" => node_aliases.to_json }
        = string_field %w(stonith per_node agent)
        %table.table.table-middle
          %thead
            %tr
              %th.col-sm-3
                = t ".stonith.per_node.name"
              %th.col-sm-9
                = t ".stonith.per_node.params"
          %tbody

      = select_field %w(corosync require_clean_for_autostart_wrapper), :collection => :require_clean_for_autostart_wrapper_for_pacemaker
      %span.help-block
        = t('.corosync.require_clean_for_autostart_hint')

    %fieldset
      %legend
        = t(".notifications_header")

      = boolean_field %w(notifications smtp enabled), "data-showit" => "true", "data-showit-target" => "#smtp_notifications_container", "data-showit-direct" => "true"

      #smtp_notifications_container
        = string_field %w(notifications smtp server)
        %span.help-block
          = t(".notifications.smtp.server_hint")
        = string_field %w(notifications smtp prefix)
        = string_field %w(notifications smtp from)
        = string_field %w(notifications smtp to)

    %fieldset
      %legend
        = t(".haproxy_header")

      .alert.alert-info
        = t(".haproxy.ssl_info", :vhostname => PacemakerServiceObject.cluster_vhostname_from_name(proposal.name))

      = string_field %w(haproxy public_name)
      %span.help-block
        = t(".haproxy.public_name_hint")

    %fieldset
      %legend
        = t(".gui_header")

      = password_field %w(corosync password)