Add Storage column to console

pull/1315/head
Isaac Connor 2016-02-03 09:42:50 -05:00
parent 48283191ec
commit 555904c588
1 changed files with 17 additions and 1 deletions

View File

@ -20,6 +20,9 @@
require_once('includes/Server.php');
$servers = Server::find_all();
require_once('includes/Storage.php');
$storage_areas = Storage::find_all();
$show_storage_areas = count($storage_areas) > 1 and canEdit( 'System' ) ? 1 : 0;
$eventCounts = array(
array(
@ -242,6 +245,9 @@ else
<th class="colServer"><?php echo translate('Server') ?></th>
<?php } ?>
<th class="colSource"><?php echo translate('Source') ?></th>
<?php if ( $show_storage_areas ) { ?>
<th class="colStorage"><?php echo translate('Storage') ?></th>
<?php } ?>
<?php
for ( $i = 0; $i < count($eventCounts); $i++ )
{
@ -264,7 +270,11 @@ if ( canEdit('Monitors') )
</thead>
<tfoot>
<tr>
<td class="colLeftButtons" colspan="<?php echo count($servers) ? 4 : 3 ?>">
<td class="colLeftButtons" colspan="<?php $columns = 3;
if ( count($servers) > 1 ) { $columns += 1; }
if ( $show_storage_areas ) { $columns += 1; }
echo $columns;
?>">
<input type="button" value="<?php echo translate('Refresh') ?>" onclick="location.reload(true);"/>
<?php echo makePopupButton( '?view=monitor', 'zmMonitor0', 'monitor', translate('AddNewMonitor'), (canEdit( 'Monitors' ) && !$user['MonitorIds']) ) ?>
<?php echo makePopupButton( '?view=filter&amp;filter[terms][0][attr]=DateTime&amp;filter[terms][0][op]=%3c&amp;filter[terms][0][val]=now', 'zmFilter', 'filter', translate('Filters'), canView( 'Events' ) ) ?>
@ -336,6 +346,12 @@ echo $Server->Name();
<?php } else { ?>
<td class="colSource">&nbsp;</td>
<?php } ?>
<?php if ( $show_storage_areas ) { ?>
<td class="colStorage"><?php
$Storage = new Storage( $monitor['StorageId'] );
echo $Storage->Name();
?></td>
<?php } ?>
<?php
for ( $i = 0; $i < count($eventCounts); $i++ )
{