Repair "Show More" links in the Alert Summary

fixes #9995
This commit is contained in:
Alexander A. Klimov 2015-09-21 13:26:42 +02:00
parent dd0e924e8d
commit 8bfc7b8805
3 changed files with 16 additions and 8 deletions

View File

@ -57,7 +57,9 @@ class AlertsummaryController extends Controller
$this->view->title = $this->translate('Alert Summary'); $this->view->title = $this->translate('Alert Summary');
$this->view->intervalBox = $this->createIntervalBox(); $this->view->intervalBox = $this->createIntervalBox();
$this->view->recentAlerts = $this->createRecentAlerts(); list($recentAlerts, $recentAlertsUrl) = $this->createRecentAlerts();
$this->view->recentAlerts = $recentAlerts;
$this->view->recentAlertsUrl = $recentAlertsUrl;
$this->view->interval = $this->getInterval(); $this->view->interval = $this->getInterval();
$this->view->defectChart = $this->createDefectImage(); $this->view->defectChart = $this->createDefectImage();
$this->view->healingChart = $this->createHealingChart(); $this->view->healingChart = $this->createHealingChart();
@ -80,6 +82,7 @@ class AlertsummaryController extends Controller
); );
$this->applyRestriction('monitoring/filter/objects', $query); $this->applyRestriction('monitoring/filter/objects', $query);
$this->view->notifications = $query; $this->view->notifications = $query;
$this->view->notificationsUrl = 'monitoring/list/notifications';
$this->setupLimitControl(); $this->setupLimitControl();
$this->setupPaginationControl($this->view->notifications); $this->setupPaginationControl($this->view->notifications);
@ -487,7 +490,7 @@ class AlertsummaryController extends Controller
/** /**
* Top recent alerts * Top recent alerts
* *
* @return mixed * @return array
*/ */
private function createRecentAlerts() private function createRecentAlerts()
{ {
@ -508,7 +511,10 @@ class AlertsummaryController extends Controller
$query->order('notification_start_time', 'desc'); $query->order('notification_start_time', 'desc');
return $query->limit(5); return array(
$query->limit(5),
'monitoring/list/notifications?sort=notification_start_time&dir=desc'
);
} }
/** /**

View File

@ -59,8 +59,9 @@
<div class="alertsummary-flex-container"> <div class="alertsummary-flex-container">
<div class="alertsummary-flex"> <div class="alertsummary-flex">
<?= $this->partial('list/notifications.phtml', array( <?= $this->partial('list/notifications.phtml', array(
'notifications' => $this->recentAlerts, 'notifications' => $this->recentAlerts,
'compact' => true 'compact' => true,
'notificationsUrl' => $recentAlertsUrl
)); ?> )); ?>
</div> </div>
</div> </div>
@ -70,8 +71,9 @@
<div class="alertsummary-flex-container"> <div class="alertsummary-flex-container">
<div class="alertsummary-flex"> <div class="alertsummary-flex">
<?= $this->partial('list/notifications.phtml', array( <?= $this->partial('list/notifications.phtml', array(
'notifications' => $this->notifications, 'notifications' => $this->notifications,
'compact' => true 'compact' => true,
'notificationsUrl' => $notificationsUrl
)); ?> )); ?>
</div> </div>
</div> </div>

View File

@ -72,7 +72,7 @@ if (! $this->compact): ?>
<?php elseif ($notifications->hasMore()): ?> <?php elseif ($notifications->hasMore()): ?>
<?= $this->qlink( <?= $this->qlink(
$this->translate('Show More'), $this->translate('Show More'),
$this->url()->without(array('view', 'limit')), $this->url(isset($notificationsUrl) ? $notificationsUrl : null)->without(array('view', 'limit')),
null, null,
array( array(
'data-base-target' => '_next', 'data-base-target' => '_next',