mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-15 21:43:00 +02:00
dhcp.cgi: Update to naming of variables in css section
- After looking at other .cgi files I realised that I had named the variables based on their dhcp usage only. However colouryellow or color20 etc can be used not only in a row but also in a cell or a column. Rather than ending up with multiple copies of the same colour for rows, cells, columns etc I have simplified the variable names to just the colour. They can then be used in whatever situation is wanted. The rest of the cgi code will give the view of what structure the colour is being applied to. - This will limit the number of different css variables defined in the header.pl file Tested-by: Adolf Belka <adolf.belka@ipfire.org> Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
This commit is contained in:
committed by
Peter Müller
parent
83f31dcef2
commit
d3aec71828
@@ -43,19 +43,19 @@ $Header::viewsize = 150;
|
||||
$Header::errormessage = '';
|
||||
$Header::extraHead = <<END
|
||||
<style>
|
||||
.row-color20 {
|
||||
.color20 {
|
||||
background-color: $color{'color20'};
|
||||
}
|
||||
.row-color22 {
|
||||
.color22 {
|
||||
background-color: $color{'color22'};
|
||||
}
|
||||
.row-colouryellow {
|
||||
.colouryellow {
|
||||
background-color: $Header::colouryellow;
|
||||
}
|
||||
.cell-orange {
|
||||
.orange {
|
||||
background-color: orange;
|
||||
}
|
||||
.cell-red {
|
||||
.red {
|
||||
background-color: red;
|
||||
}
|
||||
</style>
|
||||
|
||||
20
html/cgi-bin/dhcp.cgi
Normal file → Executable file
20
html/cgi-bin/dhcp.cgi
Normal file → Executable file
@@ -844,11 +844,11 @@ foreach my $line (@current1) {
|
||||
}
|
||||
|
||||
if ($dhcpsettings{'KEY1'} eq $key) {
|
||||
print "<tr class='row-colouryellow'>";
|
||||
print "<tr class='colouryellow'>";
|
||||
} elsif ($key % 2) {
|
||||
print "<tr class='row-color22'>";
|
||||
print "<tr class='color22'>";
|
||||
} else {
|
||||
print "<tr class='row-color20'>";
|
||||
print "<tr class='color20'>";
|
||||
}
|
||||
|
||||
print <<END
|
||||
@@ -1078,13 +1078,13 @@ foreach my $line (@current2) {
|
||||
|
||||
if ($dhcpsettings{'KEY2'} eq $key) {
|
||||
print "<tr>";
|
||||
$col="class='row-colouryellow'";
|
||||
$col="class='colouryellow'";
|
||||
} elsif ($key % 2) {
|
||||
print "<tr>";
|
||||
$col="class='row-color20'";
|
||||
$col="class='color20'";
|
||||
} else {
|
||||
print "<tr>";
|
||||
$col="class='row-color22'";
|
||||
$col="class='color22'";
|
||||
}
|
||||
my $TAG0 = '';
|
||||
my $TAG1 = '';
|
||||
@@ -1100,10 +1100,10 @@ foreach my $line (@current2) {
|
||||
$TAG3 = '</b>';
|
||||
}
|
||||
if ($ipoutside{$temp[1]} > 0) {
|
||||
$TAG4 = "class='cell-orange'" if ($dhcpsettings{'KEY2'} ne $key);
|
||||
$TAG4 = "class='orange'" if ($dhcpsettings{'KEY2'} ne $key);
|
||||
}
|
||||
if ($ipinrange{$temp[1]} > 0) {
|
||||
$TAG4 = "class='cell-red'" if ($dhcpsettings{'KEY2'} ne $key);
|
||||
$TAG4 = "class='red'" if ($dhcpsettings{'KEY2'} ne $key);
|
||||
}
|
||||
|
||||
print <<END
|
||||
@@ -1166,9 +1166,9 @@ print <<END
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td class='base cell-orange'>$Lang::tr{'ip address outside subnets'}</td>
|
||||
<td class='base orange'>$Lang::tr{'ip address outside subnets'}</td>
|
||||
<td>  </td>
|
||||
<td class='base cell-red'>$Lang::tr{'dhcp fixed ip address in dynamic range'}</td>
|
||||
<td class='base red'>$Lang::tr{'dhcp fixed ip address in dynamic range'}</td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
$dup
|
||||
|
||||
Reference in New Issue
Block a user