From 223244b503743a0351d6746079d261b38fef7fb8 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Sun, 18 May 2014 16:16:08 +0200 Subject: Reports/templatetags: mark special hosts in grid view Highligh additional special hosts in the grid view. Stale hosts get a grey background and clean hosts with extra packages get a blue background. --- src/lib/Bcfg2/Reporting/templatetags/bcfg2_tags.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/lib') diff --git a/src/lib/Bcfg2/Reporting/templatetags/bcfg2_tags.py b/src/lib/Bcfg2/Reporting/templatetags/bcfg2_tags.py index 489682f30..ceb9f5d91 100644 --- a/src/lib/Bcfg2/Reporting/templatetags/bcfg2_tags.py +++ b/src/lib/Bcfg2/Reporting/templatetags/bcfg2_tags.py @@ -318,7 +318,11 @@ def determine_client_state(entry): dirty. If the client is reporting dirty, this will figure out just _how_ dirty and adjust the color accordingly. """ + if isstale(entry.timestamp): + return "stale-lineitem" if entry.state == 'clean': + if entry.extra_count > 0: + return "extra-lineitem" return "clean-lineitem" bad_percentage = 100 * (float(entry.bad_count) / entry.total_count) -- cgit v1.2.3-1-g7c22