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.

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