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.

513 lines
13 KiB

4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <?php
  2. require_once('../ajax_asm.php');
  3. if( $CUser->Data['id'] > 1 ){
  4. $EID = intval( $_POST['MID'] );
  5. $QS = "SELECT * FROM server_modules WHERE id = {$EID}";
  6. $Result = $DATABASE->Query( $QS, false );
  7. if( count( $Result ) ){
  8. $CR = $Result[0];
  9. switch( $CR['type'] ){
  10. case 1: //ZLMedia
  11. $QS = "SELECT * FROM uart_settings WHERE id={$CR['aux_id']}";
  12. $Result = $DATABASE->Query( $QS );
  13. $Z = $Result[0];
  14. $R_name = $Labels->GetLabel('_RES_HW_UART_DESC_');
  15. $R_dev = $CR['device'];
  16. $R_nfo = 'Speed: ' . $Z['speed'] . ', Bits: ' . $Z['bit'] . ', Parity: ' . $Z['parity'] . ', Stop Bit: '. $Z['stop_bit'];
  17. $R_image = 'unnamed.png';
  18. $TPL =<<<EFUFU
  19. {
  20. xtype: 'form',
  21. labelAlign: 'right',
  22. autoScroll: 'auto',
  23. labelWidth: 120,
  24. items:[{
  25. border: false,
  26. frame: false,
  27. xtype: 'panel',
  28. 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">%%%NAME%%%</td></tr><tr><td colspan=2>%%%INFO%%%</td></tr></table>'
  29. },{
  30. xtype: 'spacer',
  31. height: 5
  32. },{
  33. border: false,
  34. frame: false,
  35. xtype: 'panel',
  36. html: '<table width="100%" border=0 class="setEd_infoPanel" id="UART"><tr><td valign="middle">%%%LOINFO%%%</td></tr></table>'
  37. },{
  38. xtype: 'spacer',
  39. height: 5
  40. },{
  41. xtype: 'combo',
  42. fieldLabel: 'Module Status',
  43. id: 'mod_ena',
  44. lazyRender:true,
  45. mode: 'local',
  46. forceSelection: true,
  47. triggerAction: 'all',
  48. editable: false,
  49. disableKeyFilter: true,
  50. store: new Ext.data.ArrayStore({
  51. fields: ['status_val','status_txt'],
  52. data: [[0,'Disabled'],[1,'Enabled']]
  53. }),
  54. value: %%%ENA_VAL%%%,
  55. valueField: 'status_val',
  56. displayField: 'status_txt'
  57. },{
  58. xtype: 'spacer',
  59. height: 5
  60. },{
  61. xtype: 'button',
  62. id: 'mo_edit_btn',
  63. disabled: false,
  64. width: '100%',
  65. text: 'Edit Module Config',
  66. handler: function(){
  67. }
  68. },{
  69. xtype: 'spacer',
  70. height: 5
  71. },{
  72. xtype: 'button',
  73. id: 'mo_del_btn',
  74. disabled: false,
  75. width: '100%',
  76. text: 'Remove Module',
  77. handler: function(){
  78. }
  79. },{
  80. xtype: 'spacer',
  81. height: 5
  82. },{
  83. xtype: 'button',
  84. id: 'ua_apply_btn',
  85. disabled: true,
  86. width: '100%',
  87. text: 'Apply Changes',
  88. handler: function(){
  89. }
  90. }]
  91. }
  92. EFUFU;
  93. $TPL = str_ireplace( '%%%NAME%%%',$Labels->GetLabel('_ZL_MEDIA_DESC_SHO_') , $TPL );
  94. $TPL = str_ireplace( '%%%INFO%%%', $Labels->GetLabel('_ZL_MEDIA_DESC_LOO_'), $TPL );
  95. $TPL = str_ireplace( '%%%LOINFO%%%','' , $TPL );
  96. $TPL = str_ireplace( '%%%ENA_VAL%%%',$CR['enabled'], $TPL );
  97. echo $TPL;
  98. break;
  99. case 2: //DCB USB
  100. break;
  101. case 3: //Kafka
  102. $QS="SELECT * FROM `modules_kafka` WHERE `module_id`={$CR['aux_id']}";
  103. $II = $DATABASE->Query( $QS );
  104. $CI = $II[0];
  105. $R_nfo = 'Broker Node:'. $CI['brocker_address'].':'.$CI['brocker_port'].((intval($CI['use_ssl'])>0)?'<img title="SSL Encription" src="/style/icons/icons/rosette.png">':'<img title="NO Encription" src="/style/icons/icons/flag_green.png">');
  106. $TPL =<<<EFUFU
  107. {
  108. xtype: 'form',
  109. labelAlign: 'right',
  110. autoScroll: 'auto',
  111. labelWidth: 120,
  112. items:[{
  113. border: false,
  114. frame: false,
  115. xtype: 'panel',
  116. html: '<table width="100%" border=0 class="setEd_infoPanel" id="KAFKA"><tr><td width="65px"><img width="64px" src="/style/assets/Kafka.png"></td><td valign="middle">%%%NAME%%%</td></tr><tr><td colspan=2>%%%INFO%%%</td></tr></table>'
  117. },{
  118. xtype: 'spacer',
  119. height: 5
  120. },{
  121. border: false,
  122. frame: false,
  123. xtype: 'panel',
  124. html: '<table width="100%" border=0 class="setEd_infoPanel" id="KAFKA"><tr><td valign="middle">%%%LOINFO%%%</td></tr></table>'
  125. },{
  126. xtype: 'spacer',
  127. height: 5
  128. },{
  129. xtype: 'combo',
  130. fieldLabel: 'Module Status',
  131. id: 'mod_ena',
  132. lazyRender:true,
  133. mode: 'local',
  134. forceSelection: true,
  135. triggerAction: 'all',
  136. editable: false,
  137. disableKeyFilter: true,
  138. store: new Ext.data.ArrayStore({
  139. fields: ['status_val','status_txt'],
  140. data: [[0,'Disabled'],[1,'Enabled']]
  141. }),
  142. value: %%%ENA_VAL%%%,
  143. valueField: 'status_val',
  144. displayField: 'status_txt'
  145. },{
  146. xtype: 'spacer',
  147. height: 5
  148. },{
  149. xtype: 'button',
  150. id: 'mo_edit_btn',
  151. disabled: false,
  152. width: '100%',
  153. text: 'Edit Module Config',
  154. handler: function(){
  155. }
  156. },{
  157. xtype: 'spacer',
  158. height: 5
  159. },{
  160. xtype: 'button',
  161. id: 'mo_del_btn',
  162. disabled: false,
  163. width: '100%',
  164. text: 'Remove Module',
  165. handler: function(){
  166. }
  167. },{
  168. xtype: 'spacer',
  169. height: 5
  170. },{
  171. xtype: 'button',
  172. id: 'ua_apply_btn',
  173. disabled: true,
  174. width: '100%',
  175. text: 'Apply Changes',
  176. handler: function(){
  177. }
  178. }]
  179. }
  180. EFUFU;
  181. $TPL = str_ireplace( '%%%NAME%%%',$Labels->GetLabel('_KAFKA_DESC_SHO_') , $TPL );
  182. $TPL = str_ireplace( '%%%INFO%%%', $Labels->GetLabel('_KAFKA_DESC_LOO_'), $TPL );
  183. $TPL = str_ireplace( '%%%LOINFO%%%',$R_nfo , $TPL );
  184. $TPL = str_ireplace( '%%%ENA_VAL%%%',$CR['enabled'], $TPL );
  185. echo $TPL;
  186. break;
  187. case 7: // SSDP
  188. $TPL =<<<EFUFU
  189. {
  190. xtype: 'form',
  191. labelAlign: 'right',
  192. autoScroll: 'auto',
  193. labelWidth: 120,
  194. items:[{
  195. border: false,
  196. frame: false,
  197. xtype: 'panel',
  198. html: '<table width="100%" border=0 class="setEd_infoPanel" id="SSDP"><tr><td width="65px"><img width="64px" src="/style/assets/upnp.png"></td><td valign="middle">%%%NAME%%%</td></tr><tr><td colspan=2>%%%INFO%%%</td></tr></table>'
  199. },{
  200. xtype: 'spacer',
  201. height: 5
  202. },{
  203. border: false,
  204. frame: false,
  205. xtype: 'panel',
  206. html: '<table width="100%" border=0 class="setEd_infoPanel" id="SSDP"><tr><td valign="middle">%%%LOINFO%%%</td></tr></table>'
  207. },{
  208. xtype: 'spacer',
  209. height: 5
  210. },{
  211. xtype: 'combo',
  212. fieldLabel: 'Module Status',
  213. id: 'mod_ena',
  214. lazyRender:true,
  215. mode: 'local',
  216. forceSelection: true,
  217. triggerAction: 'all',
  218. editable: false,
  219. disableKeyFilter: true,
  220. store: new Ext.data.ArrayStore({
  221. fields: ['status_val','status_txt'],
  222. data: [[0,'Disabled'],[1,'Enabled']]
  223. }),
  224. value: %%%ENA_VAL%%%,
  225. valueField: 'status_val',
  226. displayField: 'status_txt'
  227. },{
  228. xtype: 'spacer',
  229. height: 5
  230. },{
  231. xtype: 'button',
  232. id: 'mo_del_btn',
  233. disabled: false,
  234. width: '100%',
  235. text: 'Remove Module',
  236. handler: function(){
  237. }
  238. },{
  239. xtype: 'spacer',
  240. height: 5
  241. },{
  242. xtype: 'button',
  243. id: 'ua_apply_btn',
  244. disabled: true,
  245. width: '100%',
  246. text: 'Apply Changes',
  247. handler: function(){
  248. }
  249. }]
  250. }
  251. EFUFU;
  252. $TPL = str_ireplace( '%%%NAME%%%',$Labels->GetLabel('_SSDP_DESC_SHO_') , $TPL );
  253. $TPL = str_ireplace( '%%%INFO%%%', $Labels->GetLabel('_SSDP_DESC_LOO_'), $TPL );
  254. $TPL = str_ireplace( '%%%LOINFO%%%',$Labels->GetLabel('_MOD_NO_NEDCONF_'), $TPL );
  255. $TPL = str_ireplace( '%%%ENA_VAL%%%',$CR['enabled'], $TPL );
  256. echo $TPL;
  257. break;
  258. case 8: // Onvif
  259. $TPL =<<<EFUFU
  260. {
  261. xtype: 'form',
  262. labelAlign: 'right',
  263. autoScroll: 'auto',
  264. labelWidth: 120,
  265. items:[{
  266. border: false,
  267. frame: false,
  268. xtype: 'panel',
  269. html: '<table width="100%" border=0 class="setEd_infoPanel" id="ONVIF"><tr><td width="65px"><img width="64px" src="/style/assets/onvif.png"></td><td valign="middle">%%%NAME%%%</td></tr><tr><td colspan=2>%%%INFO%%%</td></tr></table>'
  270. },{
  271. xtype: 'spacer',
  272. height: 5
  273. },{
  274. border: false,
  275. frame: false,
  276. xtype: 'panel',
  277. html: '<table width="100%" border=0 class="setEd_infoPanel" id="ONVIF"><tr><td valign="middle">%%%LOINFO%%%</td></tr></table>'
  278. },{
  279. xtype: 'spacer',
  280. height: 5
  281. },{
  282. xtype: 'combo',
  283. fieldLabel: 'Module Status',
  284. id: 'mod_ena',
  285. lazyRender:true,
  286. mode: 'local',
  287. forceSelection: true,
  288. triggerAction: 'all',
  289. editable: false,
  290. disableKeyFilter: true,
  291. store: new Ext.data.ArrayStore({
  292. fields: ['status_val','status_txt'],
  293. data: [[0,'Disabled'],[1,'Enabled']]
  294. }),
  295. value: %%%ENA_VAL%%%,
  296. valueField: 'status_val',
  297. displayField: 'status_txt'
  298. },{
  299. xtype: 'spacer',
  300. height: 5
  301. },{
  302. xtype: 'button',
  303. id: 'mo_del_btn',
  304. disabled: false,
  305. width: '100%',
  306. text: 'Remove Module',
  307. handler: function(){
  308. }
  309. },{
  310. xtype: 'spacer',
  311. height: 5
  312. },{
  313. xtype: 'button',
  314. id: 'ua_apply_btn',
  315. disabled: true,
  316. width: '100%',
  317. text: 'Apply Changes',
  318. handler: function(){
  319. }
  320. }]
  321. }
  322. EFUFU;
  323. $TPL = str_ireplace( '%%%NAME%%%',$Labels->GetLabel('_ONVIF_DESC_SHO_') , $TPL );
  324. $TPL = str_ireplace( '%%%INFO%%%', $Labels->GetLabel('_ONVIF_DESC_LOO_'), $TPL );
  325. $TPL = str_ireplace( '%%%LOINFO%%%',$Labels->GetLabel('_MOD_NO_NEDCONF_'), $TPL );
  326. $TPL = str_ireplace( '%%%ENA_VAL%%%',$CR['enabled'], $TPL );
  327. echo $TPL;
  328. break;
  329. case 9://Embed Video Encoder
  330. $QS="SELECT * FROM `network_interfaces` WHERE `id`={$CR['aux_id']}";
  331. $II = $DATABASE->Query( $QS );
  332. $CI = $II[0];
  333. $TPL =<<<EFUFU
  334. {
  335. xtype: 'form',
  336. labelAlign: 'right',
  337. autoScroll: 'auto',
  338. labelWidth: 120,
  339. items:[{
  340. border: false,
  341. frame: false,
  342. xtype: 'panel',
  343. html: '<table width="100%" border=0 class="setEd_infoPanel" id="EVE"><tr><td width="65px"><img width="64px" src="/style/assets/ffmpeg.png"></td><td valign="middle">%%%NAME%%%</td></tr><tr><td colspan=2>%%%INFO%%%</td></tr></table>'
  344. },{
  345. xtype: 'spacer',
  346. height: 5
  347. },{
  348. border: false,
  349. frame: false,
  350. xtype: 'panel',
  351. html: '<table width="100%" border=0 class="setEd_infoPanel" id="EVE"><tr><td valign="middle">%%%LOINFO%%%</td></tr></table>'
  352. },{
  353. xtype: 'spacer',
  354. height: 5
  355. },{
  356. xtype: 'combo',
  357. fieldLabel: 'Module Status',
  358. id: 'mod_ena',
  359. lazyRender:true,
  360. mode: 'local',
  361. forceSelection: true,
  362. triggerAction: 'all',
  363. editable: false,
  364. disableKeyFilter: true,
  365. store: new Ext.data.ArrayStore({
  366. fields: ['status_val','status_txt'],
  367. data: [[0,'Disabled'],[1,'Enabled']]
  368. }),
  369. value: %%%ENA_VAL%%%,
  370. valueField: 'status_val',
  371. displayField: 'status_txt'
  372. },{
  373. xtype: 'spacer',
  374. height: 5
  375. },{
  376. xtype: 'button',
  377. id: 'mo_edit_btn',
  378. disabled: false,
  379. width: '100%',
  380. text: 'Edit Module Config',
  381. handler: function(){
  382. embedVideoEncoderSettings(0);
  383. }
  384. },{
  385. xtype: 'spacer',
  386. height: 5
  387. },{
  388. xtype: 'button',
  389. id: 'mo_del_btn',
  390. disabled: false,
  391. width: '100%',
  392. text: 'Remove Module',
  393. handler: function(){
  394. }
  395. },{
  396. xtype: 'spacer',
  397. height: 5
  398. },{
  399. xtype: 'button',
  400. id: 'ua_apply_btn',
  401. disabled: true,
  402. width: '100%',
  403. text: 'Apply Changes',
  404. handler: function(){
  405. }
  406. }]
  407. }
  408. EFUFU;
  409. $TPL = str_ireplace( '%%%NAME%%%',$Labels->GetLabel('_EVE_DESC_SHO_') , $TPL );
  410. $TPL = str_ireplace( '%%%INFO%%%', $Labels->GetLabel('_EVE_DESC_LOO_'), $TPL );
  411. $TPL = str_ireplace( '%%%LOINFO%%%','' , $TPL );
  412. $TPL = str_ireplace( '%%%ENA_VAL%%%',$CR['enabled'], $TPL );
  413. echo $TPL;
  414. break;
  415. case 10: //Modem
  416. $QS="SELECT * FROM `modules_kafka` WHERE `module_id`={$CR['aux_id']}";
  417. $II = $DATABASE->Query( $QS );
  418. $CI = $II[0];
  419. $R_nfo = 'Broker Node:'. $CI['brocker_address'].':'.$CI['brocker_port'].((intval($CI['use_ssl'])>0)?'<img title="SSL Encription" src="/style/icons/icons/rosette.png">':'<img title="NO Encription" src="/style/icons/icons/flag_green.png">');
  420. $TPL =<<<EFUFU
  421. {
  422. xtype: 'form',
  423. labelAlign: 'right',
  424. autoScroll: 'auto',
  425. labelWidth: 120,
  426. items:[{
  427. border: false,
  428. frame: false,
  429. xtype: 'panel',
  430. html: '<table width="100%" border=0 class="setEd_infoPanel" id="KAFKA"><tr><td width="65px"><img width="64px" src="/style/assets/modem.png"></td><td valign="middle">%%%NAME%%%</td></tr><tr><td colspan=2>%%%INFO%%%</td></tr></table>'
  431. },{
  432. xtype: 'spacer',
  433. height: 5
  434. },{
  435. border: false,
  436. frame: false,
  437. xtype: 'panel',
  438. html: '<table width="100%" border=0 class="setEd_infoPanel" id="KAFKA"><tr><td valign="middle">%%%LOINFO%%%</td></tr></table>'
  439. },{
  440. xtype: 'spacer',
  441. height: 5
  442. },{
  443. xtype: 'combo',
  444. fieldLabel: 'Module Status',
  445. id: 'mod_ena',
  446. lazyRender:true,
  447. mode: 'local',
  448. forceSelection: true,
  449. triggerAction: 'all',
  450. editable: false,
  451. disableKeyFilter: true,
  452. store: new Ext.data.ArrayStore({
  453. fields: ['status_val','status_txt'],
  454. data: [[0,'Disabled'],[1,'Enabled']]
  455. }),
  456. value: %%%ENA_VAL%%%,
  457. valueField: 'status_val',
  458. displayField: 'status_txt'
  459. },{
  460. xtype: 'spacer',
  461. height: 5
  462. },{
  463. xtype: 'button',
  464. id: 'mo_edit_btn',
  465. disabled: false,
  466. width: '100%',
  467. text: 'Edit Module Config',
  468. handler: function(){
  469. }
  470. },{
  471. xtype: 'spacer',
  472. height: 5
  473. },{
  474. xtype: 'button',
  475. id: 'mo_del_btn',
  476. disabled: false,
  477. width: '100%',
  478. text: 'Remove Module',
  479. handler: function(){
  480. }
  481. },{
  482. xtype: 'spacer',
  483. height: 5
  484. },{
  485. xtype: 'button',
  486. id: 'ua_apply_btn',
  487. disabled: true,
  488. width: '100%',
  489. text: 'Apply Changes',
  490. handler: function(){
  491. }
  492. }]
  493. }
  494. EFUFU;
  495. $TPL = str_ireplace( '%%%NAME%%%',$Labels->GetLabel('_KAFKA_DESC_SHO_') , $TPL );
  496. $TPL = str_ireplace( '%%%INFO%%%', $Labels->GetLabel('_KAFKA_DESC_LOO_'), $TPL );
  497. $TPL = str_ireplace( '%%%LOINFO%%%',$R_nfo , $TPL );
  498. $TPL = str_ireplace( '%%%ENA_VAL%%%',$CR['enabled'], $TPL );
  499. echo $TPL;
  500. break;
  501. };
  502. } else {
  503. echo '{ xtype: \'panel\', html: \'Node '.$_POST['NODE'].' Loadded\'}';
  504. };
  505. } else {
  506. header('location: /');
  507. };
  508. ?>