Replace the server attribute with a server entry, populated with a dropdown.Makes things more friendly and less error-prone

pull/1504/head
Isaac Connor 2016-05-24 16:46:34 -04:00
parent 277fdafa85
commit 7cfa2a5eaa
1 changed files with 12 additions and 1 deletions

View File

@ -85,7 +85,6 @@ $attrTypes = array(
'DiskBlocks' => translate('AttrDiskBlocks'),
'SystemLoad' => translate('AttrSystemLoad'),
'ServerId' => translate('AttrServerId'),
'ServerName' => translate('AttrServerName'),
);
$opTypes = array(
'=' => translate('OpEq'),
@ -226,6 +225,18 @@ for ( $i = 0; isset($_REQUEST['filter']) && $i < count($_REQUEST['filter']['term
?>
<td><?php echo buildSelect( "filter[terms][$i][op]", $opTypes ); ?></td>
<td><?php echo buildSelect( "filter[terms][$i][val]", $monitors ); ?></td>
<?php
}
elseif ( $_REQUEST['filter']['terms'][$i]['attr'] == "ServerId" )
{
$servers = array();
$servers['ZM_SERVER_ID'] = 'Current Server';
foreach ( dbFetchAll( "SELECT Id,Name FROM Servers ORDER BY lower(Name) ASC" ) as $server ) {
$servers[$server['Id']] = $server['Name'];
}
?>
<td><?php echo buildSelect( "filter[terms][$i][op]", $opTypes ); ?></td>
<td><?php echo buildSelect( "filter[terms][$i][val]", $servers ); ?></td>
<?php
}
else