Web Interface For Lite Argus Control modules
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

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <?php
  2. require_once('../ajax_asm.php');
  3. require_once('../php/onvif/toto.php');
  4. if( $CUser->Data['id'] > 1 ){
  5. if( $CUser->Data['access'] > 5 ){
  6. $Records = array();
  7. if( $FID = fopen("data/server.log", "r")){
  8. $LID = 0;
  9. $AID = 1;
  10. while( !feof( $FID ) ){
  11. $line = trim( fgets($FID) );
  12. $cnode['id'] = $AID;
  13. $TArr = explode( ' ', $line );
  14. if( count( $TArr ) > 2 ){
  15. $cnode['type']= $TArr[0];
  16. $cnode['ts'] = $TArr[1] . ' ' . $TArr[2];
  17. $cnode['ptr'] = $TArr[3];
  18. $cnode['module'] = str_replace(':','', $TArr[4]);
  19. $cnode['msg'] = substr( $line, strlen($TArr[0]) + strlen( $cnode['ts'] ) + strlen( $cnode['ptr'] ) + strlen( $cnode['module'] ) + 5 );
  20. if( $LID < 40 ) {
  21. $LID++;
  22. } else {
  23. array_shift($Records);
  24. };
  25. $Records[$LID] = $cnode;
  26. $AID++;
  27. };
  28. };
  29. fclose($FID);
  30. };
  31. $Data['records'] = array_reverse($Records);
  32. } else {
  33. $Data['records'] = array();
  34. };
  35. $Data['totalCount']= count($Data['records']);
  36. echo json_encode( $Data );
  37. } else {
  38. header('location: /');
  39. };
  40. ?>