DHCP: Add search box for static leases

This commit is contained in:
Michael Tremer
2015-05-28 14:49:41 +02:00
parent 81daa02876
commit 1554e8a3d3
3 changed files with 27 additions and 1 deletions

View File

@@ -857,12 +857,31 @@ print <<END
</tr>
</table>
</form>
<hr />
END
;
#Edited line number (KEY2) passed until cleared by 'save' or 'remove' or 'new sort order'
# Search for static leases
my $search_query = $dhcpsettings{'q'};
if (scalar @current2 >= 10) {
print <<END;
<form method="POST" action="#search">
<a name="search"></a>
<table width='100%'>
<tr>
<td>
<input type="text" name="q" value="$search_query">
<input type="submit" value="$Lang::tr{'search'}">
</td>
</tr>
</table>
</form>
END
}
print <<END
<hr />
<table width='100%' class='tbl'>
<tr>
<th width='20%' align='center'><a href='$ENV{'SCRIPT_NAME'}?FETHER'><b>$Lang::tr{'mac address'}</b></a></th>
@@ -918,6 +937,11 @@ foreach my $line (@current2) {
$gdesc = $Lang::tr{'click to enable'};
}
# Skip all entries that do not match the search query
if ($search_query ne "") {
next if (!grep(/$search_query/, @temp));
}
if ($dhcpsettings{'KEY2'} eq $key) {
print "<tr>";
$col="bgcolor='${Header::colouryellow}'";

View File

@@ -1950,6 +1950,7 @@
'save settings' => 'Einstellungen speichern',
'save-adv-options' => 'Erweiterte Optionen speichern',
'script name' => 'Skriptname:',
'search' => 'Suchen',
'secondary dns' => 'Sekundärer DNS:',
'secondary ntp server' => 'Sekundärer NTP-Server',
'secondary wins server address' => 'Sekundäre WINS-Server Adresse',

View File

@@ -1982,6 +1982,7 @@
'save settings' => 'Save settings',
'save-adv-options' => 'Save advanced options',
'script name' => 'Script name:',
'search' => 'Search',
'secondary dns' => 'Secondary DNS:',
'secondary ntp server' => 'Secondary NTP server',
'secondary wins server address' => 'Secondary WINS server address',