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.

182 lines
4.7 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <?php
  2. require_once('../ajax_asm.php');
  3. require_once('../php/argus/server.php');
  4. if( $CUser->Data['id'] > 1 ){
  5. $MID = intval( $_POST['MID'] );
  6. $QS = "SELECT * FROM `metro_modules` WHERE `id`={$MID}";
  7. $Result = $DATABASE->Query( $QS, false );
  8. if( count( $Result ) ){
  9. $CR = $Result[0];
  10. $TTPL=<<<DATA_BOUNDARY
  11. {
  12. xtype: 'panel',
  13. border: false,
  14. frame: false,
  15. tbar:[{
  16. id: 'btn_del_module',
  17. text: '{$Labels->GetLabel('_SMM_DEL_MODULE_')}',
  18. handler: function(){
  19. Ext.Msg.show({
  20. title:'{$Labels->GetLabel('_REMOVE_MODULE_')}',
  21. msg: '{$Labels->GetLabel('_REMOVE_MODU_QUES_')}',
  22. buttons: Ext.Msg.YESNO,
  23. fn: function(btn){
  24. if( btn == 'yes' ){
  25. SelectedModule = 0;
  26. doModuleOperation( {$CR['id']}, 200, '', true );
  27. };
  28. },
  29. icon: Ext.MessageBox.QUESTION
  30. });
  31. }
  32. }],
  33. items:[%%%ITEMS%%%]
  34. }
  35. DATA_BOUNDARY;
  36. $ITEMS = array();
  37. $INFO = '<table width="100%" border=0 style="font-weight: bold;"><tr><td width="130px" align="right">'.$Labels->GetLabel('_STATUS_').':</td><td>'.((0)?'Online':'Offline').'</td></tr><tr><td align="right">'.$Labels->GetLabel('_VERSION_').':</td><td>'.(($CR['tls_version']!='')?$CR['tls_version']:'No Version Info').'</td></tr></table>';
  38. $ITEMS[0]="{ xtype:'panel', border: false, frame: false, html: '<span class=\"setEd_infoPanel\" id=\"SENSOR_".(($CR['status']=='E')?'A':'N')."\"><table width=\"100%\" border=0><tr><td align=\"center\" valign=\"middle\"><div class=\"module_img_sset\"></div></td></tr><tr><td>{$INFO}</td></tr></table></span><br/>'}";
  39. $ITEMS[1] =<<<DATA_BOUNDARY
  40. {
  41. xtype: 'tabpanel',
  42. activeTab: 0,
  43. items:[{
  44. title: 'General',
  45. items:[{
  46. xtype: 'button',
  47. text: '{$Labels->GetLabel('_OP_MODULE_CTRL_')}',
  48. width: '100%',
  49. iconCls: 'srv_op_modctrl',
  50. scale: 'large',
  51. handler: moduleControl
  52. },{
  53. xtype: 'button',
  54. text: '{$Labels->GetLabel('_OP_CAMERA_CTRL_')}',
  55. width: '100%',
  56. iconCls: 'srv_op_camctrl',
  57. scale: 'large',
  58. handler: moduleCamControl
  59. },{
  60. xtype: 'button',
  61. text: 'Open Host Control',
  62. width: '100%',
  63. iconCls: 'srv_op_hostctrl',
  64. scale: 'large',
  65. handler: moduleHostControl
  66. }]
  67. },{
  68. title: 'Connection Settings',
  69. xtype: 'form',
  70. labelWidth: 200,
  71. border: false,
  72. frame: false,
  73. labelAlign: 'right',
  74. items:[{
  75. xtype: 'combo',
  76. fieldLabel: "{$Labels->GetLabel( '_STATUS_' )}",
  77. id: 'mod_stst',
  78. width: 200,
  79. lazyRender: true,
  80. mode: 'local',
  81. forceSelection: true,
  82. triggerAction: 'all',
  83. editable: false,
  84. disableKeyFilter: true,
  85. store: new Ext.data.ArrayStore({
  86. fields: ['val','disp'],
  87. data: [['E','Enabled'], ['D','Disabled']]
  88. }),
  89. valueField: 'val',
  90. displayField: 'disp',
  91. value: '{$CR['status']}',
  92. listeners:{
  93. select: function( t, r, i ){
  94. doModuleOperation( {$CR['id']}, 14, r.data.val, true );
  95. }
  96. }
  97. },{
  98. xtype: 'textfield',
  99. fieldLabel: 'IP Address',
  100. value: '{$CR['IP4']}',
  101. listeners:{
  102. change: function( a, c, b ){
  103. doModuleOperation( {$CR['id']}, 4, c, true );
  104. }
  105. }
  106. },{
  107. xtype: 'textfield',
  108. fieldLabel: 'Identity',
  109. value: '{$CR['identity']}',
  110. listeners:{
  111. change: function( a, c, b ){
  112. doModuleOperation( {$CR['id']}, 5, c, false );
  113. }
  114. }
  115. },{
  116. xtype: 'textfield',
  117. fieldLabel: 'Module Login',
  118. value: '{$CR['m_login']}',
  119. listeners:{
  120. change: function( a, c, b ){
  121. doModuleOperation( {$CR['id']}, 6, c, false );
  122. }
  123. }
  124. },{
  125. xtype: 'textfield',
  126. fieldLabel: 'Module Password',
  127. value: '{$CR['m_password']}',
  128. listeners:{
  129. change: function( a, c, b ){
  130. doModuleOperation( {$CR['id']}, 7, c, false );
  131. }
  132. }
  133. },{
  134. xtype: 'textfield',
  135. fieldLabel: 'Host Login',
  136. value: '{$CR['h_login']}',
  137. listeners:{
  138. change: function( a, c, b ){
  139. doModuleOperation( {$CR['id']}, 10, c, false );
  140. }
  141. }
  142. },{
  143. xtype: 'textfield',
  144. fieldLabel: 'Host Password',
  145. value: '{$CR['h_password']}',
  146. listeners:{
  147. change: function( a, c, b ){
  148. doModuleOperation( {$CR['id']}, 11, c, false );
  149. }
  150. }
  151. },{
  152. xtype: 'textfield',
  153. fieldLabel: 'Camera Login',
  154. value: '{$CR['c_login']}',
  155. listeners:{
  156. change: function( a, c, b ){
  157. doModuleOperation( {$CR['id']}, 12, c, false );
  158. }
  159. }
  160. },{
  161. xtype: 'textfield',
  162. fieldLabel: 'Camera Password',
  163. value: '{$CR['c_password']}',
  164. listeners:{
  165. change: function( a, c, b ){
  166. doModuleOperation( {$CR['id']}, 13, c, false );
  167. }
  168. }
  169. }]
  170. }]
  171. }
  172. DATA_BOUNDARY;
  173. $CONTENT = implode(',',$ITEMS);
  174. $TTPL = str_ireplace( '%%%ITEMS%%%', $CONTENT, $TTPL );
  175. echo $TTPL;
  176. } else {
  177. echo '{ xtype: \'panel\', html: \'Node '.$_POST['NODE'].' Loadded\'}';
  178. };
  179. } else {
  180. header('location: /');
  181. };
  182. ?>