Provide limit control in service grid

refs #9030
This commit is contained in:
Matthias Jentsch 2015-09-07 18:14:16 +02:00
parent e34c50bc91
commit f42476213e
2 changed files with 44 additions and 0 deletions

View File

@ -1,5 +1,6 @@
<?php <?php
use Icinga\Module\Monitoring\Object\Service; use Icinga\Module\Monitoring\Object\Service;
use Icinga\Web\Url;
if (! $this->compact): ?> if (! $this->compact): ?>
<div class="controls"> <div class="controls">
@ -45,6 +46,8 @@ $hostFilter = '(host_name=' . implode('|host_name=', array_keys($pivotData)) . '
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php $i = 0; ?>
<?php foreach ($pivotHeader['rows'] as $hostName => $hostDisplayName): ?> <?php foreach ($pivotHeader['rows'] as $hostName => $hostDisplayName): ?>
<tr> <tr>
<th><?php <th><?php
@ -88,8 +91,42 @@ $hostFilter = '(host_name=' . implode('|host_name=', array_keys($pivotData)) . '
); ?> ); ?>
</td> </td>
<?php endforeach ?> <?php endforeach ?>
<?php if (! $this->compact && $this->horizontalPaginator->getPages()->pageCount > 1): ?>
<td>
<?php $expandLink = $this->qlink(
$this->translate('more …'),
Url::fromRequest(),
array(
'limit' => (
$this->horizontalPaginator->getItemCountPerPage() + 20) . ','
. $this->verticalPaginator->getItemCountPerPage()
),
array(
'data-base-target' => '_self',
)
) ?>
<?= ++$i === (int) (count($pivotHeader['rows']) / 2) ? $expandLink : '' ?>
</td>
<?php endif;?>
</tr> </tr>
<?php endforeach ?> <?php endforeach ?>
<?php if (! $this->compact && $this->verticalPaginator->getPages()->pageCount > 1): ;?>
<tr>
<td colspan="<?= count($pivotHeader['cols']) + 1?>" class="service-grid-table-more">
<?php echo $this->qlink(
$this->translate('more …'),
Url::fromRequest(),
array(
'limit' => $this->horizontalPaginator->getItemCountPerPage() . ',' .
($this->verticalPaginator->getItemCountPerPage() + 20)
),
array(
'data-base-target' => '_self'
)
) ?>
</td>
</tr>
<?php endif;?>
</tbody> </tbody>
</table> </table>
</div> </div>

View File

@ -35,4 +35,11 @@ table.service-grid-table {
width: 1.5em; width: 1.5em;
} }
} }
td.service-grid-table-more {
text-align: center;
a {
display: inline;
}
}
} }