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.
 
 
 
 

511 lines
13 KiB

//<?php require_once('../../js_asm.php'); ?>
var addMediaServerDialog = null;
function addMediaServer(){
if( addMediaServerDialog == null ){
addMediaServerDialog = new Ext.Window({
modal: true,
title: '<?=$Labels->GetLabel("_ADD_MEDIA_SERVER_");?>',
width: 800,
height: 600,
layout: 'fit',
closeAction: 'hide',
items:{
xtype: 'panel',
html: 'KOKO'
},bbar: [{
text: '<?=$Labels->GetLabel("_CANCEL_");?>',
handler: function(){
addMediaServerDialog.hide();
}
},{
id: 'con_to_src',
text: '<?=$Labels->GetLabel("_ADD_");?>',
disabled: false,
handler: connectToSeleced
}]
});
};
addMediaServerDialog.show();
};
var embedVideoEncoderSettingsWindow = null;
var embedVideoEncoderId = 0;
function updateFramePreview(){
var canvas = document.getElementById("eve_frame_preview");
if( canvas != null ){
var ctx = canvas.getContext("2d");
ctx.beginPath();
ctx.fillStyle = "#eeeeee";
ctx.rect( 0, 0, 760, 400 );
ctx.fill();
ctx.closePath();
var f_w = 320;
var f_h = 240;
var f_p = 0;
var fsid = Ext.getCmp('FRM_SIZE').getValue();
switch( fsid ){
case 1: f_w = 640; f_h = 480; f_p = 0; break;
case 2: f_w = 800; f_h = 600; f_p = 0; break;
case 3: f_w = 1280; f_h = 720; f_p = 1; break;
case 4: f_w = 1024; f_h = 768; f_p = 0; break;
case 5: f_w = 1920; f_h = 1080; f_p = 1; break;
};
ctx.beginPath();
ctx.fillStyle = "#000000";
ctx.font = "20px Arial";
ctx.textAlign = "center";
ctx.textBaseline = "middle";
ctx.fillText( f_w+'x'+f_h, 380, 10 );
ctx.fill();
ctx.fillStyle = "#0000FF";
if( f_p ){
var t_w = 16 * ( 360 / 9 );
ctx.rect( (760-t_w)/2, 20, t_w, 360 );
} else {
var t_w = 4 * ( 360 / 3 );
ctx.rect( (760-t_w)/2, 20, t_w, 360 );
};
ctx.fill();
ctx.closePath();
if( Ext.getCmp('eve_show_logo').getValue() ){
var image = document.getElementById('eve_logo_img');
if( image.complete && image.naturalHeight !== 0 ){
var i_w = Ext.getCmp('LOGO_WIDTH').getValue();
var i_h = Ext.getCmp('LOGO_HEIGHT').getValue();
ctx.drawImage( image, 120, 120, i_w, i_h );
};
};
};
};
async function uploadFile() {
let formData = new FormData();
formData.append("file", fileupload.files[0]);
await fetch( '/upload.php', {
method: "POST",
body: formData
});
alert('The file has been uploaded successfully.');
}
function uploadEveLogo(){
if( embedVideoEncoderId > -1 ){
var llMask = new Ext.LoadMask( Ext.getCmp('eve_logo_ph').getEl(), {msg:"Please wait..."});
llMask.show();
var formData = new FormData();
var img_upload = document.getElementById('eve_logo_upload');
formData.append("file", img_upload.files[0]);
formData.append("type", 'eve_logo');
formData.append("id", embedVideoEncoderId );
$.ajax({
type: 'POST',
url: '/lib/controller/uploadAsset.php',
data: formData,
cache: false,
contentType: false,
processData: false,
success: function( data ){
llMask.hide();
console.log("success");
console.log( data );
},
error: function( data ){
llMask.hide();
console.log("error");
console.log(data);
}
});
/*
Ext.Ajax.request({
url: SITE_URL+'upload/',
headers: {'Content-type':'multipart/form-data'},
form: filefield.up('form').getForm(),
isUpload: true,
success: function(response, options) { console.log(arguments); },
failure: function(response, options) { console.log(arguments); }
});
*/
};
};
function embedVideoEncoderSettings( ModuleID ){
if( embedVideoEncoderSettingsWindow == null ){
embedVideoEncoderSettingsWindow = new Ext.Window({
modal: true,
title: '<?=$Labels->GetLabel('_EMBED_VIDEO_ENCODER_');?>',
width: 792,
height: 700,
layout: 'fit',
closeAction: 'hide',
resizable: false,
items:[{
layout: 'table',
border: false,
frame: false,
autoScroll: true,
defaults: {
bodyStyle:'padding: 0px',
border: false,
},
layoutConfig: {
columns: 4
},
items:[{
id: 'eve_frm_prev',
html: '<canvas id="eve_frame_preview" width="760" height="400" style="background: #eeeeee; display: block; margin: 0 auto;"></canvas>',
height: 400,
width: 760,
border: true,
colspan: 4
},{
html: '<p><?=$Labels->GetLabel('_OUTPUT_FRAME_SIZE_');?>:</p>'
},{
xtype: 'combo',
id: 'FRM_SIZE',
width: 120,
typeAhead: true,
triggerAction: 'all',
lazyRender:true,
mode: 'local',
store: new Ext.data.ArrayStore({
id: 0,
fields: [ 'szId', 'szText' ],
data: [
[0, '320x240'],
[1, '640x480'],
[2, '800x600'],
[3, '1280x720'],
[4, '1024x768'],
[5, '1920x1080']
]
}),
valueField: 'szId',
displayField: 'szText',
value: 0,
listeners:{
beforeselect: updateFramePreview,
//blur: updateFramePreview,
change: updateFramePreview
}
},{
html: '<p><?=$Labels->GetLabel('_EVE_COMPRESS_QUA_');?>:</p>'
},{
xtype: 'slider',
id: 'COMP_QUAL',
width: 120,
minValue: 0,
maxValue: 100,
value: 70
},{
html: '<p><?=$Labels->GetLabel('_EVE_SHOW_TS_');?>:</p>'
},{
xtype: 'checkbox',
id: 'eve_show_ts',
value: 0,
handler: updateFramePreview
},{
html: '<p><?=$Labels->GetLabel('_EVE_TS_POSX_');?>:</p>'
},{
xtype: 'slider',
id: 'TS_POSX',
width: 120,
minValue: 0,
maxValue: 100,
value: 1.0
},{
html: '<p><?=$Labels->GetLabel('_EVE_TS_POSY_');?>:</p>'
},{
xtype: 'slider',
id: 'TS_POSY',
width: 120,
minValue: 0,
maxValue: 100,
value: 1.0
},{
html: '<p><?=$Labels->GetLabel('_EVE_TRANSO_TS_');?>:</p>'
},{
xtype: 'checkbox',
id: 'eve_transp_ts',
value: 0
},{
html: '<p><?=$Labels->GetLabel('_EVE_FONT_TS_');?>:</p>'
},{
xtype: 'combo',
id: 'TS_FONT',
width: 120,
typeAhead: true,
triggerAction: 'all',
lazyRender:true,
mode: 'local',
store: new Ext.data.ArrayStore({
id: 0,
fields: [ 'szId', 'szText' ],
data: [
[0, 'SIMPLEX'],
[1, 'PLAIN'],
[2, 'DUPLEX'],
[3, 'COMPLEX'],
[4, 'TRIPLEX'],
[5, 'COMPLEX_SMALL'],
[6, 'SCRIPT_SIMPLEX'],
[7, 'SCRIPT_COMPLEX']
]
}),
valueField: 'szId',
displayField: 'szText',
value: 0
},{
html: '<p><?=$Labels->GetLabel('_EVE_TS_FSCALE_');?>:</p>'
},{
xtype: 'slider',
id: 'TS_FSCALE',
width: 120,
minValue: 0.0,
maxValue: 4.0,
value: 1.0
},{
html: '<p><?=$Labels->GetLabel('_EVE_TS_FTHICK_');?>:</p>'
},{
xtype: 'slider',
id: 'TS_FTHICK',
width: 120,
minValue: 1,
maxValue: 8.0,
value: 1.0
},{
html: '<p><?=$Labels->GetLabel('_EVE_TS_LINE_T_');?>:</p>'
},{
xtype: 'combo',
id: 'TS_LINET',
width: 120,
typeAhead: true,
triggerAction: 'all',
lazyRender:true,
mode: 'local',
store: new Ext.data.ArrayStore({
id: 0,
fields: [ 'szId', 'szText' ],
data: [
[0, 'THIN'],
[1, 'ANTIALIAZED'],
[2, 'THICK']
]
}),
valueField: 'szId',
displayField: 'szText',
value: 0
},{
html: '<p><?=$Labels->GetLabel('_EVE_SHOW_LBL_');?>:</p>'
},{
xtype: 'checkbox',
id: 'eve_show_lbl',
value: 0,
handler: updateFramePreview
},{
html: '<p><?=$Labels->GetLabel('_EVE_LBL_POSX_');?>:</p>'
},{
xtype: 'slider',
id: 'LBL_POSX',
width: 120,
minValue: 0,
maxValue: 100,
value: 1.0
},{
html: '<p><?=$Labels->GetLabel('_EVE_LBL_POSY_');?>:</p>'
},{
xtype: 'slider',
id: 'LBL_POSY',
width: 120,
minValue: 0,
maxValue: 100,
value: 1.0
},{
html: '<p><?=$Labels->GetLabel('_EVE_TRANSO_LBL_');?>:</p>'
},{
xtype: 'checkbox',
id: 'eve_transp_lbl',
value: 0
},{
html: '<p><?=$Labels->GetLabel('_EVE_FONT_LBL_');?>:</p>'
},{
xtype: 'combo',
id: 'LBL_FONT',
width: 120,
typeAhead: true,
triggerAction: 'all',
lazyRender:true,
mode: 'local',
store: new Ext.data.ArrayStore({
id: 0,
fields: [ 'szId', 'szText' ],
data: [
[0, 'SIMPLEX'],
[1, 'PLAIN'],
[2, 'DUPLEX'],
[3, 'COMPLEX'],
[4, 'TRIPLEX'],
[5, 'COMPLEX_SMALL'],
[6, 'SCRIPT_SIMPLEX'],
[7, 'SCRIPT_COMPLEX']
]
}),
valueField: 'szId',
displayField: 'szText',
value: 0
},{
html: '<p><?=$Labels->GetLabel('_EVE_LBL_FSCALE_');?>:</p>'
},{
xtype: 'slider',
id: 'LBL_FSCALE',
width: 120,
minValue: 0.0,
maxValue: 4.0,
value: 1.0
},{
html: '<p><?=$Labels->GetLabel('_EVE_LBL_FTHICK_');?>:</p>'
},{
xtype: 'slider',
id: 'LBL_FTHICK',
width: 120,
minValue: 1,
maxValue: 8.0,
value: 1.0
},{
html: '<p><?=$Labels->GetLabel('_EVE_LBL_LINE_T_');?>:</p>'
},{
xtype: 'combo',
id: 'LBL_LINET',
width: 120,
typeAhead: true,
triggerAction: 'all',
lazyRender:true,
mode: 'local',
store: new Ext.data.ArrayStore({
id: 0,
fields: [ 'szId', 'szText' ],
data: [
[0, 'THIN'],
[1, 'ANTIALIAZED'],
[2, 'THICK']
]
}),
valueField: 'szId',
displayField: 'szText',
value: 0
},{
html: '<p><?=$Labels->GetLabel('_EVE_SHOW_LOGO_');?>:</p>'
},{
xtype: 'checkbox',
id: 'eve_show_logo',
value: 0,
handler: updateFramePreview
},{
html: '<p><?=$Labels->GetLabel('_EVE_LOGO_POSX_');?>:</p>'
},{
xtype: 'slider',
id: 'LOGO_POSX',
width: 120,
minValue: 0,
maxValue: 100,
value: 1.0
},{
html: '<p><?=$Labels->GetLabel('_EVE_LOGO_POSY_');?>:</p>'
},{
xtype: 'slider',
id: 'LOGO_POSY',
width: 120,
minValue: 0,
maxValue: 100,
value: 1.0
},{
html: '<p><?=$Labels->GetLabel('_EVE_LOGO_WIDTH_');?>:</p>'
},{
xtype: 'numberfield',
id: 'LOGO_WIDTH',
width: 120,
minValue: 0,
maxValue: 256,
value: 1.0
},{
html: '<p><?=$Labels->GetLabel('_EVE_LOGO_HEIGHT_');?>:</p>'
},{
xtype: 'numberfield',
id: 'LOGO_HEIGHT',
width: 120,
minValue: 0,
maxValue: 256,
value: 1.0
},{
id: 'eve_logo_ph',
html: '<center><img width="100px" id="eve_logo_img" src="/lib/controller/data/assets/images/7shields.png"></center>'
},{
html: '<input id="eve_logo_upload" style="width: 120px;" type="file" onchange="uploadEveLogo();"/>'
},{
html: '<p><?=$Labels->GetLabel('_EVE_PORT_');?>:</p>'
},{
xtype: 'numberfield',
id: 'WA_PORT',
width: 120,
minValue: 1000,
maxValue: 65535,
value: 8080
}]
}],
bbar: [{
text: '<?=$Labels->GetLabel("_CANCEL_");?>',
handler: function(){
embedVideoEncoderSettingsWindow.hide();
}
},{
id: 'con_to_src',
text: '<?=$Labels->GetLabel("_OK_");?>',
disabled: false,
handler: function(){
}
}]
});
};
embedVideoEncoderSettingsWindow.show();
updateFramePreview();
/*
Ext.Ajax.request({
url: '/lib/controller/getModuleSettings.php',
params: {
MID: ModuleID,
UID: <?=$UserID;?>,
SID: '<?=$Session;?>',
},
success: function( response, opts ){
var data = Ext.decode( response.responseText );
if( data.error = false ){
embedVideoEncoderSettingsWindow.show();
Ext.getCmp('setting_master_ip').setValue( data.ip_address );
Ext.getCmp('setting_master_port').setValue( data.port );
Ext.getCmp('setting_slave_ip').setValue( data.aux_ip_address );
Ext.getCmp('setting_slave_port').setValue( data.aux_port );
Ext.getCmp('setting_lat').setValue( data.lat );
Ext.getCmp('setting_lon').setValue( data.lon );
Ext.getCmp('setting_alt').setValue( data.alt );
Ext.getCmp('setting_roll').setValue( data.roll );
Ext.getCmp('setting_pitch').setValue( data.pitch );
Ext.getCmp('setting_yaw').setValue( data.yaw );
} else {
Ext.Msg.show({
title:'<?=$Labels->GetLabel("_ERROR_MSG_");?>',
msg: data.error_message,
buttons: Ext.Msg.OK,
fn: function(){
//SettingsLidar3D.hide();
},
icon: Ext.MessageBox.ERROR
});
};
},
failure: failureAJAXFunction
});
*/
};