ACL Group

<%= form_for @acl_group , as: :acl_group, method: (@acl_group.id.blank? ? "post" : "put"), html: { class: "form-horizontal acl-group-form" , role: "form"} do |acl| %> <%val = ""%> <% if @acl_group.id.blank?%> <%val = "new"%> <%else%> <%val = "edit"%> <%end%>
<%= acl.label :group_name,"Group Name*".html_safe, :class=>"col-sm-4 control-label" %>
<%= acl.text_field :group_name,:class=>"form-control", :data => {validation: 'required'} %>
<%= label_tag :invenotry,"AP / AP Tags / Network*".html_safe, :class=>"col-sm-2 control-label" %>
<%= acl.select :associated_resources, grouped_options_for_select(grouped_collection_of_ap_and_networks_and_tags, { selected: @acl_group.associated_resources}), {}, :multiple => true, :class=>"form-control associated-resource", :placeholder=>"Type to select APs / AP Tags / Network", :data => { validation: 'required'} %>
<%=acl.label :logging, "Logging", :class=>"col-sm-2 control-label"%>
<%= acl.select :logging,options_for_select(AclGroup::LOGGING_TYPE.map{|n,v| [v,n]},:selected => acl.object.logging),{},:class=>"form-control",:data => { validation: 'required'} %>


Layer 3

<%=link_to " Add".html_safe,"javascript:void(0);", {:class => "btn btn-warning add-nwt-rows pull-right", :data => {:type => "acl" }} %>

">

Click Add To Add Layer 3

<% btnn3 = 0 %> <%=acl.fields_for :access_control_lists, @access_control_lists.sort_by {|d| d.priority } do |f|%>
">
<%= f.hidden_field :priority, :class => "priority_id" %>
<%= f.select :policy,[['Accept','1'],['Deny','0']],{},{:class=>"form-control policy", :data => {validation: 'required'}}%>
<%= f.select :protocol,['TCP','UDP','GRE','ICMP','TCP and UDP'],{}, {:class=>"form-control protocol", :data => {validation: 'required'}}%>
<%= f.select :src_uplink_type,AccessControlList::SRC_INTERFACE_TYPES_ARR,{}, {:class=>"form-control src_uplink_type", :data => {validation: 'required'}}%>
<%= f.text_field :src_ip,:class=>"form-control src_ip", :data => {validation: 'acl_src_ip_domain', optional: 'acl', "dependent-field" => '.scr_bitmask'}, :placeholder=>"Src IP/Domain"%>
<%= f.text_field :scr_bitmask,:class=>"form-control scr_bitmask", :data => {validation: 'bitmask', optional: 'acl'}, :placeholder=>"Src Bitmask"%>
<%= f.text_field :src_port,:class=>"form-control src_port", :data => {validation: 'acl-group port_group ', optional: 'acl'}, :placeholder=>"Src Port"%>
<%= f.select :dst_uplink_type,AccessControlList::SRC_INTERFACE_TYPES_ARR,{}, {:class=>"form-control dst_uplink_type", :data => {validation: 'required'}}%>
<%= f.text_field :dst_ip,:class=>"acl_ip_domain_select_2 form-control dst_ip", :data => {validation: 'acl_src_ip_domain', optional: 'acl', "dependent-field" => '.dst_bitmask'}, :placeholder=>"Dst IP/Domain"%>
<%= f.text_field :dst_bitmask,:class=>"form-control dst_bitmask", :data => {validation: 'bitmask', optional: 'acl'}, :placeholder=>"Dst Bitmask"%>
<%= f.text_field :dst_port,:class=>"form-control dst_port", :data => {validation: 'acl-group port_group', optional: 'acl'}, :placeholder=>"Dst Port"%>
<%= f.select :is_enabled, options_for_select([["Yes", true],["No", false]], f.object.is_enabled.to_s), {}, :class=>"form-control is_enabled" %>
<%= f.select :log, options_for_select([["Yes", true],["No", false]], f.object.log.to_s), {}, :class=>"form-control log" %>
<%=link_to " ".html_safe,"javascript:void(0);", {:class => "btn btn-sm btn-default up-arrow", title: "Move up"} %> <%=link_to " ".html_safe,"javascript:void(0);", {:class => "btn btn-sm btn-default down-arrow", title: "Move down"} %> <%= f.hidden_field :id, :class => "acl_id" %> <%= f.hidden_field :_destroy, :class => "policy_destroy" %> <%= link_to " X ","javascript:void(0);", {:class => "icon-delete_acl btn btn-xs btn-danger",style:"margin:18px 0;"} %>
<% btnn3 += 1 %> <%end%>



<% if false %> <% else %>

Layer 7

<%=link_to " Add ".html_safe,"javascript:void(0);", {:class => "btn btn-warning add-nwt-rows1 pull-right layer7_add", :data => {:type => "layer7" }} %> <% end %>

">

Click Add To Add Layer 7

<% bttn7 = 0 %> <%=acl.fields_for :access_control_list_layer_nines, @access_control_list_layer_nines do |f|%>
">
<%= f.select :policy_ly7,[['Accept','1'],['Deny','0']],{},{:class=>"form-control policy_ly7", :data => {validation: 'required'}}%>
<%= f.select :src_uplink_typely7,AccessControlList::SRC_INTERFACE_TYPES_ARR,{}, {:class=>"form-control src_uplink_typely7", :data => {validation: 'required'}}%>
<%= f.text_field :src_iply7,:class=>"form-control src_iply7", :data => {validation: 'acl_src_ip_domain', optional: 'acl', "dependent-field" => '.scr_bitmask'}, :placeholder=>"Src IP/Domain"%>
<%= f.text_field :src_bitmaskly7,:class=>"form-control src_bitmaskly7", :data => {validation: 'bitmask'}, :placeholder=>"Src Bitmask"%>
<%= f.select :application,AccessControlList::APPLICATION_ARR,{}, {:class=>"form-control application", :data => {validation: 'required'}}%>
<%= f.select :application_value,[],{}, {:class=>"form-control application_value"}%> <%= f.hidden_field :current_application_value, :class => "current_application_value" %>
<%= f.hidden_field :id, :class => "acl_id" %> <%= f.hidden_field :_destroy, :class => "policy_destroy" %> <%= link_to " X ","javascript:void(0);", {:class => "pull-left icon-delete_acl btn btn-xs btn-danger",style:"margin:18px 0;"} %>
<% bttn7 += 1 %> <%end%>

<%=acl.submit (@acl_group.id.blank? ? "Create ACL group" : "Update ACL group"),:class=>"btn btn-success create_network acl-sunmit-btn"%> <%= link_to "Cancel", acl_groups_path, :class => "btn btn-primary" %>
Note:
# - Selected Uplink type should be configured on the AP. You can only select either of Src Uplink type or Dst Uplink type. Uplink types are available only on firmware 2.0.2.28 and above.
## - Bitmask option is applicable only for IP (and not for domain).
### - Uplink types and Domain options are available only on firmware 2.0.2.28 and above.
<% end %>