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.

3387 lines
94 KiB

​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
4 years ago
​
4 years ago
4 years ago
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
3 years ago
3 years ago
​
3 years ago
3 years ago
3 years ago
​
3 years ago
​
​
​
3 years ago
​
3 years ago
3 years ago
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
3 years ago
​
​
​
​
​
​
3 years ago
​
​
​
​
​
3 years ago
​
3 years ago
3 years ago
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
3 years ago
​
​
3 years ago
​
​
​
3 years ago
​
​
​
​
​
​
​
3 years ago
​
​
3 years ago
​
3 years ago
​
​
​
​
​
​
​
​
​
3 years ago
3 years ago
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
4 years ago
​
​
​
​
​
​
​
​
2 years ago
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
4 years ago
​
​
​
​
​
4 years ago
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
4 years ago
​
​
​
4 years ago
4 years ago
​
4 years ago
​
​
​
​
​
​
​
​
​
​
4 years ago
​
4 years ago
​
​
4 years ago
​
​
​
​
​
​
​
2 years ago
​
4 years ago
​
4 years ago
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
3 years ago
3 years ago
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
4 years ago
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
3 years ago
​
​
3 years ago
​
​
3 years ago
3 years ago
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
3 years ago
​
3 years ago
​
​
​
​
3 years ago
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
3 years ago
3 years ago
​
​
​
​
​
​
​
​
3 years ago
​
3 years ago
3 years ago
​
​
3 years ago
​
​
​
​
​
3 years ago
​
​
​
​
​
3 years ago
3 years ago
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
4 years ago
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
4 years ago
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. //<?php require_once('../../js_asm.php'); ?>
  2. var helpContentTopicID = -1;
  3. var muploader = null;
  4. var uploads_store_id = 0;
  5. var uploads_store = new Ext.data.ArrayStore({
  6. autoDestroy: false,
  7. storeId: 'up_store',
  8. idIndex: 0,
  9. fields: [
  10. {name: 'id', type: 'int' },
  11. {name: 'file_name', type: 'string'},
  12. {name: 'file_id', type: 'string'},
  13. {name: 'size', type: 'string'},
  14. {name: 'progress', type: 'int'},
  15. {name: 'status', type: 'string' }
  16. ]
  17. });
  18. var uploaded_store_id = 0;
  19. var uploaded_store = new Ext.data.ArrayStore({
  20. autoDestroy: false,
  21. storeId: 'mod_store',
  22. idIndex: 0,
  23. fields: [
  24. {name: 'id', type: 'int' },
  25. {name: 'file_name', type: 'string'},
  26. {name: 'size', type: 'int'},
  27. {name: 'status', type: 'int'},
  28. {name: 'ts', type: 'string' },
  29. {name: 'memo', type: 'string' }
  30. ]
  31. });
  32. function progressRenderer( value, meta, record ){
  33. Ext.defer( function( id ){
  34. var p = new Ext.ProgressBar({
  35. id: 'progress_'+id,
  36. renderTo: 'div_'+id,
  37. animate: false,
  38. width: '100%',
  39. value: 0,
  40. text: 'Upload Pending',
  41. });
  42. }, 50, undefined, [ record.data.file_id ] );
  43. return '<div id="div_' + record.data.file_id + '"></div>';
  44. };
  45. var fileUploadsColModel_ops = {
  46. columns: [
  47. {header: "ID", width: 50, align: 'center', css: 'vertical-align: middle;', dataIndex: 'id' },
  48. {header: "<?=$Labels->GetLabel('_FILE_NAME_');?>", width: 280, fixed: false, align: 'left', css: 'vertical-align: middle;', dataIndex: 'file_name' },
  49. {header: "<?=$Labels->GetLabel('_SIZE_');?>", width: 80, align: 'left', css: 'vertical-align: middle;', dataIndex: 'size' },
  50. {header: "<?=$Labels->GetLabel('_PROGRESS_');?>", width: 150, renderer: progressRenderer, dataIndex: 'progress' },
  51. {header: " ", width: 50, dataIndex: 'status3' }
  52. ],
  53. defaults: {
  54. sortable: false,
  55. fixed: true,
  56. menuDisabled: true,
  57. width: 100
  58. }
  59. };
  60. function onModuleFileRenderer( value, meta, record ){
  61. if( value == 0 ){
  62. rv = '<img title="<?=$Labels->GetLabel('_READY_TO_UPLO_');?>" alt="<?=$Labels->GetLabel('_READY_TO_UPLO_');?>" src="/style/assets/bul_green.png">';
  63. } else {
  64. if( value < 101 ){
  65. rv = '<img title="<?=$Labels->GetLabel('_UPLO_IN_PROGRESS_');?>" alt="<?=$Labels->GetLabel('_UPLO_IN_PROGRESS_');?>" src="/style/assets/bul_gray.png">';
  66. } else {
  67. rv = '<img title="<?=$Labels->GetLabel('_UPLO_DONE_');?>" alt="<?=$Labels->GetLabel('_UPLO_DONE_');?>" src="/style/assets/bul_blue.png">';
  68. };
  69. };
  70. return rv;
  71. };
  72. var fileModuleColModel_ops = {
  73. columns: [
  74. {header: "ID", width: 50, align: 'center', css: 'vertical-align: middle;', dataIndex: 'id' },
  75. {header: "<?=$Labels->GetLabel('_FILE_NAME_');?>", width: 60, fixed: false, align: 'left', css: 'vertical-align: middle;', dataIndex: 'file_name' },
  76. {header: "<?=$Labels->GetLabel('_SIZE_');?>", width: 80, renderer: plupload.formatSize, align: 'left', css: 'vertical-align: middle;', dataIndex: 'size' },
  77. {header: "<?=$Labels->GetLabel('_TIME_');?>", width: 150, align: 'left', css: 'vertical-align: middle;', dataIndex: 'ts' },
  78. {header: "<?=$Labels->GetLabel('_STATUS_');?>", width: 50, renderer: onModuleFileRenderer, dataIndex: 'status' },
  79. {header: "<?=$Labels->GetLabel('_MEMO_');?>", dataIndex: 'memo' }
  80. ],
  81. defaults: {
  82. sortable: false,
  83. fixed: true,
  84. menuDisabled: true,
  85. width: 100
  86. }
  87. };
  88. var fileUploadsSelModel_ops = {
  89. singleSelect: true
  90. };
  91. var targetWidthTable_store = new Ext.data.ArrayStore({
  92. autoDestroy: false,
  93. storeId: 'width_table_store',
  94. idIndex: 0,
  95. fields: [
  96. {name: 'id', type: 'int' },
  97. {name: 'width', type: 'int'},
  98. {name: 'range', type: 'sting'},
  99. {name: 'range_m', type: 'sting'}
  100. ]
  101. });
  102. var cWTRowSelected = null;
  103. var cWTRowSelectedRange = 0;
  104. var cWTRowSelectedRangeP = 0;
  105. var WTSelectedSensor = 0;
  106. var widthTableSelModel_ops = {
  107. singleSelect: true,
  108. listeners: {
  109. rowselect: function( sm, row, rec ) {
  110. cWTRowSelected = rec.data.id;
  111. cWTRowSelectedRange = rec.data.range_m;
  112. cWTRowSelectedRangeP = rec.data.range;
  113. //todo
  114. Ext.getCmp('edit_btn_width_table').enable();
  115. }
  116. }
  117. };
  118. function deleteWTRow(){
  119. Ext.Ajax.request({
  120. url: '/lib/controller/delWidthTableRecord.php',
  121. params: {
  122. UID: <?=$UserID;?>,
  123. SID: '<?=$Session;?>',
  124. DID: WTSelectedSensor,
  125. RID: cWTRowSelected
  126. },
  127. success: function( response, opts ){
  128. Ext.getCmp('del_btn_width_table').disable();
  129. loadWidthTable( WTSelectedSensor );
  130. },
  131. failure: failureAJAXFunction
  132. });
  133. };
  134. var targetWidthTableColModel_ops = {
  135. columns: [
  136. {header: "<?=$Labels->GetLabel('_WIDTH_CORRECT_');?> (%)", width: 250, align: 'center', css: 'vertical-align: middle;', dataIndex: 'width' },
  137. {header: "<?=$Labels->GetLabel('_RANGE_');?> (%)", width: 150, align: 'center', css: 'vertical-align: middle;', dataIndex: 'range' },
  138. {header: "<?=$Labels->GetLabel('_RANGE_').' ('.$Labels->GetLabel('_METERS_') . ')';?>", width: 150, align: 'center', css: 'vertical-align: middle;', dataIndex: 'range_m' },
  139. ],
  140. defaults: {
  141. sortable: false,
  142. fixed: true,
  143. menuDisabled: true
  144. }
  145. };
  146. var widthTableEditDialog = null;
  147. function editWidthTableRecord(){
  148. if( widthTableEditDialog == null ){
  149. widthTableEditDialog = new Ext.Window({
  150. title: '<?=$Labels->GetLabel('_EDIT_WTR_');?>',
  151. modal: true,
  152. layout: 'form',
  153. labelWidth: 200,
  154. closeAction: 'hide',
  155. labelAlign: 'right',
  156. items:[{
  157. xtype: 'textfield',
  158. id: 'wt_ad_range_val',
  159. readOnly: true,
  160. fieldLabel: '<?=$Labels->GetLabel('_RANGE_');?> (%)',
  161. value: cWTRowSelectedRangeP
  162. },{
  163. xtype: 'textfield',
  164. id: 'wt_ad_rangea_val',
  165. readOnly: true,
  166. fieldLabel: '<?=$Labels->GetLabel('_RANGE_');?> (<?=$Labels->GetLabel('_METERS_');?>)',
  167. value: cWTRowSelectedRange
  168. },{
  169. xtype: 'numberfield',
  170. id: 'wt_ad_width_val',
  171. fieldLabel: '<?=$Labels->GetLabel('_WIDTH_');?> (%)',
  172. value: '100'
  173. },{
  174. xtype: 'button',
  175. width: '100%',
  176. text: '<?=$Labels->GetLabel('_APPLY_CHANGES_');?>',
  177. handler: function(){
  178. var tWidth = Ext.getCmp('wt_ad_width_val').getValue();
  179. Ext.Ajax.request({
  180. url: '/lib/controller/updateWidthTableRecord.php',
  181. params: {
  182. UID: <?=$UserID;?>,
  183. SID: '<?=$Session;?>',
  184. DID: WTSelectedSensor,
  185. RID: cWTRowSelected,
  186. NWW: tWidth
  187. },
  188. success: function( response, opts ){
  189. widthTableEditDialog.hide();
  190. loadWidthTable( WTSelectedSensor );
  191. },
  192. failure: failureAJAXFunction
  193. });
  194. }
  195. }]
  196. });
  197. };
  198. Ext.getCmp('wt_ad_range_val').setValue( cWTRowSelectedRangeP );
  199. Ext.getCmp('wt_ad_rangea_val').setValue( cWTRowSelectedRange );
  200. widthTableEditDialog.show();
  201. };
  202. function loadWidthTable( SensorID ){
  203. WTSelectedSensor = SensorID;
  204. Ext.Ajax.request({
  205. url: '/lib/controller/getWidthTable.php',
  206. params: {
  207. UID: <?=$UserID;?>,
  208. SID: '<?=$Session;?>',
  209. DID: SensorID
  210. },
  211. success: function( response, opts ){
  212. var data = Ext.decode( response.responseText );
  213. targetWidthTable_store.removeAll();
  214. targetWidthTable_store.loadData( data.rows );
  215. },
  216. failure: failureAJAXFunction
  217. });
  218. };
  219. function loadModuleFiles( sensorID ){
  220. Ext.Ajax.request({
  221. url: '/lib/controller/getDeviceFiles.php',
  222. params: {
  223. UID: <?=$UserID;?>,
  224. SID: '<?=$Session;?>',
  225. DID: sensorID
  226. },
  227. success: function( response, opts ){
  228. var data = Ext.decode( response.responseText );
  229. uploaded_store.removeAll();
  230. uploaded_store.loadData( data.files );
  231. },
  232. failure: failureAJAXFunction
  233. });
  234. };
  235. function loadHelpContent( topicID ){
  236. if( helpContentTopicID == topicID ) return;
  237. helpContentTopicID = topicID;
  238. Ext.Ajax.request({
  239. url: '/lib/controller/getHelpTopic.php',
  240. params: {
  241. UID: <?=$UserID;?>,
  242. SID: '<?=$Session;?>',
  243. TID: topicID
  244. },
  245. success: function( response, opts ){
  246. var tData = Ext.decode(response.responseText);
  247. var tPanel = Ext.getCmp('help_content');
  248. tPanel.removeAll( true );
  249. tPanel.add( tData );
  250. tPanel.doLayout();
  251. },
  252. failure: failureAJAXFunction
  253. });
  254. };
  255. function clearHelpContent(){
  256. helpContentTopicID = -1;
  257. };
  258. function loadRessources(){
  259. Ext.Ajax.request({
  260. url: '/lib/controller/getResources.php',
  261. params: {
  262. UID: <?=$UserID;?>,
  263. SID: '<?=$Session;?>',
  264. },
  265. success: function( response, opts ){
  266. var tData = Ext.decode(response.responseText);
  267. var tPanel = Ext.getCmp('resources_container');
  268. if( tData.status == 'ok' ){
  269. var res = Ext.decode( tData.resources );
  270. tPanel.removeAll( true );
  271. tPanel.add( res );
  272. tPanel.doLayout();
  273. } else {
  274. };
  275. },
  276. failure: failureAJAXFunction
  277. });
  278. };
  279. function loadModules(){
  280. Ext.Ajax.request({
  281. url: '/lib/controller/getModules.php',
  282. params: {
  283. UID: <?=$UserID;?>,
  284. SID: '<?=$Session;?>',
  285. },
  286. success: function( response, opts ){
  287. var tData = Ext.decode(response.responseText);
  288. var tPanel = Ext.getCmp('modules_container');
  289. if( tData.status == 'ok' ){
  290. var res = Ext.decode( tData.modules );
  291. tPanel.removeAll( true );
  292. tPanel.add( res );
  293. tPanel.doLayout();
  294. } else {
  295. tPanel.removeAll( true );
  296. tPanel.doLayout();
  297. var tPanel = Ext.getCmp('mod_ed_small');
  298. tPanel.removeAll( true );
  299. tPanel.add( { html:"<div class='setEd_infoPanel' id='NUNU'><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>" } );
  300. tPanel.doLayout();
  301. };
  302. },
  303. failure: failureAJAXFunction
  304. });
  305. };
  306. function loadFilters(){
  307. Ext.Ajax.request({
  308. url: '/lib/controller/getFilters.php',
  309. params: {
  310. UID: <?=$UserID;?>,
  311. SID: '<?=$Session;?>',
  312. },
  313. success: function( response, opts ){
  314. var tData = Ext.decode(response.responseText);
  315. var tPanel = Ext.getCmp('filters_container');
  316. if( tData.status == 'ok' ){
  317. var res = Ext.decode( tData.modules );
  318. tPanel.removeAll( true );
  319. tPanel.add( res );
  320. tPanel.doLayout();
  321. } else {
  322. tPanel.removeAll( true );
  323. tPanel.doLayout();
  324. var tPanel = Ext.getCmp('flt_ed_small');
  325. tPanel.removeAll( true );
  326. tPanel.add( { html:"<div class='setEd_infoPanel' id='NUNU'><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>" } );
  327. tPanel.doLayout();
  328. };
  329. },
  330. failure: failureAJAXFunction
  331. });
  332. };
  333. var modem_pb_store = new Ext.data.JsonStore({
  334. autoDestroy: false,
  335. storeId: 'pb_store',
  336. idIndex: 0,
  337. fields: [
  338. {name: 'id', type: 'int' },
  339. {name: 'number', type: 'string'},
  340. {name: 'mode', type: 'int'},
  341. {name: 'trig_special', type: 'int'},
  342. {name: 'label', type: 'string'},
  343. {name: 'custom_msg', type: 'string'}
  344. ]
  345. });
  346. function pb_mode_renderer( value ){
  347. switch( value ){
  348. case 0: return '<?=$Labels->GetLabel('_AUTOMATIC_');?>';
  349. case 1: return '<?=$Labels->GetLabel('_CALL_ONLY_');?>';
  350. case 2: return '<?=$Labels->GetLabel('_SMS_ONLY_');?>';
  351. };
  352. return '';
  353. };
  354. var modem_pb_ColModel_ops = {
  355. columns: [
  356. {header: "<?=$Labels->GetLabel('__MODE__');?>", width: 100, dataIndex: 'mode', renderer: pb_mode_renderer },
  357. {header: "<?=$Labels->GetLabel('_PHONE_NUMBER_');?>", width: 200, align: 'left', css: 'vertical-align: middle;', dataIndex: 'number' },
  358. {header: "<?=$Labels->GetLabel('_NAME_LABEL_');?>", width: 200, fixed: false, align: 'center', css: 'vertical-align: middle;', dataIndex: 'label' },
  359. {header: "<?=$Labels->GetLabel('_CUSTOM_MSG_');?>", dataIndex: 'custom_msg' }
  360. ],
  361. defaults: {
  362. sortable: false,
  363. fixed: true,
  364. menuDisabled: true,
  365. width: 100
  366. }
  367. };
  368. var selected_pb_id = 0;
  369. var modem_pb_SelModel_ops = {
  370. singleSelect: true,
  371. listeners: {
  372. rowselect: function(sm, row, rec ) {
  373. selected_pb_id = rec.data.id;
  374. Ext.getCmp( 'ph_bo_de_bu' ).enable();
  375. }
  376. }
  377. };
  378. function loadPhoneBook(){
  379. Ext.Ajax.request({
  380. url: '/lib/controller/getPhoneBook.php',
  381. params: {
  382. UID: <?=$UserID;?>,
  383. SID: '<?=$Session;?>',
  384. },
  385. success: function( response, opts ){
  386. var data = Ext.decode(response.responseText);
  387. modem_pb_store.loadData( data );
  388. Ext.getCmp( 'ph_bo_de_bu' ).disable();
  389. selected_pb_id = 0;
  390. //var tPanel = Ext.getCmp('main_portal');
  391. //tPanel.removeAll(true);
  392. //for( i=0; i < data.length; i++) tPanel.add( data[i] );
  393. //tPanel.doLayout();
  394. },
  395. failure: failureAJAXFunction
  396. });
  397. };
  398. var addNPNWindow = null;
  399. function addNewPhoneNumber(){
  400. if( addNPNWindow == null ){
  401. addNPNWindow = new Ext.Window({
  402. title: '<?=$Labels->GetLabel('_ADD_NEW_PHN_');?>',
  403. modal: true,
  404. closeAction: 'hide',
  405. resizable: false,
  406. width: 400,
  407. height: 332,
  408. items:[{
  409. xtype: 'form',
  410. labelWidth: 120,
  411. labelAlign: 'right',
  412. items: [{
  413. xtype: 'textfield',
  414. fieldLabel: '<?=$Labels->GetLabel('_NAME_LABEL_');?>',
  415. id: 'ph_name',
  416. width: 220,
  417. value: ''
  418. },{
  419. xtype: 'textfield',
  420. fieldLabel: '<?=$Labels->GetLabel('_PHONE_NUMBER_');?>',
  421. id: 'ph_number',
  422. width: 220,
  423. validator: function( a ){
  424. return true;
  425. },
  426. value: ''
  427. },{
  428. xtype: 'radio',
  429. id: 'r_ph_auto',
  430. fieldLabel: '<?=$Labels->GetLabel('_AUTOMATIC_');?>',
  431. name: 'ph_cam',
  432. checked: true,
  433. value: '0'
  434. },{
  435. xtype: 'radio',
  436. id: 'r_ph_call',
  437. fieldLabel: '<?=$Labels->GetLabel('_CALL_ONLY_');?>',
  438. name: 'ph_cam',
  439. value: '1'
  440. },{
  441. xtype: 'radio',
  442. id: 'r_ph_sms',
  443. fieldLabel: '<?=$Labels->GetLabel('_SMS_ONLY_');?>',
  444. name: 'ph_cam',
  445. value: '2'
  446. },{
  447. xtype: 'textarea',
  448. fieldLabel: '<?=$Labels->GetLabel('_CUSTOM_MSG_');?>',
  449. width: 220,
  450. height: 130,
  451. id: 'cus_sms',
  452. name: 'cus_sms'
  453. }]
  454. }],
  455. bbar:['->',{
  456. text: 'Add',
  457. handler: function(){
  458. var num = Ext.getCmp( 'ph_number' ).getValue();
  459. var lbl = Ext.getCmp( 'ph_name' ).getValue();
  460. var con = Ext.getCmp( 'r_ph_auto' ).getValue()?'0':(Ext.getCmp( 'r_ph_call' ).getValue()?1:2);
  461. var cust = Ext.getCmp( 'cus_sms' ).getValue();
  462. Ext.Ajax.request({
  463. url: '/lib/controller/doPhonebookOperation.php',
  464. params: {
  465. UID: <?=$UserID;?>,
  466. SID: '<?=$Session;?>',
  467. OPID: 1,
  468. PNUM: num,
  469. PNAM: lbl,
  470. PCAL: con,
  471. PMSG: cust
  472. },
  473. success: function( response, opts ){
  474. var data = Ext.decode(response.responseText);
  475. if( data.success ){
  476. loadPhoneBook();
  477. addNPNWindow.hide();
  478. } else {
  479. Ext.Msg.show({
  480. title:'<?=$Labels->GetLabel('_ERROR_');?>',
  481. msg: data.msg,
  482. buttons: Ext.Msg.OK,
  483. icon: Ext.MessageBox.ERROR
  484. });
  485. };
  486. },
  487. failure: failureAJAXFunction
  488. });
  489. }
  490. },{
  491. text: 'Cancel',
  492. handler: function(){
  493. addNPNWindow.hide();
  494. }
  495. }]
  496. });
  497. };
  498. addNPNWindow.show();
  499. };
  500. function deletePhoneNumber(){
  501. if( selected_pb_id ){
  502. Ext.Ajax.request({
  503. url: '/lib/controller/doPhonebookOperation.php',
  504. params: {
  505. UID: <?=$UserID;?>,
  506. SID: '<?=$Session;?>',
  507. OPID: 2,
  508. PBID: selected_pb_id
  509. },
  510. success: function( response, opts ){
  511. var data = Ext.decode(response.responseText);
  512. if( data.success ){
  513. loadPhoneBook();
  514. } else {
  515. Ext.Msg.show({
  516. title:'<?=$Labels->GetLabel('_ERROR_');?>',
  517. msg: data.msg,
  518. buttons: Ext.Msg.OK,
  519. icon: Ext.MessageBox.ERROR
  520. });
  521. };
  522. },
  523. failure: failureAJAXFunction
  524. });
  525. };
  526. };
  527. function loadDetectedCameras(){
  528. Ext.Ajax.request({
  529. url: '/lib/controller/getCameras.php',
  530. params: {
  531. UID: <?=$UserID;?>,
  532. TYP: 0,
  533. SID: '<?=$Session;?>',
  534. },
  535. success: function( response, opts ){
  536. var tData = Ext.decode(response.responseText);
  537. var tPanel = Ext.getCmp('dcam_container');
  538. if( tData.status == 'ok' ){
  539. var res = Ext.decode( tData.cameras );
  540. tPanel.removeAll( true );
  541. tPanel.add( res );
  542. tPanel.doLayout();
  543. var zPanel = Ext.getCmp('dcam_op_small');
  544. zPanel.removeAll( true );
  545. zPanel.add( { html: "<div class='setEd_infoPanel' id='NUNU'><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>" } );
  546. zPanel.doLayout();
  547. } else {
  548. tPanel.removeAll( true );
  549. tPanel.doLayout();
  550. var zPanel = Ext.getCmp('dcam_op_small');
  551. zPanel.removeAll( true );
  552. zPanel.add( { html: "<div class='setEd_infoPanel' id='NUNU'><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>" } );
  553. zPanel.doLayout();
  554. };
  555. },
  556. failure: failureAJAXFunction
  557. });
  558. };
  559. function loadAssignedCameras(){
  560. Ext.Ajax.request({
  561. url: '/lib/controller/getCameras.php',
  562. params: {
  563. UID: <?=$UserID;?>,
  564. TYP: 1,
  565. SID: '<?=$Session;?>',
  566. },
  567. success: function( response, opts ){
  568. var tData = Ext.decode(response.responseText);
  569. var tPanel = Ext.getCmp('acam_container');
  570. if( tData.status == 'ok' ){
  571. var res = Ext.decode( tData.cameras );
  572. tPanel.removeAll( true );
  573. tPanel.add( res );
  574. tPanel.doLayout();
  575. var zPanel = Ext.getCmp('acam_op_small');
  576. zPanel.removeAll( true );
  577. zPanel.add( { html: "<div class='setEd_infoPanel' id='NUNU'><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>" } );
  578. zPanel.doLayout();
  579. } else {
  580. tPanel.removeAll( true );
  581. tPanel.doLayout();
  582. var zPanel = Ext.getCmp('acam_op_small');
  583. zPanel.removeAll( true );
  584. zPanel.add( { html: "<div class='setEd_infoPanel' id='NUNU'><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>" } );
  585. zPanel.doLayout();
  586. };
  587. },
  588. failure: failureAJAXFunction
  589. });
  590. };
  591. function loadApplicationSettings( par ){
  592. Ext.Ajax.request({
  593. url: '/lib/controller/getApplicationSettings.php',
  594. params: {
  595. UID: <?=$UserID;?>,
  596. TYP: par,
  597. SID: '<?=$Session;?>',
  598. },
  599. success: function( response, opts ){
  600. var tData = Ext.decode(response.responseText);
  601. if( tData.status == 'ok' ){
  602. var res = Ext.decode( tData.content );
  603. var tPanel = Ext.getCmp('aps_tab_'+par );
  604. tPanel.removeAll( true );
  605. //debugger;
  606. if( Array.isArray( res ) ){
  607. for( i= 0; i < res.length; i++ )tPanel.add( res[i] );
  608. } else {
  609. tPanel.add( res );
  610. };
  611. tPanel.doLayout();
  612. };
  613. },
  614. failure: failureAJAXFunction
  615. });
  616. };
  617. function loadAttachedSensors(){
  618. Ext.Ajax.request({
  619. url: '/lib/controller/getSensors.php',
  620. params: {
  621. UID: <?=$UserID;?>,
  622. SID: '<?=$Session;?>',
  623. },
  624. success: function( response, opts ){
  625. var tData = Ext.decode(response.responseText);
  626. var tPanel = Ext.getCmp('sens_container');
  627. if( tData.status == 'ok' ){
  628. var res = Ext.decode( tData.sensors );
  629. tPanel.removeAll( true );
  630. tPanel.add( res );
  631. tPanel.doLayout();
  632. var zPanel = Ext.getCmp('sens_op_small');
  633. zPanel.removeAll( true );
  634. zPanel.add( { html: "<div class='setEd_infoPanel' id='NUNU'><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>" } );
  635. zPanel.doLayout();
  636. } else {
  637. tPanel.removeAll( true );
  638. tPanel.doLayout();
  639. var zPanel = Ext.getCmp('sens_op_small');
  640. zPanel.removeAll( true );
  641. zPanel.add( { html: "<div class='setEd_infoPanel' id='NUNU'><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>" } );
  642. zPanel.doLayout();
  643. };
  644. },
  645. failure: failureAJAXFunction
  646. });
  647. };
  648. function editResource( rid ){
  649. var loadEditor = true;
  650. if( settingsAreChanged ){
  651. Ext.Msg.show({
  652. title:'<?=$Labels->GetLabel('_SETTINGS_CHANGED_');?>',
  653. msg: '<?=$Labels->GetLabel('_SET_CHANGED_WOULD_SAVE_');?>',
  654. buttons: Ext.Msg.YESNO,
  655. icon: Ext.MessageBox.WARNING,
  656. fn: function(btn, text){
  657. if( btn == 'yes' ){
  658. cleanupChangeNotifier();
  659. } else {
  660. loadEditor = false;
  661. };
  662. }
  663. });
  664. };
  665. if( loadEditor ){
  666. Ext.Ajax.request({
  667. url: '/lib/controller/getResourceEditor.php',
  668. params: {
  669. RID: rid,
  670. UID: <?=$UserID;?>,
  671. SID: '<?=$Session;?>',
  672. },
  673. success: function( response, opts ){
  674. var data = Ext.decode(response.responseText);
  675. var resourceEdPanel = Ext.getCmp('res_ed_small');
  676. if( resourceEdPanel ){
  677. resourceEdPanel.removeAll( true );
  678. resourceEdPanel.add( data );
  679. resourceEdPanel.doLayout();
  680. };
  681. },
  682. failure: failureAJAXFunction
  683. });
  684. };
  685. };
  686. function editFilter( fid ){
  687. var loadEditor = true;
  688. if( settingsAreChanged ){
  689. Ext.Msg.show({
  690. title: "<?=$Labels->GetLabel('_SETTINGS_CHANGED_');?>",
  691. msg: "<?=$Labels->GetLabel('_SET_CHANGED_WOULD_SAVE_');?>",
  692. buttons: Ext.Msg.YESNO,
  693. icon: Ext.MessageBox.WARNING,
  694. fn: function(btn, text){
  695. if( btn == 'yes' ){
  696. cleanupChangeNotifier();
  697. } else {
  698. loadEditor = false;
  699. };
  700. }
  701. });
  702. };
  703. if( loadEditor ){
  704. Ext.Ajax.request({
  705. url: '/lib/controller/getFilterEditor.php',
  706. params: {
  707. FID: fid,
  708. UID: <?=$UserID;?>,
  709. SID: '<?=$Session;?>',
  710. },
  711. success: function( response, opts ){
  712. var data = Ext.decode(response.responseText);
  713. var resourceEdPanel = Ext.getCmp('flt_ed_small');
  714. if( resourceEdPanel ){
  715. resourceEdPanel.removeAll( true );
  716. resourceEdPanel.add( data );
  717. resourceEdPanel.doLayout();
  718. };
  719. },
  720. failure: failureAJAXFunction
  721. });
  722. };
  723. };
  724. function editModule( mid ){
  725. var loadEditor = true;
  726. if( settingsAreChanged ){
  727. Ext.Msg.show({
  728. title: "<?=$Labels->GetLabel('_SETTINGS_CHANGED_');?>",
  729. msg: "<?=$Labels->GetLabel('_SET_CHANGED_WOULD_SAVE_');?>",
  730. buttons: Ext.Msg.YESNO,
  731. icon: Ext.MessageBox.WARNING,
  732. fn: function(btn, text){
  733. if( btn == 'yes' ){
  734. cleanupChangeNotifier();
  735. } else {
  736. loadEditor = false;
  737. };
  738. }
  739. });
  740. };
  741. if( loadEditor ){
  742. Ext.Ajax.request({
  743. url: '/lib/controller/getModuleEditor.php',
  744. params: {
  745. MID: mid,
  746. UID: <?=$UserID;?>,
  747. SID: '<?=$Session;?>',
  748. },
  749. success: function( response, opts ){
  750. var data = Ext.decode(response.responseText);
  751. var moduleEdPanel = Ext.getCmp('mod_ed_small');
  752. if( moduleEdPanel ){
  753. moduleEdPanel.removeAll( true );
  754. moduleEdPanel.add( data );
  755. moduleEdPanel.doLayout();
  756. };
  757. },
  758. failure: failureAJAXFunction
  759. });
  760. };
  761. };
  762. function doModuleOperation( ID, OPO, OPCO, reload ){
  763. Ext.Ajax.request({
  764. url: '/lib/controller/doModuleOperation.php',
  765. params: {
  766. OPID: OPO,
  767. OPCODE: OPCO,
  768. MID: ID,
  769. UID: <?=$UserID;?>,
  770. SID: '<?=$Session;?>'
  771. },
  772. success: function(){
  773. if( reload ) loadModules();
  774. }
  775. });
  776. };
  777. function enableModule( ID ){
  778. doModuleOperation( ID, 2, 1, true );
  779. };
  780. function disableModule( ID ){
  781. doModuleOperation( ID, 2, 0, true );
  782. };
  783. //cursor: url('data:image/svg+xml;utf8,<svg fill="%23FF0000" height="48" viewBox="0 0 24 24" width="48" xmlns="http://www.w3.org/2000/svg"><path d="M0 0h24v24H0z" fill="none"/><path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"/></svg>') 24 24, auto;
  784. function doCamOperation( cid, op, param, reload = false ){
  785. Ext.Ajax.request({
  786. url: '/lib/controller/doCameraOperation.php',
  787. params: {
  788. CID: cid,
  789. CMD: 10,
  790. OPID: op,
  791. OPCODE: param,
  792. UID: <?=$UserID;?>,
  793. SID: '<?=$Session;?>'
  794. },
  795. success: function(){
  796. if( reload ) loadDetectedCameras();
  797. if( reload ) loadAssignedCameras();
  798. }
  799. });
  800. };
  801. function doApplicationOperation( op, param, reload = false ){
  802. Ext.Ajax.request({
  803. url: '/lib/controller/doApplicationOperation.php',
  804. params: {
  805. OPID: op,
  806. OPCODE: param,
  807. UID: <?=$UserID;?>,
  808. SID: '<?=$Session;?>'
  809. },
  810. success: function(){
  811. if( reload ) loadApplicationSettings( content_lvl3 );
  812. //if( reload ) loadAssignedCameras();
  813. }
  814. });
  815. };
  816. function doSensorOperation( sensorid, op, param, reload = false ){
  817. Ext.Ajax.request({
  818. url: '/lib/controller/doSensorOperation.php',
  819. params: {
  820. SNID: sensorid,
  821. CMD: op,
  822. OPID: op,
  823. OPCODE: param,
  824. UID: <?=$UserID;?>,
  825. SID: '<?=$Session;?>'
  826. },
  827. success: function(){
  828. if( reload ) loadAttachedSensors();
  829. }
  830. });
  831. };
  832. function doResourceOperation( resourceid, op, param, value, reload = false ){
  833. Ext.Ajax.request({
  834. url: '/lib/controller/doResourceOperation.php',
  835. params: {
  836. RID: resourceid,
  837. OPID: op,
  838. OPCODE: param,
  839. OPVAL: value,
  840. UID: <?=$UserID;?>,
  841. SID: '<?=$Session;?>'
  842. },
  843. success: function(){
  844. if( reload ) loadAttachedSensors();
  845. }
  846. });
  847. };
  848. function removeModule( ID ){
  849. Ext.Msg.show({
  850. title: "<?=$Labels->GetLabel('_PLS_CONFIRM_');?>",
  851. msg: "<?=$Labels->GetLabel('_RUS_DELETE_MODULE_');?>",
  852. buttons: Ext.Msg.YESNOCANCEL,
  853. fn: function( btn, text ){
  854. if( btn == 'yes' ){
  855. Ext.Ajax.request({
  856. url: '/lib/controller/doModuleOperation.php',
  857. params: {
  858. OPID: 1,
  859. MID: ID,
  860. UID: <?=$UserID;?>,
  861. SID: '<?=$Session;?>'
  862. },
  863. success: function(){
  864. //showSettings( SelectedNodeID, 2 );
  865. loadModules();
  866. }
  867. });
  868. };
  869. },
  870. icon: Ext.MessageBox.QUESTION
  871. });
  872. };
  873. function disableServOps(){
  874. var tC = Ext.getCmp('servopPanel01');
  875. tC.removeClass('servopInfo_item01');
  876. tC.addClass('servopInfo_item00');
  877. tC.disable();
  878. Ext.getCmp('tbtn_sop01').disable();
  879. //tC.doLayout();
  880. tC = Ext.getCmp('servopPanel02');
  881. tC.removeClass('servopInfo_item11');
  882. tC.addClass('servopInfo_item10');
  883. tC.disable();
  884. Ext.getCmp('tbtn_sop02').disable();
  885. //tC.doLayout();
  886. tC = Ext.getCmp('servopPanel03');
  887. tC.removeClass('servopInfo_item21');
  888. tC.addClass('servopInfo_item20');
  889. tC.disable();
  890. Ext.getCmp('tbtn_sop03').disable();
  891. //tC.doLayout();
  892. tC = Ext.getCmp('servopPanel04');
  893. tC.removeClass('servopInfo_item31');
  894. tC.addClass('servopInfo_item30');
  895. tC.disable();
  896. Ext.getCmp('tbtn_sop04').disable();
  897. //tC.doLayout();
  898. };
  899. function enableServOps(){
  900. var tC = Ext.getCmp('servopPanel01');
  901. if( tC != undefined ){
  902. tC.removeClass('servopInfo_item00');
  903. tC.addClass('servopInfo_item01');
  904. Ext.getCmp('tbtn_sop01').enable();
  905. tC.enable();
  906. };
  907. //tC.doLayout();
  908. tC = Ext.getCmp('servopPanel02');
  909. if( tC != undefined ){
  910. tC.removeClass('servopInfo_item10');
  911. tC.addClass('servopInfo_item11');
  912. tC.enable();
  913. Ext.getCmp('tbtn_sop02').enable();
  914. };
  915. //tC.doLayout();
  916. tC = Ext.getCmp('servopPanel03');
  917. if( tC != undefined ){
  918. tC.removeClass('servopInfo_item20');
  919. tC.addClass('servopInfo_item21');
  920. tC.enable();
  921. Ext.getCmp('tbtn_sop03').enable();
  922. };
  923. //tC.doLayout();
  924. tC = Ext.getCmp('servopPanel04');
  925. if( tC != undefined ){
  926. tC.removeClass('servopInfo_item30');
  927. tC.addClass('servopInfo_item31');
  928. tC.enable();
  929. Ext.getCmp('tbtn_sop04').enable();
  930. };
  931. //tC.doLayout();
  932. };
  933. function updateServerStatus(){
  934. Ext.Ajax.request({
  935. url: '/lib/controller/getServerStatus.php',
  936. params: {
  937. SERVID: 1,
  938. UID: <?=$UserID;?>,
  939. SID: '<?=$Session;?>'
  940. },
  941. success: function( response, opts ){
  942. // If the response is JSON, you have to decode it
  943. var sps = document.getElementById("INFO_SPS");
  944. if( sps == undefined ) return;
  945. var data = Ext.decode(response.responseText);
  946. if( data.status == 'ok' ){
  947. serverIsOnLine = true;
  948. enableServOps();
  949. //document.getElementById('HW_NFO').innerHTML = data.stats.hw_info;
  950. //document.getElementById('OS_NFO').innerHTML = data.stats.os_info;
  951. //document.getElementById('BLD_NFO').innerHTML = data.stats.build;
  952. setDonatStatus( 1, 0, data.stats.stat_cpu15 );
  953. setDonatStatus( 1, 1, data.stats.stat_mem );
  954. setDonatStatus( 1, 2, data.stats.stat_disk );
  955. setDonatStatus( 1, 3, data.stats.temp0 );
  956. sps.classList.remove('setEd_infoPanel');
  957. sps.classList.add('setEl_infoPanel');
  958. } else {
  959. serverIsOnLine = false;
  960. disableServOps();
  961. if( data.status == 'na' ){
  962. setDonatStatus( 1, 0, -1 );
  963. setDonatStatus( 1, 1, -1 );
  964. setDonatStatus( 1, 2, -1 );
  965. setDonatStatus( 1, 3, -1 );
  966. sps.classList.remove('setEl_infoPanel');
  967. sps.classList.add('setEd_infoPanel');
  968. } else {
  969. Ext.Msg.show({
  970. title: "<?=$Labels->GetLabel("_INFO_MSG_");?>",
  971. msg: data.messages,
  972. buttons: Ext.Msg.OK,//YESNOCANCEL,
  973. fn: function(){
  974. },
  975. icon: Ext.MessageBox.INFO //QUESTION
  976. });
  977. };
  978. };
  979. if( tlInterval == null ){
  980. tlInterval = window.setInterval( updateServerStatus, 1200, selectedSite );
  981. };
  982. },
  983. failure: failureAJAXFunction
  984. });
  985. };
  986. var addE2UDialog = null;
  987. function addEthernet2Uart(){
  988. if( addE2UDialog == null ){
  989. addE2UDialog = new Ext.Window({
  990. modal: true,
  991. title: "<?=$Labels->GetLabel('_ADD_E2U_DIAL_TTL_');?>",
  992. width: 400,
  993. height: 560,
  994. layout: 'fit',
  995. closeAction: 'hide',
  996. items:[{
  997. xtype: 'form',
  998. labelWidth: 120, // label settings here cascade unless overridden
  999. frame: false,
  1000. width: 400,
  1001. labelAlign: 'right',
  1002. //bodyStyle:'padding:5px 5px 0',
  1003. defaultType: 'textfield',
  1004. items:[{
  1005. xtype: 'panel',
  1006. height: 200,
  1007. frame: false,
  1008. border: false,
  1009. html: '<center><img width="200px" src="/style/assets/eth2uart.png"></center>'
  1010. },/*{
  1011. fieldLabel: 'Name',
  1012. id: 'ued_name'
  1013. },{
  1014. xtype: 'combo',
  1015. fieldLabel: '<?=$Labels->GetLabel('_CONNECT_2_');?>',
  1016. id: 'ued_servid',
  1017. editable: false,
  1018. typeAhead: true,
  1019. triggerAction: 'all',
  1020. width: '100%',
  1021. lazyRender:true,
  1022. mode: 'local',
  1023. store: new Ext.data.ArrayStore({
  1024. <?php
  1025. $QS = "SELECT `id`, `name` FROM `nodes` WHERE `type`=0";
  1026. $Servers = $DATABASE->Query( $QS );
  1027. $SLIST = array();
  1028. $SSID = 0;
  1029. if( count( $Servers ) ){
  1030. foreach( $Servers as $A ) $SLIST[] = '['.$A['id'].',\''.$A['name'].'\']';
  1031. $SSID = intval( $Servers[0]['id'] );
  1032. };
  1033. //[1,'Server Node'], [2,'Aux Server']
  1034. ?>
  1035. fields: ['sid', 'snam'],
  1036. data: [<?=implode(',',$SLIST);?>]
  1037. }),
  1038. value: <?=$SSID;?>,
  1039. valueField: 'sid',
  1040. displayField: 'snam'
  1041. },*/{
  1042. xtype: 'combo',
  1043. fieldLabel: "<?=$Labels->GetLabel('UART_COM_SPEED');?>",
  1044. id: 'ued_speed',
  1045. editable: false,
  1046. typeAhead: true,
  1047. triggerAction: 'all',
  1048. width: '100%',
  1049. lazyRender:true,
  1050. mode: 'local',
  1051. store: new Ext.data.ArrayStore({
  1052. fields: ['speed'],
  1053. data: [[19200], [115200]]
  1054. }),
  1055. value: 19200,
  1056. valueField: 'speed',
  1057. displayField: 'speed'
  1058. },{
  1059. xtype: 'combo',
  1060. fieldLabel: "<?=$Labels->GetLabel('UART_COM_BITS');?>",
  1061. id: 'ued_bit',
  1062. editable: false,
  1063. typeAhead: true,
  1064. triggerAction: 'all',
  1065. width: '100%',
  1066. lazyRender:true,
  1067. mode: 'local',
  1068. store: new Ext.data.ArrayStore({
  1069. fields: ['bits'],
  1070. data: [[5],[6],[7],[8],[9]]
  1071. }),
  1072. value: 8,
  1073. valueField: 'bits',
  1074. displayField: 'bits'
  1075. },{
  1076. xtype: 'combo',
  1077. fieldLabel: "<?=$Labels->GetLabel('UART_COM_SBITS');?>",
  1078. id: 'ued_stops',
  1079. editable: false,
  1080. typeAhead: true,
  1081. triggerAction: 'all',
  1082. width: '100%',
  1083. lazyRender:true,
  1084. mode: 'local',
  1085. store: new Ext.data.ArrayStore({
  1086. fields: ['stops'],
  1087. data: [[1],[1.5],[2]]
  1088. }),
  1089. value: 1,
  1090. valueField: 'stops',
  1091. displayField: 'stops'
  1092. },{
  1093. xtype: 'combo',
  1094. fieldLabel: "<?=$Labels->GetLabel('UART_COM_PARITY');?>",
  1095. id: 'ued_parity',
  1096. editable: false,
  1097. typeAhead: true,
  1098. triggerAction: 'all',
  1099. width: '100%',
  1100. lazyRender:true,
  1101. mode: 'local',
  1102. store: new Ext.data.ArrayStore({
  1103. fields: ['parity'],
  1104. data: [['Odd'], ['Even'],['None']]
  1105. }),
  1106. value: 'None',
  1107. valueField: 'parity',
  1108. displayField: 'parity'
  1109. },{
  1110. xtype: 'combo',
  1111. fieldLabel: "<?=$Labels->GetLabel('_WORKING_MODE_');?>",
  1112. id: 'ued_mode',
  1113. editable: false,
  1114. typeAhead: true,
  1115. triggerAction: 'all',
  1116. width: '100%',
  1117. lazyRender:true,
  1118. mode: 'local',
  1119. store: new Ext.data.ArrayStore({
  1120. fields: ['mode','mode_txt'],
  1121. data: [[0,"<?=$Labels->GetLabel('_UDP_CLIENT_');?>"], [1,"<?=$Labels->GetLabel('_TCP_CLIENT_');?>"], [2,"<?=$Labels->GetLabel('_UDP_SERVER_');?>"], [3,"<?=$Labels->GetLabel('_TCP_SERVER_');?>"]]
  1122. }),
  1123. value: 3,
  1124. valueField: 'mode',
  1125. displayField: 'mode_txt'
  1126. },{
  1127. fieldLabel: "<?=$Labels->GetLabel('_DEVICE_IP_');?>",
  1128. id: 'ued_ip'
  1129. },{
  1130. fieldLabel: "<?=$Labels->GetLabel('_DEVICE_PORT_');?>",
  1131. value: 8234,
  1132. id: 'ued_port'
  1133. }],
  1134. bbar: [{
  1135. text: 'Cancel',
  1136. handler: function(){//discoverOnvifSources
  1137. addE2UDialog.hide();
  1138. }
  1139. },'->',{
  1140. id: 'con_to_src',
  1141. text: 'Add Adapter to Site',
  1142. disabled: false,
  1143. handler: function(){
  1144. var SPD = Ext.getCmp('ued_speed').getValue();
  1145. var BIT = Ext.getCmp('ued_bit').getValue();
  1146. var STP = Ext.getCmp('ued_stops').getValue();
  1147. var PAR = Ext.getCmp('ued_parity').getValue();
  1148. var MOD = Ext.getCmp('ued_mode').getValue();
  1149. var IP = Ext.getCmp('ued_ip').getValue();
  1150. var PORT= Ext.getCmp('ued_port').getValue();
  1151. var MAC = '';//Ext.getCmp('ued_mac').getValue();
  1152. //var NAME= Ext.getCmp('ued_name').getValue();
  1153. //var SRV = Ext.getCmp('ued_servid').getValue();
  1154. Ext.Ajax.request({
  1155. url: '/lib/controller/addNode.php',
  1156. params: {
  1157. TYPE: 20,
  1158. UART_SPEED: SPD,
  1159. UART_BITS: BIT,
  1160. UART_STOP: STP,
  1161. UART_PAR: PAR,
  1162. UART_MODE: MOD,
  1163. UART_IP: IP,
  1164. UART_PORT: PORT,
  1165. UART_MAC: MAC,
  1166. //UART_NAME: NAME,
  1167. UID: <?=$UserID;?>,
  1168. //SRVID: SRV,
  1169. SID: '<?=$Session;?>'
  1170. },
  1171. success: function( response, opts ){
  1172. var data = Ext.decode(response.responseText);
  1173. if( data.sucess == false ){
  1174. Ext.Msg.show({
  1175. title:'Request Failure!',
  1176. msg: data.error,
  1177. buttons: Ext.Msg.OK,
  1178. icon: Ext.MessageBox.INFO
  1179. });
  1180. } else {
  1181. loadRessources();
  1182. };
  1183. addE2UDialog.hide();
  1184. },
  1185. failure: function( response, opts ) {
  1186. failureAJAXFunction( response, opts );
  1187. addE2UDialog.hide();
  1188. }
  1189. });
  1190. }
  1191. }]
  1192. }]
  1193. });
  1194. };
  1195. addE2UDialog.show();
  1196. };
  1197. var addSensorDialog = null;
  1198. var addSensWM = null;
  1199. function addSensor(){
  1200. if( addSensorDialog == null ){
  1201. addSensorDialog = new Ext.Window({
  1202. modal: true,
  1203. title: '<?=$Labels->GetLabel('_SMM_ADD_LSEN_');?>',
  1204. width: 500,
  1205. height: 438,
  1206. layout: 'form',
  1207. closeAction: 'hide',
  1208. labelWidth: 160,
  1209. labelAlign: 'right',
  1210. items:[{
  1211. xtype: 'panel',
  1212. frame: false,
  1213. border: false,
  1214. html: '<table width="100%" border=0><tr><td align="center" valign="middle"><div id="asd_img_div" class="node_1_img_set"></div></td></tr></table>'
  1215. },{
  1216. xtype: 'spacer',
  1217. height: 8
  1218. },{
  1219. xtype: 'combo',
  1220. id: 'sens_type',
  1221. fieldLabel: "<?=$Labels->GetLabel('SENS_TYPE');?>",
  1222. lazyRender: true,
  1223. mode: 'local',
  1224. forceSelection: true,
  1225. triggerAction: 'all',
  1226. editable: false,
  1227. disableKeyFilter: true,
  1228. store: new Ext.data.ArrayStore({
  1229. fields: ['mode','mode_txt'],
  1230. data: [
  1231. [1,"ALS <?=$Labels->GetLabel('_SENSOR_');?>"],
  1232. [2,"LFS <?=$Labels->GetLabel('_SENSOR_');?>"],
  1233. [3,"PLS 200 <?=$Labels->GetLabel('_SENSOR_');?>"],
  1234. [4,"PLS 360 <?=$Labels->GetLabel('_SENSOR_');?>"],
  1235. [5,"3D <?=$Labels->GetLabel('_SENSOR_');?>"]
  1236. ]
  1237. }),
  1238. valueField: 'mode',
  1239. displayField: 'mode_txt',
  1240. value: 1,
  1241. width: 200,
  1242. listeners:{
  1243. select: function( a, v, c ){
  1244. var ii = document.getElementById( 'asd_img_div' );
  1245. ii.className = "node_"+(c+1)+"_img_set";
  1246. if( c == 4 ){
  1247. Ext.getCmp('sens_id').hide();
  1248. Ext.getCmp('uart_id').hide();
  1249. Ext.getCmp('sens_port').show();
  1250. Ext.getCmp('sens_ip').show();
  1251. } else {
  1252. Ext.getCmp('sens_id').show();
  1253. Ext.getCmp('uart_id').show();
  1254. Ext.getCmp('sens_port').hide();
  1255. Ext.getCmp('sens_ip').hide();
  1256. };
  1257. }
  1258. }
  1259. },{
  1260. xtype: 'combo',
  1261. id: 'sens_range',
  1262. fieldLabel: "<?=$Labels->GetLabel('SENS_RANGE');?>",
  1263. lazyRender: true,
  1264. mode: 'local',
  1265. forceSelection: true,
  1266. triggerAction: 'all',
  1267. editable: false,
  1268. disableKeyFilter: true,
  1269. store: new Ext.data.ArrayStore({
  1270. fields: ['range','range_txt'],
  1271. data: [
  1272. [15,"15 <?=$Labels->GetLabel('_METERS_RANGE_');?>"],
  1273. [35,"35 <?=$Labels->GetLabel('_METERS_RANGE_');?>"],
  1274. [65,"65 <?=$Labels->GetLabel('_METERS_RANGE_');?>"],
  1275. [75,"75 <?=$Labels->GetLabel('_METERS_RANGE_');?>"],
  1276. [150,"150 <?=$Labels->GetLabel('_METERS_RANGE_');?>"],
  1277. [200,"200 <?=$Labels->GetLabel('_METERS_RANGE_');?>"],
  1278. [300,"300 <?=$Labels->GetLabel('_METERS_RANGE_');?>"],
  1279. [350,"350 <?=$Labels->GetLabel('_METERS_RANGE_');?>"]
  1280. ]
  1281. }),
  1282. valueField: 'range',
  1283. displayField: 'range_txt',
  1284. value: 15,
  1285. width: 200
  1286. },{
  1287. xtype: 'numberfield',
  1288. id: 'sens_id',
  1289. fieldLabel: "<?=$Labels->GetLabel('_PROTO_DEVICE_ID_');?>",
  1290. width: 200,
  1291. value: 0
  1292. },{
  1293. xtype: 'combo',
  1294. fieldLabel: "<?=$Labels->GetLabel('_UART_PORT_');?>",
  1295. lazyRender: true,
  1296. id: 'uart_id',
  1297. mode: 'local',
  1298. disabled: false,
  1299. forceSelection: true, triggerAction: 'all', editable: false, disableKeyFilter: true,
  1300. store: new Ext.data.ArrayStore({
  1301. fields: ['uart','uart_txt'],
  1302. data: [<?php
  1303. $QS="SELECT aux_id, device FROM resources WHERE ( type=1 OR type=129 )";
  1304. $RR=$DATABASE->Query( $QS );
  1305. if( count( $RR ) ){
  1306. $RE=array();
  1307. foreach( $RR as $R ){
  1308. $RE[] = "[ {$R['aux_id']}, '{$R['device']}']";
  1309. };
  1310. echo implode( ',', $RE );
  1311. } else {
  1312. echo "[0, \"".$Labels->GetLabel('_NO_UARTS_DEF_')."\"]";
  1313. };
  1314. ?>]
  1315. }),
  1316. valueField: 'uart',
  1317. displayField: 'uart_txt',
  1318. width: 200
  1319. },{
  1320. xtype: 'textfield',
  1321. id: 'sens_ip',
  1322. hidden: true,
  1323. fieldLabel: "<?=$Labels->GetLabel('_DEVICE_IP_');?>",
  1324. width: 200,
  1325. value: '192.168.200.105'
  1326. },{
  1327. xtype: 'numberfield',
  1328. id: 'sens_port',
  1329. hidden: true,
  1330. fieldLabel: "<?=$Labels->GetLabel('_DEVICE_PORT_');?>",
  1331. width: 200,
  1332. value: 2222
  1333. },{
  1334. xtype:'button',
  1335. width: '100%',
  1336. text: "<?=$Labels->GetLabel('_ADD_');?>",
  1337. handler: function(){
  1338. var TYP = parseInt( Ext.getCmp('sens_type').getValue() );
  1339. var RAN = parseInt( Ext.getCmp('sens_range').getValue() );
  1340. if( TYP > 4 ){
  1341. var RIP = Ext.getCmp('sens_ip').getValue();
  1342. var RPP = parseInt( Ext.getCmp('sens_port').getValue() );
  1343. addSensWM = new Ext.LoadMask( addSensorDialog.getEl(), {msg:"<?=$Labels->GetLabel('_Please_Wait_');?>..."});
  1344. addSensWM.show();
  1345. Ext.Ajax.request({
  1346. url: '/lib/controller/doNodeOperation.php',
  1347. params: {
  1348. UID: <?=$UserID;?>,
  1349. SID: '<?=$Session;?>',
  1350. TYPE: TYP,
  1351. RANGE: RAN,
  1352. ADDR: RIP,
  1353. PORT: RPP,
  1354. CCMD: 1
  1355. },
  1356. success: function( response, opts ){
  1357. addSensWM.hide();
  1358. var data = Ext.decode(response.responseText);
  1359. if( data.status == 'ok' ){
  1360. loadAttachedSensors();
  1361. } else {
  1362. Ext.Msg.show({
  1363. title:'Error!',
  1364. msg: data.msg,
  1365. buttons: Ext.Msg.OK,
  1366. icon: Ext.MessageBox.WARNING
  1367. });
  1368. };
  1369. addSensorDialog.hide();
  1370. },
  1371. failure: failureAJAXFunction
  1372. });
  1373. } else {
  1374. var RTI = parseInt( Ext.getCmp('uart_id').getValue() );
  1375. if( RTI > 0 ){
  1376. var PID = parseInt( Ext.getCmp('sens_id').getValue() );
  1377. addSensWM = new Ext.LoadMask( addSensorDialog.getEl(), {msg:"<?=$Labels->GetLabel('_Please_Wait_');?>..."});
  1378. addSensWM.show();
  1379. Ext.Ajax.request({
  1380. url: '/lib/controller/doNodeOperation.php',
  1381. params: {
  1382. UID: <?=$UserID;?>,
  1383. SID: '<?=$Session;?>',
  1384. TYPE: TYP,
  1385. DEVID: PID,
  1386. UART: RTI,
  1387. RANGE: RAN,
  1388. CCMD: 1
  1389. },
  1390. success: function( response, opts ){
  1391. addSensWM.hide();
  1392. var data = Ext.decode(response.responseText);
  1393. if( data.status == 'ok' ){
  1394. loadAttachedSensors();
  1395. } else {
  1396. Ext.Msg.show({
  1397. title:'Error!',
  1398. msg: data.msg,
  1399. buttons: Ext.Msg.OK,
  1400. icon: Ext.MessageBox.WARNING
  1401. });
  1402. };
  1403. addSensorDialog.hide();
  1404. },
  1405. failure: failureAJAXFunction
  1406. });
  1407. } else {
  1408. Ext.Msg.show({
  1409. title:'Error!',
  1410. msg: 'Please Choose UART Port',
  1411. buttons: Ext.Msg.OK,
  1412. icon: Ext.MessageBox.WARNING
  1413. });
  1414. };
  1415. };
  1416. }
  1417. }]
  1418. });
  1419. };
  1420. addSensorDialog.show();
  1421. };
  1422. var addDetCamDialog = null;
  1423. var addDetCamWM = null;
  1424. function addDetectedIPCam(){
  1425. if( addDetCamDialog == null ){
  1426. addDetCamDialog = new Ext.Window({
  1427. modal: true,
  1428. title: "<?=$Labels->GetLabel('_ADD_CAM_DIAL_TTL_');?>",
  1429. width: 400,
  1430. height: 187,
  1431. layout: 'form',
  1432. closeAction: 'hide',
  1433. labelWidth: 160,
  1434. labelAlign: 'right',
  1435. items:[{
  1436. xtype: 'spacer',
  1437. height: 8
  1438. },{
  1439. xtype: 'textfield',
  1440. id: 'ncam_ip',
  1441. fieldLabel: "<?=$Labels->GetLabel('_CAM_IP_ADDRESS_');?>",
  1442. value: ''
  1443. },{
  1444. xtype: 'textfield',
  1445. id: 'ncam_user',
  1446. fieldLabel: "<?=$Labels->GetLabel('_ACCESS_LOGIN_');?>",
  1447. value: ''
  1448. },{
  1449. xtype: 'textfield',
  1450. id: 'ncam_pwd',
  1451. inputType: 'password',
  1452. fieldLabel: "<?=$Labels->GetLabel('_ACCESS_PASSWORD_');?>",
  1453. value: ''
  1454. },{
  1455. xtype: 'combo',
  1456. id: 'ncam_auth_mode',
  1457. fieldLabel: "<?=$Labels->GetLabel('_AUTH_MODE_0_');?>",
  1458. lazyRender: true,
  1459. mode: 'local',
  1460. forceSelection: true,
  1461. triggerAction: 'all',
  1462. editable: false,
  1463. disableKeyFilter: true,
  1464. store: new Ext.data.ArrayStore({
  1465. fields: ['mode','mode_txt'],
  1466. data: [
  1467. [0,'BASIC'],
  1468. [1,'DIGEST'],
  1469. [2,'DIGEST_IE'],
  1470. [3,'BEARER'],
  1471. [4,'NEGOTIATE'],
  1472. [5,'NTLM'],
  1473. [6,'NTLM_WB'],
  1474. [7,'ANY'],
  1475. [8,'ANYSAFE'],
  1476. [9,'ONLY'],
  1477. [10,'AWS_SIGV4']
  1478. ]
  1479. }),
  1480. valueField: 'mode',
  1481. displayField: 'mode_txt',
  1482. value: 0,
  1483. width: 200
  1484. },{
  1485. xtype: 'spacer',
  1486. height: 8
  1487. },{
  1488. xtype:'button',
  1489. width: '100%',
  1490. text: 'Add Camera to List',
  1491. handler: function(){
  1492. addDetCamWM = new Ext.LoadMask( addDetCamDialog.getEl(), {msg:"<?=$Labels->GetLabel('_Please_Wait_');?>..."});
  1493. addDetCamWM.show();
  1494. var NIP = Ext.getCmp('ncam_ip').getValue();
  1495. var NUU = Ext.getCmp('ncam_user').getValue();
  1496. var NPP = Ext.getCmp('ncam_pwd').getValue();
  1497. var NAM = Ext.getCmp('ncam_auth_mode').getValue();
  1498. Ext.Ajax.request({
  1499. url: '/lib/controller/doCameraOperation.php',
  1500. params: {
  1501. UID: <?=$UserID;?>,
  1502. SID: '<?=$Session;?>',
  1503. IP: NIP,
  1504. UU: NUU,
  1505. PP: NPP,
  1506. AU: NAM,
  1507. CMD: 3
  1508. },
  1509. success: function( response, opts ){
  1510. addDetCamWM.hide();
  1511. var data = Ext.decode(response.responseText);
  1512. if( data.status == 'ok' ){
  1513. loadDetectedCameras();
  1514. } else {
  1515. Ext.Msg.show({
  1516. title:'Error!',
  1517. msg: data.msg,
  1518. buttons: Ext.Msg.OK,
  1519. icon: Ext.MessageBox.WARNING
  1520. });
  1521. };
  1522. addDetCamDialog.hide();
  1523. },
  1524. failure: failureAJAXFunction
  1525. });
  1526. }
  1527. }]
  1528. });
  1529. };
  1530. addDetCamDialog.show();
  1531. };
  1532. var devUploadTimeout = null;
  1533. var devUploadID = -1;
  1534. function fetchDeviceUploadStatus(){
  1535. clearTimeout( devUploadTimeout );
  1536. if( devUploadID < 1 ) return;
  1537. Ext.Ajax.request({
  1538. url: '/lib/controller/getDeviceUploadStatus.php',
  1539. params: {
  1540. UID: <?=$UserID;?>,
  1541. SID: '<?=$Session;?>',
  1542. DID: devUploadID
  1543. },
  1544. success: function( response, opts ){
  1545. var data = Ext.decode(response.responseText);
  1546. var tT = Ext.getCmp('upp_ttext');
  1547. if( tT != undefined ){
  1548. if( data.count > 0 ){
  1549. devUploadTimeout = setTimeout( fetchDeviceUploadStatus, 1000 );
  1550. };
  1551. if( data.current != undefined ){
  1552. tT.update('<p class="UPTTEXT">Uploading '+data.count+' file(s)</p>');
  1553. document.getElementById('upp_ctext').innerHTML ='<p class="UPCTEXT">Current File: '+data.current+'</p>';
  1554. Ext.getCmp('upp_pbar').updateProgress( data.progress, Math.round( data.progress*100 )+'%', true );
  1555. devUploadTimeout = setTimeout( fetchDeviceUploadStatus, 1000 );
  1556. } else {
  1557. Ext.getCmp('upload_progres_panel').hide();
  1558. Ext.getCmp('uploaded_grid').show();
  1559. loadModuleFiles( devUploadID );
  1560. };
  1561. };
  1562. },
  1563. failure: failureAJAXFunction
  1564. });
  1565. };
  1566. function downloadSettings(){
  1567. ReportMask = new Ext.LoadMask(Ext.getBody(), {msg:"<?=$Labels->GetLabel('_Please_Wait_');?>..."});
  1568. ReportMask.show();
  1569. const formData = new FormData();
  1570. formData.append("UID",<?=$UserID;?>);
  1571. formData.append("SID",'<?=$Session;?>');
  1572. fetch('/lib/controller/downloadSettings.php',{
  1573. method: "POST",
  1574. body: formData
  1575. })
  1576. .then(resp => resp.blob())
  1577. .then(blob => {
  1578. const url = window.URL.createObjectURL(blob);
  1579. const a = document.createElement('a');
  1580. a.style.display = 'none';
  1581. a.href = url;
  1582. var today=new Date();
  1583. var SY=1900+today.getYear();
  1584. var SMO=today.getMonth()+1;
  1585. var SD=today.getDate();
  1586. var SH = today.getHours();
  1587. var SM = today.getMinutes();
  1588. var SS = today.getSeconds();
  1589. a.download = 'backup_'+SY+'.'+SMO+'.'+SD+'_'+SH+'-'+SM+'-'+SS+'.db';
  1590. document.body.appendChild(a);
  1591. a.click();
  1592. window.URL.revokeObjectURL(url);
  1593. ReportMask.hide();
  1594. Ext.Msg.show({
  1595. title:'<?=$Labels->GetLabel('_SUCCESS_');?>',
  1596. msg: '<?=$Labels->GetLabel('_DB_FILE_HAS_DOWNLOADED_');?>',
  1597. buttons: Ext.Msg.OK,
  1598. icon: Ext.MessageBox.INFO
  1599. });
  1600. })
  1601. .catch(() => {
  1602. ReportMask.hide();
  1603. Ext.Msg.show({
  1604. title:'<?=$Labels->GetLabel('_REQ_FAILURE_');?>',
  1605. msg: '<?=$Labels->GetLabel('_AJX_REQFAILURE_');?>',
  1606. buttons: Ext.Msg.OK,
  1607. icon: Ext.MessageBox.ERROR
  1608. });
  1609. });
  1610. };
  1611. function showSettingsGeneral(){
  1612. stopStatusUpdater();
  1613. content_lvl1 = 1;
  1614. content_lvl2 = 0;
  1615. var tPanel = Ext.getCmp('main_content');
  1616. tPanel.removeAll( true );
  1617. <?php
  1618. //$QS="SELECT * FROM `servers` WHERE `id`=1";
  1619. //$SDD = $DATABASE->Query( $QS );
  1620. //$NData = $SDD[0];
  1621. $QS="SELECT * FROM `resources` WHERE `node_id`=1 AND ( `type`=101 OR `type`=102 )";
  1622. $CN = $DATABASE->Query( $QS );
  1623. $IL=array();
  1624. foreach( $CN as $N ){
  1625. $QS="SELECT * FROM `networks` WHERE `nif_id`={$N['aux_id']} AND `type`=0";
  1626. $NWD = $DATABASE->Query( $QS );
  1627. $NW = $NWD[0];
  1628. $IL[]="<td width=\"50px\"><img width=\"32\" src=\"/style/assets/".(($N['type']==101)?'NICs.png':'wifi-icon.png')."\"></td><td align=\"right\"><b>{$N['device']}:</b></td><td><b>{$NW['address']}</b></td>";
  1629. };
  1630. $NIFO = '<table><tr>' . implode( '</tr><tr>', $IL ) . '</tr></table>';
  1631. ?>
  1632. tPanel.add({
  1633. xtype: 'tabpanel',
  1634. frame: false,
  1635. id: 'node_settings_content',
  1636. border: false,
  1637. activeTab: content_lvl3,
  1638. items: [{
  1639. xtype: 'panel',
  1640. id: 'gi_tab',
  1641. title: "<?=$Labels->GetLabel( '_GENERAL_NFO_' );?>",
  1642. layout: 'hbox',
  1643. items:[{
  1644. xtype: 'panel',
  1645. flex: 1,
  1646. height: PanelH-15,
  1647. autoScroll: false,
  1648. html: '<table width="100%" height="100%" border=0><tr><td height="290px" align="center" valign="middle"><div class="server_img_set"></div></td></tr>\
  1649. <tr><td height="100px"><table width="100%" border=0><tr>\
  1650. <td align="center"><svg class="donut" width="80" height="100%" viewBox="0 0 42 42"><circle id="status_1_donut0_segment2" cx="21" cy="21" r="15.91549430918954" fill="transparent" stroke="#b1c94e" stroke-width="3" stroke-dasharray="0 100" stroke-dashoffset="25"></circle><circle id="status_1_donut0_segment3" cx="21" cy="21" r="15.91549430918954" fill="transparent" stroke="#aaddff" stroke-width="3" stroke-dasharray="0 100" stroke-dashoffset="25"></circle><circle id="status_1_donut0_segment1" cx="21" cy="21" r="15.91549430918954" fill="transparent" stroke="#ce4b99" stroke-width="3" stroke-dasharray="0 100" stroke-dashoffset="25"></circle><g class="chart-text"><text x="50%" y="50%" class="chart-number" id="status_1_totalValue0">0</text><text x="50%" y="50%" class="chart-label">CPU</text></g></svg></td>\
  1651. <td align="center"><svg class="donut" width="80" height="100%" viewBox="0 0 42 42"><circle id="status_1_donut1_segment2" cx="21" cy="21" r="15.91549430918954" fill="transparent" stroke="#b1c94e" stroke-width="3" stroke-dasharray="0 100" stroke-dashoffset="25"></circle><circle id="status_1_donut1_segment3" cx="21" cy="21" r="15.91549430918954" fill="transparent" stroke="#aaddff" stroke-width="3" stroke-dasharray="0 100" stroke-dashoffset="25"></circle><circle id="status_1_donut1_segment1" cx="21" cy="21" r="15.91549430918954" fill="transparent" stroke="#ce4b99" stroke-width="3" stroke-dasharray="0 100" stroke-dashoffset="25"></circle><g class="chart-text"><text x="50%" y="50%" class="chart-number" id="status_1_totalValue1">0</text><text x="50%" y="50%" class="chart-label">MEM</text></g></svg></td>\
  1652. <td align="center"><svg class="donut" width="80" height="100%" viewBox="0 0 42 42"><circle id="status_1_donut2_segment2" cx="21" cy="21" r="15.91549430918954" fill="transparent" stroke="#b1c94e" stroke-width="3" stroke-dasharray="0 100" stroke-dashoffset="25"></circle><circle id="status_1_donut2_segment3" cx="21" cy="21" r="15.91549430918954" fill="transparent" stroke="#aaddff" stroke-width="3" stroke-dasharray="0 100" stroke-dashoffset="25"></circle><circle id="status_1_donut2_segment1" cx="21" cy="21" r="15.91549430918954" fill="transparent" stroke="#ce4b99" stroke-width="3" stroke-dasharray="0 100" stroke-dashoffset="25"></circle><g class="chart-text"><text x="50%" y="50%" class="chart-number" id="status_1_totalValue2">0</text><text x="50%" y="50%" class="chart-label">DISK</text></g></svg></td>\
  1653. <td align="center"><svg class="donut" width="80" height="100%" viewBox="0 0 42 42"><circle id="status_1_donut3_segment2" cx="21" cy="21" r="15.91549430918954" fill="transparent" stroke="#b1c94e" stroke-width="3" stroke-dasharray="0 100" stroke-dashoffset="25"></circle><circle id="status_1_donut3_segment3" cx="21" cy="21" r="15.91549430918954" fill="transparent" stroke="#aaddff" stroke-width="3" stroke-dasharray="0 100" stroke-dashoffset="25"></circle><circle id="status_1_donut3_segment1" cx="21" cy="21" r="15.91549430918954" fill="transparent" stroke="#ce4b99" stroke-width="3" stroke-dasharray="0 100" stroke-dashoffset="25"></circle><g class="chart-text"><text x="50%" y="50%" class="chart-number" id="status_1_totalValue3">0</text><text x="50%" y="50%" class="chart-label">TEMP</text></g></svg></td>\
  1654. </tr></table></td></tr>\
  1655. <tr><td valign="top"><div class="setEd_infoPanel" id="INFO_SPS">\
  1656. <div class="sideInfo_item" id="SW_INFO"><?=$AP_DATA['build'];?></div>\
  1657. <div class="sideInfo_item" id="OS_INFO"><?=$AP_DATA['os_info'];?></div>\
  1658. <div class="sideInfo_item" id="HW_INFO"><?=$AP_DATA['hw_info'];?></div>\
  1659. </div></td></tr>\
  1660. <tr><td height="60%">&nbsp;</td></tr></table>'
  1661. },{
  1662. xtype: 'panel',
  1663. id: '_ed_small',
  1664. flex: 1,
  1665. height: PanelH-15,
  1666. autoScroll: false,
  1667. items:[
  1668. <?php if( $CUser->Data['access'] > 3 ){ ?>
  1669. {
  1670. xtype: 'panel',
  1671. baseCls:'servopInfo_item00',
  1672. id: 'servopPanel01',
  1673. items:[{
  1674. xtype: 'panel',
  1675. frame: false,
  1676. border: false,
  1677. unstyled: true,
  1678. html: "<p><?=$Labels->GetLabel('_SERV_RESTART_DESC_');?></p><br/>"
  1679. },{
  1680. xtype: 'button',
  1681. lazyRender: true,
  1682. iconCls: 'srv_op_restart',
  1683. text: "<?=$Labels->GetLabel('_SERV_RESTART_OP_');?>",
  1684. id: 'tbtn_sop01',
  1685. scale: 'large',
  1686. width: '95%',
  1687. disabled: true,
  1688. handler: function( bt ){
  1689. Ext.Msg.show({
  1690. title:"<?=$Labels->GetLabel('_SERV_RESTART_QT_');?>",
  1691. msg: "<?=$Labels->GetLabel('_SERV_RESTART_QM_');?>",
  1692. buttons: Ext.Msg.YESNO,
  1693. width: 400,
  1694. icon: Ext.MessageBox.INFO,
  1695. fn: function(btn, text){
  1696. if( btn == 'yes' ){
  1697. disableServOps();
  1698. doDeviceOperation( 1, 250,'', true );
  1699. };
  1700. }
  1701. });
  1702. }
  1703. }]
  1704. },{
  1705. xtype: 'spacer',
  1706. height: 8
  1707. }
  1708. <?php if( $CUser->Data['access'] > 4 ){ ?>
  1709. ,{
  1710. xtype: 'panel',
  1711. baseCls:'servopInfo_item10',
  1712. id: 'servopPanel02',
  1713. items:[{
  1714. xtype: 'panel',
  1715. frame: false,
  1716. border: false,
  1717. unstyled: true,
  1718. html: "<p><?=$Labels->GetLabel('_SERV_HW_DET_DESC_');?></p><br/>"
  1719. },{
  1720. xtype: 'button',
  1721. iconCls: 'srv_op_hw_init',
  1722. text: "<?=$Labels->GetLabel('_SERV_HW_DET_OP_');?>",
  1723. id: 'tbtn_sop02',
  1724. scale: 'large',
  1725. width: '95%',
  1726. disabled: true,
  1727. handler: function( bt ){
  1728. Ext.Msg.show({
  1729. title:"<?=$Labels->GetLabel('_SERV_HW_DET_QT_');?>",
  1730. msg: "<?=$Labels->GetLabel('_SERV_HW_DET_QM_');?>",
  1731. buttons: Ext.Msg.YESNO,
  1732. width: 400,
  1733. icon: Ext.MessageBox.INFO,
  1734. fn: function(btn, text){
  1735. if( btn == 'yes' ){
  1736. disableServOps();
  1737. doDeviceOperation( 1, 251,'', true );
  1738. };
  1739. }
  1740. });
  1741. }
  1742. }]
  1743. },{
  1744. xtype: 'spacer',
  1745. height: 8
  1746. }
  1747. <?php if( $CUser->Data['access'] > 5 ){ ?>
  1748. ,{
  1749. xtype: 'panel',
  1750. baseCls:'servopInfo_item20',
  1751. id: 'servopPanel03',
  1752. items:[{
  1753. xtype: 'panel',
  1754. frame: false,
  1755. border: false,
  1756. unstyled: true,
  1757. html: "<p><?=$Labels->GetLabel('_SERV_OSRESET_DESC_');?></p><br/>"
  1758. },{
  1759. xtype: 'button',
  1760. iconCls: 'srv_op_power_cycle',
  1761. text: "<?=$Labels->GetLabel('_SERV_OSRESET_OP_');?>",
  1762. id: 'tbtn_sop03',
  1763. scale: 'large',
  1764. width: '95%',
  1765. disabled: true,
  1766. handler: function( bt ){
  1767. Ext.Msg.show({
  1768. title: "<?=$Labels->GetLabel('_SERV_OSRESET_QT_');?>",
  1769. msg: "<?=$Labels->GetLabel('_SERV_OSRESET_QM_');?>",
  1770. buttons: Ext.Msg.YESNO,
  1771. width: 400,
  1772. icon: Ext.MessageBox.WARNING,
  1773. fn: function(btn, text){
  1774. if( btn == 'yes' ){
  1775. cleanupChangeNotifier();
  1776. } else {
  1777. loadEditor = false;
  1778. };
  1779. }
  1780. });
  1781. }
  1782. }]
  1783. },{
  1784. xtype: 'spacer',
  1785. height: 8
  1786. },{
  1787. xtype: 'panel',
  1788. baseCls:'servopInfo_item30',
  1789. id: 'servopPanel04',
  1790. items:[{
  1791. xtype: 'panel',
  1792. frame: false,
  1793. border: false,
  1794. unstyled: true,
  1795. html: "<p><?=$Labels->GetLabel('_SERV_FACTORY_DESC_');?></p><br/>"
  1796. },{
  1797. xtype: 'button',
  1798. iconCls: 'srv_op_factory_reset',
  1799. text: "<?=$Labels->GetLabel('_SERV_FACTORY_OP_');?>",
  1800. id: 'tbtn_sop04',
  1801. scale: 'large',
  1802. width: '95%',
  1803. disabled: true,
  1804. handler: function( bt ){
  1805. Ext.Msg.show({
  1806. title: "<?=$Labels->GetLabel('_SERV_FACTORY_QT_');?>",
  1807. msg: "<?=$Labels->GetLabel('_SERV_FACTORY_QM_');?>",
  1808. buttons: Ext.Msg.YESNO,
  1809. width: 400,
  1810. icon: Ext.MessageBox.ERROR,
  1811. fn: function(btn, text){
  1812. if( btn == 'yes' ){
  1813. disableServOps();
  1814. doDeviceOperation( 1, 254,'', true );
  1815. };
  1816. }
  1817. });
  1818. }
  1819. }]
  1820. }
  1821. <?php
  1822. };
  1823. };
  1824. }; ?>
  1825. ]
  1826. }]
  1827. }
  1828. <?php if( $CUser->Data['access'] > 4 ){ ?>
  1829. ,{
  1830. xtype: 'panel',
  1831. title: "<?=$Labels->GetLabel( '_RESOURCES_' );?>",
  1832. id: 'res_tab',
  1833. layout: 'hbox',
  1834. items:[{
  1835. xtype: 'panel',
  1836. id: 'resources_container',
  1837. flex: 1,
  1838. height: PanelH-15,
  1839. autoScroll: 'auto',
  1840. tbar:[{
  1841. text: "<?=$Labels->GetLabel( '_ADD_REMOTE_UART_' );?>",
  1842. handler: function(){
  1843. addEthernet2Uart();
  1844. }
  1845. }],
  1846. items:[]
  1847. },{
  1848. xtype: 'panel',
  1849. id: 'res_ed_small',
  1850. flex: 1,
  1851. height: PanelH-15,
  1852. layout: 'fit',
  1853. items:[{
  1854. html: "<div class='setEd_infoPanel' id='NUNU'><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>"
  1855. }]
  1856. }]
  1857. },{
  1858. xtype: 'panel',
  1859. title: "<?=$Labels->GetLabel( '_SERVER_MODULES_' );?>",
  1860. id: 'mod_tab',
  1861. layout: 'hbox',
  1862. items:[{
  1863. xtype: 'panel',
  1864. id: 'modules_container',
  1865. flex: 1,
  1866. height: PanelH-15,
  1867. autoScroll: 'auto',
  1868. tbar:[{
  1869. text: "<?=$Labels->GetLabel( '_ADD_MODULE_' );?>",
  1870. handler: function(){
  1871. var addModuleWindow = new Ext.Window({
  1872. id: 'huha_boa',
  1873. title: "<?=$Labels->GetLabel( '_AS_MODULE_' );?>",
  1874. modal: true,
  1875. width: 400,
  1876. height: 300,
  1877. items:[{
  1878. xtype: 'form',
  1879. items: [{
  1880. xtype: 'combo',
  1881. fieldLabel: "<?=$Labels->GetLabel( 'MOD_TYPE' );?>",
  1882. id: 'mod_type',
  1883. lazyRender: true,
  1884. mode: 'local',
  1885. forceSelection: true,
  1886. triggerAction: 'all',
  1887. editable: false,
  1888. disableKeyFilter: true,
  1889. store: new Ext.data.ArrayStore({
  1890. fields: ['az_t','az_txt'],
  1891. data: [<?php
  1892. $QS = "SELECT * FROM `module_types`";
  1893. $MM = $DATABASE->Query( $QS );
  1894. $MIMO = array();
  1895. foreach( $MM as $M ) $MIMO[]="[{$M['id']},\"".$Labels->GetLabel($M['name'])."\"]";
  1896. echo implode( ',', $MIMO );
  1897. ?>]
  1898. }),
  1899. valueField: 'az_t',
  1900. displayField: 'az_txt',
  1901. value: 1,
  1902. listeners:{
  1903. select: function( t, r, i ){
  1904. var n = r.data.az_t;
  1905. Ext.Ajax.request({
  1906. url: '/lib/controller/getModuleInfo.php',
  1907. params: {
  1908. MID: n,
  1909. UID: <?=$UserID;?>,
  1910. SID: '<?=$Session;?>'
  1911. },
  1912. success: function( response, opts ){
  1913. Ext.getCmp('infopan').update( response.responseText );
  1914. }
  1915. });
  1916. }
  1917. }
  1918. },{
  1919. xtype: 'panel',
  1920. id: 'infopan',
  1921. html: ''
  1922. }]
  1923. }],
  1924. bbar:[{
  1925. text: '<?=$Labels->GetLabel( '_CANCEL_' );?>',
  1926. handler: function(){
  1927. addModuleWindow.close();
  1928. }
  1929. },{
  1930. text: '<?=$Labels->GetLabel( '_ADD_' );?>',
  1931. handler: function(){
  1932. var mtyp = Ext.getCmp('mod_type').getValue();
  1933. Ext.Ajax.request({
  1934. url: '/lib/controller/addModule.php',
  1935. params: {
  1936. SERVID: 1,
  1937. TYPE: mtyp,
  1938. UID: <?=$UserID;?>,
  1939. SID: '<?=$Session;?>'
  1940. },
  1941. success: function( response, opts ){
  1942. // If the response is JSON, you have to decode it
  1943. var data = Ext.decode(response.responseText);
  1944. if( data.status == 'ok' ){
  1945. addModuleWindow.close();
  1946. loadModules();
  1947. } else {
  1948. Ext.Msg.show({
  1949. title: "<?=$Labels->GetLabel("_INFO_MSG_");?>",
  1950. msg: data.message,
  1951. buttons: Ext.Msg.OK,//YESNOCANCEL,
  1952. fn: function(){
  1953. //SettingsLidar3D.hide();
  1954. },
  1955. icon: Ext.MessageBox.INFO //QUESTION
  1956. });
  1957. }
  1958. },
  1959. failure: failureAJAXFunction
  1960. });
  1961. }
  1962. }]
  1963. });
  1964. addModuleWindow.show();
  1965. }
  1966. }],
  1967. items:[]
  1968. },{
  1969. xtype: 'panel',
  1970. id: 'mod_ed_small',
  1971. flex: 1,
  1972. height: PanelH-15,
  1973. layout: 'fit',
  1974. items:[{
  1975. html: "<div class='setEd_infoPanel' id='NUNU'><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>"
  1976. }]
  1977. }]
  1978. },{
  1979. xtype: 'panel',
  1980. title: "<?=$Labels->GetLabel( '_TARGET_FILTERS_' );?>",
  1981. id: 'flt_tab',
  1982. layout: 'hbox',
  1983. items:[{
  1984. xtype: 'panel',
  1985. id: 'filters_container',
  1986. flex: 1,
  1987. height: PanelH-15,
  1988. autoScroll: 'auto',
  1989. tbar:[{
  1990. text: "<?=$Labels->GetLabel( '_ADD_FILTER_' );?>",
  1991. handler: function(){
  1992. var addFilterWindow = new Ext.Window({
  1993. id: 'fulu_boa',
  1994. title: "<?=$Labels->GetLabel( '_ADD_EVT_FILTER_' );?>",
  1995. modal: true,
  1996. width: 400,
  1997. height: 300,
  1998. items:[{
  1999. xtype: 'form',
  2000. items: [{
  2001. xtype: 'combo',
  2002. fieldLabel: "<?=$Labels->GetLabel( 'MOD_TYPE' );?>",
  2003. id: 'flt_type',
  2004. lazyRender: true,
  2005. mode: 'local',
  2006. forceSelection: true,
  2007. triggerAction: 'all',
  2008. editable: false,
  2009. disableKeyFilter: true,
  2010. store: new Ext.data.ArrayStore({
  2011. fields: ['az_t','az_txt'],
  2012. data: [<?php
  2013. $QS="SELECT `id`,`name` FROM `target_filter_types`";
  2014. $JIJI=$DATABASE->Query( $QS );
  2015. $OOP = array();
  2016. foreach( $JIJI as $JI ) $OOP[] = "[{$JI['id']},'".$Labels->getLabel($JI['name'])."']";
  2017. echo implode(',', $OOP );
  2018. ?>]
  2019. }),
  2020. valueField: 'az_t',
  2021. displayField: 'az_txt',
  2022. value: 1,
  2023. listeners:{
  2024. select: function( t, r, i ){
  2025. var n = r.data.az_t;
  2026. Ext.Ajax.request({
  2027. url: '/lib/controller/getFilterInfo.php',
  2028. params: {
  2029. FID: n,
  2030. UID: <?=$UserID;?>,
  2031. SID: '<?=$Session;?>'
  2032. },
  2033. success: function( response, opts ){
  2034. Ext.getCmp('filt_infopan').update( response.responseText );
  2035. }
  2036. });
  2037. }
  2038. }
  2039. },{
  2040. xtype: 'panel',
  2041. id: 'filt_infopan',
  2042. html: ''
  2043. }]
  2044. }],
  2045. bbar:[{
  2046. text: "<?=$Labels->GetLabel( '_CANCEL_' );?>",
  2047. handler: function(){
  2048. addFilterWindow.close();
  2049. }
  2050. },{
  2051. text: "<?=$Labels->GetLabel( '_ADD_' );?>",
  2052. handler: function(){
  2053. var mtyp = Ext.getCmp('flt_type').getValue();
  2054. Ext.Ajax.request({
  2055. url: '/lib/controller/addFilter.php',
  2056. params: {
  2057. SERVID: 1,
  2058. TYPE: mtyp,
  2059. UID: <?=$UserID;?>,
  2060. SID: '<?=$Session;?>'
  2061. },
  2062. success: function( response, opts ){
  2063. // If the response is JSON, you have to decode it
  2064. var data = Ext.decode(response.responseText);
  2065. if( data.status == 'ok' ){
  2066. addFilterWindow.close();
  2067. loadFilters();
  2068. } else {
  2069. Ext.Msg.show({
  2070. title: "<?=$Labels->GetLabel("_INFO_MSG_");?>",
  2071. msg: data.message,
  2072. buttons: Ext.Msg.OK,//YESNOCANCEL,
  2073. fn: function(){
  2074. //SettingsLidar3D.hide();
  2075. },
  2076. icon: Ext.MessageBox.INFO //QUESTION
  2077. });
  2078. }
  2079. },
  2080. failure: failureAJAXFunction
  2081. });
  2082. }
  2083. }]
  2084. });
  2085. addFilterWindow.show();
  2086. Ext.Ajax.request({
  2087. url: '/lib/controller/getFilterInfo.php',
  2088. params: {
  2089. FID: 1,
  2090. UID: <?=$UserID;?>,
  2091. SID: '<?=$Session;?>'
  2092. },
  2093. success: function( response, opts ){
  2094. Ext.getCmp('filt_infopan').update( response.responseText );
  2095. }
  2096. });
  2097. }
  2098. }],
  2099. items:[]
  2100. },{
  2101. xtype: 'panel',
  2102. id: 'flt_ed_small',
  2103. flex: 1,
  2104. height: PanelH-15,
  2105. layout: 'fit',
  2106. items:[{
  2107. html: "<div class='setEd_infoPanel' id='NUNU'><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>"
  2108. }]
  2109. }]
  2110. }
  2111. <?php }; ?>
  2112. ],
  2113. listeners:{
  2114. tabchange: function( tp, t ){
  2115. switch( t.getId() ){
  2116. case 'gi_tab': {
  2117. //content_lvl3=0;
  2118. updateServerStatus();
  2119. break;
  2120. };
  2121. case 'res_tab': {
  2122. //content_lvl3=1;
  2123. stopStatusUpdater();
  2124. loadRessources();
  2125. break;
  2126. };
  2127. case 'mod_tab':{
  2128. //content_lvl3=2;
  2129. stopStatusUpdater();
  2130. loadModules();
  2131. break;
  2132. };
  2133. case 'flt_tab':{
  2134. //content_lvl3=3;
  2135. stopStatusUpdater();
  2136. loadFilters();
  2137. break;
  2138. };
  2139. };
  2140. //updateUserContent();
  2141. },
  2142. afterrender: function(){
  2143. settingsAreChanged = false;
  2144. }
  2145. },
  2146. updateSettings: function(){
  2147. alert('Update Settings');
  2148. }
  2149. });
  2150. tPanel.doLayout();
  2151. updateServerStatus();
  2152. };
  2153. function showSettingsSensors(){
  2154. stopStatusUpdater();
  2155. content_lvl1 = 1;
  2156. content_lvl2 = 4;
  2157. var tPanel = Ext.getCmp('main_content');
  2158. tPanel.removeAll( true );
  2159. tPanel.add({
  2160. xtype: 'panel',
  2161. id: 'sen_set',
  2162. layout: 'hbox',
  2163. tbar:[{
  2164. text: "<?=$Labels->GetLabel( '_SMM_ADD_LSEN_' );?>",
  2165. handler: function(){
  2166. addSensor();
  2167. }
  2168. }],
  2169. items:[{
  2170. xtype: 'panel',
  2171. id: 'sens_container',
  2172. flex: 1,
  2173. height: PanelH-15,
  2174. autoScroll: 'auto',
  2175. items:[]
  2176. },{
  2177. xtype: 'panel',
  2178. id: 'sens_op_small',
  2179. flex: 1,
  2180. height: PanelH-15,
  2181. layout: 'fit',
  2182. items:[{
  2183. html: "<div class='setEd_infoPanel' id='NUNU'><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>"
  2184. }]
  2185. }]
  2186. });
  2187. tPanel.doLayout();
  2188. loadAttachedSensors();
  2189. };
  2190. function showSettingsDetection(){
  2191. stopStatusUpdater();
  2192. content_lvl1 = 1;
  2193. content_lvl2 = 4;
  2194. var tPanel = Ext.getCmp('main_content');
  2195. tPanel.removeAll( true );
  2196. tPanel.add({
  2197. xtype: 'panel',
  2198. id: 'sen_set',
  2199. layout: 'hbox',
  2200. tbar:[{
  2201. text: "<?=$Labels->GetLabel( '_SMM_ADD_LSEN_' );?>",
  2202. handler: function(){
  2203. addSensor();
  2204. }
  2205. }],
  2206. items:[{
  2207. xtype: 'panel',
  2208. id: 'sens_container',
  2209. flex: 1,
  2210. height: PanelH-15,
  2211. autoScroll: 'auto',
  2212. items:[]
  2213. },{
  2214. xtype: 'panel',
  2215. id: 'sens_op_small',
  2216. flex: 1,
  2217. height: PanelH-15,
  2218. layout: 'fit',
  2219. items:[{
  2220. html: "<div class='setEd_infoPanel' id='NUNU'><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>"
  2221. }]
  2222. }]
  2223. });
  2224. tPanel.doLayout();
  2225. loadAttachedSensors();
  2226. };
  2227. function editSensorHW( cid ){
  2228. SelectedSensor = cid;
  2229. Ext.Ajax.request({
  2230. url: '/lib/controller/getSensorEditor.php',
  2231. params: {
  2232. CID: SelectedSensor,
  2233. UID: <?=$UserID;?>,
  2234. SID: '<?=$Session;?>'
  2235. },
  2236. success: function( response, opts ){
  2237. var data = Ext.decode( response.responseText );
  2238. var tComp = Ext.getCmp('sens_op_small');
  2239. if( data.status == 'ok' ){
  2240. if( tComp!= null ){
  2241. var content = Ext.decode( data.content );
  2242. tComp.removeAll( true );
  2243. tComp.add( content );
  2244. tComp.doLayout();
  2245. };
  2246. } else {
  2247. if( tComp!= null ){
  2248. tComp.removeAll( true );
  2249. tComp.add( data );
  2250. tComp.doLayout();
  2251. };
  2252. };
  2253. },
  2254. failure: function(){
  2255. }
  2256. });
  2257. };
  2258. var cameraEditorContent = null;
  2259. function editCamera( cid, etyp ){
  2260. SelectedCam = cid;
  2261. switch( etyp ){
  2262. case 0: cameraEditorContent = Ext.getCmp('dcam_op_small'); break;
  2263. case 1: cameraEditorContent = Ext.getCmp('acam_op_small'); break;
  2264. };
  2265. Ext.Ajax.request({
  2266. url: '/lib/controller/getCameraEditor.php',
  2267. params: {
  2268. CID: SelectedCam,
  2269. UID: <?=$UserID;?>,
  2270. SID: '<?=$Session;?>'
  2271. },
  2272. success: function( response, opts ){
  2273. var data = Ext.decode( response.responseText );
  2274. if( data.status == 'ok' ){
  2275. if( cameraEditorContent!= null ){
  2276. var content = Ext.decode( data.content );
  2277. cameraEditorContent.removeAll( true );
  2278. cameraEditorContent.add( content );
  2279. cameraEditorContent.doLayout();
  2280. };
  2281. } else {
  2282. if( cameraEditorContent!= null ){
  2283. cameraEditorContent.removeAll( true );
  2284. cameraEditorContent.add( data );
  2285. cameraEditorContent.doLayout();
  2286. };
  2287. };
  2288. },
  2289. failure: function(){
  2290. }
  2291. });
  2292. };
  2293. function showSettingsVideo(){
  2294. stopStatusUpdater();
  2295. content_lvl1 = 1;
  2296. content_lvl2 = 4;
  2297. content_lvl3 = 0;
  2298. var tPanel = Ext.getCmp('main_content');
  2299. tPanel.removeAll( true );
  2300. tPanel.add({
  2301. xtype: 'tabpanel',
  2302. frame: false,
  2303. id: 'node_settings_content',
  2304. border: false,
  2305. activeTab: content_lvl3,
  2306. items: [{
  2307. xtype: 'panel',
  2308. id: 'cam_ass_tab',
  2309. title: "<?=$Labels->GetLabel('_CAM_ASS_LIST_');?>",
  2310. layout: 'hbox',
  2311. items:[{
  2312. xtype: 'panel',
  2313. id: 'acam_container',
  2314. flex: 1,
  2315. height: PanelH-15,
  2316. autoScroll: 'auto',
  2317. items:[]
  2318. },{
  2319. xtype: 'panel',
  2320. id: 'acam_op_small',
  2321. flex: 1,
  2322. height: PanelH-15,
  2323. layout: 'fit',
  2324. items:[{
  2325. html: "<div class='setEd_infoPanel' id='NUNU'><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>"
  2326. }]
  2327. }]
  2328. },{
  2329. xtype: 'panel',
  2330. title: "<?=$Labels->GetLabel('_CAM_DET_LIST_');?>",
  2331. id: 'cam_det_tab',
  2332. layout: 'hbox',
  2333. items:[{
  2334. xtype: 'panel',
  2335. id: 'dcam_container',
  2336. flex: 1,
  2337. height: PanelH-15,
  2338. autoScroll: 'auto',
  2339. tbar:[{
  2340. text: "<?=$Labels->GetLabel( '_MANUADD_CAMERA_' );?>",
  2341. handler: function(){
  2342. addDetectedIPCam();
  2343. }
  2344. }],
  2345. items:[]
  2346. },{
  2347. xtype: 'panel',
  2348. id: 'dcam_op_small',
  2349. flex: 1,
  2350. height: PanelH-15,
  2351. layout: 'fit',
  2352. items:[{
  2353. html: "<div class='setEd_infoPanel' id='NUNU'><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>"
  2354. }]
  2355. }]
  2356. }],
  2357. listeners:{
  2358. tabchange: function( tp, t ){
  2359. switch( t.getId() ){
  2360. case 'cam_det_tab': {
  2361. content_lvl3=0;
  2362. stopStatusUpdater();
  2363. loadDetectedCameras();
  2364. break;
  2365. };
  2366. case 'cam_ass_tab': {
  2367. content_lvl3=1;
  2368. stopStatusUpdater();
  2369. loadAssignedCameras();
  2370. break;
  2371. };
  2372. case 'mod_tab':{
  2373. content_lvl3=2;
  2374. stopStatusUpdater();
  2375. loadModules();
  2376. break;
  2377. };
  2378. case 'net_tab':{
  2379. content_lvl3=3;
  2380. stopStatusUpdater();
  2381. break;
  2382. };
  2383. };
  2384. updateUserContent();
  2385. },
  2386. afterrender: function(){
  2387. settingsAreChanged = false;
  2388. }
  2389. }
  2390. });
  2391. tPanel.doLayout();
  2392. updateUserContent();
  2393. updateServerStatus();
  2394. };
  2395. function showSettingsApplication( ap_sid ){
  2396. stopStatusUpdater();
  2397. content_lvl1 = 1;
  2398. content_lvl2 = 3;
  2399. <?php if( $AP_DATA['type']!=1){ ?>
  2400. //Load Location
  2401. prepareMapData();
  2402. <?php };?>
  2403. if( ap_sid == undefined ) ap_sid = 0;
  2404. content_lvl3 = ap_sid;
  2405. var tPanel = Ext.getCmp('main_content');
  2406. tPanel.removeAll( true );
  2407. tPanel.add({
  2408. xtype: 'tabpanel',
  2409. frame: false,
  2410. id: 'settings_a_content',
  2411. border: false,
  2412. activeTab: 'aps_tab_'+content_lvl3,
  2413. items:[{
  2414. title: "<?=$Labels->GetLabel('_WORKING_MODE_');?>",
  2415. xtype: 'form',
  2416. id: 'aps_tab_0',
  2417. labelAlign: 'right',
  2418. labelWidth: 250,
  2419. height: PanelH - 30,
  2420. items:[]
  2421. },
  2422. <?php if( $AP_DATA['type']!=1){ ?>
  2423. {
  2424. title: "<?=$Labels->GetLabel('_GEO_LOCATION_');?>",
  2425. layout: 'column',
  2426. id: 'aps_tab_1',
  2427. items:[]
  2428. },
  2429. <?php };?>{
  2430. title: "<?=$Labels->GetLabel('_BACKUP_SETTINGS_');?>",
  2431. xtype: 'form',
  2432. id: 'aps_tab_2',
  2433. fileUpload: true,
  2434. labelAlign: 'right',
  2435. labelWidth: 180,
  2436. height: PanelH - 30,
  2437. items:[{
  2438. xtype: 'spacer',
  2439. height: 10
  2440. },{
  2441. xtype: 'button',
  2442. text: "<?=$Labels->GetLabel( '_DOWNLOAD_SETTINGS_' );?>",
  2443. width: 500,
  2444. handler: downloadSettings
  2445. },{
  2446. xtype: 'spacer',
  2447. height: 10
  2448. },{
  2449. xtype: 'fileuploadfield',
  2450. id: 'db_file',
  2451. emptyText: "<?=$Labels->GetLabel('_DB_BACKUP_');?>",
  2452. fieldLabel: "<?=$Labels->GetLabel('_SELE_DBBACKUP_');?>",
  2453. width: 300,
  2454. name: 'db_file',
  2455. buttonText: "<?=$Labels->GetLabel('_BROWSE_');?>"
  2456. },{
  2457. xtype: 'spacer',
  2458. height: 10
  2459. },{
  2460. xtype: 'button',
  2461. text: "<?=$Labels->GetLabel( '_APLY_DBBACKUP_' );?>",
  2462. width: 500,
  2463. handler: function(){
  2464. if( Ext.getCmp('as_dbbackup').getForm().isValid()){
  2465. Ext.getCmp('as_dbbackup').getForm().submit({
  2466. url: '/lib/controller/doDatabaseOperation.php',
  2467. waitMsg: "<?=$Labels->GetLabel('_DB_UPLOAD_BACKUP_');?>...",
  2468. encoding: 'multipart/form-data',
  2469. success: function(fp, o){
  2470. }
  2471. });
  2472. };
  2473. }
  2474. },{
  2475. xtype: 'spacer',
  2476. height: 10
  2477. }<?php
  2478. if( file_exists( '../../controller/data/factory.db' ) ){
  2479. ?>,{
  2480. xtype: 'button',
  2481. text: "<?=$Labels->GetLabel( '_FACTORY_RESET_' );?>",
  2482. width: 500,
  2483. handler: function(){
  2484. doDeviceOperation( 1, 254, '', true );
  2485. }
  2486. }<?php
  2487. };
  2488. ?>]
  2489. },{
  2490. title: "<?=$Labels->GetLabel('_REPORT_STORAGE_');?>",
  2491. xtype: 'form',
  2492. id: 'aps_tab_3',
  2493. labelAlign: 'right',
  2494. labelWidth: 180,
  2495. height: PanelH - 30,
  2496. items:[{
  2497. xtype: 'spacer',
  2498. height: 10
  2499. },{
  2500. xtype: 'numberfield',
  2501. id: 'stor_days',
  2502. fieldLabel: "<?=$Labels->GetLabel('_STORE_DAYS_');?>",
  2503. width: 300,
  2504. value: <?=intval($AP_DATA['report_cleanup']);?>,
  2505. name: 'stor_time',
  2506. listeners: {
  2507. change: function( t, b, o ){
  2508. doApplicationOperation( 4, b );
  2509. }
  2510. }
  2511. },{
  2512. xtype: 'spacer',
  2513. height: 10
  2514. },{
  2515. xtype: 'slider',
  2516. id: 'stor_space',
  2517. fieldLabel: "<?=$Labels->GetLabel('_STORE_EMPTY_SPACE_');?>",
  2518. value: <?=intval($AP_DATA['preserve_empty']);?>,
  2519. width: 300,
  2520. name: 'stor_space',
  2521. listeners: {
  2522. change: function( t, b, o ){
  2523. doApplicationOperation( 5, b );
  2524. }
  2525. }
  2526. },{
  2527. xtype: 'spacer',
  2528. height: 10
  2529. },{
  2530. xtype: 'button',
  2531. text: "<?=$Labels->GetLabel( '_APPLY_SETTINGS_' );?>",
  2532. width: 500,
  2533. handler: function(){
  2534. doDeviceOperation( 1, 250, '', true );
  2535. }
  2536. },{
  2537. xtype: 'spacer',
  2538. height: 10
  2539. }]
  2540. },{
  2541. title: "<?=$Labels->GetLabel('_MULTI_LAYOUT_');?>",
  2542. xtype: 'form',
  2543. id: 'aps_tab_4',
  2544. labelAlign: 'right',
  2545. labelWidth: 180,
  2546. height: PanelH - 30,
  2547. items:[]
  2548. }],
  2549. listeners:{
  2550. tabchange: function( tp, t ){
  2551. switch( t.getId() ){
  2552. case 'aps_tab_0': content_lvl3 = 0; break;
  2553. case 'aps_tab_1': content_lvl3 = 1; break;
  2554. case 'aps_tab_2': content_lvl3 = 2; break;
  2555. case 'aps_tab_3': content_lvl3 = 3; break;
  2556. case 'aps_tab_4': content_lvl3 = 4; break;
  2557. case 'aps_tab_5': content_lvl3 = 5; break;
  2558. };
  2559. loadApplicationSettings( content_lvl3 );
  2560. updateUserContent();
  2561. },
  2562. afterrender: function(){
  2563. //settingsAreChanged = false;
  2564. }
  2565. }
  2566. });
  2567. tPanel.doLayout();
  2568. loadApplicationSettings( content_lvl3 );
  2569. //updateUserContent();
  2570. };
  2571. function showMultyLayoutEditor(){
  2572. alert('KAKA');
  2573. };
  2574. function showSettingsUpgrade(){
  2575. stopStatusUpdater();
  2576. content_lvl1 = 1;
  2577. content_lvl2 = 4;
  2578. var tPanel = Ext.getCmp('main_content');
  2579. tPanel.removeAll( true );
  2580. initial_md5 = '';
  2581. tPanel.add({
  2582. columnWidth: 1.0,
  2583. frame: false,
  2584. border: false,
  2585. items: [{
  2586. frame: false,
  2587. border: false,
  2588. collapsible: false,
  2589. draggable: false,
  2590. layout: 'vbox',
  2591. //layoutConfig: {
  2592. // align : 'stretch',
  2593. // pack : 'start',
  2594. //},
  2595. height: PanelH,
  2596. items:[{
  2597. title: "<?=$Labels->getLabel('_MAP_MONITORING_');?>",
  2598. xtype: 'panel',
  2599. height: PanelH-300,
  2600. //flex: 1,
  2601. frame: true,
  2602. width: '100%',
  2603. border: false,
  2604. layout: {
  2605. type: 'table',
  2606. columns: 2,
  2607. tableAttrs: {
  2608. valign: 'top',
  2609. style: 'valign:top;width:100%;'
  2610. }
  2611. },
  2612. defaults: {
  2613. frame: true,
  2614. border: false,
  2615. height: ( PanelH-400 ) / 2,
  2616. style: 'margin: 5px;width:400px;display:block;'
  2617. },
  2618. items:[{
  2619. title: 'Current System Info',
  2620. width: '100%',
  2621. //flex: 1,
  2622. html: '<p>Current Web Version:&nbsp;<b><?=$ARGUS_WEB_VERSION;?></b></p>'
  2623. },{
  2624. title: 'Tasks',
  2625. //width: 400,
  2626. layout: 'vbox',
  2627. items:[{
  2628. xtype: 'button',
  2629. width: '100%',
  2630. text: 'Create Database Backup',
  2631. handler: function(){
  2632. createNewTask( 2 );
  2633. }
  2634. },{
  2635. xtype: 'button',
  2636. width: '100%',
  2637. text: 'Create Full Snapeshot',
  2638. handler: function(){
  2639. createNewTask( 255 );
  2640. }
  2641. }]
  2642. },{
  2643. title: 'Archives',
  2644. height: 250,
  2645. width: '100%',
  2646. tbar:[{
  2647. text: 'Restore',
  2648. id: 'ar_restore_btn',
  2649. handler: function(){
  2650. createNewTask(1, selectedArchiveRecord.data.file_name );
  2651. }
  2652. },{
  2653. text: 'Download',
  2654. id: 'ar_download_btn',
  2655. handler: function(){
  2656. if( selectedArchiveRecord!= null ){
  2657. window.open( '/lib/php/setup_toolkit/vault/'+selectedArchiveRecord.data.base_version + '/'+ selectedArchiveRecord.data.file_name );
  2658. };
  2659. }
  2660. },{
  2661. text: 'Delete',
  2662. id: 'ar_delete_btn',
  2663. handler: function(){
  2664. createNewTask(100, selectedArchiveRecord.data.file_name );
  2665. }
  2666. }],
  2667. items:[{
  2668. xtype: 'grid',
  2669. id: 'archives_grid',
  2670. border: false,
  2671. frame: false,
  2672. autoScroll: true,
  2673. //width: '100%',
  2674. lazyRender: true,
  2675. height: 210,
  2676. ds: archives_store,
  2677. cm: new Ext.grid.ColumnModel( archivesColModel_ops ),
  2678. sm: new Ext.grid.RowSelectionModel( archivesSelModel_ops ),
  2679. viewConfig: {
  2680. // forceFit: true
  2681. },
  2682. }]
  2683. },{
  2684. title: 'Task Status',
  2685. height: 250,
  2686. //flex: 1,
  2687. items:[{
  2688. xtype: 'spacer',
  2689. height: 4
  2690. },{
  2691. id: 'ctask_status',
  2692. border: true,
  2693. html: ''
  2694. },{
  2695. xtype: 'spacer',
  2696. height: 4
  2697. },{
  2698. xtype: 'textarea',
  2699. id: 'task_log',
  2700. height: ( PanelH-320 ) / 2 - 120,
  2701. style: 'font-size:9px;width:100%;margin-bottom:4px;',
  2702. readOnly: true,
  2703. autoScroll: true,
  2704. value: ''
  2705. },{
  2706. xtype: 'progress',
  2707. id: 'task_progress',
  2708. value: 1.0,
  2709. text: 'idle',
  2710. disabled: true
  2711. }],
  2712. tbar:[{
  2713. text: 'Cancel Task',
  2714. id: 'ch_ta_btn',
  2715. disabled: true,
  2716. handler: deleteNewTask
  2717. }]
  2718. }]
  2719. },{
  2720. title: '<?=$Labels->getLabel('_UPLOAD_PACKAGE_');?>',
  2721. xtype: 'panel',
  2722. height: 300,
  2723. //flex: 1,
  2724. frame: true,
  2725. border: false,
  2726. //layout: 'vbox',
  2727. items:[{
  2728. xtype:'button',
  2729. id: 'pickfiles',
  2730. width: '100%',
  2731. text: 'Choose File'
  2732. },{
  2733. height: 200,
  2734. xtype: 'grid',
  2735. id: 'upload_grid',
  2736. border: false,
  2737. frame: false,
  2738. mode: 'local',
  2739. lazyRender: true,
  2740. width: '100%',
  2741. autoScroll: true,
  2742. ds: uploads_store,
  2743. cm: new Ext.grid.ColumnModel( fileUploadsColModel_ops ),
  2744. sm: new Ext.grid.RowSelectionModel( fileUploadsSelModel_ops ),
  2745. viewConfig: {
  2746. forceFit: true
  2747. },
  2748. bbar: [{
  2749. text: 'Clear',
  2750. width: '100%',
  2751. handler: function(){
  2752. muploader.splice();
  2753. uploads_store.removeAll();
  2754. }
  2755. }]
  2756. },{
  2757. xtype:'button',
  2758. id: 'umpalumpa',
  2759. width: '100%',
  2760. disabled: true,
  2761. text: 'Upload',
  2762. handler: function(){
  2763. if( muploader!= null ){
  2764. muploader.start();
  2765. };
  2766. }
  2767. }],
  2768. listeners:{
  2769. afterrender: function(){
  2770. muploader = new plupload.Uploader({
  2771. runtimes : 'html5,html4',
  2772. browse_button : Ext.getDom('pickfiles'), // you can pass in id...
  2773. //container: document.getElementById('upupu'), // ... or DOM Element itself
  2774. max_file_size : '1000mb',
  2775. chunk_size: '200kb',
  2776. max_retries: 3,
  2777. multi_selection: false,
  2778. max_file_count: 1,
  2779. // Fake server response here
  2780. url: '/lib/php/setup_toolkit/upload.php',
  2781. //url: "/echo/json",
  2782. //flash_swf_url : 'http://rawgithub.com/moxiecode/moxie/master/bin/flash/Moxie.cdn.swf',
  2783. //silverlight_xap_url : 'http://rawgithub.com/moxiecode/moxie/master/bin/silverlight/Moxie.cdn.xap',
  2784. filters : [
  2785. //{title : "Image files", extensions : "jpg,gif,png"},
  2786. {title : "Archive files", extensions : "rar,zip,gz,bz2"}
  2787. ],
  2788. init: {
  2789. PostInit: function() {
  2790. //$('filelist').innerHTML = '';
  2791. //$('uploadfiles').onclick = function() {
  2792. // uploader.start();
  2793. // return false;
  2794. //};
  2795. },
  2796. FilesAdded: function( up, files ) {
  2797. Ext.getCmp('umpalumpa').enable();
  2798. plupload.each( files, function(file) {
  2799. uploads_store.loadData( [[ uploads_store_id, file.name, file.id, plupload.formatSize( file.size ), 0, 'N' ]], true );
  2800. uploads_store_id++;
  2801. Ext.getCmp('upload_grid').doLayout();
  2802. });
  2803. },
  2804. UploadProgress: function(up, file) {
  2805. var pb = Ext.getCmp( 'progress_'+file.id );
  2806. if( file.percent < 100 ){
  2807. pb.updateProgress( file.percent / 100, file.percent + '%', false );
  2808. } else {
  2809. pb.updateProgress( 1.0, 'Uploaded', false );
  2810. };
  2811. },
  2812. Error: function(up, err) {
  2813. Ext.Msg.show({
  2814. title:'Upload Status',
  2815. msg: "Error #" + err.code + ": " + err.message,
  2816. buttons: Ext.Msg.OK,
  2817. icon: Ext.MessageBox.ERROR
  2818. });
  2819. }
  2820. }
  2821. });
  2822. muploader.init();
  2823. }
  2824. }
  2825. }]
  2826. }]
  2827. });
  2828. muploader = null;
  2829. uploads_store.removeAll();
  2830. tPanel.doLayout();
  2831. archives_store.load();//{params:{start:0, limit:50, src: 'arch', fil: selecredActiveSourceFilter }});
  2832. updateTaskStatus();
  2833. tlInterval = window.setInterval( updateTaskStatus, 333 );
  2834. };
  2835. function loadSensorDetectionSettings( sensid ){
  2836. Ext.Ajax.request({
  2837. url: '/lib/controller/getSensorDetectionEditor.php',
  2838. params: {
  2839. UID: <?=$UserID;?>,
  2840. SID: '<?=$Session;?>',
  2841. SEN: sensid
  2842. },
  2843. success: function( response, opts ){
  2844. var data = Ext.decode( response.responseText );
  2845. var tComp = Ext.getCmp('main_content');
  2846. if( data.status == 'ok' ){
  2847. if( tComp!= null ){
  2848. var content = Ext.decode( data.content );
  2849. tComp.removeAll( true );
  2850. tComp.add( content );
  2851. tComp.doLayout();
  2852. };
  2853. } else {
  2854. if( tComp!= null ){
  2855. tComp.removeAll( true );
  2856. tComp.add( data );
  2857. tComp.doLayout();
  2858. };
  2859. };
  2860. },
  2861. failure: function(){
  2862. }
  2863. });
  2864. };
  2865. function initSettingsView(){
  2866. if( tlInterval!= null ){
  2867. window.clearInterval( tlInterval );
  2868. tlInterval = null;
  2869. timelineObj = null;
  2870. };
  2871. var tP = Ext.getCmp('left_side_menu');
  2872. //tP.doLayout();
  2873. //tP.setVisible( false );
  2874. tP.removeAll( true );
  2875. tP.add({
  2876. id: 'sme_inner',
  2877. layout:'accordion',
  2878. //height: PanelH,
  2879. frame: false,
  2880. border: false,
  2881. layoutConfig:{
  2882. animate: true//,
  2883. //activeOnTop: true
  2884. },
  2885. items:[]
  2886. });
  2887. tP.doLayout();
  2888. tP = Ext.getCmp('sme_inner');
  2889. <?php if( $CUser->Data['access'] > 3 ){ ?>
  2890. tP.add({
  2891. title: "<?=$Labels->GetLabel('_SYS_SETTINGS_');?>",
  2892. layout: 'vbox',
  2893. height: 120,
  2894. pack: 'center',
  2895. align : 'strech',
  2896. collapsed: ( content_lvl1 != 0 ),
  2897. items:[{
  2898. xtype: 'button',
  2899. width: '100%',
  2900. id:'sys_edit',
  2901. text: "<?=$Labels->GetLabel('_SYS_GENERAL_');?>",
  2902. enableToggle: true,
  2903. pressed: ( content_lvl2 == 0 && content_lvl1 == 0 ),
  2904. allowDepress: false,
  2905. toggleGroup: 'sys_settings',
  2906. handler: showSettingsGeneral
  2907. }
  2908. <?php if( $CUser->Data['access'] > 4 ){ ?>
  2909. ,{
  2910. xtype: 'button',
  2911. width: '100%',
  2912. id:'map_edit',
  2913. text: "<?=$Labels->GetLabel('_SENSOR_CONNECTION_');?>",
  2914. enableToggle: true,
  2915. pressed: ( content_lvl2 == 1 && content_lvl1 == 0 ),
  2916. allowDepress: false,
  2917. toggleGroup: 'sys_settings',
  2918. handler: showSettingsSensors
  2919. },{
  2920. xtype: 'button',
  2921. width: '100%',
  2922. id:'video_set',
  2923. text: "<?=$Labels->GetLabel('_CAMERA_MNGMNT_');?>",
  2924. enableToggle: true,
  2925. pressed: ( content_lvl2 == 2 && content_lvl1 == 0 ),
  2926. allowDepress: false,
  2927. toggleGroup: 'sys_settings',
  2928. handler: showSettingsVideo
  2929. },{
  2930. xtype: 'button',
  2931. width: '100%',
  2932. id:'app_set',
  2933. text: "<?=$Labels->GetLabel('_APPLICA_MNGMNT_');?>",
  2934. enableToggle: true,
  2935. pressed: ( content_lvl2 == 3 && content_lvl1 == 0 ),
  2936. allowDepress: false,
  2937. toggleGroup: 'sys_settings',
  2938. handler: function(){
  2939. showSettingsApplication( content_lvl3 );
  2940. }
  2941. }
  2942. <?php }; ?>
  2943. ]
  2944. });
  2945. <?php if( $CUser->Data['access'] > 4 ){ ?>
  2946. tP.add({
  2947. title: "<?=$Labels->GetLabel('_DET_SETTINGS_');?>",
  2948. layout: 'vbox',
  2949. height: 120,
  2950. pack: 'center',
  2951. align : 'strech',
  2952. collapsed: ( content_lvl1 != 1 ),
  2953. items:[<?php
  2954. if( $AP_DATA['type'] == 1 ){
  2955. ?>
  2956. {
  2957. xtype: 'button',
  2958. width: '100%',
  2959. id:'go_home',
  2960. text: "<?=$Labels->GetLabel('_UPPER_SENSOR_');?>",
  2961. enableToggle: true,
  2962. pressed: ( content_lvl2 == 0 && content_lvl1 == 1 ),
  2963. allowDepress: false,
  2964. toggleGroup: 'det_settings',
  2965. handler: loadMetroControlUpper
  2966. },{
  2967. xtype: 'button',
  2968. width: '100%',
  2969. id:'go_monitor',
  2970. text: "<?=$Labels->GetLabel('_BOTTOM_SENSOR_');?>",
  2971. enableToggle: true,
  2972. pressed: ( content_lvl2 == 1 && content_lvl1 == 1 ),
  2973. allowDepress: false,
  2974. toggleGroup: 'det_settings',
  2975. handler: loadMetroControlBottom
  2976. },{
  2977. xtype: 'button',
  2978. width: '100%',
  2979. id:'go_archive',
  2980. text: "<?=$Labels->GetLabel('_FUSION_ENGINE_');?>",
  2981. enableToggle: true,
  2982. pressed: ( content_lvl2 == 2 && content_lvl1 == 1 ),
  2983. allowDepress: false,
  2984. toggleGroup: 'det_settings',
  2985. handler: loadMetroControlFusion
  2986. }<?php
  2987. } else {
  2988. $QS = "SELECT `name`, `aux_id` FROM `nodes` WHERE `type`>0 AND `type`<5";
  2989. $RR = $DATABASE->Query( $QS );
  2990. if( count( $RR ) ){
  2991. foreach( $RR as $CR ){
  2992. ?>
  2993. {
  2994. xtype: 'button',
  2995. width: '100%',
  2996. text: '<?=$CR['name'];?>',
  2997. enableToggle: true,
  2998. pressed: ( content_lvl2 == 0 && content_lvl1 == 1 ),
  2999. allowDepress: false,
  3000. toggleGroup: 'det_settings',
  3001. handler: function(){
  3002. loadSensorDetectionSettings( <?=$CR['aux_id'];?> );
  3003. }
  3004. },
  3005. <?php
  3006. };
  3007. } else {
  3008. ?>
  3009. {
  3010. xtype: 'spacer',
  3011. html: "<?=$Labels->GetLabel('_NO_SENSORS_DEF_');?>",
  3012. height: 32
  3013. },
  3014. <?php
  3015. };
  3016. ?>
  3017. {
  3018. xtype: 'spacer',
  3019. height: 10
  3020. }<?php
  3021. };
  3022. ?>]
  3023. });
  3024. <?php };
  3025. }; ?>
  3026. tP.add({
  3027. title: "<?=$Labels->GetLabel('_PROF_SETTINGS_');?>",
  3028. items:[<?php
  3029. $ZIGA = array();
  3030. foreach( $Site_Languages as $SL ){
  3031. if( $SL['id'] == $CUser->Data['language'] ){
  3032. $ZIGA[] = "{ xtype:'button', text:'{$SL['name']}', width: '100%', enableToggle: true, pressed : true, handler: function(){ window.location = '/?Lang={$SL['id']}'; } }";
  3033. } else {
  3034. $ZIGA[] = "{ xtype:'button', text:'{$SL['name']}', width: '100%', handler: function(){ window.location = '/?Lang={$SL['id']}'; } }";
  3035. };
  3036. };
  3037. echo implode(',',$ZIGA );
  3038. ?>]
  3039. });
  3040. <?php if( $CUser->Data['access'] > 5 ){ ?>
  3041. tP.add({
  3042. title: "<?=$Labels->GetLabel('_ADM_SETTINGS_');?>",
  3043. collapsed: ( content_lvl1 != 3 ),
  3044. items:[{
  3045. xtype: 'button',
  3046. width: '100%',
  3047. id:'adm_acc',
  3048. text: "<?=$Labels->GetLabel('_USERS_MNGMT_');?>",
  3049. enableToggle: true,
  3050. pressed: ( content_lvl2 == 0 && content_lvl1 == 3 ),
  3051. allowDepress: false,
  3052. toggleGroup: 'adm_settings',
  3053. handler: function( b, e ){
  3054. loadUserEditor();
  3055. }
  3056. },{
  3057. xtype: 'button',
  3058. width: '100%',
  3059. id:'adm_acclog',
  3060. text: "<?=$Labels->GetLabel('_ACC_LOG_');?>",
  3061. enableToggle: true,
  3062. pressed: ( content_lvl2 == 1 && content_lvl1 == 3 ),
  3063. allowDepress: false,
  3064. toggleGroup: 'adm_settings',
  3065. handler: function( b, e ){
  3066. loadAccessLog();
  3067. }
  3068. },{
  3069. xtype: 'button',
  3070. width: '100%',
  3071. id:'adm_servlog',
  3072. text: "<?=$Labels->GetLabel('_SERV_LOG_');?>",
  3073. enableToggle: true,
  3074. pressed: ( content_lvl2 == 2 && content_lvl1 == 3 ),
  3075. allowDepress: false,
  3076. toggleGroup: 'adm_settings',
  3077. handler: function( b, e ){
  3078. loadServerLog();
  3079. }
  3080. }]
  3081. });
  3082. <?php
  3083. };
  3084. ?>
  3085. tP.setVisible( true );
  3086. tP.doLayout();
  3087. switch( content_lvl1 ){
  3088. default:{
  3089. switch( content_lvl2 ){
  3090. default: showSettingsGeneral(); break;
  3091. <?php if( $CUser->Data['access'] > 5 ){ ?>
  3092. case 1: showSettingsSensors(); break;
  3093. case 2: showSettingsVideo(); break;
  3094. case 3: showSettingsApplication(); break;
  3095. <?php }; ?>
  3096. //case 4: showSettingsUpgrade(); break;
  3097. };
  3098. };
  3099. case 1:{
  3100. switch( content_lvl2 ){
  3101. case 0: break;
  3102. };
  3103. break;
  3104. };
  3105. <?php if( $CUser->Data['access'] > 5 ){ ?>
  3106. case 3:{
  3107. switch( content_lvl2 ){
  3108. case 0: loadUserEditor(); break;
  3109. };
  3110. break;
  3111. };
  3112. <?php }; ?>
  3113. };
  3114. };
  3115. function zdonut(cx, cy, radius, data) {
  3116. function arcradius(cx, cy, radius, degrees) {
  3117. var radians = (degrees - 90) * Math.PI / 180.0;
  3118. return { x: cx + (radius * Math.cos(radians)), y: cy + (radius * Math.sin(radians)) };
  3119. }
  3120. var decimals = 4;
  3121. var total = 0;
  3122. var arr = [];
  3123. var beg = 0;
  3124. var end = 0;
  3125. var count = 0;
  3126. var half = radius / 2;
  3127. var midpoint = radius / 2.4;
  3128. for( var i = 0; i < data.length; i++) total += data[i].value;
  3129. for( var i = 0; i < data.length; i++) {
  3130. var item = data[i];
  3131. var tmp = {};
  3132. //var p = Math.floor((((item.value + 1) / total) * 100), decimals );
  3133. var p = (( item.value / total ) * 100.0 );
  3134. count += p;
  3135. if( i === length - 1 && count < 100 ) p = p + (100 - count);
  3136. end = beg + ((360 / 100) * p);
  3137. tmp.index = i;
  3138. tmp.value = item.value;
  3139. tmp.data = item;
  3140. var b = arcradius(cx, cy, radius, end);
  3141. var e = arcradius(cx, cy, radius, beg);
  3142. var la = (end - beg) <= 180 ? 0 : 1;
  3143. tmp.d = ['M', Math.floor( b.x, decimals ), Math.floor( b.y, decimals ), 'A', radius, radius, 0, la, 0, Math.floor( e.x, decimals ), Math.floor( e.y, decimals ) ].join(' ');
  3144. arr.push(tmp);
  3145. beg = end;
  3146. };
  3147. return arr;
  3148. };
  3149. var selectedPresetsBackgroundSensor = 0;
  3150. function altPTZCmd( me ){
  3151. var name = me.target.id;
  3152. const myArray = name.split("_");
  3153. Ext.Ajax.request({
  3154. url: '/lib/controller/doCameraOperation.php',
  3155. params: {
  3156. UID: <?=$UserID;?>,
  3157. SID: '<?=$Session;?>',
  3158. CMD: 11,
  3159. CID: myArray[3],
  3160. MOV: myArray[2]
  3161. },
  3162. failure: failureAJAXFunction
  3163. });
  3164. };
  3165. function showCameraPresets( AA, camID ){
  3166. Ext.Ajax.request({
  3167. url: '/lib/controller/getCameraPresets.php',
  3168. params: {
  3169. CID: camID,
  3170. UID: <?=$UserID;?>,
  3171. SID: '<?=$Session;?>',
  3172. },
  3173. success: function( response, opts ){
  3174. var data = Ext.decode(response.responseText);
  3175. var hgy = Ext.getCmp('pres_count');
  3176. if( hgy!= undefined ) hgy.setValue( data.count );
  3177. var hgy = Ext.getCmp('pres_p_seg');
  3178. if( hgy!= undefined ) hgy.setValue( data.pres_cols );
  3179. var hgy = Ext.getCmp('pres_z_seg');
  3180. if( hgy!= undefined ) hgy.setValue( data.pres_rows );
  3181. if( data.special_iron != undefined ){
  3182. var hgy = Ext.getCmp('pres_iron');
  3183. if( hgy!= undefined ) hgy.setValue( data.special_iron );
  3184. var juja = document.getElementById('img_btn_035_'+camID );
  3185. if( juja != undefined ){
  3186. juja.classList.add('ptz_ctrl_btn');
  3187. juja.classList.remove('ptz_ctrl_btn_hdn');
  3188. juja.addEventListener( 'mousedown', altPTZCmd );
  3189. };
  3190. } else {
  3191. var juja = document.getElementById('img_btn_035_'+camID );
  3192. if( juja != undefined ){
  3193. juja.classList.add('ptz_ctrl_btn_hdn');
  3194. juja.classList.remove('ptz_ctrl_btn');
  3195. juja.removeEventListener( 'mousedown', altPTZCmd );
  3196. };
  3197. };
  3198. if( data.special_iroff != undefined ){
  3199. var hgy = Ext.getCmp('pres_iroff');
  3200. if( hgy!= undefined ) hgy.setValue( data.special_iroff );
  3201. var juja = document.getElementById('img_btn_036_'+camID );
  3202. if( juja != undefined ){
  3203. juja.classList.add('ptz_ctrl_btn');
  3204. juja.classList.remove('ptz_ctrl_btn_hdn');
  3205. juja.addEventListener( 'mousedown', altPTZCmd );
  3206. };
  3207. } else {
  3208. var juja = document.getElementById('img_btn_036_'+camID );
  3209. if( juja != undefined ){
  3210. juja.classList.add('ptz_ctrl_btn_hdn');
  3211. juja.classList.remove('ptz_ctrl_btn');
  3212. juja.removeEventListener( 'mousedown', altPTZCmd );
  3213. };
  3214. };
  3215. if( data.special_irauto != undefined ){
  3216. var hgy = Ext.getCmp('pres_irauto');
  3217. if( hgy!= undefined ) hgy.setValue( data.special_irauto );
  3218. };
  3219. if( data.special_wiper != undefined ){
  3220. var hgy = Ext.getCmp('pres_wiper');
  3221. if( hgy!= undefined ) hgy.setValue( data.special_wiper );
  3222. var juja = document.getElementById('img_btn_037_'+camID );
  3223. if( juja != undefined ){
  3224. juja.classList.add('ptz_ctrl_btn');
  3225. juja.classList.remove('ptz_ctrl_btn_hdn');
  3226. juja.addEventListener( 'mousedown', altPTZCmd );
  3227. };
  3228. } else {
  3229. var juja = document.getElementById('img_btn_037_'+camID );
  3230. if( juja != undefined ){
  3231. juja.classList.add('ptz_ctrl_btn_hdn');
  3232. juja.classList.remove('ptz_ctrl_btn');
  3233. juja.removeEventListener( 'mousedown', altPTZCmd );
  3234. };
  3235. };
  3236. var svg = document.getElementById( AA );
  3237. svg.innerHTML = "";
  3238. var centerX = svg.clientWidth / 2.0;
  3239. var centerY = svg.clientHeight / 2.0;
  3240. var radius = svg.clientHeight / 2.0 - (data.pres_rows*2.0);
  3241. var color = ['#F6BB42', '#8CC152', '#3BAFDA', '#967ADC', '#DA4453'];
  3242. var max_lines = data.pres_rows;
  3243. for( var cl = max_lines; cl > 0; cl--){
  3244. var segnum = data.pres_cols * Math.pow( 2, ( cl-1 ) );
  3245. var dta = [];
  3246. for( var j = 0; j< segnum; j++) dta[j]={ value: (180/segnum) };
  3247. var crad = cl * ( radius/(max_lines+1));
  3248. var arr = zdonut(centerX, centerY, crad, dta );
  3249. for (var i = 0; i < arr.length; i++) {
  3250. var item = arr[i];
  3251. var tP = document.createElementNS( 'http://www.w3.org/2000/svg', 'path' );
  3252. tP.setAttribute( 'd', item.d );
  3253. var test = false;
  3254. var ll = [];
  3255. if( data.presets.length ){
  3256. for( var z = 0; z < data.presets.length; z++)
  3257. if( data.presets[z].row == cl && data.presets[z].column == i ){
  3258. ll = data.presets[z];
  3259. test = true;
  3260. break;
  3261. };
  3262. };
  3263. if( test ){
  3264. tP.setAttribute( 'stroke', '#000000' );
  3265. tP.setAttribute( 'class', 'preset_ctrl_btn_a' );
  3266. tP.setAttribute( 'onclick', 'triggerPreset('+camID+','+ll.id+')' );
  3267. tP.setAttribute( 'oncontextmenu', 'removePreset('+camID+','+ll.id+')' );
  3268. } else {
  3269. tP.setAttribute( 'stroke', color[(i+cl)%5] );
  3270. tP.setAttribute( 'class', 'preset_ctrl_btn' );
  3271. tP.setAttribute( 'ondblclick', 'setPreset('+camID+','+i+','+cl+')' );
  3272. };
  3273. tP.setAttribute( 'fill', 'none' );
  3274. tP.setAttribute( 'stroke-width', ( radius/(max_lines+1)) );
  3275. svg.appendChild( tP );
  3276. }
  3277. };
  3278. if( selectedPresetsBackgroundSensor ) preview2DDraw( selectedPresetsBackgroundSensor, 'ptz_presets_');
  3279. },
  3280. failure: failureAJAXFunction
  3281. });
  3282. };
  3283. function triggerPreset( camID, presetID ){
  3284. //alert( "Call Preset["+presetID+"] for camera["+camID+"]" );
  3285. doCamOperation( camID, 30, presetID );
  3286. return false;
  3287. };
  3288. function removePreset( camID, presetID ){
  3289. //alert( "Remove Preset["+presetID+"] for camera["+camID+"]" );
  3290. doCamOperation( camID, 29, presetID );
  3291. window.setTimeout( "showCameraPresets( 'ptz_presets_0', "+camID+" );", 500 );
  3292. return false;
  3293. };
  3294. function setPreset( camID, colID, rowID ){
  3295. //alert( "Set new Preset for camera["+camID+"] x:"+colID+" y:"+rowID );
  3296. doCamOperation( camID, 28, colID+"_"+rowID );
  3297. window.setTimeout( "showCameraPresets( 'ptz_presets_0', "+camID+" );", 500 );
  3298. return false;
  3299. };