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.

574 lines
14 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. //<?php require_once('../../js_asm.php'); ?>
  2. var addMediaServerDialog = null;
  3. function addMediaServer(){
  4. if( addMediaServerDialog == null ){
  5. addMediaServerDialog = new Ext.Window({
  6. modal: true,
  7. title: '<?=$Labels->GetLabel("_ADD_MEDIA_SERVER_");?>',
  8. width: 800,
  9. height: 600,
  10. layout: 'fit',
  11. closeAction: 'hide',
  12. items:{
  13. xtype: 'panel',
  14. html: 'KOKO'
  15. },bbar: [{
  16. text: '<?=$Labels->GetLabel("_CANCEL_");?>',
  17. handler: function(){
  18. addMediaServerDialog.hide();
  19. }
  20. },{
  21. id: 'con_to_src',
  22. text: '<?=$Labels->GetLabel("_ADD_");?>',
  23. disabled: false,
  24. handler: connectToSeleced
  25. }]
  26. });
  27. };
  28. addMediaServerDialog.show();
  29. };
  30. var embedVideoEncoderId = 0;
  31. function updateFramePreview(){
  32. var canvas = document.getElementById("eve_frame_preview");
  33. if( canvas != null ){
  34. var ctx = canvas.getContext("2d");
  35. ctx.beginPath();
  36. ctx.fillStyle = "#eeeeee";
  37. ctx.rect( 0, 0, 760, 400 );
  38. ctx.fill();
  39. ctx.closePath();
  40. var f_w = 320;
  41. var f_h = 240;
  42. var f_p = 0;
  43. var fsid = Ext.getCmp('FRM_SIZE').getValue();
  44. switch( fsid ){
  45. case 1: f_w = 640; f_h = 480; f_p = 0; break;
  46. case 2: f_w = 800; f_h = 600; f_p = 0; break;
  47. case 3: f_w = 1280; f_h = 720; f_p = 1; break;
  48. case 4: f_w = 1024; f_h = 768; f_p = 0; break;
  49. case 5: f_w = 1920; f_h = 1080; f_p = 1; break;
  50. };
  51. ctx.beginPath();
  52. ctx.fillStyle = "#000000";
  53. ctx.font = "20px Arial";
  54. ctx.textAlign = "center";
  55. ctx.textBaseline = "middle";
  56. ctx.fillText( f_w+'x'+f_h, 380, 10 );
  57. ctx.fill();
  58. ctx.fillStyle = "#0000FF";
  59. if( f_p ){
  60. var t_w = 16 * ( 360 / 9 );
  61. ctx.rect( (760-t_w)/2, 20, t_w, 360 );
  62. } else {
  63. var t_w = 4 * ( 360 / 3 );
  64. ctx.rect( (760-t_w)/2, 20, t_w, 360 );
  65. };
  66. ctx.fill();
  67. ctx.closePath();
  68. if( Ext.getCmp('eve_show_logo').getValue() ){
  69. var image = document.getElementById('eve_logo_img');
  70. if( image.complete && image.naturalHeight !== 0 ){
  71. var i_w = Ext.getCmp('LOGO_WIDTH').getValue();
  72. var i_h = Ext.getCmp('LOGO_HEIGHT').getValue();
  73. ctx.drawImage( image, 120, 120, i_w, i_h );
  74. };
  75. };
  76. };
  77. };
  78. async function uploadFile() {
  79. let formData = new FormData();
  80. formData.append("file", fileupload.files[0]);
  81. await fetch( '/upload.php', {
  82. method: "POST",
  83. body: formData
  84. });
  85. alert('The file has been uploaded successfully.');
  86. }
  87. function uploadEveLogo(){
  88. if( embedVideoEncoderId > -1 ){
  89. var llMask = new Ext.LoadMask( Ext.getCmp('eve_logo_ph').getEl(), {msg:"Please wait..."});
  90. llMask.show();
  91. var formData = new FormData();
  92. var img_upload = document.getElementById('eve_logo_upload');
  93. formData.append("file", img_upload.files[0]);
  94. formData.append("type", 'eve_logo');
  95. formData.append("id", embedVideoEncoderId );
  96. $.ajax({
  97. type: 'POST',
  98. url: '/lib/controller/uploadAsset.php',
  99. data: formData,
  100. cache: false,
  101. contentType: false,
  102. processData: false,
  103. success: function( data ){
  104. llMask.hide();
  105. console.log("success");
  106. console.log( data );
  107. },
  108. error: function( data ){
  109. llMask.hide();
  110. console.log("error");
  111. console.log(data);
  112. }
  113. });
  114. /*
  115. Ext.Ajax.request({
  116. url: SITE_URL+'upload/',
  117. headers: {'Content-type':'multipart/form-data'},
  118. form: filefield.up('form').getForm(),
  119. isUpload: true,
  120. success: function(response, options) { console.log(arguments); },
  121. failure: function(response, options) { console.log(arguments); }
  122. });
  123. */
  124. };
  125. };
  126. var moduleSettingsEditorWindow = null;
  127. function showModuleSettingsEditor( ModuleID ){
  128. if( moduleSettingsEditorWindow == null ){
  129. moduleSettingsEditorWindow = new Ext.Window({
  130. modal: true,
  131. id: 'mo_se_ed_wi',
  132. title: '',
  133. width: 792,
  134. height: 700,
  135. layout: 'fit',
  136. closeAction: 'hide',
  137. resizable: false,
  138. items:[],
  139. buttons: [{
  140. text: '<?=$Labels->GetLabel("_CANCEL_");?>',
  141. handler: function(){
  142. moduleSettingsEditorWindow.hide();
  143. }
  144. },{
  145. id: 'con_to_src',
  146. text: '<?=$Labels->GetLabel("_OK_");?>',
  147. disabled: false,
  148. handler: function(){
  149. Ext.getCmp('mod_set_content').saveSettings();
  150. }
  151. }]
  152. });
  153. };
  154. moduleSettingsEditorWindow.show();
  155. Ext.Ajax.request({
  156. url: '/lib/controller/getModuleSettings.php',
  157. params: {
  158. MID: ModuleID,
  159. UID: <?=$UserID;?>,
  160. SID: '<?=$Session;?>',
  161. },
  162. success: function( response, opts ){
  163. var data = Ext.decode( response.responseText );
  164. if( data.status = 'ok' ){
  165. moduleSettingsEditorWindow.setTitle( data.wTitle );
  166. moduleSettingsEditorWindow.removeAll( true );
  167. moduleSettingsEditorWindow.add( data );
  168. moduleSettingsEditorWindow.doLayout();
  169. } else {
  170. moduleSettingsEditorWindow.close();
  171. moduleSettingsEditorWindow = null;
  172. Ext.Msg.show({
  173. title:'<?=$Labels->GetLabel("_ERROR_MSG_");?>',
  174. msg: data.msg,
  175. buttons: Ext.Msg.OK,
  176. fn: function(){
  177. //SettingsLidar3D.hide();
  178. },
  179. icon: Ext.MessageBox.ERROR
  180. });
  181. };
  182. },
  183. failure: failureAJAXFunction
  184. });
  185. };
  186. /*
  187. function embedVideoEncoderSettings( ModuleID ){
  188. if( embedVideoEncoderSettingsWindow == null ){
  189. embedVideoEncoderSettingsWindow = new Ext.Window({
  190. modal: true,
  191. title: '<?=$Labels->GetLabel('_EMBED_VIDEO_ENCODER_');?>',
  192. width: 792,
  193. height: 700,
  194. layout: 'fit',
  195. closeAction: 'hide',
  196. resizable: false,
  197. items:[{
  198. layout: 'table',
  199. border: false,
  200. frame: false,
  201. autoScroll: true,
  202. defaults: {
  203. bodyStyle:'padding: 0px',
  204. border: false,
  205. },
  206. layoutConfig: {
  207. columns: 4
  208. },
  209. items:[{
  210. id: 'eve_frm_prev',
  211. html: '<canvas id="eve_frame_preview" width="760" height="400" style="background: #eeeeee; display: block; margin: 0 auto;"></canvas>',
  212. height: 400,
  213. width: 760,
  214. border: true,
  215. colspan: 4
  216. },{
  217. html: '<p><?=$Labels->GetLabel('_OUTPUT_FRAME_SIZE_');?>:</p>'
  218. },{
  219. xtype: 'combo',
  220. id: 'FRM_SIZE',
  221. width: 120,
  222. typeAhead: true,
  223. triggerAction: 'all',
  224. lazyRender:true,
  225. mode: 'local',
  226. store: new Ext.data.ArrayStore({
  227. id: 0,
  228. fields: [ 'szId', 'szText' ],
  229. data: [
  230. [0, '320x240'],
  231. [1, '640x480'],
  232. [2, '800x600'],
  233. [3, '1280x720'],
  234. [4, '1024x768'],
  235. [5, '1920x1080']
  236. ]
  237. }),
  238. valueField: 'szId',
  239. displayField: 'szText',
  240. value: 0,
  241. listeners:{
  242. beforeselect: updateFramePreview,
  243. //blur: updateFramePreview,
  244. change: updateFramePreview
  245. }
  246. },{
  247. html: '<p><?=$Labels->GetLabel('_EVE_COMPRESS_QUA_');?>:</p>'
  248. },{
  249. xtype: 'slider',
  250. id: 'COMP_QUAL',
  251. width: 120,
  252. minValue: 0,
  253. maxValue: 100,
  254. value: 70
  255. },{
  256. html: '<p><?=$Labels->GetLabel('_EVE_SHOW_TS_');?>:</p>'
  257. },{
  258. xtype: 'checkbox',
  259. id: 'eve_show_ts',
  260. value: 0,
  261. handler: updateFramePreview
  262. },{
  263. html: '<p><?=$Labels->GetLabel('_EVE_TS_POSX_');?>:</p>'
  264. },{
  265. xtype: 'slider',
  266. id: 'TS_POSX',
  267. width: 120,
  268. minValue: 0,
  269. maxValue: 100,
  270. value: 1.0
  271. },{
  272. html: '<p><?=$Labels->GetLabel('_EVE_TS_POSY_');?>:</p>'
  273. },{
  274. xtype: 'slider',
  275. id: 'TS_POSY',
  276. width: 120,
  277. minValue: 0,
  278. maxValue: 100,
  279. value: 1.0
  280. },{
  281. html: '<p><?=$Labels->GetLabel('_EVE_TRANSO_TS_');?>:</p>'
  282. },{
  283. xtype: 'checkbox',
  284. id: 'eve_transp_ts',
  285. value: 0
  286. },{
  287. html: '<p><?=$Labels->GetLabel('_EVE_FONT_TS_');?>:</p>'
  288. },{
  289. xtype: 'combo',
  290. id: 'TS_FONT',
  291. width: 120,
  292. typeAhead: true,
  293. triggerAction: 'all',
  294. lazyRender:true,
  295. mode: 'local',
  296. store: new Ext.data.ArrayStore({
  297. id: 0,
  298. fields: [ 'szId', 'szText' ],
  299. data: [
  300. [0, 'SIMPLEX'],
  301. [1, 'PLAIN'],
  302. [2, 'DUPLEX'],
  303. [3, 'COMPLEX'],
  304. [4, 'TRIPLEX'],
  305. [5, 'COMPLEX_SMALL'],
  306. [6, 'SCRIPT_SIMPLEX'],
  307. [7, 'SCRIPT_COMPLEX']
  308. ]
  309. }),
  310. valueField: 'szId',
  311. displayField: 'szText',
  312. value: 0
  313. },{
  314. html: '<p><?=$Labels->GetLabel('_EVE_TS_FSCALE_');?>:</p>'
  315. },{
  316. xtype: 'slider',
  317. id: 'TS_FSCALE',
  318. width: 120,
  319. minValue: 0.0,
  320. maxValue: 4.0,
  321. value: 1.0
  322. },{
  323. html: '<p><?=$Labels->GetLabel('_EVE_TS_FTHICK_');?>:</p>'
  324. },{
  325. xtype: 'slider',
  326. id: 'TS_FTHICK',
  327. width: 120,
  328. minValue: 1,
  329. maxValue: 8.0,
  330. value: 1.0
  331. },{
  332. html: '<p><?=$Labels->GetLabel('_EVE_TS_LINE_T_');?>:</p>'
  333. },{
  334. xtype: 'combo',
  335. id: 'TS_LINET',
  336. width: 120,
  337. typeAhead: true,
  338. triggerAction: 'all',
  339. lazyRender:true,
  340. mode: 'local',
  341. store: new Ext.data.ArrayStore({
  342. id: 0,
  343. fields: [ 'szId', 'szText' ],
  344. data: [
  345. [0, 'THIN'],
  346. [1, 'ANTIALIAZED'],
  347. [2, 'THICK']
  348. ]
  349. }),
  350. valueField: 'szId',
  351. displayField: 'szText',
  352. value: 0
  353. },{
  354. html: '<p><?=$Labels->GetLabel('_EVE_SHOW_LBL_');?>:</p>'
  355. },{
  356. xtype: 'checkbox',
  357. id: 'eve_show_lbl',
  358. value: 0,
  359. handler: updateFramePreview
  360. },{
  361. html: '<p><?=$Labels->GetLabel('_EVE_LBL_POSX_');?>:</p>'
  362. },{
  363. xtype: 'slider',
  364. id: 'LBL_POSX',
  365. width: 120,
  366. minValue: 0,
  367. maxValue: 100,
  368. value: 1.0
  369. },{
  370. html: '<p><?=$Labels->GetLabel('_EVE_LBL_POSY_');?>:</p>'
  371. },{
  372. xtype: 'slider',
  373. id: 'LBL_POSY',
  374. width: 120,
  375. minValue: 0,
  376. maxValue: 100,
  377. value: 1.0
  378. },{
  379. html: '<p><?=$Labels->GetLabel('_EVE_TRANSO_LBL_');?>:</p>'
  380. },{
  381. xtype: 'checkbox',
  382. id: 'eve_transp_lbl',
  383. value: 0
  384. },{
  385. html: '<p><?=$Labels->GetLabel('_EVE_FONT_LBL_');?>:</p>'
  386. },{
  387. xtype: 'combo',
  388. id: 'LBL_FONT',
  389. width: 120,
  390. typeAhead: true,
  391. triggerAction: 'all',
  392. lazyRender:true,
  393. mode: 'local',
  394. store: new Ext.data.ArrayStore({
  395. id: 0,
  396. fields: [ 'szId', 'szText' ],
  397. data: [
  398. [0, 'SIMPLEX'],
  399. [1, 'PLAIN'],
  400. [2, 'DUPLEX'],
  401. [3, 'COMPLEX'],
  402. [4, 'TRIPLEX'],
  403. [5, 'COMPLEX_SMALL'],
  404. [6, 'SCRIPT_SIMPLEX'],
  405. [7, 'SCRIPT_COMPLEX']
  406. ]
  407. }),
  408. valueField: 'szId',
  409. displayField: 'szText',
  410. value: 0
  411. },{
  412. html: '<p><?=$Labels->GetLabel('_EVE_LBL_FSCALE_');?>:</p>'
  413. },{
  414. xtype: 'slider',
  415. id: 'LBL_FSCALE',
  416. width: 120,
  417. minValue: 0.0,
  418. maxValue: 4.0,
  419. value: 1.0
  420. },{
  421. html: '<p><?=$Labels->GetLabel('_EVE_LBL_FTHICK_');?>:</p>'
  422. },{
  423. xtype: 'slider',
  424. id: 'LBL_FTHICK',
  425. width: 120,
  426. minValue: 1,
  427. maxValue: 8.0,
  428. value: 1.0
  429. },{
  430. html: '<p><?=$Labels->GetLabel('_EVE_LBL_LINE_T_');?>:</p>'
  431. },{
  432. xtype: 'combo',
  433. id: 'LBL_LINET',
  434. width: 120,
  435. typeAhead: true,
  436. triggerAction: 'all',
  437. lazyRender:true,
  438. mode: 'local',
  439. store: new Ext.data.ArrayStore({
  440. id: 0,
  441. fields: [ 'szId', 'szText' ],
  442. data: [
  443. [0, 'THIN'],
  444. [1, 'ANTIALIAZED'],
  445. [2, 'THICK']
  446. ]
  447. }),
  448. valueField: 'szId',
  449. displayField: 'szText',
  450. value: 0
  451. },{
  452. html: '<p><?=$Labels->GetLabel('_EVE_SHOW_LOGO_');?>:</p>'
  453. },{
  454. xtype: 'checkbox',
  455. id: 'eve_show_logo',
  456. value: 0,
  457. handler: updateFramePreview
  458. },{
  459. html: '<p><?=$Labels->GetLabel('_EVE_LOGO_POSX_');?>:</p>'
  460. },{
  461. xtype: 'slider',
  462. id: 'LOGO_POSX',
  463. width: 120,
  464. minValue: 0,
  465. maxValue: 100,
  466. value: 1.0
  467. },{
  468. html: '<p><?=$Labels->GetLabel('_EVE_LOGO_POSY_');?>:</p>'
  469. },{
  470. xtype: 'slider',
  471. id: 'LOGO_POSY',
  472. width: 120,
  473. minValue: 0,
  474. maxValue: 100,
  475. value: 1.0
  476. },{
  477. html: '<p><?=$Labels->GetLabel('_EVE_LOGO_WIDTH_');?>:</p>'
  478. },{
  479. xtype: 'numberfield',
  480. id: 'LOGO_WIDTH',
  481. width: 120,
  482. minValue: 0,
  483. maxValue: 256,
  484. value: 1.0
  485. },{
  486. html: '<p><?=$Labels->GetLabel('_EVE_LOGO_HEIGHT_');?>:</p>'
  487. },{
  488. xtype: 'numberfield',
  489. id: 'LOGO_HEIGHT',
  490. width: 120,
  491. minValue: 0,
  492. maxValue: 256,
  493. value: 1.0
  494. },{
  495. id: 'eve_logo_ph',
  496. html: '<center><img width="100px" id="eve_logo_img" src="/lib/controller/data/assets/images/7shields.png"></center>'
  497. },{
  498. html: '<input id="eve_logo_upload" style="width: 120px;" type="file" onchange="uploadEveLogo();"/>'
  499. },{
  500. html: '<p><?=$Labels->GetLabel('_EVE_PORT_');?>:</p>'
  501. },{
  502. xtype: 'numberfield',
  503. id: 'WA_PORT',
  504. width: 120,
  505. minValue: 1000,
  506. maxValue: 65535,
  507. value: 8080
  508. }]
  509. }],
  510. bbar: [{
  511. text: '<?=$Labels->GetLabel("_CANCEL_");?>',
  512. handler: function(){
  513. embedVideoEncoderSettingsWindow.hide();
  514. }
  515. },{
  516. id: 'con_to_src',
  517. text: '<?=$Labels->GetLabel("_OK_");?>',
  518. disabled: false,
  519. handler: function(){
  520. }
  521. }]
  522. });
  523. };
  524. embedVideoEncoderSettingsWindow.show();
  525. updateFramePreview();
  526. /*
  527. Ext.Ajax.request({
  528. url: '/lib/controller/getModuleSettings.php',
  529. params: {
  530. MID: ModuleID,
  531. UID: <?=$UserID;?>,
  532. SID: '<?=$Session;?>',
  533. },
  534. success: function( response, opts ){
  535. var data = Ext.decode( response.responseText );
  536. if( data.error = false ){
  537. embedVideoEncoderSettingsWindow.show();
  538. Ext.getCmp('setting_master_ip').setValue( data.ip_address );
  539. Ext.getCmp('setting_master_port').setValue( data.port );
  540. Ext.getCmp('setting_slave_ip').setValue( data.aux_ip_address );
  541. Ext.getCmp('setting_slave_port').setValue( data.aux_port );
  542. Ext.getCmp('setting_lat').setValue( data.lat );
  543. Ext.getCmp('setting_lon').setValue( data.lon );
  544. Ext.getCmp('setting_alt').setValue( data.alt );
  545. Ext.getCmp('setting_roll').setValue( data.roll );
  546. Ext.getCmp('setting_pitch').setValue( data.pitch );
  547. Ext.getCmp('setting_yaw').setValue( data.yaw );
  548. } else {
  549. Ext.Msg.show({
  550. title:'<?=$Labels->GetLabel("_ERROR_MSG_");?>',
  551. msg: data.error_message,
  552. buttons: Ext.Msg.OK,
  553. fn: function(){
  554. //SettingsLidar3D.hide();
  555. },
  556. icon: Ext.MessageBox.ERROR
  557. });
  558. };
  559. },
  560. failure: failureAJAXFunction
  561. });
  562. * /
  563. };*/