diff --git a/static/monit-dashboard.css b/static/monit-dashboard.css index 7459367..348d641 100644 --- a/static/monit-dashboard.css +++ b/static/monit-dashboard.css @@ -10,6 +10,11 @@ th { padding: 10px; } +.th-custom { + padding: 10px; + font-weight: 300; +} + td { border-bottom: 1px solid #ccc; padding: 15px; diff --git a/templates/index.html b/templates/index.html index 437c40b..f210aec 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,5 +1,19 @@ $def with (output, now) +$def row_error(check): + + $check + + + +$def row_ok(check): + + $check + + + $ errors = 0 $ color = "green" @@ -34,27 +48,41 @@ $def with (output, now) $for env, services in output[server]['result'].items(): - - - $env - - - + $ errors = 0 $for check in services.keys(): - $ isError = services.get(check) - $if isError != 0: - - $check - - - $else: - - $check - - - + $ isError = services.get(check) + $if isError != 0: + $ errors=errors+1 + $if errors > 0: + $ color = "red" + + + $env + + + + $for check in services.keys(): + $ isError = services.get(check) + $if isError != 0: + $:row_error(check) + $else: + $:row_ok(check) + + $else: + $ color = "green" + + + $env + + + + $for check in services.keys(): + $ isError = services.get(check) + $if isError != 0: + $:row_error(check) + $else: + $:row_ok(check) + $else: @@ -79,17 +107,9 @@ $def with (output, now) $for check in services.keys(): $ isError = services.get(check) $if isError != 0: - - $check - - + $:row_error(check) $else: - - $check - - + $:row_ok(check)