Web UI for ARGUS server
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

39 lines
1.1 KiB

<?php
require_once('../ajax_asm.php');
require_once('../php/onvif/toto.php');
if( $CUser->Data['id'] > 1 ){
if( $CUser->Data['access'] > 5 ){
$Records = array();
if( $FID = fopen("data/server.log", "r")){
$LID = 0;
$AID = 1;
while( !feof( $FID ) ){
$line = trim( fgets($FID) );
$cnode['id'] = $AID;
$TArr = explode( ' ', $line );
if( count( $TArr ) > 2 ){
$cnode['ts'] = $TArr[0] . ' ' . $TArr[1];
$cnode['ptr'] = $TArr[2];
$cnode['module'] = str_replace(':','', $TArr[3]);
$cnode['msg'] = substr( $line, strlen( $cnode['ts'] ) + strlen( $cnode['ptr'] ) + strlen( $cnode['module'] ) + 4 );
if( $LID < 40 ) {
$LID++;
} else {
array_shift($Records);
};
$Records[$LID] = $cnode;
$AID++;
};
};
fclose($FID);
};
$Data['records'] = array_reverse($Records);
} else {
$Data['records'] = array();
};
$Data['totalCount']= count($Data['records']);
echo json_encode( $Data );
} else {
header('location: /');
};
?>