diff --git a/DnsServerCore/www/js/dhcp.js b/DnsServerCore/www/js/dhcp.js
index 2d0d09ff..c4da7c68 100644
--- a/DnsServerCore/www/js/dhcp.js
+++ b/DnsServerCore/www/js/dhcp.js
@@ -39,22 +39,17 @@ function refreshDhcpLeases() {
url: "/api/listDhcpLeases?token=" + token,
success: function (responseJSON) {
var dhcpLeases = responseJSON.response.leases;
- var tableHtmlRows;
+ var tableHtmlRows = "";
- if (dhcpLeases.length < 1) {
- tableHtmlRows = "
| No Lease Found |
";
- }
- else {
- tableHtmlRows = "";
+ for (var i = 0; i < dhcpLeases.length; i++)
+ tableHtmlRows += "| " + htmlEncode(dhcpLeases[i].scope) + " | " + dhcpLeases[i].hardwareAddress + " | " + dhcpLeases[i].address + " | " + dhcpLeases[i].type + " | " + htmlEncode(dhcpLeases[i].hostName) + " | " + dhcpLeases[i].leaseObtained + " | " + dhcpLeases[i].leaseExpires + " |
";
- for (var i = 0; i < dhcpLeases.length; i++) {
- tableHtmlRows += "| " + htmlEncode(dhcpLeases[i].scope) + " | " + dhcpLeases[i].hardwareAddress + " | " + dhcpLeases[i].address + " | " + dhcpLeases[i].type + " | " + htmlEncode(dhcpLeases[i].hostName) + " | " + dhcpLeases[i].leaseObtained + " | " + dhcpLeases[i].leaseExpires + " |
";
- }
+ $("#tableDhcpLeasesBody").html(tableHtmlRows);
- tableHtmlRows += "| Total Leases: " + dhcpLeases.length + " |
";
- }
-
- $("#tableDhcpLeases").html(tableHtmlRows);
+ if (dhcpLeases.length > 0)
+ $("#tableDhcpLeasesFooter").html("| Total Leases: " + dhcpLeases.length + " |
");
+ else
+ $("#tableDhcpLeasesFooter").html("| No Lease Found |
");
divDhcpLeasesLoader.hide();
divDhcpLeases.show();
@@ -87,30 +82,26 @@ function refreshDhcpScopes(checkDisplay) {
url: "/api/listDhcpScopes?token=" + token,
success: function (responseJSON) {
var dhcpScopes = responseJSON.response.scopes;
- var tableHtmlRows;
+ var tableHtmlRows = "";
- if (dhcpScopes.length < 1) {
- tableHtmlRows = "| No Scope Found |
";
- }
- else {
- tableHtmlRows = "";
+ for (var i = 0; i < dhcpScopes.length; i++) {
+ tableHtmlRows += "| " + htmlEncode(dhcpScopes[i].name) + " | " + dhcpScopes[i].startingAddress + " - " + dhcpScopes[i].endingAddress + " " + dhcpScopes[i].subnetMask + " | " + dhcpScopes[i].networkAddress + " " + dhcpScopes[i].broadcastAddress + " | " + (dhcpScopes[i].interfaceAddress == null ? "" : dhcpScopes[i].interfaceAddress) + " | ";
+ tableHtmlRows += "";
- for (var i = 0; i < dhcpScopes.length; i++) {
- tableHtmlRows += " |
| " + htmlEncode(dhcpScopes[i].name) + " | " + dhcpScopes[i].startingAddress + " - " + dhcpScopes[i].endingAddress + " " + dhcpScopes[i].subnetMask + " | " + dhcpScopes[i].networkAddress + " " + dhcpScopes[i].broadcastAddress + " | " + (dhcpScopes[i].interfaceAddress == null ? "" : dhcpScopes[i].interfaceAddress) + " | ";
- tableHtmlRows += "";
+ if (dhcpScopes[i].enabled)
+ tableHtmlRows += "";
+ else
+ tableHtmlRows += "";
- if (dhcpScopes[i].enabled)
- tableHtmlRows += "";
- else
- tableHtmlRows += "";
-
- tableHtmlRows += " |
";
- }
-
- tableHtmlRows += "| Total Scopes: " + dhcpScopes.length + " |
";
+ tableHtmlRows += "";
}
- $("#tableDhcpScopes").html(tableHtmlRows);
+ $("#tableDhcpScopesBody").html(tableHtmlRows);
+
+ if (dhcpScopes.length > 0)
+ $("#tableDhcpScopesFooter").html("| Total Scopes: " + dhcpScopes.length + " |
");
+ else
+ $("#tableDhcpScopesFooter").html("| No Scope Found |
");
divDhcpViewScopesLoader.hide();
divDhcpViewScopes.show();