webapp: implemented new DHCP scope options.

This commit is contained in:
Shreyas Zare
2020-10-24 16:58:15 +05:30
parent 08f8e71cf1
commit 31269aff9b
2 changed files with 35 additions and 8 deletions

View File

@@ -1180,11 +1180,27 @@
</div>
<div class="form-group">
<label for="txtDhcpScopeNextServerAddress" class="col-sm-3 control-label">Next Server Address</label>
<label for="txtDhcpScopeServerAddress" class="col-sm-3 control-label">Bootstrap Server Address</label>
<div class="col-sm-3">
<input type="text" class="form-control" id="txtDhcpScopeNextServerAddress" placeholder="Next Server Address">
<input type="text" class="form-control" id="txtDhcpScopeServerAddress" placeholder="Bootstrap Server Address">
</div>
<div class="col-sm-offset-3 col-sm-8" style="padding-top: 5px;">The next bootstrap server IP address to be used by the clients. If not specified, the DHCP server's IP address is used.</div>
<div class="col-sm-offset-3 col-sm-8" style="padding-top: 5px;">The bootstrap TFTP server IP address to be used by the clients. If not specified, the DHCP server's IP address is used.</div>
</div>
<div class="form-group">
<label for="txtDhcpScopeServerHostName" class="col-sm-3 control-label">Bootstrap Server Host Name</label>
<div class="col-sm-3">
<input type="text" class="form-control" id="txtDhcpScopeServerHostName" placeholder="Bootstrap Server Host Name">
</div>
<div class="col-sm-offset-3 col-sm-8" style="padding-top: 5px;">The optional bootstrap TFTP server host name to be used by the clients to identify the TFTP server.</div>
</div>
<div class="form-group">
<label for="txtDhcpScopeBootFileName" class="col-sm-3 control-label">Boot File Name</label>
<div class="col-sm-3">
<input type="text" class="form-control" id="txtDhcpScopeBootFileName" placeholder="Bootstrap File Name">
</div>
<div class="col-sm-offset-3 col-sm-8" style="padding-top: 5px;">The boot file name stored on the bootstrap TFTP server to be used by the clients.</div>
</div>
<div class="form-group">

View File

@@ -191,6 +191,9 @@ function clearDhcpScopeForm() {
$("#txtDhcpScopeOfferDelayTime").val("0");
$("#txtDhcpScopeDomainName").val("");
$("#txtDhcpScopeDnsTtl").val("900");
$("#txtDhcpScopeServerAddress").val("");
$("#txtDhcpScopeServerHostName").val("");
$("#txtDhcpScopeBootFileName").val("");
$("#txtDhcpScopeRouterAddress").val("");
$("#chkUseThisDnsServer").prop("checked", false);
$('#txtDhcpScopeDnsServers').prop('disabled', false);
@@ -247,8 +250,14 @@ function showEditDhcpScope(scopeName) {
$("#txtDhcpScopeDnsTtl").val(responseJSON.response.dnsTtl);
if (responseJSON.response.nextServerAddress != null)
$("#txtDhcpScopeNextServerAddress").val(responseJSON.response.nextServerAddress);
if (responseJSON.response.serverAddress != null)
$("#txtDhcpScopeServerAddress").val(responseJSON.response.serverAddress);
if (responseJSON.response.serverHostName != null)
$("#txtDhcpScopeServerHostName").val(responseJSON.response.serverHostName);
if (responseJSON.response.bootFileName != null)
$("#txtDhcpScopeBootFileName").val(responseJSON.response.bootFileName);
if (responseJSON.response.routerAddress != null)
$("#txtDhcpScopeRouterAddress").val(responseJSON.response.routerAddress);
@@ -318,7 +327,9 @@ function saveDhcpScope() {
var domainName = $("#txtDhcpScopeDomainName").val();
var dnsTtl = $("#txtDhcpScopeDnsTtl").val();
var nextServerAddress = $("#txtDhcpScopeNextServerAddress").val();
var serverAddress = $("#txtDhcpScopeServerAddress").val();
var serverHostName = $("#txtDhcpScopeServerHostName").val();
var bootFileName = $("#txtDhcpScopeBootFileName").val();
var routerAddress = $("#txtDhcpScopeRouterAddress").val();
var useThisDnsServer = $("#chkUseThisDnsServer").prop('checked');
@@ -344,8 +355,8 @@ function saveDhcpScope() {
HTTPRequest({
url: "/api/setDhcpScope?token=" + token + "&name=" + encodeURIComponent(name) + (newName == null ? "" : "&newName=" + encodeURIComponent(newName)) + "&startingAddress=" + encodeURIComponent(startingAddress) + "&endingAddress=" + encodeURIComponent(endingAddress) + "&subnetMask=" + encodeURIComponent(subnetMask) +
"&leaseTimeDays=" + leaseTimeDays + "&leaseTimeHours=" + leaseTimeHours + "&leaseTimeMinutes=" + leaseTimeMinutes + "&offerDelayTime=" + offerDelayTime + "&domainName=" + encodeURIComponent(domainName) + "&dnsTtl=" + dnsTtl + "&nextServerAddress=" + encodeURIComponent(nextServerAddress) + "&routerAddress=" + encodeURIComponent(routerAddress) +
"&useThisDnsServer=" + useThisDnsServer + (useThisDnsServer ? "" : "&dnsServers=" + encodeURIComponent(dnsServers)) + "&winsServers=" + encodeURIComponent(winsServers) + "&ntpServers=" + encodeURIComponent(ntpServers) +
"&leaseTimeDays=" + leaseTimeDays + "&leaseTimeHours=" + leaseTimeHours + "&leaseTimeMinutes=" + leaseTimeMinutes + "&offerDelayTime=" + offerDelayTime + "&domainName=" + encodeURIComponent(domainName) + "&dnsTtl=" + dnsTtl + "&serverAddress=" + encodeURIComponent(serverAddress) + "&serverHostName=" + encodeURIComponent(serverHostName) + "&bootFileName=" + encodeURIComponent(bootFileName) +
"&routerAddress=" + encodeURIComponent(routerAddress) + "&useThisDnsServer=" + useThisDnsServer + (useThisDnsServer ? "" : "&dnsServers=" + encodeURIComponent(dnsServers)) + "&winsServers=" + encodeURIComponent(winsServers) + "&ntpServers=" + encodeURIComponent(ntpServers) +
"&staticRoutes=" + encodeURIComponent(staticRoutes) + "&exclusions=" + encodeURIComponent(exclusions) + "&reservedLeases=" + encodeURIComponent(reservedLeases) + "&allowOnlyReservedLeases=" + allowOnlyReservedLeases,
success: function (responseJSON) {
refreshDhcpScopes();