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.

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