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.

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