Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Highlight online+active in results #948

Open
wants to merge 1 commit into from

3 participants

@stilez

"class=grey" isn't really useful with a significant number of temporary leases, because you can't quickly pick out by eye, the few current or active leases from a long list of inactive or past leases.

This highlights the "online" and "active" leases that currently exist, so it's much easier to see the active or online devices in the leases table

@stilez stilez Highlight online+active in results
"class=grey" isn't really useful with a significant number of temporary leases, because you can't quickly pick out by eye, the few current or active leases from a long list of inactive or past leases.

This highlights the "online" and "active" leases that currently exist, so it's much easier to see the active or online devices in the leases table
f92b888
@wagonza

It would better to just add a class and adjust all.css instead of inline css.

@stilez

Just add ".highlight_green" class or something to all.css? Do I need to do anything to other css files or themes?

@wagonza

yeah and ideally update all other themes as well. Might be better to choose a better name incase the other themes want to use a different colour.

@rbgarga
Owner

@stilez Do you have plans to make changes suggested by @wagonza? Otherwise this can be closed.

@stilez

I'd like to, but not confident enough about how pfSense css formating is done (which files, at what level, etc) to be sure of it.

If someone can reply here with css suitable for highlighting online/active items in a table and the file/s to add it to, or add the css to the themes file/s so that all I have to do is modify the PR to add the newly added class to any active leases, I can do the rest happily.

I'm assuming it would ideally be an extra css class in the theme css file/s as described above, not just in the leases page, since the same improvement could conceptually apply to other tables with active/inactive members, and should be re-themable by user themes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 19, 2014
  1. @stilez

    Highlight online+active in results

    stilez authored
    "class=grey" isn't really useful with a significant number of temporary leases, because you can't quickly pick out by eye, the few current or active leases from a long list of inactive or past leases.
    
    This highlights the "online" and "active" leases that currently exist, so it's much easier to see the active or online devices in the leases table
This page is out of date. Refresh to see the latest.
Showing with 12 additions and 4 deletions.
  1. +12 −4 usr/local/www/status_dhcp_leases.php
View
16 usr/local/www/status_dhcp_leases.php
@@ -343,9 +343,17 @@ function remove_duplicate($array, $field)
if ($data['act'] != "active" && $data['act'] != "static") {
$fspans = "<span class=\"gray\">";
$fspane = "</span>";
- } else {
+ } else
$fspans = $fspane = "";
- }
+ if ($data['online'] == "online")
+ $fspans2 = 'style="background-color:#00ff00"';
+ else
+ $fspans2 = "";
+ if ($data['act'] == "active")
+ $fspans3 = 'style="background-color:#00ff00"';
+ else
+ $fspans3 = "";
+
$lip = ip2ulong($data['ip']);
if ($data['act'] == "static") {
foreach ($config['dhcpd'] as $dhcpif => $dhcpifconf) {
@@ -396,8 +404,8 @@ function remove_duplicate($array, $field)
echo "<td class=\"listr\">{$fspans} n/a {$fspane}&nbsp;</td>\n";
echo "<td class=\"listr\">{$fspans} n/a {$fspane}&nbsp;</td>\n";
}
- echo "<td class=\"listr\">{$fspans}{$data['online']}{$fspane}&nbsp;</td>\n";
- echo "<td class=\"listr\">{$fspans}{$data['act']}{$fspane}&nbsp;</td>\n";
+ echo "<td class=\"listr\" {$fspans2}>{$data['online']}&nbsp;</td>\n";
+ echo "<td class=\"listr\" {$fspans3}>{$data['act']}&nbsp;</td>\n";
if ($data['type'] == "dynamic") {
echo "<td valign=\"middle\"><a href=\"services_dhcp_edit.php?if={$data['if']}&mac={$data['mac']}&hostname={$data['hostname']}\">";
Something went wrong with that request. Please try again.