Hi Sebastien,
Thanks for the patch. I have tested this out and found a few quirks with it.
The table for that section is set at 100%. The original columns then added up to 100%.
Your patch added in an additional column at 20% making the total width now 120% but the overall table is still set at 100%. I think you need to adjust the width of each of the columns including the new column to come to a total of 100%.
In your line for the heading you have a closing <a/> tag for a hyperlink but there is no equivalent opening <a> tag in the line and no hyperlink defined. I am not sure if this is giving any problems but the closing <a/> tag is not needed there as there is no hyperlink.
When evaluating your patch I found that your Hostname column expands to keep the hostname on one line. This forces the other columns (next-server, filename and root path) to be squeezed up and made into multiple line entries. I think the hostname column should also be allowed to be a multi line entry to balance the columns up.
Eventually the other columns reach a min width and then the table expands outside of the overall frame of the IPFire page. This may be due to the columns totalling more than 100% but I am not familiar enough with html coding to be certain of that.
The line
if (!$rname || $rname eq "") { $rname = $Lang::tr{'lookup failed'}; }
has a Language lookup but the phrase 'lookup failed' has not been added into the English, German or French Language files.
Regards,
Adolf.
On 09/11/2023 22:36, Sebastien GISLAIN wrote:
html/cgi-bin/dhcp.cgi | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/html/cgi-bin/dhcp.cgi b/html/cgi-bin/dhcp.cgi index f45703f0b..aabf565d7 100755 --- a/html/cgi-bin/dhcp.cgi +++ b/html/cgi-bin/dhcp.cgi @@ -21,6 +21,7 @@
use strict; use experimental 'smartmatch'; +use IO::Socket;
# enable only the following on debugging purpose #use warnings; @@ -1009,6 +1010,7 @@ print <<END
<tr> <th width='20%' align='center'><a href='$ENV{'SCRIPT_NAME'}?FETHER'><b>$Lang::tr{'mac address'}</b></a></th> <th width='20%' align='center'><a href='$ENV{'SCRIPT_NAME'}?FIPADDR'><b>$Lang::tr{'ip address'}</b></a></th> + <th width='20%' align='center'><b>$Lang::tr{'hostname'}</b></a></th> <th width='15%' align='center'><b>$Lang::tr{'remark'}</b></th> <th width='15%' class='boldbase' align='center'><b>next-server</b></th> <th width='15%' class='boldbase' align='center'><b>filename</b></th> @@ -1106,9 +1108,14 @@ foreach my $line (@current2) { $TAG4 = "class='red'" if ($dhcpsettings{'KEY2'} ne $key); }
- # resolved name (if exists)
- my $iaddr = inet_aton($temp[1]);
- my $rname = gethostbyaddr($iaddr, AF_INET);
- if (!$rname || $rname eq "") { $rname = $Lang::tr{'lookup failed'}; } print <<END
<td align='center' $col>$TAG2$temp[0]$TAG3</td> <td align='center' $TAG4 $col>$TAG0$temp[1]$TAG1</td>
+<td align='center' $col>$rname </td>
<td align='center' $col>$temp[6] </td> <td align='center' $col>$temp[3] </td> <td align='center' $col>$temp[4] </td>