Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Put the state of a host as it's color on the quicklook.

  • Loading branch information...
commit 7b69706f61f20d4d1c95c4c8ea795350305aee0a 1 parent 8f86701
Mike Cooper authored
View
8 railroad/railroad/viewhosts/views.py
@@ -363,6 +363,14 @@ def index(request):
stat, obj = parse()
services = stat['service']
+ hosts = stat['host']
+
+ host_status = {}
+ for h in hosts:
+ host_status[h['host_name']] = h['current_state']
+
+ for s in services:
+ s['host_state'] = host_status[s['host_name']]
context_data = {'services': services}
context_data = add_hostlist(stat, obj, context_data)
View
8 railroad/static/css/style.css
@@ -463,10 +463,16 @@ fieldset {
}
#quicklook ul ul { list-style: circle; }
#quicklook ul ul ul { list-style: square; }
+#quicklook li {
+ margin: 2px 0;
+}
+
#quicklook .host { cursor: pointer; font-size: 1.1em; }
-#quicklook .status_text { cursor: pointer; font-size: 1.2em; font-weight: bold; }
+#quicklook .status_text {
+ cursor: pointer; font-size: 1.2em; font-weight: bold;
+}
.state_ok { background-color: #BFB !important; }
.state_warning { background-color: #FFB !important; }
.state_critical { background-color: #F64 !important; }
View
4 railroad/templates/index.html
@@ -38,7 +38,9 @@
{% for host in hosts_in_state %}
<li>
<span class="host">
- {{ host.grouper }} -
+ <span class="state_{{host.list.0.host_state|state_name|lower}}">
+ {{ host.grouper }}
+ </span> -
{{host.list|length}} service{{state.list|length|pluralize}}
</span>
<a href="/railroad/configurator/host/{{host.grouper}}">
Please sign in to comment.
Something went wrong with that request. Please try again.