Replace Function monitor filter with Capturing, Analysing, Recording filters.

This commit is contained in:
Isaac Connor 2022-02-08 11:21:16 -05:00
parent dcf6e5da46
commit 01fad8a0dc
1 changed files with 24 additions and 21 deletions

View File

@ -21,7 +21,7 @@
require_once('includes/Monitor.php');
zm_session_start();
foreach ( array('GroupId','Function','ServerId','StorageId','Status','MonitorId','MonitorName','Source') as $var ) {
foreach (array('GroupId','Capturing','Analysing','Recording','ServerId','StorageId','Status','MonitorId','MonitorName','Source') as $var) {
if (isset($_REQUEST[$var])) {
if ($_REQUEST[$var] != '') {
$_SESSION[$var] = $_REQUEST[$var];
@ -81,7 +81,7 @@ $values = array();
if ( $groupSql )
$conditions[] = $groupSql;
foreach ( array('ServerId','StorageId','Status','Function') as $filter ) {
foreach ( array('ServerId','StorageId','Status','Capturing','Analysing','Recording') as $filter ) {
if ( isset($_SESSION[$filter]) ) {
if ( is_array($_SESSION[$filter]) ) {
$conditions[] = '`'.$filter . '` IN ('.implode(',', array_map(function(){return '?';}, $_SESSION[$filter])). ')';
@ -101,14 +101,12 @@ if ( !empty($user['MonitorIds']) ) {
$html .= '<span class="MonitorNameFilter"><label>'.translate('Name').'</label>';
$html .= '<input type="text" name="MonitorName" value="'.(isset($_SESSION['MonitorName'])?validHtmlStr($_SESSION['MonitorName']):'').'" placeholder="text or regular expression"/>';
$html .= '</span>
';
$html .= '</span>'.PHP_EOL;
$Functions = ZM\GetMonitorFunctionTypes();
$html .= '<span class="FunctionFilter"><label>'.translate('Function').'</label>';
$html .= htmlSelect('Function[]', $Functions,
(isset($_SESSION['Function'])?$_SESSION['Function']:''),
function addFilterSelect($name, $options) {
$html .= '<span class="'.$name.'Filter"><label>'.translate($name).'</label>';
$html .= htmlSelect($name.'[]', $options,
(isset($_SESSION[$name])?$_SESSION[$name]:''),
array(
'data-on-change'=>'submitThisForm',
'class'=>'chosen',
@ -116,8 +114,13 @@ $html .= htmlSelect('Function[]', $Functions,
'data-placeholder'=>'All',
)
);
$html .= '</span>
';
$html .= '</span>'.PHP_EOL;
return $html;
}
$html .= addFilterSelect('Capturing', array('None'=>translate('None'), 'OnDemand'=>translate('On Demand')));
$html .= addFilterSelect('Analysing', array('None'=>translate('None'), 'Always'=>translate('Always')));
$html .= addFilterSelect('Recording', array('None'=>translate('None'), 'OnMotion'=>translate('On Motion'),'Always'=>translate('Always')));
if ( count($ServersById) > 1 ) {
$html .= '<span class="ServerFilter"><label>'. translate('Server').'</label>';