Add Server auto-selection

This commit is contained in:
Isaac Connor 2018-01-19 11:00:46 -08:00
parent 5cd3d14828
commit 9b7fee03c7
1 changed files with 3 additions and 0 deletions

View File

@ -485,6 +485,9 @@ if ( canEdit( 'Monitors' ) ) {
$columns = getTableColumns( 'Monitors' ); $columns = getTableColumns( 'Monitors' );
$changes = getFormChanges( $monitor, $_REQUEST['newMonitor'], $types, $columns ); $changes = getFormChanges( $monitor, $_REQUEST['newMonitor'], $types, $columns );
if ( isset($changes['ServerId']) and $changes['ServerId'] == 'auto' ) {
$changes['ServerId'] = dbFetchOne( 'SELECT Id FROM Servers WHERE Status=\'Running\' ORDER BY FreeMem, CpuLoad LIMIT 1', 'Id' );
}
if ( count( $changes ) ) { if ( count( $changes ) ) {
if ( $mid ) { if ( $mid ) {