Revision 05ed57c1
Added by Sean Handley about 10 years ago
app/assets/javascripts/host_edit.js | ||
---|---|---|
interface_domain_selected(this);
|
||
});
|
||
|
||
$(document).on('click', '#suggest_new_ip', function (e) {
|
||
$('#host_ip').val('')
|
||
interface_subnet_selected($('#host_subnet_id'));
|
||
e.preventDefault();
|
||
});
|
||
|
||
$(document).on('change', '.interface_subnet', function () {
|
||
interface_subnet_selected(this);
|
||
});
|
app/views/hosts/_unattended.html.erb | ||
---|---|---|
<span id="subnet_select">
|
||
<%= render 'common/domain', :item => @host %>
|
||
</span>
|
||
<%= text_f f, :ip, :autocomplete => 'off',
|
||
<%= text_f f, :ip, :autocomplete => 'off', :help_block => link_to("Suggest new", '#', :id => 'suggest_new_ip'),
|
||
:help_inline => popover(_("IP address auto-suggest"), _("An IP address will be auto-suggested if you have a DHCP-enabled Smart Proxy on the subnet selected above.<br/><br/>The IP address can be left blank when:<br/><ul><li>provisioning tokens are enabled</li><li>the domain does not manage DNS</li><li>the subnet does not manage reverse DNS</li><li>and the subnet does not manage DHCP reservations</li></ul>"), :title => _("IP address for this host")).html_safe %>
|
||
<%= f.fields_for :interfaces do |interfaces| %>
|
||
<%= render 'hosts/interfaces', :f => interfaces %>
|
Also available in: Unified diff
fixes #5157 - allowed to suggest new IP on the new host form