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.

478 lines
12 KiB

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