<%=form_for @inventory, as: :router_inventories, url: inventory_path(@inventory), method: :put, html: { role: "form", class: "router-inventories-form"} do |f|%>
<% if (can? :manage, @inventory) || (can? :update, @inventory) %>
<%= f.label :name, "Name"%>
<%= f.text_field :name, :class=>"form-control", :placeholder=>"Name", "data-validation" => 'required' %>
<% end %>
<%#if !["3", "4"].include? @inventory.hardware_part.try(:part_number) -%>
<%#= f.label :channel, "Channel" %>
<%#= f.select :channel,(1..11).to_a, {}, {:class=>"form-control channel"} %>
<% if (can? :manage, @inventory)%>
<% if !@inventory.switch? %>
<%= f.label :enable_gre_on_lan, "L2oGRE on LAN" %>
<%= f.check_box :enable_gre_on_lan %> Enable
<%= f.text_field :gre ,:class=>"form-control gre", :placeholder=>"IP Address", "data-validation" => 'required ip' %>
<%=f.label :enable_dhcp_on_lan, "DHCP Relay on LAN"%>
<%= f.check_box :enable_dhcp_on_lan %> Enable
<%= f.text_field :dhcp_relay, :class=>"form-control dhcp_relay", :placeholder=>"IP Address", "data-validation" => 'required ip' %>
<%# if !["3", "4"].include? @inventory.hardware_part.try(:part_number) -%>
<%#= f.label :power, "Power(dbm)" %>
<%#= f.select :power, Array(1..20).reverse!,{},{:class=>"form-control power"}%>
<%# end -%>
Uplink Type |
IP Type |
Primary |
Set LB(%) |
Actions |
<% i=0 %>
<%= f.fields_for :uplinks, @inventory.uplinks do |link| %>
<%=@uplink_types[link.object.uplink_type.to_s] %> |
<%= type = link.object.uplink_type == '4' ? '-' : link.object.ip_type %> |
<%= check_box_tag "is_primary", 1, link.object.is_primary, { class: 'check_primary' } %> |
' step='10' max='100' min='0'/> |
|
<%= link.hidden_field :uplink_name %>
<%= link.hidden_field :id %>
<%= link.hidden_field :uplink_type %>
<%= link.hidden_field :wl_association %>
<%= link.hidden_field :wds_enabled %>
<%= link.hidden_field :wl_wpa_key %>
<%= link.hidden_field :wl_band %>
<%= link.hidden_field :wl_ssid_name %>
<%= link.hidden_field :wl_ssid_uniqe_id %>
<%= link.hidden_field :mo_service %>
<%= link.hidden_field :mo_apn %>
<%= link.hidden_field :uplink_module %>
<%= link.hidden_field :mo_device %>
<%= link.hidden_field :mo_proto_key %>
<%= link.hidden_field :mo_is_advanced %>
<%= link.hidden_field :mo_username %>
<%= link.hidden_field :mo_password %>
<%= link.hidden_field :_destroy %>
<%= link.hidden_field :ip_type %>
<%= link.hidden_field :is_primary, :class => "is-primary-field" %>
<%= link.hidden_field :ip %>
<%= link.hidden_field :gateway %>
<%= link.hidden_field :primary_dns %>
<%= link.hidden_field :secondary_dns %>
<%= link.hidden_field :subnet_mask %>
<%= link.hidden_field :pppoe_username %>
<%= link.hidden_field :pppoe_password %>
<%= link.hidden_field :dns_mode %>
<%= link.hidden_field :hb_type %>
<%= link.hidden_field :hb_interval %>
<%= link.hidden_field :ttl %>
<%= link.hidden_field :operator %>
<%= link.hidden_field :operator_band %>
<%= hidden_field_tag "router_inventories[uplinks_attributes][#{i}][mwan3_cfg][up_count]", link.object.mwan3_cfg["up_count"] %>
<%= hidden_field_tag "router_inventories[uplinks_attributes][#{i}][mwan3_cfg][down_count]", link.object.mwan3_cfg["down_count"] %>
<%= hidden_field_tag "router_inventories[uplinks_attributes][#{i}][mwan3_cfg][quality_check]", link.object.mwan3_cfg["quality_check"]%>
<%= hidden_field_tag "router_inventories[uplinks_attributes][#{i}][mwan3_cfg][failure_latency]", link.object.mwan3_cfg["failure_latency"] %>
<%= hidden_field_tag "router_inventories[uplinks_attributes][#{i}][mwan3_cfg][recovery_latency]", link.object.mwan3_cfg["recovery_latency"] %>
|
<% i += 1%>
<% end %>
<% if @inventory.hardware_part.blank? || ["3","5","6","9","7","10","11","19","20","23","24","25","28","29","30","32","34","35","39"].include?(@inventory.hardware_part.try(&:part_number)) %>
<%= f.label :enable_lb, "Enable LB" %>
<%= f.check_box :enable_lb ,{ class: "form-control enable_lb"} %>
<% end %>
<%# if ["6", "9"].include? @inventory.hardware_part.try(:part_number) %>
<% if false %>
<%=f.label :retry_count, "Retry Count"%>
<%= f.text_field :retry_count,:class=>"form-control", :type=>'number' ,:placeholder=>"Retry Count", :max=>'100', :min=>'0',:data => { :validation => "phone-only-integer" } %>
<%=f.label :retry_interval, "Retry Interval(seconds)"%>
<%= f.text_field :retry_interval ,:type=>'number' ,:max=>'100', :min=>'0',:class=>"form-control",:placeholder=>"Retry Interval(seconds)",:data => { :validation => "phone-only-integer " } %>
<%=f.label :retry_ip1, "Retry Primary IP"%>
<%= f.text_field :retry_ip1, :class=>"form-control ip-mask ip", :placeholder=>"Retry primary IP", :data => { :validation => "required ip " } %>
<%=f.label :retry_ip2, "Retry Secondary IP"%>
<%= f.text_field :retry_ip2 ,:class=>"form-control ip-mask ip",:placeholder=>"Retry Secondary IP" , :data => {:validation =>'required ip'}%>
<% end %>
<% end %>
<%=f.label :notes, "Notes"%>
<%= f.text_area :notes,:class=>"form-control", :placeholder=>"Notes"%>
<%=f.label :tag_list, "Tags"%>
<%= f.text_field :tag_list ,:class=>"form-control tag_list"%>
<%= f.label :enable_pci, "PCI Compliance" %>
<%= f.check_box :enable_pci %> Enable
Note:Below details can be set automatically by dragging marker on map.
<%=f.label :address, "Address Line"%>
<%= f.text_field :address,:class=>"form-control", :placeholder=>"Address"%>
<%= hidden_field_tag "old_address", :value => f.object.address %>
<%=f.label :city, "City"%>
<%= f.text_field :city,:class=>"form-control", :placeholder=>"City"%>
<%= hidden_field_tag "old_city", :value => f.object.city %>
<%=f.label :country, "Country"%>
<%= f.text_field :country, :class => "form-control", placeholder: "Enter country" %>
<%= hidden_field_tag "old_country", :value => f.object.country %>
<%= f.label :state, "State / Province" %>
<%= f.text_field :state, :class=>"form-control", placeholder: "Enter state / province" %>
<%= hidden_field_tag "old_state", :value => f.object.state %>
<%= f.label :zipcode, "Zipcode"%>
<%= f.text_field :zipcode, :class=>"form-control", :placeholder=>"Zipcode" %>
<%= hidden_field_tag "old_zipcode", :value => f.object.zipcode %>
<%= f.label :latitude, "Latitude"%>
<%= f.text_field :latitude, :class=>"form-control", :placeholder=>"Latitude" ,"data-validation" => 'location-validation','data-validation-help' =>"eg..74.2589,-26.5987"%>
<%= hidden_field_tag "old_latitude", :value => f.object.latitude %>
<%= f.label :longitude, "Longitude"%>
<%= f.text_field :longitude, :class=>"form-control", :placeholder=>"Longitude" ,"data-validation" => 'location-validation','data-validation-help' =>"eg..74.2589,-26.5987"%>
<%= hidden_field_tag "old_longitude", :value => f.object.longitude %>
<%end %>
<%= f.button "Save",:class => "btn btn-success" %>
<%= link_to "Cancel",inventory_path(@inventory),:class => "btn btn-primary cancel" %>
<% end %>