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.

38 lines
1.1 KiB

5 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  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['ts'] = $TArr[0] . ' ' . $TArr[1];
  16. $cnode['ptr'] = $TArr[2];
  17. $cnode['module'] = str_replace(':','', $TArr[3]);
  18. $cnode['msg'] = substr( $line, strlen( $cnode['ts'] ) + strlen( $cnode['ptr'] ) + strlen( $cnode['module'] ) + 4 );
  19. if( $LID < 40 ) {
  20. $LID++;
  21. } else {
  22. array_shift($Records);
  23. };
  24. $Records[$LID] = $cnode;
  25. $AID++;
  26. };
  27. };
  28. fclose($FID);
  29. };
  30. $Data['records'] = array_reverse($Records);
  31. } else {
  32. $Data['records'] = array();
  33. };
  34. $Data['totalCount']= count($Data['records']);
  35. echo json_encode( $Data );
  36. } else {
  37. header('location: /');
  38. };
  39. ?>