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.

51 lines
1.3 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <?php
  2. require_once('/srv/etc/sys_map.php');
  3. $Data = array();
  4. $Data['status'] = 0;
  5. $Data['msg'] = 'Idle';
  6. $RMD5 = '';
  7. if( isset( $_POST['IMD'] ) ){
  8. $RMD5 = $_POST['IMD'];
  9. } else {
  10. $RMD5 = $_GET['IMD'];
  11. };
  12. if( file_exists( $GVAULT_PATH.'/new_task.var' ) ){
  13. $Data['status'] = 1;
  14. $Data['msg'] = 'Task is Pending';
  15. $Task = json_decode( file_get_contents( $GVAULT_PATH.'/new_task.var' ));
  16. } elseif( file_exists( $GVAULT_PATH.'/cur_task.var' ) ){
  17. $Data['msg'] = 'Task is Running';
  18. $Data['status'] = 2;
  19. $Task = json_decode( file_get_contents( $GVAULT_PATH.'/cur_task.var' ));
  20. };
  21. if( file_exists( $GVAULT_PATH.'/task_log.var' ) ) {
  22. $TLOG = file_get_contents( $GVAULT_PATH.'/task_log.var' );
  23. } else {
  24. $TLOG = '';
  25. };
  26. $Data['log_md5'] = md5( $TLOG );
  27. if( $Data['log_md5'] != $RMD5 ){
  28. $Data['status_log'] = $TLOG;
  29. };
  30. switch( $Data['status'] ){
  31. case 0:{
  32. $Data['status_desc'] = 'No Pending Tasks';
  33. break;
  34. };
  35. case 1:{
  36. $Data['status_desc']=$Task->description;
  37. break;
  38. };
  39. case 2:{
  40. $Data['status_desc']=$Task->description;
  41. if( file_exists( $GVAULT_PATH.'/task_perc.var' ) ){
  42. $ACO = intval( file_get_contents( $GVAULT_PATH.'/task_perc.var' ) );
  43. } else {
  44. $ACO = 0;
  45. };
  46. break;
  47. };
  48. };
  49. echo json_encode( $Data );
  50. ?>