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.

3091 lines
84 KiB

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