diff --git a/modules/monitoring/application/controllers/TimelineController.php b/modules/monitoring/application/controllers/TimelineController.php index c178fb6d2..99a56cbec 100644 --- a/modules/monitoring/application/controllers/TimelineController.php +++ b/modules/monitoring/application/controllers/TimelineController.php @@ -46,10 +46,47 @@ class TimelineController extends Controller ) ), array( - 'notify' => array( - 'class' => 'timeline-notification', - 'detailUrl' => $detailUrl, - 'label' => mt('monitoring', 'Notifications') + 'notification_ack' => array( + 'class' => 'timeline-notification', + 'detailUrl' => $detailUrl, + 'label' => mt('monitoring', 'Notifications'), + 'groupBy' => 'notification_*' + ), + 'notification_flapping' => array( + 'class' => 'timeline-notification', + 'detailUrl' => $detailUrl, + 'label' => mt('monitoring', 'Notifications'), + 'groupBy' => 'notification_*' + ), + 'notification_flapping_end' => array( + 'class' => 'timeline-notification', + 'detailUrl' => $detailUrl, + 'label' => mt('monitoring', 'Notifications'), + 'groupBy' => 'notification_*' + ), + 'notification_dt_start' => array( + 'class' => 'timeline-notification', + 'detailUrl' => $detailUrl, + 'label' => mt('monitoring', 'Notifications'), + 'groupBy' => 'notification_*' + ), + 'notification_dt_end' => array( + 'class' => 'timeline-notification', + 'detailUrl' => $detailUrl, + 'label' => mt('monitoring', 'Notifications'), + 'groupBy' => 'notification_*' + ), + 'notification_custom' => array( + 'class' => 'timeline-notification', + 'detailUrl' => $detailUrl, + 'label' => mt('monitoring', 'Notifications'), + 'groupBy' => 'notification_*' + ), + 'notification_state' => array( + 'class' => 'timeline-notification', + 'detailUrl' => $detailUrl, + 'label' => mt('monitoring', 'Notifications'), + 'groupBy' => 'notification_*' ), 'hard_state' => array( 'class' => 'timeline-hard-state', diff --git a/modules/monitoring/library/Monitoring/Timeline/TimeLine.php b/modules/monitoring/library/Monitoring/Timeline/TimeLine.php index bfec989bd..d1a98fc40 100644 --- a/modules/monitoring/library/Monitoring/Timeline/TimeLine.php +++ b/modules/monitoring/library/Monitoring/Timeline/TimeLine.php @@ -208,6 +208,10 @@ class TimeLine implements IteratorAggregate { $groupInfo = array(); foreach ($this->identifiers as $name => $attributes) { + if (isset($attributes['groupBy'])) { + $name = $attributes['groupBy']; + } + $groupInfo[$name]['class'] = $attributes['class']; $groupInfo[$name]['label'] = $attributes['label']; } @@ -436,16 +440,28 @@ class TimeLine implements IteratorAggregate foreach ($data as $timestamp => $count) { $dateTime = new DateTime(); $dateTime->setTimestamp($timestamp); - $groups[$timestamp][$name] = TimeEntry::fromArray( - array_merge( - $this->identifiers[$name], + + $groupName = $name; + if (isset($this->identifiers[$name]['groupBy'])) { + $groupName = $this->identifiers[$name]['groupBy']; + } + + if (isset($groups[$timestamp][$groupName])) { + $groups[$timestamp][$groupName]->setValue( + $groups[$timestamp][$groupName]->getValue() + $count + ); + } else { + $groups[$timestamp][$groupName] = TimeEntry::fromArray( array( - 'name' => $name, + 'name' => $groupName, 'value' => $count, - 'dateTime' => $dateTime + 'dateTime' => $dateTime, + 'class' => $this->identifiers[$name]['class'], + 'detailUrl' => $this->identifiers[$name]['detailUrl'], + 'label' => $this->identifiers[$name]['label'] ) - ) - ); + ); + } } } diff --git a/modules/monitoring/public/css/module.less b/modules/monitoring/public/css/module.less index 57b80ebfe..7e079adc1 100644 --- a/modules/monitoring/public/css/module.less +++ b/modules/monitoring/public/css/module.less @@ -503,21 +503,38 @@ div.timeline { } div.circle-box { + // width: inline-style; height: 100%; margin-right: 0.5em; position: relative; float: left; div.outer-circle { + // width: inline-style; + // height: inline-style; position: absolute; top: 50%; + // margin-top: inline-style; + + &.extrapolated { + border-width: 2px; + border-style: dotted; + //border-color: inline-style; + border-radius: 100%; + // background-color: inline-style; + } a.inner-circle { + // width: inline-style; + // height: inline-style; display: block; position: absolute; top: 50%; left: 50%; + // margin-top: inline-style; + // margin-left: inline-style; border-radius: 100%; + // background-color: inline-style; } } }