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.

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