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.

560 lines
14 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <?php
  2. require_once('../ajax_asm.php');
  3. if( $CUser->Data['id'] > 1 ){
  4. $EID = intval( $_POST['MID'] );
  5. $QS = "SELECT * FROM modules WHERE id = {$EID}";
  6. $Result = $DATABASE->Query( $QS, false );
  7. if( count( $Result ) ){
  8. $CR = $Result[0];
  9. switch( $CR['type'] ){
  10. case 0: //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 1: //DCB USB
  89. break;
  90. case 2: //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 6: // SSDP
  173. //$QS = "SELECT * FROM `module_ssdp` WHERE `module_id`={$CR['aux_id']}";
  174. //$ZZ = $DATABASE->Query( $QS );
  175. $TPL =<<<EFUFU
  176. {
  177. xtype: 'form',
  178. labelAlign: 'right',
  179. autoScroll: 'auto',
  180. labelWidth: 120,
  181. items:[{
  182. border: false,
  183. frame: false,
  184. xtype: 'panel',
  185. 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>'
  186. },{
  187. xtype: 'spacer',
  188. height: 5
  189. },{
  190. border: false,
  191. frame: false,
  192. xtype: 'panel',
  193. html: '<table width="100%" border=0 class="setEd_infoPanel" id="SSDP"><tr><td valign="middle">%%%LOINFO%%%</td></tr></table>'
  194. },{
  195. xtype: 'spacer',
  196. height: 5
  197. },{
  198. xtype: 'combo',
  199. fieldLabel: 'Module Status',
  200. id: 'mod_ena',
  201. lazyRender:true,
  202. mode: 'local',
  203. forceSelection: true,
  204. triggerAction: 'all',
  205. editable: false,
  206. disableKeyFilter: true,
  207. store: new Ext.data.ArrayStore({
  208. fields: ['status_val','status_txt'],
  209. data: [[0,'Disabled'],[1,'Enabled']]
  210. }),
  211. value: %%%ENA_VAL%%%,
  212. valueField: 'status_val',
  213. displayField: 'status_txt',
  214. listeners:{
  215. select: function( t, r, i ){
  216. if( r.data.status_val ) enableModule({$EID}); else disableModule({$EID});
  217. }
  218. }
  219. },{
  220. xtype: 'spacer',
  221. height: 5
  222. },{
  223. xtype: 'button',
  224. id: 'mo_del_btn',
  225. disabled: false,
  226. width: '100%',
  227. text: 'Remove Module',
  228. handler: function(){
  229. removeModule({$EID});
  230. }
  231. }]
  232. }
  233. EFUFU;
  234. $TPL = str_ireplace( '%%%NAME%%%',$Labels->GetLabel('_SSDP_DESC_SHO_') , $TPL );
  235. $TPL = str_ireplace( '%%%INFO%%%', $Labels->GetLabel('_SSDP_DESC_LOO_'), $TPL );
  236. $TPL = str_ireplace( '%%%LOINFO%%%',$Labels->GetLabel('_MOD_NO_NEDCONF_'), $TPL );
  237. $TPL = str_ireplace( '%%%ENA_VAL%%%',$CR['enabled'], $TPL );
  238. echo $TPL;
  239. break;
  240. case 7: // Onvif
  241. $TPL =<<<EFUFU
  242. {
  243. xtype: 'form',
  244. labelAlign: 'right',
  245. autoScroll: 'auto',
  246. labelWidth: 120,
  247. items:[{
  248. border: false,
  249. frame: false,
  250. xtype: 'panel',
  251. 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>'
  252. },{
  253. xtype: 'spacer',
  254. height: 5
  255. },{
  256. border: false,
  257. frame: false,
  258. xtype: 'panel',
  259. html: '<table width="100%" border=0 class="setEd_infoPanel" id="ONVIF"><tr><td valign="middle">%%%LOINFO%%%</td></tr></table>'
  260. },{
  261. xtype: 'spacer',
  262. height: 5
  263. },{
  264. xtype: 'combo',
  265. fieldLabel: 'Module Status',
  266. id: 'mod_ena',
  267. lazyRender:true,
  268. mode: 'local',
  269. forceSelection: true,
  270. triggerAction: 'all',
  271. editable: false,
  272. disableKeyFilter: true,
  273. store: new Ext.data.ArrayStore({
  274. fields: ['status_val','status_txt'],
  275. data: [[0,'Disabled'],[1,'Enabled']]
  276. }),
  277. value: %%%ENA_VAL%%%,
  278. valueField: 'status_val',
  279. displayField: 'status_txt',
  280. listeners:{
  281. select: function( t, r, i ){
  282. if( r.data.status_val ) enableModule({$EID}); else disableModule({$EID});
  283. }
  284. }
  285. },{
  286. xtype: 'spacer',
  287. height: 5
  288. },{
  289. xtype: 'button',
  290. id: 'mo_del_btn',
  291. disabled: false,
  292. width: '100%',
  293. text: 'Remove Module',
  294. handler: function(){
  295. removeModule({$EID});
  296. }
  297. }]
  298. }
  299. EFUFU;
  300. $TPL = str_ireplace( '%%%NAME%%%',$Labels->GetLabel('_ONVIF_DESC_SHO_') , $TPL );
  301. $TPL = str_ireplace( '%%%INFO%%%', $Labels->GetLabel('_ONVIF_DESC_LOO_'), $TPL );
  302. $TPL = str_ireplace( '%%%LOINFO%%%',$Labels->GetLabel('_MOD_NO_NEDCONF_'), $TPL );
  303. $TPL = str_ireplace( '%%%ENA_VAL%%%',$CR['enabled'], $TPL );
  304. echo $TPL;
  305. break;
  306. case 8://Embed Video Encoder
  307. //$QS="SELECT * FROM `network_interfaces` WHERE `id`={$CR['aux_id']}";
  308. //$II = $DATABASE->Query( $QS );
  309. //$CI = $II[0];
  310. $TPL =<<<EFUFU
  311. {
  312. xtype: 'form',
  313. labelAlign: 'right',
  314. autoScroll: 'auto',
  315. labelWidth: 120,
  316. items:[{
  317. border: false,
  318. frame: false,
  319. xtype: 'panel',
  320. 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>'
  321. },{
  322. xtype: 'spacer',
  323. height: 5
  324. },{
  325. border: false,
  326. frame: false,
  327. xtype: 'panel',
  328. html: '<table width="100%" border=0 class="setEd_infoPanel" id="EVE"><tr><td valign="middle">%%%LOINFO%%%</td></tr></table>'
  329. },{
  330. xtype: 'spacer',
  331. height: 5
  332. },{
  333. xtype: 'combo',
  334. fieldLabel: 'Module Status',
  335. id: 'mod_ena',
  336. lazyRender:true,
  337. mode: 'local',
  338. forceSelection: true,
  339. triggerAction: 'all',
  340. editable: false,
  341. disableKeyFilter: true,
  342. store: new Ext.data.ArrayStore({
  343. fields: ['status_val','status_txt'],
  344. data: [[0,'Disabled'],[1,'Enabled']]
  345. }),
  346. value: %%%ENA_VAL%%%,
  347. valueField: 'status_val',
  348. displayField: 'status_txt',
  349. listeners:{
  350. select: function( t, r, i ){
  351. if( r.data.status_val ) enableModule({$EID}); else disableModule({$EID});
  352. }
  353. }
  354. },{
  355. xtype: 'spacer',
  356. height: 5
  357. },{
  358. xtype: 'button',
  359. id: 'mo_edit_btn',
  360. disabled: false,
  361. width: '100%',
  362. text: 'Edit Module Config',
  363. handler: function(){
  364. showModuleSettingsEditor({$EID});
  365. }
  366. },{
  367. xtype: 'spacer',
  368. height: 5
  369. },{
  370. xtype: 'button',
  371. id: 'mo_del_btn',
  372. disabled: false,
  373. width: '100%',
  374. text: 'Remove Module',
  375. handler: function(){
  376. removeModule({$EID});
  377. }
  378. }]
  379. }
  380. EFUFU;
  381. $TPL = str_ireplace( '%%%NAME%%%',$Labels->GetLabel('_EVE_DESC_SHO_') , $TPL );
  382. $TPL = str_ireplace( '%%%INFO%%%', $Labels->GetLabel('_EVE_DESC_LOO_'), $TPL );
  383. $TPL = str_ireplace( '%%%LOINFO%%%','' , $TPL );
  384. $TPL = str_ireplace( '%%%ENA_VAL%%%',$CR['enabled'], $TPL );
  385. echo $TPL;
  386. break;
  387. case 9: //Modem
  388. $R_nfo = '';
  389. $TPL =<<<EFUFU
  390. {
  391. xtype: 'form',
  392. labelAlign: 'right',
  393. autoScroll: 'auto',
  394. labelWidth: 120,
  395. items:[{
  396. border: false,
  397. frame: false,
  398. xtype: 'panel',
  399. html: '<table width="100%" border=0 class="setEd_infoPanel" id="MODEM"><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>'
  400. },{
  401. xtype: 'spacer',
  402. height: 5
  403. },{
  404. border: false,
  405. frame: false,
  406. xtype: 'panel',
  407. html: '<table width="100%" border=0 class="setEd_infoPanel" id="MODEM"><tr><td valign="middle">%%%LOINFO%%%</td></tr></table>'
  408. },{
  409. xtype: 'spacer',
  410. height: 5
  411. },{
  412. xtype: 'combo',
  413. fieldLabel: 'Module Status',
  414. id: 'mod_ena',
  415. lazyRender:true,
  416. mode: 'local',
  417. forceSelection: true,
  418. triggerAction: 'all',
  419. editable: false,
  420. disableKeyFilter: true,
  421. store: new Ext.data.ArrayStore({
  422. fields: ['status_val','status_txt'],
  423. data: [[0,'Disabled'],[1,'Enabled']]
  424. }),
  425. value: %%%ENA_VAL%%%,
  426. valueField: 'status_val',
  427. displayField: 'status_txt',
  428. listeners:{
  429. select: function( t, r, i ){
  430. if( r.data.status_val ) enableModule({$EID}); else disableModule({$EID});
  431. }
  432. }
  433. },{
  434. xtype: 'spacer',
  435. height: 5
  436. },{
  437. xtype: 'button',
  438. id: 'mo_edit_btn',
  439. disabled: false,
  440. width: '100%',
  441. text: 'Edit Module Config',
  442. handler: function(){
  443. showModuleSettingsEditor({$EID});
  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('_MODEM_DESC_SHO_'), $TPL );
  461. $TPL = str_ireplace( '%%%INFO%%%', $Labels->GetLabel('_MODEM_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. case 12: //Bosch VMS Proxy
  467. $R_nfo = '';
  468. $TPL =<<<EFUFU
  469. {
  470. xtype: 'form',
  471. labelAlign: 'right',
  472. autoScroll: 'auto',
  473. labelWidth: 120,
  474. items:[{
  475. border: false,
  476. frame: false,
  477. xtype: 'panel',
  478. html: '<table width="100%" border=0 class="setEd_infoPanel" id="BOSCH"><tr><td width="65px"><img width="64px" src="/style/assets/bosch.png"></td><td valign="middle">%%%NAME%%%</td></tr><tr><td colspan=2>%%%INFO%%%</td></tr></table>'
  479. },{
  480. xtype: 'spacer',
  481. height: 5
  482. },{
  483. border: false,
  484. frame: false,
  485. xtype: 'panel',
  486. html: '<table width="100%" border=0 class="setEd_infoPanel" id="BOSCH"><tr><td valign="middle">%%%LOINFO%%%</td></tr></table>'
  487. },{
  488. xtype: 'spacer',
  489. height: 5
  490. },{
  491. xtype: 'combo',
  492. fieldLabel: 'Module Status',
  493. id: 'mod_ena',
  494. lazyRender:true,
  495. mode: 'local',
  496. forceSelection: true,
  497. triggerAction: 'all',
  498. editable: false,
  499. disableKeyFilter: true,
  500. store: new Ext.data.ArrayStore({
  501. fields: ['status_val','status_txt'],
  502. data: [[0,'Disabled'],[1,'Enabled']]
  503. }),
  504. value: %%%ENA_VAL%%%,
  505. valueField: 'status_val',
  506. displayField: 'status_txt',
  507. listeners:{
  508. select: function( t, r, i ){
  509. if( r.data.status_val ) enableModule({$EID}); else disableModule({$EID});
  510. }
  511. }
  512. },{
  513. xtype: 'spacer',
  514. height: 5
  515. },{
  516. xtype: 'button',
  517. id: 'mo_edit_btn',
  518. disabled: false,
  519. width: '100%',
  520. text: 'Edit Module Config',
  521. handler: function(){
  522. showModuleSettingsEditor({$EID});
  523. }
  524. },{
  525. xtype: 'spacer',
  526. height: 5
  527. },{
  528. xtype: 'button',
  529. id: 'mo_del_btn',
  530. disabled: false,
  531. width: '100%',
  532. text: 'Remove Module',
  533. handler: function(){
  534. removeModule({$EID});
  535. }
  536. }]
  537. }
  538. EFUFU;
  539. $TPL = str_ireplace( '%%%NAME%%%',$Labels->GetLabel('_BVMS_DESC_SHO_'), $TPL );
  540. $TPL = str_ireplace( '%%%INFO%%%', $Labels->GetLabel('_BVMS_DESC_LOO_'), $TPL );
  541. $TPL = str_ireplace( '%%%LOINFO%%%',$R_nfo , $TPL );
  542. $TPL = str_ireplace( '%%%ENA_VAL%%%',$CR['enabled'], $TPL );
  543. echo $TPL;
  544. break;
  545. };
  546. } else {
  547. echo '{ xtype: \'panel\', html: \'Node '.$_POST['NODE'].' Loadded\'}';
  548. };
  549. } else {
  550. header('location: /');
  551. };
  552. ?>