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.

183 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.YESNOCANCEL,
  23. fn: function(btn){
  24. if( btn == 'yes' ){
  25. SelectedModule = 0;
  26. doModuleOperation( {$CR['id']}, 200, '', true );
  27. };
  28. },
  29. animEl: 'elId',
  30. icon: Ext.MessageBox.QUESTION
  31. });
  32. }
  33. }],
  34. items:[%%%ITEMS%%%]
  35. }
  36. DATA_BOUNDARY;
  37. $ITEMS = array();
  38. $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>';
  39. $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/>'}";
  40. $ITEMS[1] =<<<DATA_BOUNDARY
  41. {
  42. xtype: 'tabpanel',
  43. activeTab: 0,
  44. items:[{
  45. title: 'General',
  46. items:[{
  47. xtype: 'button',
  48. text: '{$Labels->GetLabel('_OP_MODULE_CTRL_')}',
  49. width: '100%',
  50. iconCls: 'srv_op_modctrl',
  51. scale: 'large',
  52. handler: moduleControl
  53. },{
  54. xtype: 'button',
  55. text: '{$Labels->GetLabel('_OP_CAMERA_CTRL_')}',
  56. width: '100%',
  57. iconCls: 'srv_op_camctrl',
  58. scale: 'large',
  59. handler: moduleCamControl
  60. },{
  61. xtype: 'button',
  62. text: 'Open Host Control',
  63. width: '100%',
  64. iconCls: 'srv_op_hostctrl',
  65. scale: 'large',
  66. handler: moduleHostControl
  67. }]
  68. },{
  69. title: 'Connection Settings',
  70. xtype: 'form',
  71. labelWidth: 200,
  72. border: false,
  73. frame: false,
  74. labelAlign: 'right',
  75. items:[{
  76. xtype: 'combo',
  77. fieldLabel: "{$Labels->GetLabel( '_STATUS_' )}",
  78. id: 'mod_stst',
  79. width: 200,
  80. lazyRender: true,
  81. mode: 'local',
  82. forceSelection: true,
  83. triggerAction: 'all',
  84. editable: false,
  85. disableKeyFilter: true,
  86. store: new Ext.data.ArrayStore({
  87. fields: ['val','disp'],
  88. data: [['E','Enabled'], ['D','Disabled']]
  89. }),
  90. valueField: 'val',
  91. displayField: 'disp',
  92. value: '{$CR['status']}',
  93. listeners:{
  94. select: function( t, r, i ){
  95. doModuleOperation( {$CR['id']}, 14, r.data.val, true );
  96. }
  97. }
  98. },{
  99. xtype: 'textfield',
  100. fieldLabel: 'IP Address',
  101. value: '{$CR['IP4']}',
  102. listeners:{
  103. change: function( a, c, b ){
  104. doModuleOperation( {$CR['id']}, 4, c, true );
  105. }
  106. }
  107. },{
  108. xtype: 'textfield',
  109. fieldLabel: 'Identity',
  110. value: '{$CR['identity']}',
  111. listeners:{
  112. change: function( a, c, b ){
  113. doModuleOperation( {$CR['id']}, 5, c, false );
  114. }
  115. }
  116. },{
  117. xtype: 'textfield',
  118. fieldLabel: 'Module Login',
  119. value: '{$CR['m_login']}',
  120. listeners:{
  121. change: function( a, c, b ){
  122. doModuleOperation( {$CR['id']}, 6, c, false );
  123. }
  124. }
  125. },{
  126. xtype: 'textfield',
  127. fieldLabel: 'Module Password',
  128. value: '{$CR['m_password']}',
  129. listeners:{
  130. change: function( a, c, b ){
  131. doModuleOperation( {$CR['id']}, 7, c, false );
  132. }
  133. }
  134. },{
  135. xtype: 'textfield',
  136. fieldLabel: 'Host Login',
  137. value: '{$CR['h_login']}',
  138. listeners:{
  139. change: function( a, c, b ){
  140. doModuleOperation( {$CR['id']}, 10, c, false );
  141. }
  142. }
  143. },{
  144. xtype: 'textfield',
  145. fieldLabel: 'Host Password',
  146. value: '{$CR['h_password']}',
  147. listeners:{
  148. change: function( a, c, b ){
  149. doModuleOperation( {$CR['id']}, 11, c, false );
  150. }
  151. }
  152. },{
  153. xtype: 'textfield',
  154. fieldLabel: 'Camera Login',
  155. value: '{$CR['c_login']}',
  156. listeners:{
  157. change: function( a, c, b ){
  158. doModuleOperation( {$CR['id']}, 12, c, false );
  159. }
  160. }
  161. },{
  162. xtype: 'textfield',
  163. fieldLabel: 'Camera Password',
  164. value: '{$CR['c_password']}',
  165. listeners:{
  166. change: function( a, c, b ){
  167. doModuleOperation( {$CR['id']}, 13, c, false );
  168. }
  169. }
  170. }]
  171. }]
  172. }
  173. DATA_BOUNDARY;
  174. $CONTENT = implode(',',$ITEMS);
  175. $TTPL = str_ireplace( '%%%ITEMS%%%', $CONTENT, $TTPL );
  176. echo $TTPL;
  177. } else {
  178. echo '{ xtype: \'panel\', html: \'Node '.$_POST['NODE'].' Loadded\'}';
  179. };
  180. } else {
  181. header('location: /');
  182. };
  183. ?>