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.

1895 lines
51 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. //<?php require_once('../../js_asm.php'); ?>
  2. var helpContentTopicID = -1;
  3. function loadHelpContent( topicID ){
  4. if( helpContentTopicID == topicID ) return;
  5. helpContentTopicID = topicID;
  6. Ext.Ajax.request({
  7. url: '/lib/controller/getHelpTopic.php',
  8. params: {
  9. UID: <?=$UserID;?>,
  10. SID: '<?=$Session;?>',
  11. TID: topicID
  12. },
  13. success: function( response, opts ){
  14. var tData = Ext.decode(response.responseText);
  15. var tPanel = Ext.getCmp('help_content');
  16. tPanel.removeAll( true );
  17. tPanel.add( tData );
  18. tPanel.doLayout();
  19. },
  20. failure: failureAJAXFunction
  21. });
  22. };
  23. function clearHelpContent(){
  24. helpContentTopicID = -1;
  25. };
  26. function loadRessources(){
  27. Ext.Ajax.request({
  28. url: '/lib/controller/getResources.php',
  29. params: {
  30. UID: <?=$UserID;?>,
  31. SID: '<?=$Session;?>',
  32. },
  33. success: function( response, opts ){
  34. var tData = Ext.decode(response.responseText);
  35. var tPanel = Ext.getCmp('resources_container');
  36. if( tData.status == 'ok' ){
  37. var res = Ext.decode( tData.resources );
  38. tPanel.removeAll( true );
  39. tPanel.add( res );
  40. tPanel.doLayout();
  41. } else {
  42. };
  43. },
  44. failure: failureAJAXFunction
  45. });
  46. };
  47. function loadModules(){
  48. Ext.Ajax.request({
  49. url: '/lib/controller/getModules.php',
  50. params: {
  51. UID: <?=$UserID;?>,
  52. SID: '<?=$Session;?>',
  53. },
  54. success: function( response, opts ){
  55. var tData = Ext.decode(response.responseText);
  56. var tPanel = Ext.getCmp('modules_container');
  57. if( tData.status == 'ok' ){
  58. var res = Ext.decode( tData.modules );
  59. tPanel.removeAll( true );
  60. tPanel.add( res );
  61. tPanel.doLayout();
  62. } else {
  63. tPanel.removeAll( true );
  64. tPanel.doLayout();
  65. var tPanel = Ext.getCmp('mod_ed_small');
  66. tPanel.removeAll( true );
  67. tPanel.add( { html:'<div class="setEd_infoPanel" id="NUNU"><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>' } );
  68. tPanel.doLayout();
  69. };
  70. },
  71. failure: failureAJAXFunction
  72. });
  73. };
  74. function loadDetectedCameras(){
  75. Ext.Ajax.request({
  76. url: '/lib/controller/getCameras.php',
  77. params: {
  78. UID: <?=$UserID;?>,
  79. TYP: 0,
  80. SID: '<?=$Session;?>',
  81. },
  82. success: function( response, opts ){
  83. var tData = Ext.decode(response.responseText);
  84. var tPanel = Ext.getCmp('dcam_container');
  85. if( tData.status == 'ok' ){
  86. var res = Ext.decode( tData.cameras );
  87. tPanel.removeAll( true );
  88. tPanel.add( res );
  89. tPanel.doLayout();
  90. var zPanel = Ext.getCmp('dcam_op_small');
  91. zPanel.removeAll( true );
  92. zPanel.add( { html:'<div class="setEd_infoPanel" id="NUNU"><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>' } );
  93. zPanel.doLayout();
  94. } else {
  95. tPanel.removeAll( true );
  96. tPanel.doLayout();
  97. var zPanel = Ext.getCmp('dcam_op_small');
  98. zPanel.removeAll( true );
  99. zPanel.add( { html:'<div class="setEd_infoPanel" id="NUNU"><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>' } );
  100. zPanel.doLayout();
  101. };
  102. },
  103. failure: failureAJAXFunction
  104. });
  105. };
  106. function loadAssignedCameras(){
  107. Ext.Ajax.request({
  108. url: '/lib/controller/getCameras.php',
  109. params: {
  110. UID: <?=$UserID;?>,
  111. TYP: 1,
  112. SID: '<?=$Session;?>',
  113. },
  114. success: function( response, opts ){
  115. var tData = Ext.decode(response.responseText);
  116. var tPanel = Ext.getCmp('acam_container');
  117. if( tData.status == 'ok' ){
  118. var res = Ext.decode( tData.cameras );
  119. tPanel.removeAll( true );
  120. tPanel.add( res );
  121. tPanel.doLayout();
  122. var zPanel = Ext.getCmp('acam_op_small');
  123. zPanel.removeAll( true );
  124. zPanel.add( { html:'<div class="setEd_infoPanel" id="NUNU"><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>' } );
  125. zPanel.doLayout();
  126. } else {
  127. tPanel.removeAll( true );
  128. tPanel.doLayout();
  129. var zPanel = Ext.getCmp('acam_op_small');
  130. zPanel.removeAll( true );
  131. zPanel.add( { html:'<div class="setEd_infoPanel" id="NUNU"><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>' } );
  132. zPanel.doLayout();
  133. };
  134. },
  135. failure: failureAJAXFunction
  136. });
  137. };
  138. function loadAttachedSensors(){
  139. Ext.Ajax.request({
  140. url: '/lib/controller/getSensors.php',
  141. params: {
  142. UID: <?=$UserID;?>,
  143. SID: '<?=$Session;?>',
  144. },
  145. success: function( response, opts ){
  146. var tData = Ext.decode(response.responseText);
  147. var tPanel = Ext.getCmp('sens_container');
  148. if( tData.status == 'ok' ){
  149. var res = Ext.decode( tData.sensors );
  150. tPanel.removeAll( true );
  151. tPanel.add( res );
  152. tPanel.doLayout();
  153. var zPanel = Ext.getCmp('sens_op_small');
  154. zPanel.removeAll( true );
  155. zPanel.add( { html:'<div class="setEd_infoPanel" id="NUNU"><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>' } );
  156. zPanel.doLayout();
  157. } else {
  158. tPanel.removeAll( true );
  159. tPanel.doLayout();
  160. var zPanel = Ext.getCmp('sens_op_small');
  161. zPanel.removeAll( true );
  162. zPanel.add( { html:'<div class="setEd_infoPanel" id="NUNU"><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>' } );
  163. zPanel.doLayout();
  164. };
  165. },
  166. failure: failureAJAXFunction
  167. });
  168. };
  169. function editResource( rid ){
  170. var loadEditor = true;
  171. if( settingsAreChanged ){
  172. Ext.Msg.show({
  173. title:'<?=$Labels->GetLabel('_SETTINGS_CHANGED_');?>',
  174. msg: '<?=$Labels->GetLabel('_SET_CHANGED_WOULD_SAVE_');?>',
  175. buttons: Ext.Msg.YESNO,
  176. icon: Ext.MessageBox.WARNING,
  177. fn: function(btn, text){
  178. if( btn == 'yes' ){
  179. cleanupChangeNotifier();
  180. } else {
  181. loadEditor = false;
  182. };
  183. }
  184. });
  185. };
  186. if( loadEditor ){
  187. Ext.Ajax.request({
  188. url: '/lib/controller/getResourceEditor.php',
  189. params: {
  190. RID: rid,
  191. UID: <?=$UserID;?>,
  192. SID: '<?=$Session;?>',
  193. },
  194. success: function( response, opts ){
  195. var data = Ext.decode(response.responseText);
  196. var resourceEdPanel = Ext.getCmp('res_ed_small');
  197. if( resourceEdPanel ){
  198. resourceEdPanel.removeAll( true );
  199. resourceEdPanel.add( data );
  200. resourceEdPanel.doLayout();
  201. };
  202. },
  203. failure: failureAJAXFunction
  204. });
  205. };
  206. };
  207. function editModule( mid ){
  208. var loadEditor = true;
  209. if( settingsAreChanged ){
  210. Ext.Msg.show({
  211. title:'<?=$Labels->GetLabel('_SETTINGS_CHANGED_');?>',
  212. msg: '<?=$Labels->GetLabel('_SET_CHANGED_WOULD_SAVE_');?>',
  213. buttons: Ext.Msg.YESNO,
  214. icon: Ext.MessageBox.WARNING,
  215. fn: function(btn, text){
  216. if( btn == 'yes' ){
  217. cleanupChangeNotifier();
  218. } else {
  219. loadEditor = false;
  220. };
  221. }
  222. });
  223. };
  224. if( loadEditor ){
  225. Ext.Ajax.request({
  226. url: '/lib/controller/getModuleEditor.php',
  227. params: {
  228. MID: mid,
  229. UID: <?=$UserID;?>,
  230. SID: '<?=$Session;?>',
  231. },
  232. success: function( response, opts ){
  233. var data = Ext.decode(response.responseText);
  234. var moduleEdPanel = Ext.getCmp('mod_ed_small');
  235. if( moduleEdPanel ){
  236. moduleEdPanel.removeAll( true );
  237. moduleEdPanel.add( data );
  238. moduleEdPanel.doLayout();
  239. };
  240. },
  241. failure: failureAJAXFunction
  242. });
  243. };
  244. };
  245. function enableModule( ID ){
  246. Ext.Ajax.request({
  247. url: '/lib/controller/doModuleOperation.php',
  248. params: {
  249. OPID: 2,
  250. OPCODE: 1,
  251. MID: ID,
  252. UID: <?=$UserID;?>,
  253. SID: '<?=$Session;?>'
  254. },
  255. success: function(){
  256. //showSettings( SelectedNodeID, 2 );
  257. loadModules();
  258. }
  259. });
  260. };
  261. function disableModule( ID ){
  262. Ext.Ajax.request({
  263. url: '/lib/controller/doModuleOperation.php',
  264. params: {
  265. OPID: 2,
  266. OPCODE: 0,
  267. MID: ID,
  268. UID: <?=$UserID;?>,
  269. SID: '<?=$Session;?>'
  270. },
  271. success: function(){
  272. //showSettings( SelectedNodeID, 2 );
  273. loadModules();
  274. }
  275. });
  276. };
  277. function doCamOperation( cid, op, param, reload = false ){
  278. Ext.Ajax.request({
  279. url: '/lib/controller/doCameraOperation.php',
  280. params: {
  281. CID: cid,
  282. CMD: 10,
  283. OPID: op,
  284. OPCODE: param,
  285. UID: <?=$UserID;?>,
  286. SID: '<?=$Session;?>'
  287. },
  288. success: function(){
  289. if( reload ) loadDetectedCameras();
  290. if( reload ) loadAssignedCameras();
  291. }
  292. });
  293. };
  294. function removeModule( ID ){
  295. Ext.Msg.show({
  296. title:'<?=$Labels->GetLabel('_PLS_CONFIRM_');?>',
  297. msg: '<?=$Labels->GetLabel('_RUS_DELETE_MODULE_');?>',
  298. buttons: Ext.Msg.YESNOCANCEL,
  299. fn: function( btn, text ){
  300. if( btn == 'yes' ){
  301. Ext.Ajax.request({
  302. url: '/lib/controller/doModuleOperation.php',
  303. params: {
  304. OPID: 1,
  305. MID: ID,
  306. UID: <?=$UserID;?>,
  307. SID: '<?=$Session;?>'
  308. },
  309. success: function(){
  310. //showSettings( SelectedNodeID, 2 );
  311. loadModules();
  312. }
  313. });
  314. };
  315. },
  316. icon: Ext.MessageBox.QUESTION
  317. });
  318. };
  319. function disableServOps(){
  320. var tC = Ext.getCmp('servopPanel01');
  321. tC.removeClass('servopInfo_item01');
  322. tC.addClass('servopInfo_item00');
  323. tC.disable();
  324. Ext.getCmp('tbtn_sop01').disable();
  325. //tC.doLayout();
  326. tC = Ext.getCmp('servopPanel02');
  327. tC.removeClass('servopInfo_item11');
  328. tC.addClass('servopInfo_item10');
  329. tC.disable();
  330. Ext.getCmp('tbtn_sop02').disable();
  331. //tC.doLayout();
  332. tC = Ext.getCmp('servopPanel03');
  333. tC.removeClass('servopInfo_item21');
  334. tC.addClass('servopInfo_item20');
  335. tC.disable();
  336. Ext.getCmp('tbtn_sop03').disable();
  337. //tC.doLayout();
  338. tC = Ext.getCmp('servopPanel04');
  339. tC.removeClass('servopInfo_item31');
  340. tC.addClass('servopInfo_item30');
  341. tC.disable();
  342. Ext.getCmp('tbtn_sop04').disable();
  343. //tC.doLayout();
  344. };
  345. function enableServOps(){
  346. var tC = Ext.getCmp('servopPanel01');
  347. if( tC != undefined ){
  348. tC.removeClass('servopInfo_item00');
  349. tC.addClass('servopInfo_item01');
  350. Ext.getCmp('tbtn_sop01').enable();
  351. tC.enable();
  352. };
  353. //tC.doLayout();
  354. tC = Ext.getCmp('servopPanel02');
  355. if( tC != undefined ){
  356. tC.removeClass('servopInfo_item10');
  357. tC.addClass('servopInfo_item11');
  358. tC.enable();
  359. Ext.getCmp('tbtn_sop02').enable();
  360. };
  361. //tC.doLayout();
  362. tC = Ext.getCmp('servopPanel03');
  363. if( tC != undefined ){
  364. tC.removeClass('servopInfo_item20');
  365. tC.addClass('servopInfo_item21');
  366. tC.enable();
  367. Ext.getCmp('tbtn_sop03').enable();
  368. };
  369. //tC.doLayout();
  370. tC = Ext.getCmp('servopPanel04');
  371. if( tC != undefined ){
  372. tC.removeClass('servopInfo_item30');
  373. tC.addClass('servopInfo_item31');
  374. tC.enable();
  375. Ext.getCmp('tbtn_sop04').enable();
  376. };
  377. //tC.doLayout();
  378. };
  379. function updateServerStatus(){
  380. Ext.Ajax.request({
  381. url: '/lib/controller/getServerStatus.php',
  382. params: {
  383. SERVID: 1,
  384. UID: <?=$UserID;?>,
  385. SID: '<?=$Session;?>'
  386. },
  387. success: function( response, opts ){
  388. // If the response is JSON, you have to decode it
  389. var sps = document.getElementById("INFO_SPS");
  390. if( sps == undefined ) return;
  391. var data = Ext.decode(response.responseText);
  392. if( data.status == 'ok' ){
  393. serverIsOnLine = true;
  394. enableServOps();
  395. //document.getElementById('HW_NFO').innerHTML = data.stats.hw_info;
  396. //document.getElementById('OS_NFO').innerHTML = data.stats.os_info;
  397. //document.getElementById('BLD_NFO').innerHTML = data.stats.build;
  398. setDonatStatus( 1, 0, data.stats.stat_cpu15 );
  399. setDonatStatus( 1, 1, data.stats.stat_mem );
  400. setDonatStatus( 1, 2, data.stats.stat_disk );
  401. setDonatStatus( 1, 3, data.stats.temp0 );
  402. sps.classList.remove('setEd_infoPanel');
  403. sps.classList.add('setEl_infoPanel');
  404. } else {
  405. serverIsOnLine = false;
  406. disableServOps();
  407. if( data.status == 'na' ){
  408. setDonatStatus( 1, 0, -1 );
  409. setDonatStatus( 1, 1, -1 );
  410. setDonatStatus( 1, 2, -1 );
  411. setDonatStatus( 1, 3, -1 );
  412. sps.classList.remove('setEl_infoPanel');
  413. sps.classList.add('setEd_infoPanel');
  414. } else {
  415. Ext.Msg.show({
  416. title:'<?=$Labels->GetLabel("_INFO_MSG_");?>',
  417. msg: data.messages,
  418. buttons: Ext.Msg.OK,//YESNOCANCEL,
  419. fn: function(){
  420. },
  421. icon: Ext.MessageBox.INFO //QUESTION
  422. });
  423. };
  424. };
  425. if( tlInterval == null ){
  426. tlInterval = window.setInterval( updateServerStatus, 1200, selectedSite );
  427. };
  428. },
  429. failure: failureAJAXFunction
  430. });
  431. };
  432. var addE2UDialog = null;
  433. function addEthernet2Uart(){
  434. if( addE2UDialog == null ){
  435. addE2UDialog = new Ext.Window({
  436. modal: true,
  437. title: '<?=$Labels->GetLabel('_ADD_E2U_DIAL_TTL_');?>',
  438. width: 400,
  439. height: 560,
  440. layout: 'fit',
  441. closeAction: 'hide',
  442. items:[{
  443. xtype: 'form',
  444. labelWidth: 120, // label settings here cascade unless overridden
  445. frame: false,
  446. width: 400,
  447. labelAlign: 'right',
  448. //bodyStyle:'padding:5px 5px 0',
  449. defaultType: 'textfield',
  450. items:[{
  451. xtype: 'panel',
  452. height: 200,
  453. frame: false,
  454. border: false,
  455. html: '<center><img width="200px" src="/style/assets/eth2uart.png"></center>'
  456. },{
  457. fieldLabel: 'Name',
  458. id: 'ued_name'
  459. },{
  460. xtype: 'combo',
  461. fieldLabel: '<?=$Labels->GetLabel('_CONNECT_2_');?>',
  462. id: 'ued_servid',
  463. editable: false,
  464. typeAhead: true,
  465. triggerAction: 'all',
  466. width: '100%',
  467. lazyRender:true,
  468. mode: 'local',
  469. store: new Ext.data.ArrayStore({
  470. <?php
  471. $QS = "SELECT `id`, `name` FROM `nodes` WHERE `type`=0";
  472. $Servers = $DATABASE->Query( $QS );
  473. $SLIST = array();
  474. $SSID = 0;
  475. if( count( $Servers ) ){
  476. foreach( $Servers as $A ) $SLIST[] = '['.$A['id'].',\''.$A['name'].'\']';
  477. $SSID = intval( $Servers[0]['id'] );
  478. };
  479. //[1,'Server Node'], [2,'Aux Server']
  480. ?>
  481. fields: ['sid', 'snam'],
  482. data: [<?=implode(',',$SLIST);?>]
  483. }),
  484. value: <?=$SSID;?>,
  485. valueField: 'sid',
  486. displayField: 'snam'
  487. },{
  488. xtype: 'combo',
  489. fieldLabel: '<?=$Labels->GetLabel('UART_COM_SPEED');?>',
  490. id: 'ued_speed',
  491. editable: false,
  492. typeAhead: true,
  493. triggerAction: 'all',
  494. width: '100%',
  495. lazyRender:true,
  496. mode: 'local',
  497. store: new Ext.data.ArrayStore({
  498. fields: ['speed'],
  499. data: [[19200], [115200]]
  500. }),
  501. value: 19200,
  502. valueField: 'speed',
  503. displayField: 'speed'
  504. },{
  505. xtype: 'combo',
  506. fieldLabel: '<?=$Labels->GetLabel('UART_COM_BITS');?>',
  507. id: 'ued_bit',
  508. editable: false,
  509. typeAhead: true,
  510. triggerAction: 'all',
  511. width: '100%',
  512. lazyRender:true,
  513. mode: 'local',
  514. store: new Ext.data.ArrayStore({
  515. fields: ['bits'],
  516. data: [[5],[6],[7],[8],[9]]
  517. }),
  518. value: 8,
  519. valueField: 'bits',
  520. displayField: 'bits'
  521. },{
  522. xtype: 'combo',
  523. fieldLabel: '<?=$Labels->GetLabel('UART_COM_SBITS');?>',
  524. id: 'ued_stops',
  525. editable: false,
  526. typeAhead: true,
  527. triggerAction: 'all',
  528. width: '100%',
  529. lazyRender:true,
  530. mode: 'local',
  531. store: new Ext.data.ArrayStore({
  532. fields: ['stops'],
  533. data: [[1],[1.5],[2]]
  534. }),
  535. value: 1,
  536. valueField: 'stops',
  537. displayField: 'stops'
  538. },{
  539. xtype: 'combo',
  540. fieldLabel: '<?=$Labels->GetLabel('UART_COM_PARITY');?>',
  541. id: 'ued_parity',
  542. editable: false,
  543. typeAhead: true,
  544. triggerAction: 'all',
  545. width: '100%',
  546. lazyRender:true,
  547. mode: 'local',
  548. store: new Ext.data.ArrayStore({
  549. fields: ['parity'],
  550. data: [['Odd'], ['Even'],['None']]
  551. }),
  552. value: 'None',
  553. valueField: 'parity',
  554. displayField: 'parity'
  555. },{
  556. xtype: 'combo',
  557. fieldLabel: '<?=$Labels->GetLabel('_WORKING_MODE_');?>',
  558. id: 'ued_mode',
  559. editable: false,
  560. typeAhead: true,
  561. triggerAction: 'all',
  562. width: '100%',
  563. lazyRender:true,
  564. mode: 'local',
  565. store: new Ext.data.ArrayStore({
  566. fields: ['mode','mode_txt'],
  567. data: [[0,'<?=$Labels->GetLabel('_UDP_CLIENT_');?>'], [1,'<?=$Labels->GetLabel('_TCP_CLIENT_');?>'], [2,'<?=$Labels->GetLabel('_UDP_SERVER_');?>'], [3,'<?=$Labels->GetLabel('_TCP_SERVER_');?>']]
  568. }),
  569. value: 3,
  570. valueField: 'mode',
  571. displayField: 'mode_txt'
  572. },{
  573. fieldLabel: '<?=$Labels->GetLabel('_DEVICE_IP_');?>',
  574. id: 'ued_ip'
  575. },{
  576. fieldLabel: '<?=$Labels->GetLabel('_DEVICE_PORT_');?>',
  577. value: 8234,
  578. id: 'ued_port'
  579. }],
  580. bbar: [{
  581. text: 'Cancel',
  582. handler: function(){//discoverOnvifSources
  583. addE2UDialog.hide();
  584. }
  585. },'->',{
  586. id: 'con_to_src',
  587. text: 'Add Adapter to Site',
  588. disabled: false,
  589. handler: function(){
  590. var SPD = Ext.getCmp('ued_speed').getValue();
  591. var BIT = Ext.getCmp('ued_bit').getValue();
  592. var STP = Ext.getCmp('ued_stops').getValue();
  593. var PAR = Ext.getCmp('ued_parity').getValue();
  594. var MOD = Ext.getCmp('ued_mode').getValue();
  595. var IP = Ext.getCmp('ued_ip').getValue();
  596. var PORT= Ext.getCmp('ued_port').getValue();
  597. var MAC = '';//Ext.getCmp('ued_mac').getValue();
  598. var NAME= Ext.getCmp('ued_name').getValue();
  599. var SRV = Ext.getCmp('ued_servid').getValue();
  600. Ext.Ajax.request({
  601. url: '/lib/controller/addNetworkNode.php',
  602. params: {
  603. SITEID: <?=$SiteID;?>,
  604. TYPE: 20,
  605. UART_SPEED: SPD,
  606. UART_BITS: BIT,
  607. UART_STOP: STP,
  608. UART_PAR: PAR,
  609. UART_MODE: MOD,
  610. UART_IP: IP,
  611. UART_PORT: PORT,
  612. UART_MAC: MAC,
  613. UART_NAME: NAME,
  614. UID: <?=$UserID;?>,
  615. SRVID: SRV,
  616. SID: '<?=$Session;?>'
  617. },
  618. success: function( response, opts ){
  619. var data = Ext.decode(response.responseText);
  620. if( data.sucess == false ){
  621. Ext.Msg.show({
  622. title:'Request Failure!',
  623. msg: data.error,
  624. buttons: Ext.Msg.OK,
  625. icon: Ext.MessageBox.INFO
  626. });
  627. } else {
  628. loadSystemEditor();
  629. };
  630. addE2UDialog.hide();
  631. },
  632. failure: function( response, opts ) {
  633. failureAJAXFunction( response, opts );
  634. addE2UDialog.hide();
  635. }
  636. });
  637. }
  638. }]
  639. }]
  640. });
  641. };
  642. addE2UDialog.show();
  643. };
  644. var addSensorDialog = null;
  645. var addSensWM = null;
  646. function addSensor(){
  647. if( addSensorDialog == null ){
  648. addSensorDialog = new Ext.Window({
  649. modal: true,
  650. title: '<?=$Labels->GetLabel('_SMM_ADD_LSEN_');?>',
  651. width: 500,
  652. height: 438,
  653. layout: 'form',
  654. closeAction: 'hide',
  655. labelWidth: 160,
  656. labelAlign: 'right',
  657. items:[{
  658. xtype: 'panel',
  659. frame: false,
  660. border: false,
  661. html: '<table width="100%" border=0><tr><td align="center" valign="middle"><div class="node_1_img_set"></div></td></tr></table>'
  662. },{
  663. xtype: 'spacer',
  664. height: 8
  665. },{
  666. xtype: 'combo',
  667. id: 'sens_type',
  668. fieldLabel: "<?=$Labels->GetLabel('SENS_TYPE');?>",
  669. lazyRender: true,
  670. mode: 'local',
  671. forceSelection: true,
  672. triggerAction: 'all',
  673. editable: false,
  674. disableKeyFilter: true,
  675. store: new Ext.data.ArrayStore({
  676. fields: ['mode','mode_txt'],
  677. data: [
  678. [1,'ALS Sensor'],
  679. [2,'LFS Sensor'],
  680. [3,'PLS 200 Sensor'],
  681. [4,'PLS 360 Sensor']
  682. ]
  683. }),
  684. valueField: 'mode',
  685. displayField: 'mode_txt',
  686. value: 1,
  687. width: 200
  688. },{
  689. xtype: 'combo',
  690. id: 'sens_range',
  691. fieldLabel: "<?=$Labels->GetLabel('SENS_RANGE');?>",
  692. lazyRender: true,
  693. mode: 'local',
  694. forceSelection: true,
  695. triggerAction: 'all',
  696. editable: false,
  697. disableKeyFilter: true,
  698. store: new Ext.data.ArrayStore({
  699. fields: ['range','range_txt'],
  700. data: [
  701. [15,'15 Meters'],
  702. [35,'35 Meters'],
  703. [65,'65 Meters'],
  704. [75,'75 Meters'],
  705. [150,'150 Meters'],
  706. [200,'200 Meters'],
  707. [300,'300 Meters']
  708. ]
  709. }),
  710. valueField: 'range',
  711. displayField: 'range_txt',
  712. value: 15,
  713. width: 200
  714. },{
  715. xtype: 'numberfield',
  716. id: 'sens_id',
  717. fieldLabel: '<?=$Labels->GetLabel('_PROTO_DEVICE_ID_');?>',
  718. width: 200,
  719. value: 0
  720. },{
  721. xtype: 'combo',
  722. fieldLabel: '<?=$Labels->GetLabel('_UART_PORT_');?>',
  723. lazyRender: true,
  724. id: 'uart_id',
  725. mode: 'local',
  726. disabled: false,
  727. forceSelection: true, triggerAction: 'all', editable: false, disableKeyFilter: true,
  728. store: new Ext.data.ArrayStore({
  729. fields: ['uart','uart_txt'],
  730. data: [<?php
  731. $QS="SELECT aux_id, device FROM resources WHERE ( type=1 OR type=129 )";
  732. $RR=$DATABASE->Query( $QS );
  733. if( count( $RR ) ){
  734. $RE=array();
  735. foreach( $RR as $R ){
  736. $RE[] = "[ {$R['aux_id']}, '{$R['device']}']";
  737. };
  738. echo implode( ',', $RE );
  739. } else {
  740. echo "[0, \"".$Labels->GetLabel('_NO_UARTS_DEF_')."\"]";
  741. };
  742. ?>]
  743. }),
  744. valueField: 'uart',
  745. displayField: 'uart_txt',
  746. width: 200
  747. },{
  748. xtype:'button',
  749. width: '100%',
  750. text: '<?=$Labels->GetLabel('_ADD_');?>',
  751. handler: function(){
  752. var TYP = parseInt( Ext.getCmp('sens_type').getValue() );
  753. var RAN = parseInt( Ext.getCmp('sens_range').getValue() );
  754. var PID = parseInt( Ext.getCmp('sens_id').getValue() );
  755. var RTI = parseInt( Ext.getCmp('uart_id').getValue() );
  756. if( RTI > 0 ){
  757. addSensWM = new Ext.LoadMask( addSensorDialog.getEl(), {msg:"<?=$Labels->GetLabel('_Please_Wait_');?>..."});
  758. addSensWM.show();
  759. Ext.Ajax.request({
  760. url: '/lib/controller/doNodeOperation.php',
  761. params: {
  762. UID: <?=$UserID;?>,
  763. SID: '<?=$Session;?>',
  764. TYPE: TYP,
  765. DEVID: PID,
  766. UART: RTI,
  767. RANGE: RAN,
  768. CCMD: 1
  769. },
  770. success: function( response, opts ){
  771. addSensWM.hide();
  772. var data = Ext.decode(response.responseText);
  773. if( data.status == 'ok' ){
  774. loadAttachedSensors();
  775. } else {
  776. Ext.Msg.show({
  777. title:'Error!',
  778. msg: data.msg,
  779. buttons: Ext.Msg.OK,
  780. icon: Ext.MessageBox.WARNING
  781. });
  782. };
  783. addSensorDialog.hide();
  784. },
  785. failure: failureAJAXFunction
  786. });
  787. } else {
  788. Ext.Msg.show({
  789. title:'Error!',
  790. msg: 'Please Choose UART Port',
  791. buttons: Ext.Msg.OK,
  792. icon: Ext.MessageBox.WARNING
  793. });
  794. };
  795. }
  796. }]
  797. });
  798. };
  799. addSensorDialog.show();
  800. };
  801. var addDetCamDialog = null;
  802. var addDetCamWM = null;
  803. function addDetectedIPCam(){
  804. if( addDetCamDialog == null ){
  805. addDetCamDialog = new Ext.Window({
  806. modal: true,
  807. title: '<?=$Labels->GetLabel('_ADD_CAM_DIAL_TTL_');?>',
  808. width: 400,
  809. height: 187,
  810. layout: 'form',
  811. closeAction: 'hide',
  812. labelWidth: 160,
  813. labelAlign: 'right',
  814. items:[{
  815. xtype: 'spacer',
  816. height: 8
  817. },{
  818. xtype: 'textfield',
  819. id: 'ncam_ip',
  820. fieldLabel: 'Camera IP Address',
  821. value: ''
  822. },{
  823. xtype: 'textfield',
  824. id: 'ncam_user',
  825. fieldLabel: 'Access Login',
  826. value: ''
  827. },{
  828. xtype: 'textfield',
  829. id: 'ncam_pwd',
  830. inputType: 'password',
  831. fieldLabel: 'Access Password',
  832. value: ''
  833. },{
  834. xtype: 'combo',
  835. id: 'ncam_auth_mode',
  836. fieldLabel: '<?=$Labels->GetLabel('_AUTH_MODE_0_');?>',
  837. lazyRender: true,
  838. mode: 'local',
  839. forceSelection: true,
  840. triggerAction: 'all',
  841. editable: false,
  842. disableKeyFilter: true,
  843. store: new Ext.data.ArrayStore({
  844. fields: ['mode','mode_txt'],
  845. data: [
  846. [0,'BASIC'],
  847. [1,'DIGEST'],
  848. [2,'DIGEST_IE'],
  849. [3,'BEARER'],
  850. [4,'NEGOTIATE'],
  851. [5,'NTLM'],
  852. [6,'NTLM_WB'],
  853. [7,'ANY'],
  854. [8,'ANYSAFE'],
  855. [9,'ONLY'],
  856. [10,'AWS_SIGV4']
  857. ]
  858. }),
  859. valueField: 'mode',
  860. displayField: 'mode_txt',
  861. value: 0,
  862. width: 200
  863. },{
  864. xtype: 'spacer',
  865. height: 8
  866. },{
  867. xtype:'button',
  868. width: '100%',
  869. text: 'Add Camera to List',
  870. handler: function(){
  871. addDetCamWM = new Ext.LoadMask( addDetCamDialog.getEl(), {msg:"<?=$Labels->GetLabel('_Please_Wait_');?>..."});
  872. addDetCamWM.show();
  873. var NIP = Ext.getCmp('ncam_ip').getValue();
  874. var NUU = Ext.getCmp('ncam_user').getValue();
  875. var NPP = Ext.getCmp('ncam_pwd').getValue();
  876. var NAM = Ext.getCmp('ncam_auth_mode').getValue();
  877. Ext.Ajax.request({
  878. url: '/lib/controller/doCameraOperation.php',
  879. params: {
  880. UID: <?=$UserID;?>,
  881. SID: '<?=$Session;?>',
  882. IP: NIP,
  883. UU: NUU,
  884. PP: NPP,
  885. AU: NAM,
  886. CMD: 2
  887. },
  888. success: function( response, opts ){
  889. addDetCamWM.hide();
  890. var data = Ext.decode(response.responseText);
  891. if( data.status == 'ok' ){
  892. loadDetectedCameras();
  893. } else {
  894. Ext.Msg.show({
  895. title:'Error!',
  896. msg: data.msg,
  897. buttons: Ext.Msg.OK,
  898. icon: Ext.MessageBox.WARNING
  899. });
  900. };
  901. addDetCamDialog.hide();
  902. },
  903. failure: failureAJAXFunction
  904. });
  905. }
  906. }]
  907. });
  908. };
  909. addDetCamDialog.show();
  910. };
  911. function showSettingsGeneral(){
  912. stopStatusUpdater();
  913. content_lvl1 = 1;
  914. content_lvl2 = 0;
  915. var tPanel = Ext.getCmp('main_content');
  916. tPanel.removeAll( true );
  917. <?php
  918. //$QS="SELECT * FROM `servers` WHERE `id`=1";
  919. //$SDD = $DATABASE->Query( $QS );
  920. //$NData = $SDD[0];
  921. $QS="SELECT * FROM `resources` WHERE `node_id`=1 AND ( `type`=101 OR `type`=102 )";
  922. $CN = $DATABASE->Query( $QS );
  923. $IL=array();
  924. foreach( $CN as $N ){
  925. $QS="SELECT * FROM `networks` WHERE `nif_id`={$N['aux_id']} AND `type`=0";
  926. $NWD = $DATABASE->Query( $QS );
  927. $NW = $NWD[0];
  928. $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>";
  929. };
  930. $NIFO = '<table><tr>' . implode( '</tr><tr>', $IL ) . '</tr></table>';
  931. ?>
  932. tPanel.add({
  933. xtype: 'tabpanel',
  934. frame: false,
  935. id: 'node_settings_content',
  936. border: false,
  937. activeTab: content_lvl3,
  938. items: [{
  939. xtype: 'panel',
  940. id: 'gi_tab',
  941. title: 'General Info',
  942. layout: 'hbox',
  943. items:[{
  944. xtype: 'panel',
  945. flex: 1,
  946. height: PanelH-15,
  947. autoScroll: false,
  948. html: '<table width="100%" height="100%" border=0><tr><td height="290px" align="center" valign="middle"><div class="server_img_set"></div></td></tr>\
  949. <tr><td height="100px"><table width="100%" border=0><tr>\
  950. <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>\
  951. <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>\
  952. <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>\
  953. <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>\
  954. </tr></table></td></tr>\
  955. <tr><td valign="top"><div class="setEd_infoPanel" id="INFO_SPS">\
  956. <div class="sideInfo_item" id="SW_INFO"><?=$AP_DATA['build'];?></div>\
  957. <div class="sideInfo_item" id="OS_INFO"><?=$AP_DATA['os_info'];?></div>\
  958. <div class="sideInfo_item" id="HW_INFO"><?=$AP_DATA['hw_info'];?></div>\
  959. </div></td></tr>\
  960. <tr><td height="60%">&nbsp;</td></tr></table>'
  961. },{
  962. xtype: 'panel',
  963. id: '_ed_small',
  964. flex: 1,
  965. height: PanelH-15,
  966. autoScroll: false,
  967. items:[{
  968. xtype: 'panel',
  969. baseCls:'servopInfo_item00',
  970. id: 'servopPanel01',
  971. items:[{
  972. xtype: 'panel',
  973. frame: false,
  974. border: false,
  975. unstyled: true,
  976. html: '<p><?=$Labels->GetLabel('_SERV_RESTART_DESC_');?></p><br/>'
  977. },{
  978. xtype: 'button',
  979. lazyRender: true,
  980. iconCls: 'srv_op_restart',
  981. text: '<?=$Labels->GetLabel('_SERV_RESTART_OP_');?>',
  982. id: 'tbtn_sop01',
  983. scale: 'large',
  984. width: '95%',
  985. disabled: true,
  986. handler: function( bt ){
  987. Ext.Msg.show({
  988. title:'<?=$Labels->GetLabel('_SERV_RESTART_QT_');?>',
  989. msg: '<?=$Labels->GetLabel('_SERV_RESTART_QM_');?>',
  990. buttons: Ext.Msg.YESNO,
  991. width: 400,
  992. icon: Ext.MessageBox.INFO,
  993. fn: function(btn, text){
  994. if( btn == 'yes' ){
  995. disableServOps();
  996. doDeviceOperation( 1, 250,'', true );
  997. };
  998. }
  999. });
  1000. }
  1001. }]
  1002. },{
  1003. xtype: 'spacer',
  1004. height: 8
  1005. },{
  1006. xtype: 'panel',
  1007. baseCls:'servopInfo_item10',
  1008. id: 'servopPanel02',
  1009. items:[{
  1010. xtype: 'panel',
  1011. frame: false,
  1012. border: false,
  1013. unstyled: true,
  1014. html: '<p><?=$Labels->GetLabel('_SERV_HW_DET_DESC_');?></p><br/>'
  1015. },{
  1016. xtype: 'button',
  1017. iconCls: 'srv_op_hw_init',
  1018. text: '<?=$Labels->GetLabel('_SERV_HW_DET_OP_');?>',
  1019. id: 'tbtn_sop02',
  1020. scale: 'large',
  1021. width: '95%',
  1022. disabled: true,
  1023. handler: function( bt ){
  1024. Ext.Msg.show({
  1025. title:'<?=$Labels->GetLabel('_SERV_HW_DET_QT_');?>',
  1026. msg: '<?=$Labels->GetLabel('_SERV_HW_DET_QM_');?>',
  1027. buttons: Ext.Msg.YESNO,
  1028. width: 400,
  1029. icon: Ext.MessageBox.INFO,
  1030. fn: function(btn, text){
  1031. if( btn == 'yes' ){
  1032. disableServOps();
  1033. doDeviceOperation( 1, 251,'', true );
  1034. };
  1035. }
  1036. });
  1037. }
  1038. }]
  1039. },{
  1040. xtype: 'spacer',
  1041. height: 8
  1042. },{
  1043. xtype: 'panel',
  1044. baseCls:'servopInfo_item20',
  1045. id: 'servopPanel03',
  1046. items:[{
  1047. xtype: 'panel',
  1048. frame: false,
  1049. border: false,
  1050. unstyled: true,
  1051. html: '<p><?=$Labels->GetLabel('_SERV_OSRESET_DESC_');?></p><br/>'
  1052. },{
  1053. xtype: 'button',
  1054. iconCls: 'srv_op_power_cycle',
  1055. text: '<?=$Labels->GetLabel('_SERV_OSRESET_OP_');?>',
  1056. id: 'tbtn_sop03',
  1057. scale: 'large',
  1058. width: '95%',
  1059. disabled: true,
  1060. handler: function( bt ){
  1061. Ext.Msg.show({
  1062. title:'<?=$Labels->GetLabel('_SERV_OSRESET_QT_');?>',
  1063. msg: '<?=$Labels->GetLabel('_SERV_OSRESET_QM_');?>',
  1064. buttons: Ext.Msg.YESNO,
  1065. width: 400,
  1066. icon: Ext.MessageBox.WARNING,
  1067. fn: function(btn, text){
  1068. if( btn == 'yes' ){
  1069. cleanupChangeNotifier();
  1070. } else {
  1071. loadEditor = false;
  1072. };
  1073. }
  1074. });
  1075. }
  1076. }]
  1077. },{
  1078. xtype: 'spacer',
  1079. height: 8
  1080. },{
  1081. xtype: 'panel',
  1082. baseCls:'servopInfo_item30',
  1083. id: 'servopPanel04',
  1084. items:[{
  1085. xtype: 'panel',
  1086. frame: false,
  1087. border: false,
  1088. unstyled: true,
  1089. html: '<p><?=$Labels->GetLabel('_SERV_FACTORY_DESC_');?></p><br/>'
  1090. },{
  1091. xtype: 'button',
  1092. iconCls: 'srv_op_factory_reset',
  1093. text: '<?=$Labels->GetLabel('_SERV_FACTORY_OP_');?>',
  1094. id: 'tbtn_sop04',
  1095. scale: 'large',
  1096. width: '95%',
  1097. disabled: true,
  1098. handler: function( bt ){
  1099. Ext.Msg.show({
  1100. title:'<?=$Labels->GetLabel('_SERV_FACTORY_QT_');?>',
  1101. msg: '<?=$Labels->GetLabel('_SERV_FACTORY_QM_');?>',
  1102. buttons: Ext.Msg.YESNO,
  1103. width: 400,
  1104. icon: Ext.MessageBox.ERROR,
  1105. fn: function(btn, text){
  1106. if( btn == 'yes' ){
  1107. disableServOps();
  1108. doDeviceOperation( 1, 254,'', true );
  1109. };
  1110. }
  1111. });
  1112. }
  1113. }]
  1114. }]
  1115. }]
  1116. },{
  1117. xtype: 'panel',
  1118. title: 'Resources',
  1119. id: 'res_tab',
  1120. layout: 'hbox',
  1121. items:[{
  1122. xtype: 'panel',
  1123. id: 'resources_container',
  1124. flex: 1,
  1125. height: PanelH-15,
  1126. autoScroll: 'auto',
  1127. tbar:[{
  1128. text: '<?=$Labels->GetLabel( '_ADD_REMOTE_UART_' );?>',
  1129. handler: function(){
  1130. addEthernet2Uart();
  1131. }
  1132. }],
  1133. items:[]
  1134. },{
  1135. xtype: 'panel',
  1136. id: 'res_ed_small',
  1137. flex: 1,
  1138. height: PanelH-15,
  1139. layout: 'fit',
  1140. items:[{
  1141. html:'<div class="setEd_infoPanel" id="NUNU"><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>'
  1142. }]
  1143. }]
  1144. },{
  1145. xtype: 'panel',
  1146. title: 'Modules',
  1147. id: 'mod_tab',
  1148. layout: 'hbox',
  1149. items:[{
  1150. xtype: 'panel',
  1151. id: 'modules_container',
  1152. flex: 1,
  1153. height: PanelH-15,
  1154. autoScroll: 'auto',
  1155. tbar:[{
  1156. text: 'Add Module',
  1157. handler: function(){
  1158. var addModuleWindow = new Ext.Window({
  1159. id: 'huha_boa',
  1160. title: 'Add Server Module',
  1161. modal: true,
  1162. width: 400,
  1163. height: 300,
  1164. items:[{
  1165. xtype: 'form',
  1166. items: [{
  1167. xtype: 'combo',
  1168. fieldLabel: "<?=$Labels->GetLabel( 'MOD_TYPE' );?>",
  1169. id: 'mod_type',
  1170. lazyRender: true,
  1171. mode: 'local',
  1172. forceSelection: true,
  1173. triggerAction: 'all',
  1174. editable: false,
  1175. disableKeyFilter: true,
  1176. store: new Ext.data.ArrayStore({
  1177. fields: ['az_t','az_txt'],
  1178. data: [<?php
  1179. $QS = "SELECT * FROM `module_types`";
  1180. $MM = $DATABASE->Query( $QS );
  1181. $MIMO = array();
  1182. foreach( $MM as $M ) $MIMO[]="[{$M['id']},'".$Labels->GetLabel($M['name'])."']";
  1183. echo implode( ',', $MIMO );
  1184. ?>]
  1185. }),
  1186. valueField: 'az_t',
  1187. displayField: 'az_txt',
  1188. value: 1,
  1189. listeners:{
  1190. select: function( t, r, i ){
  1191. var n = r.data.az_t;
  1192. Ext.Ajax.request({
  1193. url: '/lib/controller/getModuleInfo.php',
  1194. params: {
  1195. MID: n,
  1196. UID: <?=$UserID;?>,
  1197. SID: '<?=$Session;?>'
  1198. },
  1199. success: function( response, opts ){
  1200. Ext.getCmp('infopan').update( response.responseText );
  1201. }
  1202. });
  1203. }
  1204. }
  1205. },{
  1206. xtype: 'panel',
  1207. id: 'infopan',
  1208. html: ''
  1209. }]
  1210. }],
  1211. bbar:[{
  1212. text: 'Cancel',
  1213. handler: function(){
  1214. addModuleWindow.close();
  1215. }
  1216. },{
  1217. text: 'Add Module',
  1218. handler: function(){
  1219. var mtyp = Ext.getCmp('mod_type').getValue();
  1220. Ext.Ajax.request({
  1221. url: '/lib/controller/addModule.php',
  1222. params: {
  1223. SERVID: 1,
  1224. TYPE: mtyp,
  1225. UID: <?=$UserID;?>,
  1226. SID: '<?=$Session;?>'
  1227. },
  1228. success: function( response, opts ){
  1229. // If the response is JSON, you have to decode it
  1230. var data = Ext.decode(response.responseText);
  1231. if( data.status == 'ok' ){
  1232. addModuleWindow.close();
  1233. loadModules();
  1234. } else {
  1235. Ext.Msg.show({
  1236. title:'<?=$Labels->GetLabel("_INFO_MSG_");?>',
  1237. msg: data.message,
  1238. buttons: Ext.Msg.OK,//YESNOCANCEL,
  1239. fn: function(){
  1240. //SettingsLidar3D.hide();
  1241. },
  1242. icon: Ext.MessageBox.INFO //QUESTION
  1243. });
  1244. }
  1245. },
  1246. failure: failureAJAXFunction
  1247. });
  1248. }
  1249. }]
  1250. });
  1251. addModuleWindow.show();
  1252. }
  1253. }],
  1254. items:[]
  1255. },{
  1256. xtype: 'panel',
  1257. id: 'mod_ed_small',
  1258. flex: 1,
  1259. height: PanelH-15,
  1260. layout: 'fit',
  1261. items:[{
  1262. html:'<div class="setEd_infoPanel" id="NUNU"><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>'
  1263. }]
  1264. }]
  1265. },{
  1266. xtype: 'panel',
  1267. id: 'net_tab',
  1268. title: 'Filters',
  1269. items:[]
  1270. }],
  1271. listeners:{
  1272. tabchange: function( tp, t ){
  1273. switch( t.getId() ){
  1274. case 'gi_tab': {
  1275. content_lvl3=0;
  1276. updateServerStatus();
  1277. break;
  1278. };
  1279. case 'res_tab': {
  1280. content_lvl3=1;
  1281. stopStatusUpdater();
  1282. loadRessources();
  1283. break;
  1284. };
  1285. case 'mod_tab':{
  1286. content_lvl3=2;
  1287. stopStatusUpdater();
  1288. loadModules();
  1289. break;
  1290. };
  1291. case 'net_tab':{
  1292. content_lvl3=3;
  1293. stopStatusUpdater();
  1294. break;
  1295. };
  1296. };
  1297. updateUserContent();
  1298. },
  1299. afterrender: function(){
  1300. settingsAreChanged = false;
  1301. }
  1302. },
  1303. updateSettings: function(){
  1304. alert('Update Settings');
  1305. }
  1306. });
  1307. tPanel.doLayout();
  1308. updateServerStatus();
  1309. };
  1310. function showSettingsSensors(){
  1311. stopStatusUpdater();
  1312. content_lvl1 = 1;
  1313. content_lvl2 = 4;
  1314. var tPanel = Ext.getCmp('main_content');
  1315. tPanel.removeAll( true );
  1316. tPanel.add({
  1317. xtype: 'panel',
  1318. id: 'sen_set',
  1319. layout: 'hbox',
  1320. tbar:[{
  1321. text: '<?=$Labels->GetLabel( '_SMM_ADD_LSEN_' );?>',
  1322. handler: function(){
  1323. addSensor();
  1324. }
  1325. }],
  1326. items:[{
  1327. xtype: 'panel',
  1328. id: 'sens_container',
  1329. flex: 1,
  1330. height: PanelH-15,
  1331. autoScroll: 'auto',
  1332. items:[]
  1333. },{
  1334. xtype: 'panel',
  1335. id: 'sens_op_small',
  1336. flex: 1,
  1337. height: PanelH-15,
  1338. layout: 'fit',
  1339. items:[{
  1340. html:'<div class="setEd_infoPanel" id="NUNU"><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>'
  1341. }]
  1342. }]
  1343. });
  1344. tPanel.doLayout();
  1345. loadAttachedSensors();
  1346. };
  1347. function editSensorHW( cid ){
  1348. SelectedSensor = cid;
  1349. Ext.Ajax.request({
  1350. url: '/lib/controller/getSensorEditor.php',
  1351. params: {
  1352. CID: SelectedSensor,
  1353. UID: <?=$UserID;?>,
  1354. SID: '<?=$Session;?>'
  1355. },
  1356. success: function( response, opts ){
  1357. var data = Ext.decode( response.responseText );
  1358. var tComp = Ext.getCmp('sens_op_small');
  1359. if( data.status == 'ok' ){
  1360. if( tComp!= null ){
  1361. var content = Ext.decode( data.content );
  1362. tComp.removeAll( true );
  1363. tComp.add( content );
  1364. tComp.doLayout();
  1365. };
  1366. } else {
  1367. if( tComp!= null ){
  1368. tComp.removeAll( true );
  1369. tComp.add( data );
  1370. tComp.doLayout();
  1371. };
  1372. };
  1373. },
  1374. failure: function(){
  1375. }
  1376. });
  1377. };
  1378. var cameraEditorContent = null;
  1379. function editCamera( cid, etyp ){
  1380. SelectedCam = cid;
  1381. switch( etyp ){
  1382. case 0: cameraEditorContent = Ext.getCmp('dcam_op_small'); break;
  1383. case 1: cameraEditorContent = Ext.getCmp('acam_op_small'); break;
  1384. };
  1385. Ext.Ajax.request({
  1386. url: '/lib/controller/getCameraEditor.php',
  1387. params: {
  1388. CID: SelectedCam,
  1389. UID: <?=$UserID;?>,
  1390. SID: '<?=$Session;?>'
  1391. },
  1392. success: function( response, opts ){
  1393. var data = Ext.decode( response.responseText );
  1394. if( data.status == 'ok' ){
  1395. if( cameraEditorContent!= null ){
  1396. var content = Ext.decode( data.content );
  1397. cameraEditorContent.removeAll( true );
  1398. cameraEditorContent.add( content );
  1399. cameraEditorContent.doLayout();
  1400. };
  1401. } else {
  1402. if( cameraEditorContent!= null ){
  1403. cameraEditorContent.removeAll( true );
  1404. cameraEditorContent.add( data );
  1405. cameraEditorContent.doLayout();
  1406. };
  1407. };
  1408. },
  1409. failure: function(){
  1410. }
  1411. });
  1412. };
  1413. function showSettingsVideo(){
  1414. stopStatusUpdater();
  1415. content_lvl1 = 1;
  1416. content_lvl2 = 4;
  1417. var tPanel = Ext.getCmp('main_content');
  1418. tPanel.removeAll( true );
  1419. tPanel.add({
  1420. xtype: 'tabpanel',
  1421. frame: false,
  1422. id: 'node_settings_content',
  1423. border: false,
  1424. activeTab: content_lvl3,
  1425. items: [{
  1426. xtype: 'panel',
  1427. title: 'Detected Cameras',
  1428. id: 'cam_det_tab',
  1429. layout: 'hbox',
  1430. items:[{
  1431. xtype: 'panel',
  1432. id: 'dcam_container',
  1433. flex: 1,
  1434. height: PanelH-15,
  1435. autoScroll: 'auto',
  1436. tbar:[{
  1437. text: '<?=$Labels->GetLabel( '_MANUADD_CAMERA_' );?>',
  1438. handler: function(){
  1439. addDetectedIPCam();
  1440. }
  1441. }],
  1442. items:[]
  1443. },{
  1444. xtype: 'panel',
  1445. id: 'dcam_op_small',
  1446. flex: 1,
  1447. height: PanelH-15,
  1448. layout: 'fit',
  1449. items:[{
  1450. html:'<div class="setEd_infoPanel" id="NUNU"><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>'
  1451. }]
  1452. }]
  1453. },{
  1454. xtype: 'panel',
  1455. id: 'cam_ass_tab',
  1456. title: 'Assigned Cameras',
  1457. layout: 'hbox',
  1458. items:[{
  1459. xtype: 'panel',
  1460. id: 'acam_container',
  1461. flex: 1,
  1462. height: PanelH-15,
  1463. autoScroll: 'auto',
  1464. items:[]
  1465. },{
  1466. xtype: 'panel',
  1467. id: 'acam_op_small',
  1468. flex: 1,
  1469. height: PanelH-15,
  1470. layout: 'fit',
  1471. items:[{
  1472. html:'<div class="setEd_infoPanel" id="NUNU"><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>'
  1473. }]
  1474. }]
  1475. }],
  1476. listeners:{
  1477. tabchange: function( tp, t ){
  1478. switch( t.getId() ){
  1479. case 'cam_det_tab': {
  1480. content_lvl3=0;
  1481. stopStatusUpdater();
  1482. loadDetectedCameras();
  1483. break;
  1484. };
  1485. case 'cam_ass_tab': {
  1486. content_lvl3=1;
  1487. stopStatusUpdater();
  1488. loadAssignedCameras();
  1489. break;
  1490. };
  1491. case 'mod_tab':{
  1492. content_lvl3=2;
  1493. stopStatusUpdater();
  1494. loadModules();
  1495. break;
  1496. };
  1497. case 'net_tab':{
  1498. content_lvl3=3;
  1499. stopStatusUpdater();
  1500. break;
  1501. };
  1502. };
  1503. updateUserContent();
  1504. },
  1505. afterrender: function(){
  1506. settingsAreChanged = false;
  1507. }
  1508. }
  1509. });
  1510. tPanel.doLayout();
  1511. updateUserContent();
  1512. updateServerStatus();
  1513. };
  1514. function showSettingsApplication(){
  1515. stopStatusUpdater();
  1516. content_lvl1 = 1;
  1517. content_lvl2 = 3;
  1518. var tPanel = Ext.getCmp('main_content');
  1519. tPanel.removeAll( true );
  1520. tPanel.add({
  1521. xtype: 'tabpanel',
  1522. frame: false,
  1523. id: 'settings_a_content',
  1524. border: false,
  1525. activeTab: 0,
  1526. items:[{
  1527. title: '<?=$Labels->GetLabel('_WORKING_MODE_');?>',
  1528. xtype: 'form',
  1529. labelAlign: 'right',
  1530. labelWidth: 180,
  1531. items:[{
  1532. xtype: 'spacer',
  1533. height: 10
  1534. },{
  1535. xtype: 'combo',
  1536. fieldLabel: '<?=$Labels->GetLabel('_DEBUGGING_MODE_');?>',
  1537. editable: false,
  1538. typeAhead: true,
  1539. triggerAction: 'all',
  1540. width: '100%',
  1541. lazyRender:true,
  1542. mode: 'local',
  1543. store: new Ext.data.ArrayStore({
  1544. fields: ['sid', 'snam'],
  1545. data: [[0,'<?=$Labels->GetLabel('__DISABLED__');?>'], [1,'<?=$Labels->GetLabel('___ENABLED__');?>']]
  1546. }),
  1547. value: <?=0;?>,
  1548. valueField: 'sid',
  1549. displayField: 'snam'
  1550. }]
  1551. },{
  1552. title: '_MONIT_LAYOUT_',
  1553. layout:'table',
  1554. defaults: {
  1555. // applied to each contained panel
  1556. bodyStyle:'padding:20px'
  1557. },
  1558. layoutConfig: {
  1559. // The total column count must be specified here
  1560. columns: 3
  1561. },
  1562. frame: false,
  1563. border: false,
  1564. height: 800,
  1565. items:[{
  1566. xtype: 'spacer',
  1567. width: 100
  1568. },{
  1569. xtype: 'radio',
  1570. width: '100%',
  1571. name: 'layo_apa',
  1572. id: 'db_layout_0',
  1573. checked: true
  1574. },{
  1575. frame: false,
  1576. border: false,
  1577. html: '<img src="/style/assets/ed-0.png" />'
  1578. },{
  1579. xtype: 'spacer',
  1580. width: 100
  1581. },{
  1582. xtype: 'radio',
  1583. width: '100%',
  1584. name: 'layo_apa',
  1585. id: 'db_layout_1',
  1586. checked: true
  1587. },{
  1588. frame: false,
  1589. border: false,
  1590. html: '<img src="/style/assets/ed-1.png" />'
  1591. },{
  1592. xtype: 'spacer',
  1593. width: 100
  1594. },{
  1595. xtype: 'radio',
  1596. name: 'layo_apa',
  1597. id: 'db_layout_2',
  1598. checked: true
  1599. },{
  1600. frame: false,
  1601. border: false,
  1602. html: '<img src="/style/assets/ed-2.png" />'
  1603. },{
  1604. xtype: 'spacer',
  1605. width: 100
  1606. },{
  1607. xtype: 'radio',
  1608. width: '100%',
  1609. name: 'layo_apa',
  1610. id: 'db_layout_3',
  1611. checked: true
  1612. },{
  1613. frame: false,
  1614. border: false,
  1615. html: '<img src="/style/assets/ed-3.png" />'
  1616. }]
  1617. }]
  1618. });
  1619. tPanel.doLayout();
  1620. updateUserContent();
  1621. };
  1622. function showSettingsUpgrade(){
  1623. stopStatusUpdater();
  1624. content_lvl1 = 1;
  1625. content_lvl2 = 4;
  1626. var tPanel = Ext.getCmp('main_content');
  1627. tPanel.removeAll( true );
  1628. tPanel.doLayout();
  1629. updateServerStatus();
  1630. };
  1631. function initSettingsView(){
  1632. if( tlInterval!= null ){
  1633. window.clearInterval( tlInterval );
  1634. tlInterval = null;
  1635. timelineObj = null;
  1636. };
  1637. var tP = Ext.getCmp('left_side_menu');
  1638. tP.doLayout();
  1639. tP.setVisible( false );
  1640. tP.removeAll( true );
  1641. tP.add({
  1642. title: '<?=$Labels->GetLabel('_DET_SETTINGS_');?>',
  1643. layout: 'vbox',
  1644. height: 120,
  1645. pack: 'center',
  1646. align : 'strech',
  1647. collapsed: ( content_lvl1 != 0 ),
  1648. items:[<?php
  1649. if( $AP_DATA['type'] == 1 ){
  1650. ?>
  1651. {
  1652. xtype: 'button',
  1653. width: '100%',
  1654. id:'go_home',
  1655. text: '<?=$Labels->GetLabel('_UPPER_SENSOR_');?>',
  1656. enableToggle: true,
  1657. pressed: ( content_lvl2 == 0 && content_lvl1 == 0 ),
  1658. allowDepress: false,
  1659. toggleGroup: 'det_settings',
  1660. handler: loadDashBoard
  1661. },{
  1662. xtype: 'button',
  1663. width: '100%',
  1664. id:'go_monitor',
  1665. text: '<?=$Labels->GetLabel('_BOTTOM_SENSOR_');?>',
  1666. enableToggle: true,
  1667. pressed: ( content_lvl2 == 1 && content_lvl1 == 0 ),
  1668. allowDepress: false,
  1669. toggleGroup: 'det_settings',
  1670. handler: loadMonitoring
  1671. },{
  1672. xtype: 'button',
  1673. width: '100%',
  1674. id:'go_archive',
  1675. text: '<?=$Labels->GetLabel('_FUSION_ENGINE_');?>',
  1676. enableToggle: true,
  1677. pressed: ( content_lvl2 == 2 && content_lvl1 == 0 ),
  1678. allowDepress: false,
  1679. toggleGroup: 'det_settings',
  1680. handler: loadArchive
  1681. }<?php
  1682. } else {
  1683. if( 1 || intval( $CUser->Data['sipi_enable'] ) ){
  1684. ?>
  1685. {
  1686. xtype: 'button',
  1687. width: '100%',
  1688. id:'go_singleIpi',
  1689. text: '<?=$Labels->GetLabel('_EVT_MONITOR_IPI_');?>',
  1690. enableToggle: true,
  1691. pressed: ( content_lvl2 == 3 && content_lvl1 == 0 ),
  1692. allowDepress: false,
  1693. toggleGroup: 'det_settings',
  1694. handler: loadSingleIPI
  1695. },
  1696. <?php
  1697. };
  1698. ?>
  1699. {
  1700. xtype: 'button',
  1701. width: '100%',
  1702. id:'go_out',
  1703. text: '<?=$Labels->GetLabel('_LOGOUT_');?>',
  1704. handler: doLogout
  1705. }<?php
  1706. };
  1707. ?>]
  1708. });
  1709. tP.add({
  1710. title: '<?=$Labels->GetLabel('_SYS_SETTINGS_');?>',
  1711. layout: 'vbox',
  1712. height: 120,
  1713. pack: 'center',
  1714. align : 'strech',
  1715. collapsed: ( content_lvl1 != 1 ),
  1716. items:[{
  1717. xtype: 'button',
  1718. width: '100%',
  1719. id:'sys_edit',
  1720. text: '<?=$Labels->GetLabel('_SYS_GENERAL_');?>',
  1721. enableToggle: true,
  1722. pressed: ( content_lvl2 == 0 && content_lvl1 == 1 ),
  1723. allowDepress: false,
  1724. toggleGroup: 'sys_settings',
  1725. handler: showSettingsGeneral
  1726. },{
  1727. xtype: 'button',
  1728. width: '100%',
  1729. id:'map_edit',
  1730. text: '<?=$Labels->GetLabel('_SENSOR_CONNECTION_');?>',
  1731. enableToggle: true,
  1732. pressed: ( content_lvl2 == 1 && content_lvl1 == 1 ),
  1733. allowDepress: false,
  1734. toggleGroup: 'sys_settings',
  1735. handler: showSettingsSensors
  1736. },{
  1737. xtype: 'button',
  1738. width: '100%',
  1739. id:'video_set',
  1740. text: '<?=$Labels->GetLabel('_CAMERA_MNGMNT_');?>',
  1741. enableToggle: true,
  1742. pressed: ( content_lvl2 == 2 && content_lvl1 == 1 ),
  1743. allowDepress: false,
  1744. toggleGroup: 'sys_settings',
  1745. handler: showSettingsVideo
  1746. },{
  1747. xtype: 'button',
  1748. width: '100%',
  1749. id:'app_set',
  1750. text: '<?=$Labels->GetLabel('_APPLICA_MNGMNT_');?>',
  1751. enableToggle: true,
  1752. pressed: ( content_lvl2 == 3 && content_lvl1 == 1 ),
  1753. allowDepress: false,
  1754. toggleGroup: 'sys_settings',
  1755. handler: showSettingsApplication
  1756. },{
  1757. xtype: 'button',
  1758. width: '100%',
  1759. id:'soft_update',
  1760. text: '<?=$Labels->GetLabel('_UPGRADE_MNGMNT_');?>',
  1761. enableToggle: true,
  1762. pressed: ( content_lvl2 == 4 && content_lvl1 == 1 ),
  1763. allowDepress: false,
  1764. toggleGroup: 'sys_settings',
  1765. handler: showSettingsUpgrade
  1766. }]
  1767. });
  1768. tP.add({
  1769. title: '<?=$Labels->GetLabel('_NET_SETTINGS_');?>',
  1770. collapsed: ( content_lvl1 != 2 ),
  1771. items:[{
  1772. xtype: 'button',
  1773. width: '100%',
  1774. text: 'Ethernet',
  1775. enableToggle: true,
  1776. pressed: ( content_lvl2 == 0 && content_lvl1 == 2 ),
  1777. allowDepress: false,
  1778. id:'ethernet',
  1779. },{
  1780. xtype: 'button',
  1781. width: '100%',
  1782. text: 'WiFi',
  1783. enableToggle: true,
  1784. pressed: ( content_lvl2 == 1 && content_lvl1 == 2 ),
  1785. allowDepress: false,
  1786. id:'wifi',
  1787. },{
  1788. xtype: 'button',
  1789. width: '100%',
  1790. text: 'Integration',
  1791. enableToggle: true,
  1792. pressed: ( content_lvl2 == 2 && content_lvl1 == 2 ),
  1793. allowDepress: false,
  1794. id:'api_serv',
  1795. }]
  1796. });
  1797. tP.add({
  1798. title: '<?=$Labels->GetLabel('_PROF_SETTINGS_');?>',
  1799. items:[]
  1800. });
  1801. <?php
  1802. if( $CUser->Data['access'] > 5 ){
  1803. ?>tP.add({
  1804. title: '<?=$Labels->GetLabel('_ADM_SETTINGS_');?>',
  1805. collapsed: ( content_lvl1 != 3 ),
  1806. items:[{
  1807. xtype: 'button',
  1808. width: '100%',
  1809. id:'adm_acc',
  1810. text: '<?=$Labels->GetLabel('_USERS_MNGMT_');?>',
  1811. enableToggle: true,
  1812. pressed: ( content_lvl2 == 11 ),
  1813. allowDepress: false,
  1814. handler: function( b, e ){
  1815. loadUserEditor();
  1816. }
  1817. },{
  1818. xtype: 'button',
  1819. width: '100%',
  1820. id:'adm_acclog',
  1821. text: '<?=$Labels->GetLabel('_ACC_LOG_');?>',
  1822. enableToggle: true,
  1823. pressed: ( content_lvl2 == 12 ),
  1824. allowDepress: false,
  1825. handler: function( b, e ){
  1826. loadAccessLog();
  1827. }
  1828. },{
  1829. xtype: 'button',
  1830. width: '100%',
  1831. id:'adm_servlog',
  1832. text: '<?=$Labels->GetLabel('_SERV_LOG_');?>',
  1833. enableToggle: true,
  1834. pressed: ( content_lvl2 == 13 ),
  1835. allowDepress: false,
  1836. handler: function( b, e ){
  1837. loadServerLog();
  1838. }
  1839. }]
  1840. });
  1841. <?php
  1842. };
  1843. ?>
  1844. tP.setVisible( true );
  1845. tP.doLayout();
  1846. switch( content_lvl1 ){
  1847. case 0:{
  1848. switch( content_lvl2 ){
  1849. case 0: break;
  1850. };
  1851. break;
  1852. };
  1853. case 1:{
  1854. switch( content_lvl2 ){
  1855. case 0: showSettingsGeneral(); break;
  1856. case 1: showSettingsSensors(); break;
  1857. case 2: showSettingsVideo(); break;
  1858. case 3: showSettingsApplication(); break;
  1859. case 4: showSettingsUpgrade(); break;
  1860. };
  1861. };
  1862. };
  1863. };