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.

30 lines
1.1 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <?php
  2. require_once('../ajax_asm.php');
  3. if( $CUser->Data['id'] > 1 ){
  4. $EID = intval( $_POST['RID'] );
  5. $QS = "SELECT * FROM resources WHERE id = {$EID}";
  6. $Result = $DATABASE->Query( $QS, false );
  7. if( count( $Result ) ){
  8. $CR = $Result[0];
  9. switch( $CR['type'] ){
  10. case 1: //https://bufferwall.com/posts/330881001ji1a/
  11. $QS = "SELECT * FROM uart_settings WHERE id={$CR['aux_id']}";
  12. $Result = $DATABASE->Query( $QS );
  13. $Z = $Result[0];
  14. $R_name = 'UART connected to a Server Appliance';
  15. $R_dev = $CR['device'];
  16. $R_nfo = 'Speed: ' . $Z['speed'] . ', Bits: ' . $Z['bit'] . ', Parity: ' . $Z['parity'] . ', Stop Bit: '. $Z['stop_bit'];
  17. break;
  18. };
  19. echo "{ xtype: 'panel', html: '<table width=\"100%\" border=0><tr><td rowspan=3 width=\"256px\">";
  20. echo "<img id=\"res_info_image\" src=\"/style/assets/unnamed.png\"></td>";
  21. echo "<td>{$R_name}</td></tr>";
  22. echo "<tr><td>{$R_dev}</td></tr>";
  23. echo "<tr><td>{$R_nfo}</td></tr>";
  24. echo "</table>'}";
  25. } else {
  26. echo '{ xtype: \'panel\', html: \'Node '.$_POST['NODE'].' Loadded\'}';
  27. };
  28. } else {
  29. header('location: /');
  30. };
  31. ?>