Commit 83a21034 authored by Marco Nett's avatar Marco Nett Committed by Michael Friedrich
Browse files

List problem widget is now ordered by state and colorized background

parent 0fc5fbbd
......@@ -88,9 +88,13 @@ SCHEDULER.every '10s', :first_in => 0 do |job|
# problem services
severity_stats = []
icinga.service_problems_severity.each do |name, state|
#severity_stats.push({ "label" => icinga.formatService(name), "color" => icinga.stateToColor(state.to_int, false)})
severity_stats.push({ "label" => icinga.formatService(name) })
severity_stats.push({
"label" => icinga.formatService(name),
"color" => icinga.stateToColor(state.to_int, false),
"state" => icinga.stateToString(state)
})
end
severity_stats = severity_stats.sort_by{|stat| stat["state"]}
puts "Severity: " + severity_stats.to_s
send_event('icinga-severity', {
......
<div class="header" data-bind="title"></div>
<div class="content">
<ol>
<li data-foreach-item="items">
<li data-foreach-item="items" data-bind-class="item.color">
<span class="label" data-bind-class="item.color" data-bind="item.label"></span>
<span class="value" data-bind-class="item.color" data-bind="item.value"></span>
</li>
</ol>
<ul class="list-nostyle">
<li data-foreach-item="items">
<li data-foreach-item="items" data-bind-class="item.color">
<span class="label" data-bind-class="item.color" data-bind="item.label"></span>
<span class="value" data-bind-class="item.color" data-bind="item.value"></span>
</li>
......
......@@ -15,6 +15,10 @@ $label-color: rgba(255, 255, 255, 0.7);
color: $label-color;
}
ul {
color: #ffffff;
}
ol {
list-style-position: inside;
}
......@@ -41,19 +45,19 @@ $label-color: rgba(255, 255, 255, 0.7);
}
.green {
color: #44bb77;
background-color: #44bb77;
font-size: 15px;
}
.yellow {
color: #ffaa44;
background-color: #ffaa44;
font-size: 15px;
}
.red {
color: #ff5566;
background-color: #ff5566;
font-size: 15px;
}
.purple {
color: #aa44ff;
background-color: #aa44ff;
font-size: 15px;
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment