Fix pieChart layout and add indicator for truncated piecharts

This commit is contained in:
Matthias Jentsch 2015-02-03 17:33:30 +01:00
parent 38ad802bd5
commit 2f254851e3
5 changed files with 11 additions and 12 deletions

View File

@ -57,8 +57,13 @@ class Zend_View_Helper_Perfdata extends Zend_View_Helper_Abstract
}
if ($limit > 0) {
$count = max (count($table), count ($results));
$table = array_slice ($table, 0, $limit);
$results = array_slice ($results, 0, $limit);
if ($count > $limit) {
$mess = sprintf(t('%d more ...'), $count - $limit);
$results[] = '<span title="' . $mess . '">...</span>';
}
}
if ($compact) {

View File

@ -65,7 +65,7 @@ foreach ($services as $service):
</td>
<td>
<div class="sparkline-box"><?= $this->perfdata($service->service_perfdata, true, 8) ?></div>
<div class="sparkline-box"><?= $this->perfdata($service->service_perfdata, true, 8) ?> </div>
<?php if (!$service->service_handled && $service->service_state > 0): ?>
<?= $this->icon('attention-alt', $this->translate('Unhandled')) ?>

View File

@ -64,15 +64,6 @@ table.action td a:hover {
text-decoration: underline;
}
table.action span.sparkline, table.action img.inlinepie {
margin: 0.5em 0.25em 0.5em 0.25em;
float:right;
}
.dashboard table.action span.sparkline, .dashboard table.action img.inlinepie {
margin: 0em 0.25em 0em 0.25em;
}
/* END of Action table */

View File

@ -287,7 +287,8 @@ li li .badge {
.sparkline-box {
position: relative;
top: -9px;
top: -3px;
float: right;
}
.dashboard .sparkline-box {
@ -299,4 +300,6 @@ li li .badge {
height: 12px;
position: relative;
top: 4px;
margin: 0em 0em 0em 0.1em;
}

View File

@ -15,7 +15,7 @@
Sparkline.prototype.onRendered = function(evt) {
var el = evt.target;
$('span.sparkline', el).each(function(i, element) {
$('.sparkline', el).each(function(i, element) {
// read custom options
var $spark = $(element);
var title = $spark.attr('title');