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.

581 lines
22 KiB

4 years ago
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
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. $CT = intval( $_POST['TAB'] );
  6. if( $Z ){
  7. $QS = "SELECT * FROM `nodes` WHERE `id`={$Z}";
  8. $NN = $DATABASE->Query( $QS );
  9. if( count( $NN ) ){
  10. $Node = $NN[0];
  11. switch( $Node['type'] ){
  12. case 0:{
  13. $QS="SELECT * FROM `servers` WHERE `id`={$Node['aux_id']}";
  14. $SDD = $DATABASE->Query( $QS );
  15. $NData = $SDD[0];
  16. $QS="SELECT * FROM `resources` WHERE `node_id`={$Z} AND ( `type`=101 OR `type`=102 )";
  17. $CN = $DATABASE->Query( $QS );
  18. $IL=array();
  19. foreach( $CN as $N ){
  20. $QS="SELECT * FROM `networks` WHERE `nif_id`={$N['aux_id']} AND `type`=0";
  21. $NWD = $DATABASE->Query( $QS );
  22. $NW = $NWD[0];
  23. $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>";
  24. };
  25. $NIFO = '<table><tr>' . implode( '</tr><tr>', $IL ) . '</tr></table>';
  26. ?>
  27. {
  28. xtype: 'tabpanel',
  29. frame: false,
  30. id: 'node_settings_content',
  31. border: false,
  32. activeTab: <?=$CT;?>,
  33. items: [{
  34. xtype: 'panel',
  35. title: 'General Info',
  36. layout: 'hbox',
  37. items:[{
  38. xtype: 'panel',
  39. flex: 1,
  40. height: 303,
  41. autoScroll: false,
  42. html: '<table width="100%" border=0><tr><td height="290px" align="center" valign="middle"><div class="server_img_set"></div></td></tr></table>'
  43. },{
  44. xtype: 'form',
  45. id: '_ed_small',
  46. flex: 1,
  47. height: 303,
  48. autoScroll: false,
  49. //layout: 'vbox',
  50. labelWidth: 120,
  51. labelAlign: 'right',
  52. items:[{
  53. xtype: 'textfield',
  54. fieldLabel: '<?=$Labels->GetLabel( 'SERV_NAME' );?>',
  55. id: 'node_name',
  56. value: '<?=$Node['name'];?>',
  57. listeners:{
  58. change: function(){
  59. settingsChangeNotifier( 'node_name' );
  60. Ext.getCmp('sasa_bo').enable();
  61. }
  62. }
  63. },{
  64. xtype: 'panel',
  65. width: '100%',
  66. html: '<div class="sideInfo_item" id="INFO_ON"><?=$Labels->GetLabel( 'SERV_BLD_TAG' ).': '.$NData['version_string'];?></div>'
  67. },{
  68. xtype: 'panel',
  69. width: '100%',
  70. html: '<div class="setEd_infoPanel" id="INFO_IPS"><?=$NIFO;?></div>'
  71. },{
  72. xtype: 'button',
  73. id: 'sasa_bo',
  74. width: '100%',
  75. disabled: true,
  76. text: 'Apply Changes',
  77. handler: function(){
  78. }
  79. }]
  80. }]
  81. },{
  82. xtype: 'panel',
  83. title: 'Resources',
  84. layout: 'hbox',
  85. items:[{
  86. xtype: 'panel',
  87. flex: 1,
  88. height: 303,
  89. autoScroll: 'auto',
  90. //layout: 'fit',
  91. items:[<?php
  92. $QS = "SELECT * FROM resources WHERE `node_id`={$Z}";
  93. $Result = $DATABASE->Query( $QS, false );
  94. if( count( $Result ) ){
  95. foreach( $Result as $R ){
  96. switch( $R['type'] ){
  97. case 1:
  98. //Uart
  99. $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>\'}';
  100. break;
  101. case 6:
  102. //USB DC
  103. $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>\'}';
  104. break;
  105. case 31:
  106. //Video Grabber
  107. $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>\'}';
  108. break;
  109. case 100:
  110. //Loopback
  111. $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>\'}';
  112. break;
  113. case 101:
  114. //Ethernet Interface
  115. $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>\'}';
  116. break;
  117. case 102:
  118. //WiFi Interface
  119. $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>\'}';
  120. break;
  121. case 103:
  122. //Virtual IP Interface
  123. $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>\'}';
  124. break;
  125. case 104:
  126. //VPN Interface
  127. $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>\'}';
  128. break;
  129. case 105:
  130. //WAN Interface
  131. $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>\'}';
  132. break;
  133. //Media Encoder Sink
  134. case 131: // Video Encoder Sink
  135. $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>\'}';
  136. break;
  137. case 132: // Audio Encoder Sink
  138. $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>\'}';
  139. break;
  140. default:
  141. $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>\'}';
  142. };
  143. };
  144. echo implode( ',', $SockDataParts );
  145. };
  146. ?>]
  147. },{
  148. xtype: 'panel',
  149. id: 'res_ed_small',
  150. flex: 1,
  151. height: 303,
  152. layout: 'fit',
  153. items:[{
  154. html:'<div class="setEd_infoPanel" id="NUNU"><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>'
  155. }]
  156. }]
  157. },{
  158. xtype: 'panel',
  159. title: 'Modules',
  160. layout: 'hbox',
  161. items:[{
  162. xtype: 'panel',
  163. flex: 1,
  164. height: 303,
  165. autoScroll: 'auto',
  166. tbar:[{
  167. text: 'Add Module',
  168. handler: function(){
  169. var addModuleWindow = new Ext.Window({
  170. id: 'huha_boa',
  171. title: 'Add Server Module',
  172. modal: true,
  173. width: 400,
  174. height: 300,
  175. items:[{
  176. xtype: 'form',
  177. items: [{
  178. xtype: 'combo',
  179. fieldLabel: "<?=$Labels->GetLabel( 'MOD_TYPE' );?>",
  180. id: 'mod_type',
  181. lazyRender: true,
  182. mode: 'local',
  183. forceSelection: true,
  184. triggerAction: 'all',
  185. editable: false,
  186. disableKeyFilter: true,
  187. store: new Ext.data.ArrayStore({
  188. fields: ['az_t','az_txt'],
  189. data: [<?php
  190. $QS = "SELECT * FROM `server_module_types`";
  191. $MM = $DATABASE->Query( $QS );
  192. $MIMO = array();
  193. foreach( $MM as $M ) $MIMO[]="[{$M['id']},'".$Labels->GetLabel($M['name'])."']";
  194. echo implode( ',', $MIMO );
  195. ?>]
  196. }),
  197. valueField: 'az_t',
  198. displayField: 'az_txt',
  199. value: 1,
  200. listeners:{
  201. select: function( t, r, i ){
  202. var n = r.data.az_t;
  203. Ext.Ajax.request({
  204. url: '/lib/controller/getModuleInfo.php',
  205. params: {
  206. MID: n,
  207. UID: <?=$UserID;?>,
  208. SID: '<?=$Session;?>'
  209. },
  210. success: function( response, opts ){
  211. Ext.getCmp('infopan').update( response.responseText );
  212. }
  213. });
  214. }
  215. }
  216. },{
  217. xtype: 'panel',
  218. id: 'infopan',
  219. html: '<table width="100%" border=0 class="setEd_infoPanel" id="UART"><tr><td width="65px"><img width="64px" src="/style/assets/ZL_logo.png"></td><td valign="middle"><?=$Labels->GetLabel('_ZL_MEDIA_DESC_SHO_');?></td></tr><tr><td colspan=2><?=$Labels->GetLabel('_ZL_MEDIA_DESC_LOO_');?></td></tr></table>'
  220. }]
  221. }],
  222. bbar:[{
  223. text: 'Cancel',
  224. handler: function(){
  225. addModuleWindow.close();
  226. }
  227. },{
  228. text: 'Add Module',
  229. handler: function(){
  230. var mtyp = Ext.getCmp('mod_type').getValue();
  231. Ext.Ajax.request({
  232. url: '/lib/controller/addServerModule.php',
  233. params: {
  234. SERVID: <?=$Node['aux_id'];?>,
  235. TYPE: mtyp,
  236. UID: <?=$UserID;?>,
  237. SID: '<?=$Session;?>'
  238. },
  239. success: function( response, opts ){
  240. // If the response is JSON, you have to decode it
  241. var data = Ext.decode(response.responseText);
  242. if( data.status == 'ok' ){
  243. addModuleWindow.close();
  244. showSettings( SelectedNodeID, 2 );
  245. } else {
  246. Ext.Msg.show({
  247. title:'<?=$Labels->GetLabel("_INFO_MSG_");?>',
  248. msg: data.msg,
  249. buttons: Ext.Msg.OK,//YESNOCANCEL,
  250. fn: function(){
  251. //SettingsLidar3D.hide();
  252. },
  253. icon: Ext.MessageBox.INFO //QUESTION
  254. });
  255. }
  256. },
  257. failure: failureAJAXFunction
  258. });
  259. }
  260. }]
  261. });
  262. addModuleWindow.show();
  263. }
  264. }],
  265. items:[<?php
  266. $QS = "SELECT * FROM server_modules WHERE `server_id`={$Node['aux_id']}";
  267. $Result = $DATABASE->Query( $QS, false );
  268. if( count( $Result ) ){
  269. foreach( $Result as $R ){
  270. $QS = "SELECT * FROM server_module_types WHERE id={$R['type']}";
  271. $MOMO = $DATABASE->Query( $QS, false );
  272. $MOD = $MOMO[0];
  273. switch( $R['type'] ){
  274. case 1:
  275. case 2:
  276. case 3:
  277. case 4:
  278. case 5:
  279. case 6:
  280. case 7:
  281. case 8:
  282. case 9:
  283. case 10:
  284. $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>\'}';
  285. break;
  286. default:
  287. $ModPart[] = '{ xtype: \'panel\', boder: false, frame: false, html: \'<a align="center" style="padding: 5px; color: black; background-color: grey;">'.$R['device'].'</a>\'}';
  288. };
  289. };
  290. echo implode( ',', $ModPart );
  291. };
  292. ?>]
  293. },{
  294. xtype: 'panel',
  295. id: 'mod_ed_small',
  296. flex: 1,
  297. height: 303,
  298. layout: 'fit',
  299. items:[{
  300. html:'<div class="setEd_infoPanel" id="NUNU"><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>'
  301. }]
  302. }]
  303. },{
  304. xtype: 'panel',
  305. title: 'Network',
  306. items:[]
  307. }],
  308. listeners:{
  309. afterrender: function(){
  310. settingsAreChanged = false;
  311. }
  312. },
  313. updateSettings: function(){
  314. alert('Update Settings');
  315. }
  316. }
  317. <?php
  318. break;
  319. };
  320. case 1:
  321. case 2:
  322. case 3:
  323. case 4:{
  324. //Serial Devices
  325. $QS = "SELECT * FROM `lrf_sensors` WHERE `id`={$Node['aux_id']}";
  326. $RR=$DATABASE->Query( $QS );
  327. $NData = $RR[0];
  328. $NIFO = $Labels->GetLabel( 'SERV_BLD_TAG' ).':'. $NData['version'];
  329. ?>
  330. {
  331. xtype: 'tabpanel',
  332. frame: false,
  333. id: 'node_settings_content',
  334. border: false,
  335. activeTab: 0,
  336. items: [{
  337. xtype: 'panel',
  338. title: 'General Info',
  339. layout: 'hbox',
  340. items:[{
  341. xtype: 'panel',
  342. flex: 1,
  343. height: 303,
  344. autoScroll: false,
  345. 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>'
  346. },{
  347. xtype: 'form',
  348. id: '_ed_small',
  349. flex: 1,
  350. height: 303,
  351. autoScroll: false,
  352. //layout: 'vbox',
  353. labelWidth: 120,
  354. labelAlign: 'right',
  355. items:[{
  356. xtype: 'textfield',
  357. fieldLabel: "<?=$Labels->GetLabel( 'SENS_NAME' );?>",
  358. id: 'node_name',
  359. value: '<?=$Node['name'];?>',
  360. listeners:{
  361. change: function(){
  362. settingsChangeNotifier( 'node_name' );
  363. Ext.getCmp('sasa_bo').enable();
  364. }
  365. }
  366. },{
  367. xtype: 'combo',
  368. fieldLabel: "<?=$Labels->GetLabel( 'SENS_TYPE' );?>",
  369. id: 'node_type',
  370. lazyRender: true,
  371. mode: 'local',
  372. forceSelection: true,
  373. triggerAction: 'all',
  374. editable: false,
  375. disableKeyFilter: true,
  376. store: new Ext.data.ArrayStore({
  377. fields: ['aa_t','aa_txt'],
  378. data: [
  379. [1,'ALS Sensor'],
  380. [2,'LFS Sensor'],
  381. [3,'PLS 200 Sensor'],
  382. [4,'PLS 360 Sensor']
  383. ]
  384. }),
  385. valueField: 'aa_t',
  386. displayField: 'aa_txt',
  387. value: '<?=$Node['type'];?>',
  388. listeners:{
  389. select: function( t, r, i ){
  390. var n = r.data.aa_t;
  391. //var b = t.getValue();
  392. //if( n != b ){
  393. document.getElementById('node_pic').className = 'node_'+ n +'_img_set';
  394. settingsChangeNotifier( 'node_type' );
  395. Ext.getCmp('sasa_bo').enable();
  396. //};
  397. },
  398. change: function( t, n, o ){
  399. document.getElementById('node_pic').className = 'node_'+ n +'_img_set';
  400. settingsChangeNotifier( 'node_type' );
  401. Ext.getCmp('sasa_bo').enable();
  402. }
  403. }
  404. },{
  405. xtype: 'numberfield',
  406. fieldLabel: "<?=$Labels->GetLabel( 'SENS_RANGE' );?>",
  407. id: 'node_range',
  408. value: '<?=$NData['max_range'];?>',
  409. listeners:{
  410. change: function( t, n, o ){
  411. settingsChangeNotifier( 'node_range' );
  412. Ext.getCmp('sasa_bo').enable();
  413. }
  414. }
  415. },{
  416. xtype: 'panel',
  417. width: '100%',
  418. html: '<div class="sideInfo_item" id="INFO_ON"><?=$Labels->GetLabel( 'SETIAL_TAG' ).': '.$NData['serial'];?></div>'
  419. },{
  420. xtype: 'panel',
  421. width: '100%',
  422. html: '<div class="setEd_infoPanel" id="INFO_IPS"><?=$NIFO;?></div>'
  423. },{
  424. xtype: 'button',
  425. id: 'sasa_bo',
  426. width: '100%',
  427. disabled: true,
  428. text: 'Apply Changes',
  429. handler: function(){
  430. }
  431. }]
  432. }]
  433. },{
  434. xtype: 'panel',
  435. title: 'Resources',
  436. layout: 'hbox',
  437. items:[{
  438. xtype: 'panel',
  439. flex: 1,
  440. height: 303,
  441. autoScroll: 'auto',
  442. //layout: 'fit',
  443. items:[<?php
  444. $QS = "SELECT * FROM resources WHERE `node_id`={$Z}";
  445. $Result = $DATABASE->Query( $QS, false );
  446. $SockDataParts = array();
  447. if( count( $Result ) ){
  448. foreach( $Result as $R ){
  449. switch( $R['type'] ){
  450. case 1:
  451. //Uart
  452. $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>\'}';
  453. break;
  454. case 6:
  455. //USB DC
  456. $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>\'}';
  457. break;
  458. case 31:
  459. //Video Grabber
  460. $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>\'}';
  461. break;
  462. case 100:
  463. //Loopback
  464. $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>\'}';
  465. break;
  466. case 101:
  467. //Ethernet Interface
  468. $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>\'}';
  469. break;
  470. case 102:
  471. //WiFi Interface
  472. $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>\'}';
  473. break;
  474. case 103:
  475. //Virtual IP Interface
  476. $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>\'}';
  477. break;
  478. case 104:
  479. //VPN Interface
  480. $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>\'}';
  481. break;
  482. case 105:
  483. //WAN Interface
  484. $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>\'}';
  485. break;
  486. //Media Encoder Sink
  487. case 131: // Video Encoder Sink
  488. $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>\'}';
  489. break;
  490. case 132: // Audio Encoder Sink
  491. $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>\'}';
  492. break;
  493. default:
  494. $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>\'}';
  495. };
  496. };
  497. echo implode( ',', $SockDataParts );
  498. };
  499. ?>]
  500. },{
  501. xtype: 'panel',
  502. id: 'res_ed_small',
  503. flex: 1,
  504. height: 303,
  505. layout: 'fit',
  506. items:[{
  507. html:'<div class="setEd_infoPanel" id="NUNU"><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>'
  508. }]
  509. }]
  510. },{
  511. xtype: 'panel',
  512. title: 'Detection Settings',
  513. layout: 'hbox',
  514. items:[{
  515. xtype: 'panel',
  516. flex: 1,
  517. height: 303,
  518. autoScroll: 'auto',
  519. //layout: 'fit',
  520. items:[<?php
  521. $QS = "SELECT DISTINCT `profile_id` FROM `lrf_detection_profiles` WHERE `aux_id`={$Node['aux_id']} ORDER BY `profile_id`";
  522. $ZUBI = $DATABASE->Query( $QS );
  523. $Proparts = array();
  524. foreach( $ZUBI as $Z ){
  525. switch( $Z['profile_id'] ){
  526. case 1: $MOMO = 'Low Sensitivity Profile'; break;
  527. case 2: $MOMO = 'Medium Sensitivity Profile'; break;
  528. case 3: $MOMO = 'High Sensitivity Profile'; break;
  529. default: $MOMO = 'Factory Profile'; break;
  530. };
  531. $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>\'}';
  532. };
  533. if( count( $ZUBI ) > 1 ){
  534. $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>\'}';
  535. };
  536. $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>\'}';
  537. // Check if Masks Exists
  538. $QS = "SELECT `id` FROM `lrf_masks` WHERE `sensor_id`={$Node['aux_id']}";
  539. $MM = $DATABASE->Query( $QS );
  540. if( count( $MM ) ){
  541. $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>\'}';
  542. };
  543. echo implode( ',', $Proparts );
  544. ?>]
  545. },{
  546. xtype: 'panel',
  547. id: 'dep_ed_small',
  548. flex: 1,
  549. height: 303,
  550. layout: 'fit',
  551. items:[{
  552. html:'<div class="setEd_infoPanel" id="NUNU"><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>'
  553. }]
  554. }]
  555. },{
  556. xtype: 'panel',
  557. title: 'Embed Options',
  558. layout: 'hbox',
  559. items:[{
  560. }]
  561. },{
  562. xtype: 'panel',
  563. title: 'Advanced',
  564. layout: 'hbox',
  565. items:[{
  566. }]
  567. }]
  568. }
  569. <?php
  570. break;
  571. };
  572. };
  573. } else {
  574. echo "{}";
  575. };
  576. } else {
  577. echo "{}";
  578. };
  579. } else {
  580. echo "{}";
  581. };
  582. ?>