Include Capturing, Analysing, Recording instead of Function

pull/3648/head
Isaac Connor 2022-12-14 08:28:21 -05:00
parent e4b4fae584
commit 1c538a4bf0
1 changed files with 10 additions and 4 deletions

View File

@ -3,6 +3,8 @@ if (!isset($_REQUEST['entity'])) {
Error("No entity pass to status request.");
http_response_code(404);
return;
} else {
}
if ($_REQUEST['entity'] == 'navBar') {
@ -33,7 +35,7 @@ $statusData = array(
'limit' => 1,
'elements' => array(
'MonitorCount' => array( 'sql' => 'count(*)' ),
'ActiveMonitorCount' => array( 'sql' => 'count(if(`Function` != \'None\',1,NULL))' ),
'ActiveMonitorCount' => array( 'sql' => 'count(if(`Capturing` != \'None\',1,NULL))' ),
'State' => array( 'func' => 'daemonCheck()?\''.translate('Running').'\':\''.translate('Stopped').'\'' ),
'Load' => array( 'func' => 'getLoad()' ),
'Disk' => array( 'func' => 'getDiskPercent()' ),
@ -48,7 +50,9 @@ $statusData = array(
'Id' => array( 'sql' => 'Monitors.Id' ),
'Name' => array( 'sql' => 'Monitors.Name' ),
'Type' => true,
'Function' => true,
'Capturing' => true,
'Analysing' => true,
'Capturing' => true,
'Enabled' => true,
'LinkedMonitors' => true,
'Triggers' => true,
@ -228,8 +232,10 @@ function collectData() {
$entitySpec = &$statusData[strtolower(validJsStr($_REQUEST['entity']))];
#print_r( $entitySpec );
if ( !canView($entitySpec['permission']) )
if (!canView($entitySpec['permission'])) {
ajaxError('Unrecognised action or insufficient permissions');
return;
}
if ( !empty($entitySpec['func']) ) {
$data = eval('return('.$entitySpec['func'].');');