Web UI for ARGUS server
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.

484 lines
19 KiB

4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
  1. <?php
  2. require_once('../ajax_asm.php');
  3. if( $CUser->Data['id'] > 1 ){
  4. $Z = intval( $_POST['NID'] );
  5. if( $Z ){
  6. $QS = "SELECT * FROM `nodes` WHERE `id`={$Z}";
  7. $NN = $DATABASE->Query( $QS );
  8. if( count( $NN ) ){
  9. $Node = $NN[0];
  10. switch( $Node['type'] ){
  11. case 0:{
  12. $QS="SELECT * FROM `servers` WHERE `id`={$Node['aux_id']}";
  13. $SDD = $DATABASE->Query( $QS );
  14. $NData = $SDD[0];
  15. $QS="SELECT * FROM `resources` WHERE `node_id`={$Z} AND ( `type`=101 OR `type`=102 )";
  16. $CN = $DATABASE->Query( $QS );
  17. $IL=array();
  18. foreach( $CN as $N ){
  19. $QS="SELECT * FROM `networks` WHERE `nif_id`={$N['aux_id']} AND `type`=0";
  20. $NWD = $DATABASE->Query( $QS );
  21. $NW = $NWD[0];
  22. $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>";
  23. };
  24. $NIFO = '<table><tr>' . implode( '</tr><tr>', $IL ) . '</tr></table>';
  25. ?>
  26. {
  27. xtype: 'tabpanel',
  28. frame: false,
  29. id: 'node_settings_content',
  30. border: false,
  31. activeTab: 0,
  32. items: [{
  33. xtype: 'panel',
  34. title: 'General Info',
  35. layout: 'hbox',
  36. items:[{
  37. xtype: 'panel',
  38. flex: 1,
  39. height: 303,
  40. autoScroll: false,
  41. html: '<table width="100%" border=0><tr><td height="290px" align="center" valign="middle"><div class="server_img_set"></div></td></tr></table>'
  42. },{
  43. xtype: 'form',
  44. id: '_ed_small',
  45. flex: 1,
  46. height: 303,
  47. autoScroll: false,
  48. //layout: 'vbox',
  49. labelWidth: 120,
  50. labelAlign: 'right',
  51. items:[{
  52. xtype: 'textfield',
  53. fieldLabel: '<?=$Labels->GetLabel( 'SERV_NAME' );?>',
  54. id: 'node_name',
  55. value: '<?=$Node['name'];?>',
  56. listeners:{
  57. change: function(){
  58. settingsChangeNotifier( 'node_name' );
  59. Ext.getCmp('sasa_bo').enable();
  60. }
  61. }
  62. },{
  63. xtype: 'panel',
  64. width: '100%',
  65. html: '<div class="sideInfo_item" id="INFO_ON"><?=$Labels->GetLabel( 'SERV_BLD_TAG' ).': '.$NData['version_string'];?></div>'
  66. },{
  67. xtype: 'panel',
  68. width: '100%',
  69. html: '<div class="setEd_infoPanel" id="INFO_IPS"><?=$NIFO;?></div>'
  70. },{
  71. xtype: 'button',
  72. id: 'sasa_bo',
  73. width: '100%',
  74. disabled: true,
  75. text: 'Apply Changes',
  76. handler: function(){
  77. }
  78. }]
  79. }]
  80. },{
  81. xtype: 'panel',
  82. title: 'Resources',
  83. layout: 'hbox',
  84. items:[{
  85. xtype: 'panel',
  86. flex: 1,
  87. height: 303,
  88. autoScroll: 'auto',
  89. //layout: 'fit',
  90. items:[<?php
  91. $QS = "SELECT * FROM resources WHERE `node_id`={$Z}";
  92. $Result = $DATABASE->Query( $QS, false );
  93. if( count( $Result ) ){
  94. foreach( $Result as $R ){
  95. switch( $R['type'] ){
  96. case 1:
  97. //Uart
  98. $SockDataParts[] = '{ xtype: \'panel\', boder: false, frame: false, html: \'<a class="sideInfo_item" id="UART_'.(($R['active']==0)?'N':'O').'" onclick="editResource('.$R['id'].');">'.$Labels->GetLabel('UART_LINE_PROP').' '.(($R['used']==0)?'':'<img title="used" src="/style/icons/icons/link.png">').'</a>\'}';
  99. break;
  100. case 6:
  101. //USB DC
  102. $SockDataParts[] = '{ xtype: \'panel\', boder: false, frame: false, html: \'<a class="sideInfo_item" id="USBDC_'.(($R['active']==0)?'N':'O').'" onclick="editResource('.$R['id'].');">'.$Labels->GetLabel('UART_LINE_PROP').' '.(($R['used']==0)?'':'<img title="used" src="/style/icons/icons/link.png">').'</a>\'}';
  103. break;
  104. case 31:
  105. //Video Grabber
  106. $SockDataParts[] = '{ xtype: \'panel\', boder: false, frame: false, html: \'<a class="sideInfo_item" id="VIDEO_'.(($R['active']==0)?'N':'O').'" onclick="editResource('.$R['id'].');">'.$Labels->GetLabel('FRAMEGRAB_PROP').' '.(($R['used']==0)?'':'<img title="used" src="/style/icons/icons/link.png">').'</a>\'}';
  107. break;
  108. case 100:
  109. //Loopback
  110. $SockDataParts[] = '{ xtype: \'panel\', boder: false, frame: false, html: \'<a class="sideInfo_item" id="NET_'.(($R['active']==0)?'N':'O').'" onclick="editResource('.$R['id'].');">'.$Labels->GetLabel('LOOPBACK_PROP').' '.(($R['used']==0)?'':'<img title="used" src="/style/icons/icons/link.png">').'</a>\'}';
  111. break;
  112. case 101:
  113. //Ethernet Interface
  114. $SockDataParts[] = '{ xtype: \'panel\', boder: false, frame: false, html: \'<a class="sideInfo_item" id="NET_'.(($R['active']==0)?'N':'O').'" onclick="editResource('.$R['id'].');">'.$Labels->GetLabel('ETHERNET_PROP').' '.(($R['used']==0)?'':'<img title="used" src="/style/icons/icons/link.png">').'</a>\'}';
  115. break;
  116. case 102:
  117. //WiFi Interface
  118. $SockDataParts[] = '{ xtype: \'panel\', boder: false, frame: false, html: \'<a class="sideInfo_item" id="NET_'.(($R['active']==0)?'N':'O').'" onclick="editResource('.$R['id'].');">'.$Labels->GetLabel('WIFI_PROP').' '.(($R['used']==0)?'':'<img title="used" src="/style/icons/icons/link.png">').'</a>\'}';
  119. break;
  120. case 103:
  121. //Virtual IP Interface
  122. $SockDataParts[] = '{ xtype: \'panel\', boder: false, frame: false, html: \'<a class="sideInfo_item" id="NET_'.(($R['active']==0)?'N':'O').'" onclick="editResource('.$R['id'].');">'.$Labels->GetLabel('VIRTUALIP_PROP').' '.(($R['used']==0)?'':'<img title="used" src="/style/icons/icons/link.png">').'</a>\'}';
  123. break;
  124. case 104:
  125. //VPN Interface
  126. $SockDataParts[] = '{ xtype: \'panel\', boder: false, frame: false, html: \'<a class="sideInfo_item" id="NET_'.(($R['active']==0)?'N':'O').'" onclick="editResource('.$R['id'].');">'.$Labels->GetLabel('VPN_TUN_PROP').' '.(($R['used']==0)?'':'<img title="used" src="/style/icons/icons/link.png">').'</a>\'}';
  127. break;
  128. case 105:
  129. //WAN Interface
  130. $SockDataParts[] = '{ xtype: \'panel\', boder: false, frame: false, html: \'<a class="sideInfo_item" id="NET_'.(($R['active']==0)?'N':'O').'" onclick="editResource('.$R['id'].');">'.$Labels->GetLabel('WAN_LINE_PROP').' '.(($R['used']==0)?'':'<img title="used" src="/style/icons/icons/link.png">').'</a>\'}';
  131. break;
  132. //Media Encoder Sink
  133. case 131: // Video Encoder Sink
  134. $SockDataParts[] = '{ xtype: \'panel\', boder: false, frame: false, html: \'<a class="sideInfo_item" id="MEDIA_'.(($R['active']==0)?'N':'O').'">'.'Video Sink'.' '.(($R['used']==0)?'':'<img title="used" src="/style/icons/icons/link.png">').'</a>\'}';
  135. break;
  136. case 132: // Audio Encoder Sink
  137. $SockDataParts[] = '{ xtype: \'panel\', boder: false, frame: false, html: \'<a class="sideInfo_item" id="MEDIA_'.(($R['active']==0)?'N':'O').'">'.'Audio Sink'.' '.(($R['used']==0)?'':'<img title="used" src="/style/icons/icons/link.png">').'</a>\'}';
  138. break;
  139. default:
  140. $SockDataParts[] = '{ xtype: \'panel\', boder: false, frame: false, html: \'<a align="center" style="padding: 5px; color: black; background-color: grey;">'.$R['device'].' '.(($R['used']==0)?'':'<img title="used" src="/style/icons/icons/link.png">').'</a>\'}';
  141. };
  142. };
  143. echo implode( ',', $SockDataParts );
  144. };
  145. ?>]
  146. },{
  147. xtype: 'panel',
  148. id: 'res_ed_small',
  149. flex: 1,
  150. height: 303,
  151. layout: 'fit',
  152. items:[{
  153. html:'<div class="setEd_infoPanel" id="NUNU"><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>'
  154. }]
  155. }]
  156. },{
  157. xtype: 'panel',
  158. title: 'Modules',
  159. layout: 'hbox',
  160. items:[{
  161. xtype: 'panel',
  162. flex: 1,
  163. height: 303,
  164. autoScroll: 'auto',
  165. tbar:[{
  166. text: 'Add Module'
  167. }],
  168. items:[<?php
  169. $QS = "SELECT * FROM server_modules WHERE `server_id`={$Node['aux_id']}";
  170. $Result = $DATABASE->Query( $QS, false );
  171. if( count( $Result ) ){
  172. foreach( $Result as $R ){
  173. $QS = "SELECT * FROM server_module_types WHERE id={$R['type']}";
  174. $MOMO = $DATABASE->Query( $QS, false );
  175. $MOD = $MOMO[0];
  176. switch( $R['type'] ){
  177. case 1:
  178. case 2:
  179. case 3:
  180. case 4:
  181. case 5:
  182. case 6:
  183. case 7:
  184. case 8:
  185. case 9:
  186. case 10:
  187. $ModPart[] = '{ xtype: \'panel\', boder: false, frame: false, html: \'<a class="sideInfo_item" id="UART_'.(($R['enabled']==0)?'N':'O').'" onclick="editModule('.$R['id'].');">'.$Labels->GetLabel($MOD['name']).'</a>\'}';
  188. break;
  189. default:
  190. $ModPart[] = '{ xtype: \'panel\', boder: false, frame: false, html: \'<a align="center" style="padding: 5px; color: black; background-color: grey;">'.$R['device'].'</a>\'}';
  191. };
  192. };
  193. echo implode( ',', $ModPart );
  194. };
  195. ?>]
  196. },{
  197. xtype: 'panel',
  198. id: 'mod_ed_small',
  199. flex: 1,
  200. height: 303,
  201. layout: 'fit',
  202. items:[{
  203. html:'<div class="setEd_infoPanel" id="NUNU"><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>'
  204. }]
  205. }]
  206. },{
  207. xtype: 'panel',
  208. title: 'Network',
  209. items:[]
  210. }],
  211. listeners:{
  212. afterrender: function(){
  213. settingsAreChanged = false;
  214. }
  215. },
  216. updateSettings: function(){
  217. alert('Update Settings');
  218. }
  219. }
  220. <?php
  221. break;
  222. };
  223. case 1:
  224. case 2:
  225. case 3:
  226. case 4:{
  227. //Serial Devices
  228. $QS = "SELECT * FROM `lrf_sensors` WHERE `id`={$Node['aux_id']}";
  229. $RR=$DATABASE->Query( $QS );
  230. $NData = $RR[0];
  231. $NIFO = $Labels->GetLabel( 'SERV_BLD_TAG' ).':'. $NData['version'];
  232. ?>
  233. {
  234. xtype: 'tabpanel',
  235. frame: false,
  236. id: 'node_settings_content',
  237. border: false,
  238. activeTab: 0,
  239. items: [{
  240. xtype: 'panel',
  241. title: 'General Info',
  242. layout: 'hbox',
  243. items:[{
  244. xtype: 'panel',
  245. flex: 1,
  246. height: 303,
  247. autoScroll: false,
  248. html: '<table width="100%" border=0><tr><td height="290px" align="center" valign="middle"><div id="node_pic" class="node_<?=$Node['type'];?>_img_set"></div></td></tr></table>'
  249. },{
  250. xtype: 'form',
  251. id: '_ed_small',
  252. flex: 1,
  253. height: 303,
  254. autoScroll: false,
  255. //layout: 'vbox',
  256. labelWidth: 120,
  257. labelAlign: 'right',
  258. items:[{
  259. xtype: 'textfield',
  260. fieldLabel: "<?=$Labels->GetLabel( 'SENS_NAME' );?>",
  261. id: 'node_name',
  262. value: '<?=$Node['name'];?>',
  263. listeners:{
  264. change: function(){
  265. settingsChangeNotifier( 'node_name' );
  266. Ext.getCmp('sasa_bo').enable();
  267. }
  268. }
  269. },{
  270. xtype: 'combo',
  271. fieldLabel: "<?=$Labels->GetLabel( 'SENS_TYPE' );?>",
  272. id: 'node_type',
  273. lazyRender: true,
  274. mode: 'local',
  275. forceSelection: true,
  276. triggerAction: 'all',
  277. editable: false,
  278. disableKeyFilter: true,
  279. store: new Ext.data.ArrayStore({
  280. fields: ['aa_t','aa_txt'],
  281. data: [
  282. [1,'ALS Sensor'],
  283. [2,'LFS Sensor'],
  284. [3,'PLS 200 Sensor'],
  285. [4,'PLS 360 Sensor']
  286. ]
  287. }),
  288. valueField: 'aa_t',
  289. displayField: 'aa_txt',
  290. value: '<?=$Node['type'];?>',
  291. listeners:{
  292. select: function( t, r, i ){
  293. var n = r.data.aa_t;
  294. //var b = t.getValue();
  295. //if( n != b ){
  296. document.getElementById('node_pic').className = 'node_'+ n +'_img_set';
  297. settingsChangeNotifier( 'node_type' );
  298. Ext.getCmp('sasa_bo').enable();
  299. //};
  300. },
  301. change: function( t, n, o ){
  302. document.getElementById('node_pic').className = 'node_'+ n +'_img_set';
  303. settingsChangeNotifier( 'node_type' );
  304. Ext.getCmp('sasa_bo').enable();
  305. }
  306. }
  307. },{
  308. xtype: 'numberfield',
  309. fieldLabel: "<?=$Labels->GetLabel( 'SENS_RANGE' );?>",
  310. id: 'node_range',
  311. value: '<?=$NData['max_range'];?>',
  312. listeners:{
  313. change: function( t, n, o ){
  314. settingsChangeNotifier( 'node_range' );
  315. Ext.getCmp('sasa_bo').enable();
  316. }
  317. }
  318. },{
  319. xtype: 'panel',
  320. width: '100%',
  321. html: '<div class="sideInfo_item" id="INFO_ON"><?=$Labels->GetLabel( 'SETIAL_TAG' ).': '.$NData['serial'];?></div>'
  322. },{
  323. xtype: 'panel',
  324. width: '100%',
  325. html: '<div class="setEd_infoPanel" id="INFO_IPS"><?=$NIFO;?></div>'
  326. },{
  327. xtype: 'button',
  328. id: 'sasa_bo',
  329. width: '100%',
  330. disabled: true,
  331. text: 'Apply Changes',
  332. handler: function(){
  333. }
  334. }]
  335. }]
  336. },{
  337. xtype: 'panel',
  338. title: 'Resources',
  339. layout: 'hbox',
  340. items:[{
  341. xtype: 'panel',
  342. flex: 1,
  343. height: 303,
  344. autoScroll: 'auto',
  345. //layout: 'fit',
  346. items:[<?php
  347. $QS = "SELECT * FROM resources WHERE `node_id`={$Z}";
  348. $Result = $DATABASE->Query( $QS, false );
  349. $SockDataParts = array();
  350. if( count( $Result ) ){
  351. foreach( $Result as $R ){
  352. switch( $R['type'] ){
  353. case 1:
  354. //Uart
  355. $SockDataParts[] = '{ xtype: \'panel\', boder: false, frame: false, html: \'<a class="sideInfo_item" id="UART_'.(($R['active']==0)?'N':'O').'" onclick="editResource('.$R['id'].');">'.$Labels->GetLabel('UART_LINE_PROP').' '.(($R['used']==0)?'':'<img title="used" src="/style/icons/icons/link.png">').'</a>\'}';
  356. break;
  357. case 6:
  358. //USB DC
  359. $SockDataParts[] = '{ xtype: \'panel\', boder: false, frame: false, html: \'<a class="sideInfo_item" id="USBDC_'.(($R['active']==0)?'N':'O').'" onclick="editResource('.$R['id'].');">'.$Labels->GetLabel('UART_LINE_PROP').' '.(($R['used']==0)?'':'<img title="used" src="/style/icons/icons/link.png">').'</a>\'}';
  360. break;
  361. case 31:
  362. //Video Grabber
  363. $SockDataParts[] = '{ xtype: \'panel\', boder: false, frame: false, html: \'<a class="sideInfo_item" id="VIDEO_'.(($R['active']==0)?'N':'O').'" onclick="editResource('.$R['id'].');">'.$Labels->GetLabel('FRAMEGRAB_PROP').' '.(($R['used']==0)?'':'<img title="used" src="/style/icons/icons/link.png">').'</a>\'}';
  364. break;
  365. case 100:
  366. //Loopback
  367. $SockDataParts[] = '{ xtype: \'panel\', boder: false, frame: false, html: \'<a class="sideInfo_item" id="NET_'.(($R['active']==0)?'N':'O').'" onclick="editResource('.$R['id'].');">'.$Labels->GetLabel('LOOPBACK_PROP').' '.(($R['used']==0)?'':'<img title="used" src="/style/icons/icons/link.png">').'</a>\'}';
  368. break;
  369. case 101:
  370. //Ethernet Interface
  371. $SockDataParts[] = '{ xtype: \'panel\', boder: false, frame: false, html: \'<a class="sideInfo_item" id="NET_'.(($R['active']==0)?'N':'O').'" onclick="editResource('.$R['id'].');">'.$Labels->GetLabel('ETHERNET_PROP').' '.(($R['used']==0)?'':'<img title="used" src="/style/icons/icons/link.png">').'</a>\'}';
  372. break;
  373. case 102:
  374. //WiFi Interface
  375. $SockDataParts[] = '{ xtype: \'panel\', boder: false, frame: false, html: \'<a class="sideInfo_item" id="NET_'.(($R['active']==0)?'N':'O').'" onclick="editResource('.$R['id'].');">'.$Labels->GetLabel('WIFI_PROP').' '.(($R['used']==0)?'':'<img title="used" src="/style/icons/icons/link.png">').'</a>\'}';
  376. break;
  377. case 103:
  378. //Virtual IP Interface
  379. $SockDataParts[] = '{ xtype: \'panel\', boder: false, frame: false, html: \'<a class="sideInfo_item" id="NET_'.(($R['active']==0)?'N':'O').'" onclick="editResource('.$R['id'].');">'.$Labels->GetLabel('VIRTUALIP_PROP').' '.(($R['used']==0)?'':'<img title="used" src="/style/icons/icons/link.png">').'</a>\'}';
  380. break;
  381. case 104:
  382. //VPN Interface
  383. $SockDataParts[] = '{ xtype: \'panel\', boder: false, frame: false, html: \'<a class="sideInfo_item" id="NET_'.(($R['active']==0)?'N':'O').'" onclick="editResource('.$R['id'].');">'.$Labels->GetLabel('VPN_TUN_PROP').' '.(($R['used']==0)?'':'<img title="used" src="/style/icons/icons/link.png">').'</a>\'}';
  384. break;
  385. case 105:
  386. //WAN Interface
  387. $SockDataParts[] = '{ xtype: \'panel\', boder: false, frame: false, html: \'<a class="sideInfo_item" id="NET_'.(($R['active']==0)?'N':'O').'" onclick="editResource('.$R['id'].');">'.$Labels->GetLabel('WAN_LINE_PROP').' '.(($R['used']==0)?'':'<img title="used" src="/style/icons/icons/link.png">').'</a>\'}';
  388. break;
  389. //Media Encoder Sink
  390. case 131: // Video Encoder Sink
  391. $SockDataParts[] = '{ xtype: \'panel\', boder: false, frame: false, html: \'<a class="sideInfo_item" id="MEDIA_'.(($R['active']==0)?'N':'O').'">'.'Video Sink'.' '.(($R['used']==0)?'':'<img title="used" src="/style/icons/icons/link.png">').'</a>\'}';
  392. break;
  393. case 132: // Audio Encoder Sink
  394. $SockDataParts[] = '{ xtype: \'panel\', boder: false, frame: false, html: \'<a class="sideInfo_item" id="MEDIA_'.(($R['active']==0)?'N':'O').'">'.'Audio Sink'.' '.(($R['used']==0)?'':'<img title="used" src="/style/icons/icons/link.png">').'</a>\'}';
  395. break;
  396. default:
  397. $SockDataParts[] = '{ xtype: \'panel\', boder: false, frame: false, html: \'<a align="center" style="padding: 5px; color: black; background-color: grey;">'.$R['device'].' '.(($R['used']==0)?'':'<img title="used" src="/style/icons/icons/link.png">').'</a>\'}';
  398. };
  399. };
  400. echo implode( ',', $SockDataParts );
  401. };
  402. ?>]
  403. },{
  404. xtype: 'panel',
  405. id: 'res_ed_small',
  406. flex: 1,
  407. height: 303,
  408. layout: 'fit',
  409. items:[{
  410. html:'<div class="setEd_infoPanel" id="NUNU"><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>'
  411. }]
  412. }]
  413. },{
  414. xtype: 'panel',
  415. title: 'Detection Settings',
  416. layout: 'hbox',
  417. items:[{
  418. xtype: 'panel',
  419. flex: 1,
  420. height: 303,
  421. autoScroll: 'auto',
  422. //layout: 'fit',
  423. items:[<?php
  424. $QS = "SELECT DISTINCT `profile_id` FROM `lrf_detection_profiles` WHERE `aux_id`={$Node['aux_id']} ORDER BY `profile_id`";
  425. $ZUBI = $DATABASE->Query( $QS );
  426. $Proparts = array();
  427. foreach( $ZUBI as $Z ){
  428. switch( $Z['profile_id'] ){
  429. case 1: $MOMO = 'Low Sensitivity Profile'; break;
  430. case 2: $MOMO = 'Medium Sensitivity Profile'; break;
  431. case 3: $MOMO = 'High Sensitivity Profile'; break;
  432. default: $MOMO = 'Factory Profile'; break;
  433. };
  434. $Proparts[] = '{ xtype: \'panel\', boder: false, frame: false, html: \'<a class="sideInfo_item" id="VIDEO_'.(($R['active']==0)?'N':'O').'" onclick="editResource('.$R['id'].');">'.$MOMO.' '.(($R['used']==0)?'':'<img title="used" src="/style/icons/icons/link.png">').'</a>\'}';
  435. };
  436. if( count( $ZUBI ) > 1 ){
  437. $Proparts[] = '{ xtype: \'panel\', boder: false, frame: false, html: \'<a class="sideInfo_item" id="VIDEO_O" onclick="editWidthTable('.$Node['aux_id'].');">'."Profiles Schedule".' '.(($R['used']==0)?'':'<img title="used" src="/style/icons/icons/link.png">').'</a>\'}';
  438. };
  439. $Proparts[] = '{ xtype: \'panel\', boder: false, frame: false, html: \'<a class="sideInfo_item" id="VIDEO_O" onclick="editWidthTable('.$Node['aux_id'].');">'."Width Table".' '.(($R['used']==0)?'':'<img title="used" src="/style/icons/icons/link.png">').'</a>\'}';
  440. // Check if Masks Exists
  441. $QS = "SELECT `id` FROM `lrf_masks` WHERE `sensor_id`={$Node['aux_id']}";
  442. $MM = $DATABASE->Query( $QS );
  443. if( count( $MM ) ){
  444. $Proparts[] = '{ xtype: \'panel\', boder: false, frame: false, html: \'<a class="sideInfo_item" id="VIDEO_O" onclick="editMaskSchedule('.$Node['aux_id'].');">'."Mask Schedule".' '.(($R['used']==0)?'':'<img title="used" src="/style/icons/icons/link.png">').'</a>\'}';
  445. };
  446. echo implode( ',', $Proparts );
  447. ?>]
  448. },{
  449. xtype: 'panel',
  450. id: 'dep_ed_small',
  451. flex: 1,
  452. height: 303,
  453. layout: 'fit',
  454. items:[{
  455. html:'<div class="setEd_infoPanel" id="NUNU"><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>'
  456. }]
  457. }]
  458. },{
  459. xtype: 'panel',
  460. title: 'Embed Options',
  461. layout: 'hbox',
  462. items:[{
  463. }]
  464. },{
  465. xtype: 'panel',
  466. title: 'Advanced',
  467. layout: 'hbox',
  468. items:[{
  469. }]
  470. }]
  471. }
  472. <?php
  473. break;
  474. };
  475. };
  476. } else {
  477. echo "{}";
  478. };
  479. } else {
  480. echo "{}";
  481. };
  482. } else {
  483. echo "{}";
  484. };
  485. ?>