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.
 
 
 
 

1045 lines
27 KiB

<?php
require_once('../ajax_asm.php');
if( $CUser->Data['id'] > 1 ){
$EID = intval( $_POST['MID'] );
$QS = "SELECT * FROM modules WHERE id = {$EID}";
$Result = $DATABASE->Query( $QS, false );
if( count( $Result ) ){
$CR = $Result[0];
switch( $CR['type'] ){
case 1: //DCB USB
break;
case 2: //Kafka
$QS="SELECT * FROM `modules_kafka` WHERE `module_id`={$CR['aux_id']}";
$II = $DATABASE->Query( $QS );
$CI = $II[0];
$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">');
$USSL = (intval($CI['use_ssl'])>0)?'true':'false';
$TPL =<<<EFUFU
{
xtype: 'tabpanel',
activeTab: 0,
id: 'mod_set_content',
saveSettings: function(){
var adr = Ext.getCmp('b_address').getValue();
var port = Ext.getCmp('b_port').getValue();
var ussl = Ext.getCmp('b_ssl').getValue();
var uan = Ext.getCmp('b_user').getValue();
var uap = Ext.getCmp('b_password').getValue();
Ext.Ajax.request({
url: '/lib/controller/updateServerModuleSettings.php',
params: {
MID: {$EID},
UID: {$UserID},
SID: '{$Session}',
ADDR: adr,
PORT: port,
SSL: ussl,
UNAM: uan,
UPWD: uap
},
success: function( response, opts ){
var data = Ext.decode(response.responseText);
if( data.success == true ) {
moduleSettingsEditorWindow.hide();
showSettings( SelectedNodeID, 2 );
} else {
Ext.Msg.show({
title:'{$Labels->GetLabel("_ERROR_MSG_")}',
msg: data['msg'],
buttons: Ext.Msg.OK,
fn: function(){
SettingsLidar3D.hide();
},
icon: Ext.MessageBox.ERROR
});
};
},
failure: failureAJAXFunction
});
},
items:[{
xtype: 'form',
id: 'ks_fp_ms',
title: '{$Labels->GetLabel('_KAFKA_BROKER_')}',
labelWidth: 480,
labelAlign: 'right',
border: false,
frame: false,
items:[{
xtype: 'spacer',
height: 10
},{
xtype: 'textfield',
id: 'b_address',
fieldLabel: 'Broker Address',
value: '{$CI['brocker_address']}'
},{
xtype: 'numberfield',
id: 'b_port',
fieldLabel: 'Broker Port',
value: {$CI['brocker_port']}
},{
xtype: 'checkbox',
id: 'b_ssl',
fieldLabel: 'Use SSL',
checked: {$USSL}
},{
xtype: 'button',
id: 'cl_cert_select',
fieldLabel: 'CA Root certificate to verify the broker\'s certificate [truststore]',
text: 'Upload New',
handler: function(){
currentSelectedFile = 1;
}
},{
xtype: 'button',
id: 'ca_cert_select',
fieldLabel: 'Client\'s certificate [keystore]',
text: 'Upload New',
handler: function(){
currentSelectedFile = 1;
}
},{
xtype: 'button',
id: 'cl_key_select',
fieldLabel: 'Client\'s key [key]',
text: 'Upload New',
handler: function(){
currentSelectedFile = 1;
}
},{
xtype: 'textfield',
fieldLabel: 'Access Username',
id: 'b_user',
value: '{$CI['cred_username']}'
},{
xtype: 'textfield',
fieldLabel: 'Access Password',
id: 'b_password',
value: '{$CI['cred_password']}'
},{
xtype: 'panel',
id: 'validator',
html: '<p>%%%VALIDATION%%%</p>'
}]
},{
title: '{$Labels->GetLabel('_KAFKA_TOP_EVTS_')}',
html: ''
}],
listeners:{
afterrender: function(){
var currentSelectedFile = 0;
var up_ca = new plupload.Uploader({
runtimes : 'html5,html4',
browse_button : Ext.getDom('ca_cert_select'),
max_file_size : '256kb',
chunk_size: '10kb',
max_retries: 0,
multi_selection: false,
max_file_count: 1,
url: '/lib/controller/uploadModuleKafkaData.php',
filters : [
{title : "Certificate files", extensions : "pem,crt,cert,jks"}
],
init: {
PostInit: function() {
},
FilesAdded: function( up, files ) {
up_ca.start();
},
UploadProgress: function(up, file) {
if( file.percent == 100 ){
alert('Umpalumpa');
};
},
Error: function(up, err) {
Ext.Msg.show({
title:'Upload Status',
msg: "Error #" + err.code + ": " + err.message,
buttons: Ext.Msg.OK,
icon: Ext.MessageBox.ERROR
});
}
}
});
var up_crt = new plupload.Uploader({
runtimes : 'html5,html4',
browse_button : Ext.getDom('cl_cert_select'),
max_file_size : '256kb',
chunk_size: '10kb',
max_retries: 0,
multi_selection: false,
max_file_count: 1,
url: '/lib/controller/uploadModuleKafkaData.php',
filters : [
{title : "Certificate files", extensions : "pem,crt,cert,jks"}
],
init: {
PostInit: function() {
},
FilesAdded: function( up, files ) {
up_crt.start();
},
UploadProgress: function(up, file) {
if( file.percent == 100 ){
alert('Umpalumpa');
};
},
Error: function(up, err) {
Ext.Msg.show({
title:'Upload Status',
msg: "Error #" + err.code + ": " + err.message,
buttons: Ext.Msg.OK,
icon: Ext.MessageBox.ERROR
});
}
}
});
var up_key = new plupload.Uploader({
runtimes : 'html5,html4',
browse_button : Ext.getDom('cl_key_select'),
max_file_size : '256kb',
chunk_size: '10kb',
max_retries: 0,
multi_selection: false,
max_file_count: 1,
url: '/lib/controller/uploadModuleKafkaData.php',
filters : [
{title : "Certificate files", extensions : "pem,crt,cert,jks"}
],
init: {
PostInit: function() {
},
FilesAdded: function( up, files ) {
up_key.start();
},
UploadProgress: function(up, file) {
if( file.percent == 100 ){
alert('Umpalumpa');
};
},
Error: function(up, err) {
Ext.Msg.show({
title:'Upload Status',
msg: "Error #" + err.code + ": " + err.message,
buttons: Ext.Msg.OK,
icon: Ext.MessageBox.ERROR
});
}
}
});
up_ca.init();
up_crt.init();
up_key.init();
}
},
status: 'ok',
wTitle: '{$Labels->GetLabel('_KAFKA_DESC_SHO_')}'
}
EFUFU;
function CTS2UTS( $KAKA ){
$parsed = date_parse_from_format( "M d H:i:s Y T", $KAKA );
return mktime(
$parsed['hour'],
$parsed['minute'],
$parsed['second'],
$parsed['month'],
$parsed['day'],
$parsed['year']
);
};
// Validate
$BPath = './data/modules/VAULT/'.$CI['vault_md5'].'/';
$CAValid = false;
$PUValid = false;
$PRValid = false;
$PUMD5 = false;
$PRMD5 = false;
$ValidationOutput = "<div class=\"yellow-tag\">Vault ID: {$CI['vault_md5']}</div>";
if( file_exists( $BPath.$CI['vault_md5'].'.CA.pem' ) ){
$CMD = "openssl x509 -in {$BPath}{$CI['vault_md5']}.CA.pem -passin pass:{$CI['cred_password']} -noout -text 2>&1";
$ININ = `$CMD`;
$TArr = explode( "\n", $ININ );
$CAValid = true;
foreach( $TArr as $T ){
$CL = trim( $T );
if( stripos( $CL, 'Not Before' ) !== false ){
if( time() < CTS2UTS( trim( substr( $CL, 11 ) ) ) ) $CAValid = false;
};
if( stripos( $CL, 'Not After' ) !== false ){
if( time() > CTS2UTS( trim( substr( $CL, 11 ) ) ) ) $CAValid = false;
};
if( stripos( $CL, 'CA:FALSE' ) !== false ) $CAValid = false;
};
if( $CAValid ){
$ValidationOutput .= "<div class=\"green-tag\">Root CA Certificate is Valid</div>";
} else {
$ValidationOutput .= "<div class=\"red-tag\">Root CA Certificate is Invalid!</div>";
};
} else {
$ValidationOutput .= "<div class=\"yellow-tag\">Root CA Certificate is not present!<br/>[it\'s OK if the system uses Real Certs(not Self Signed)]</div>";
};
if( file_exists( $BPath.$CI['vault_md5'].'.key' ) ){
$CMD = "openssl rsa -check -noout -in {$BPath}{$CI['vault_md5']}.key -passin pass:{$CI['cred_password']} 2>&1";
$ChKey = trim( `$CMD` );
if( stripos( $ChKey, 'RSA key ok' ) !== false ){
$CMD = "openssl rsa -modulus -noout -in {$BPath}{$CI['vault_md5']}.key -passin pass:{$CI['cred_password']}";
$PRMD5 = md5( trim( `$CMD` ) );
$PRValid = true;
};
} else {
$ValidationOutput .= "<div class=\"red-tag\">No Private Key is Set!</div>";
};
if( file_exists( $BPath.$CI['vault_md5'].'.CERT.pem' ) ){
$CMD = "openssl x509 -modulus -noout -in {$BPath}{$CI['vault_md5']}.CERT.pem -passin pass:{$CI['cred_password']} 2>&1";
$ChKey = trim( `$CMD` );
if( stripos( $ChKey, 'RSA key ok' ) === false ){
$CMD = "openssl x509 -modulus -noout -in {$BPath}{$CI['vault_md5']}.CERT.pem -passin pass:{$CI['cred_password']}";
$PUMD5 = md5( trim( `$CMD` ) );
$PUValid = true;
};
} else {
$ValidationOutput .= "<div class=\"red-tag\">No Public Key Certificate is Set!</div>";
};
if( $PRValid && $PUValid ){
if( $PUMD5 == $PRMD5 ){
$ValidationOutput .= "<div class=\"green-tag\">Public Key Certificate is Matched With Private Key</div>";
} else {
$ValidationOutput .= "<div class=\"red-tag\">Public Key Certificate is Not Matched With Private Key!<br/>{$PUMD5}::{$PRMD5}</div>";
};
} else {
$ValidationOutput .= "<div class=\"yellow-tag\">Private/Public Key Can not be checked!</div>";
};
$TPL = str_replace( '%%%VALIDATION%%%', $ValidationOutput, $TPL );
echo $TPL;
break;
case 6: // SSDP
$TPL =<<<EFUFU
{
xtype: 'form',
labelAlign: 'right',
autoScroll: 'auto',
labelWidth: 120,
items:[{
border: false,
frame: false,
xtype: 'panel',
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>'
},{
xtype: 'spacer',
height: 5
},{
border: false,
frame: false,
xtype: 'panel',
html: '<table width="100%" border=0 class="setEd_infoPanel" id="SSDP"><tr><td valign="middle">%%%LOINFO%%%</td></tr></table>'
},{
xtype: 'spacer',
height: 5
},{
xtype: 'combo',
fieldLabel: 'Module Status',
id: 'mod_ena',
lazyRender:true,
mode: 'local',
forceSelection: true,
triggerAction: 'all',
editable: false,
disableKeyFilter: true,
store: new Ext.data.ArrayStore({
fields: ['status_val','status_txt'],
data: [[0,'Disabled'],[1,'Enabled']]
}),
value: %%%ENA_VAL%%%,
valueField: 'status_val',
displayField: 'status_txt',
listeners:{
select: function( t, r, i ){
if( r.data.status_val ) enableModule({$EID}); else disableModule({$EID});
}
}
},{
xtype: 'spacer',
height: 5
},{
xtype: 'button',
id: 'mo_del_btn',
disabled: false,
width: '100%',
text: 'Remove Module',
handler: function(){
removeModule({$EID});
}
}]
}
EFUFU;
$TPL = str_ireplace( '%%%NAME%%%',$Labels->GetLabel('_SSDP_DESC_SHO_') , $TPL );
$TPL = str_ireplace( '%%%INFO%%%', $Labels->GetLabel('_SSDP_DESC_LOO_'), $TPL );
$TPL = str_ireplace( '%%%LOINFO%%%',$Labels->GetLabel('_MOD_NO_NEDCONF_'), $TPL );
$TPL = str_ireplace( '%%%ENA_VAL%%%',$CR['enabled'], $TPL );
echo $TPL;
break;
case 7: // Onvif
$TPL =<<<EFUFU
{
xtype: 'form',
labelAlign: 'right',
autoScroll: 'auto',
labelWidth: 120,
items:[{
border: false,
frame: false,
xtype: 'panel',
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>'
},{
xtype: 'spacer',
height: 5
},{
border: false,
frame: false,
xtype: 'panel',
html: '<table width="100%" border=0 class="setEd_infoPanel" id="ONVIF"><tr><td valign="middle">%%%LOINFO%%%</td></tr></table>'
},{
xtype: 'spacer',
height: 5
},{
xtype: 'combo',
fieldLabel: 'Module Status',
id: 'mod_ena',
lazyRender:true,
mode: 'local',
forceSelection: true,
triggerAction: 'all',
editable: false,
disableKeyFilter: true,
store: {
xtype: 'arraystore',
fields: ['status_val','status_txt'],
data: [[0,'Disabled'],[1,'Enabled']]
},
value: %%%ENA_VAL%%%,
valueField: 'status_val',
displayField: 'status_txt',
listeners:{
select: function( t, r, i ){
if( r.data.status_val ) enableModule({$EID}); else disableModule({$EID});
}
}
},{
xtype: 'spacer',
height: 5
},{
xtype: 'button',
id: 'mo_del_btn',
disabled: false,
width: '100%',
text: 'Remove Module',
handler: function(){
removeModule({$EID});
}
}]
}
EFUFU;
$TPL = str_ireplace( '%%%NAME%%%',$Labels->GetLabel('_ONVIF_DESC_SHO_') , $TPL );
$TPL = str_ireplace( '%%%INFO%%%', $Labels->GetLabel('_ONVIF_DESC_LOO_'), $TPL );
$TPL = str_ireplace( '%%%LOINFO%%%',$Labels->GetLabel('_MOD_NO_NEDCONF_'), $TPL );
$TPL = str_ireplace( '%%%ENA_VAL%%%',$CR['enabled'], $TPL );
echo $TPL;
break;
case 8://Embed Video Encoder
$QS="SELECT * FROM `module_eve` WHERE `id`={$CR['aux_id']}";
$II = $DATABASE->Query( $QS );
$CI = $II[0];
$TS = array( '320x240', '640x480', '800x600', '1280x720', '1024x768', '1920x1080' );
$YY = $CI['width'].'x'.$CI['height'];
for( $i=0; $i<count( $TS ); $i++ ) if( $TS[$i] == $YY ) break;
$CSID =($i==count($TS))?0:$i;
$TPL =<<<EFUFU
{
xtype: 'tabpanel',
activeTab: 0,
id: 'mod_set_content',
saveSettings: function(){
var sz = Ext.getCmp('FRM_SIZE').getValue();
var prt = Ext.getCmp('WA_PORT').getValue();
var cq = Ext.getCmp('COMP_QUAL').getValue();
var shts = Ext.getCmp('eve_show_ts').getValue();
var shlb = Ext.getCmp('eve_show_lbl').getValue();
var shlo = Ext.getCmp('eve_show_logo').getValue();
var tspx = Ext.getCmp('TS_POSX').getValue();
var tspy = Ext.getCmp('TS_POSY').getValue();
var tsts = Ext.getCmp('eve_transp_ts').getValue();
var tsfo = Ext.getCmp('TS_FONT').getValue();
var tsfs = Ext.getCmp('TS_FSCALE').getValue();
var tsft = Ext.getCmp('TS_FTHICK').getValue();
var tslt = Ext.getCmp('TS_LINET').getValue();
var lblpx = Ext.getCmp('LBL_POSX').getValue();
var lblpy = Ext.getCmp('LBL_POSY').getValue();
var lblts = Ext.getCmp('eve_transp_lbl').getValue();
var lblfo = Ext.getCmp('LBL_FONT').getValue();
var lblfs = Ext.getCmp('LBL_FSCALE').getValue();
var lblft = Ext.getCmp('LBL_FTHICK').getValue();
var lbllt = Ext.getCmp('LBL_LINET').getValue();
var logpx = Ext.getCmp('LOGO_POSX').getValue();
var logpy = Ext.getCmp('LOGO_POSY').getValue();
var logw = Ext.getCmp('LOGO_WIDTH').getValue();
var logh = Ext.getCmp('LOGO_HEIGHT').getValue();
Ext.Ajax.request({
url: '/lib/controller/updateServerModuleSettings.php',
params: {
MID: {$EID},
UID: {$UserID},
SID: '{$Session}',
SIZE: sz,
PORT: prt,
COMPRESSION: cq,
SHOW1: shts,
SHOW2: shlb,
SHOW3: shlo,
TS_POSX: tspx,
TS_POSY: tspy,
TS_TRANS: tsts,
TS_FONT: tsfo,
TS_FONT_SCALE: tsfs,
TS_FONT_THICK: tsft,
TS_LINE: tslt,
LBL_POSX: lblpx,
LBL_POSY: lblpy,
LBL_TRANS: lblts,
LBL_FONT: lblfo,
LBL_FONT_SCALE: lblfs,
LBL_FONT_THICK: lblft,
LBL_LINE: lbllt,
LOG_POSX: logpx,
LOG_POSY: logpy,
LOG_W: logw,
LOG_H: logh
},
success: function( response, opts ){
var data = Ext.decode(response.responseText);
if( data.success == true ) {
moduleSettingsEditorWindow.hide();
} else {
Ext.Msg.show({
title:'{$Labels->GetLabel("_ERROR_MSG_")}',
msg: data['msg'],
buttons: Ext.Msg.OK,
fn: function(){
SettingsLidar3D.hide();
},
icon: Ext.MessageBox.ERROR
});
};
},
failure: failureAJAXFunction
});
},
items:[{
xtype: 'panel',
title: 'Output Settings',
items:[{
xtype: 'panel',
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: false
},{
xtype: 'form',
labelWidth: 180,
labelAlign: 'right',
border: false,
items: [{
xtype: 'combo',
fieldLabel: '{$Labels->GetLabel('_WORKING_MODE_')}',
id: 'W_MODE',
typeAhead: false,
triggerAction: 'all',
lazyRender:true,
mode: 'local',
store: {
xtype: 'arraystore',
fields: [ 'moId', 'moText' ],
data: [
[1, 'Pictures'],
[2, 'Videos']
]
},
valueField: 'moId',
displayField: 'moText',
value: '{$CI['output_mode']}',
listeners:{
select: function( t, r, i ){
doModuleOperation( {$EID}, 3, r.data.moId, false );
}
}
},{
xtype: 'combo',
fieldLabel: '{$Labels->GetLabel('_OUTPUT_FRAME_SIZE_')}',
id: 'FRM_SIZE',
//width: 120,
typeAhead: false,
triggerAction: 'all',
lazyRender:true,
mode: 'local',
store: {
xtype: 'arraystore',
fields: [ 'szId', 'szText' ],
data: [
[0, '320x240'],
[1, '640x480'],
[2, '800x600'],
[3, '1280x720'],
[4, '1024x768'],
[5, '1920x1080']
]
},
valueField: 'szId',
displayField: 'szText',
value: {$CSID},
listeners:{
select: updateFramePreview,
change: updateFramePreview
}
},{
xtype: 'numberfield',
fieldLabel: '{$Labels->GetLabel('_EVE_PORT_')}',
id: 'WA_PORT',
width: 120,
minValue: 1000,
maxValue: 65535,
value: {$CI['web_port']}
},{
xtype: 'slider',
fieldLabel: '{$Labels->GetLabel('_EVE_COMPRESS_QUA_')}',
id: 'COMP_QUAL',
width: 120,
minValue: 0,
maxValue: 100,
value: {$CI['compression_quality']}
},{
xtype: 'checkbox',
fieldLabel: '{$Labels->GetLabel('_EVE_SHOW_TS_')}',
id: 'eve_show_ts',
disabled: true,
checked: {$CI['show_ts']},
handler: updateFramePreview
},{
xtype: 'checkbox',
fieldLabel: '{$Labels->GetLabel('_EVE_SHOW_LBL_')}',
id: 'eve_show_lbl',
disabled: true,
checked: {$CI['show_label']},
handler: updateFramePreview
},{
xtype: 'checkbox',
fieldLabel: '{$Labels->GetLabel('_EVE_SHOW_LOGO_')}',
id: 'eve_show_logo',
disabled: true,
checked: {$CI['show_logo']},
handler: updateFramePreview
}]
}]
},{
xtype: 'form',
title: 'Time Stamp',
labelWidth: 180,
labelAlign: 'right',
disabled: true,
items:[{
xtype: 'slider',
fieldLabel: '{$Labels->GetLabel('_EVE_TS_POSX_')}',
id: 'TS_POSX',
width: 120,
minValue: 0,
maxValue: 100,
value: {$CI['ts_x']}
},{
xtype: 'slider',
fieldLabel: '{$Labels->GetLabel('_EVE_TS_POSY_')}',
id: 'TS_POSY',
width: 120,
minValue: 0,
maxValue: 100,
value: {$CI['ts_y']}
},{
xtype: 'checkbox',
fieldLabel: '{$Labels->GetLabel('_EVE_TRANSO_TS_')}',
id: 'eve_transp_ts',
checked: {$CI['ts_transperant']}
},{
xtype: 'combo',
fieldLabel: '{$Labels->GetLabel('_EVE_FONT_TS_')}',
id: 'TS_FONT',
width: 120,
typeAhead: true,
triggerAction: 'all',
lazyRender:true,
mode: 'local',
store: {
xtype: 'arraystore',
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: {$CI['ts_font_face']}
},{
xtype: 'slider',
fieldLabel: '{$Labels->GetLabel('_EVE_TS_FSCALE_')}',
id: 'TS_FSCALE',
width: 120,
minValue: 0.0,
maxValue: 4.0,
value: {$CI['ts_font_scale']}
},{
xtype: 'slider',
fieldLabel: '{$Labels->GetLabel('_EVE_TS_FTHICK_')}',
id: 'TS_FTHICK',
width: 120,
minValue: 1,
maxValue: 8.0,
value: {$CI['ts_font_thickness']}
},{
xtype: 'combo',
fieldLabel: '{$Labels->GetLabel('_EVE_TS_LINE_T_')}',
id: 'TS_LINET',
width: 120,
typeAhead: true,
triggerAction: 'all',
lazyRender:true,
mode: 'local',
store: {
xtype: 'arraystore',
fields: [ 'szId', 'szText' ],
data: [
[0, 'THIN'],
[1, 'ANTIALIAZED'],
[2, 'THICK']
]
},
valueField: 'szId',
displayField: 'szText',
value: {$CI['ts_line_type']}
}]
},{
xtype: 'form',
title: 'Label',
labelWidth: 180,
labelAlign: 'right',
disabled: true,
items:[{
xtype: 'slider',
fieldLabel: '{$Labels->GetLabel('_EVE_LBL_POSX_')}',
id: 'LBL_POSX',
width: 120,
minValue: 0,
maxValue: 100,
value: {$CI['label_x']}
},{
xtype: 'slider',
fieldLabel: '{$Labels->GetLabel('_EVE_LBL_POSY_')}',
id: 'LBL_POSY',
width: 120,
minValue: 0,
maxValue: 100,
value: {$CI['label_y']}
},{
xtype: 'checkbox',
fieldLabel: '{$Labels->GetLabel('_EVE_TRANSO_LBL_')}',
id: 'eve_transp_lbl',
checked: {$CI['label_transperant']}
},{
xtype: 'combo',
fieldLabel: '{$Labels->GetLabel('_EVE_FONT_LBL_')}',
id: 'LBL_FONT',
width: 120,
typeAhead: true,
triggerAction: 'all',
lazyRender:true,
mode: 'local',
store:{
xtype: 'arraystore',
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: {$CI['label_font_face']}
},{
xtype: 'slider',
fieldLabel: '{$Labels->GetLabel('_EVE_LBL_FSCALE_')}',
id: 'LBL_FSCALE',
width: 120,
minValue: 0.0,
maxValue: 4.0,
value: {$CI['label_font_scale']}
},{
xtype: 'slider',
fieldLabel: '{$Labels->GetLabel('_EVE_LBL_FTHICK_')}',
id: 'LBL_FTHICK',
width: 120,
minValue: 1,
maxValue: 8.0,
value: {$CI['label_font_thickness']}
},{
fieldLabel: '{$Labels->GetLabel('_EVE_LBL_LINE_T_')}',
xtype: 'combo',
id: 'LBL_LINET',
width: 120,
typeAhead: true,
triggerAction: 'all',
lazyRender:true,
mode: 'local',
store: {
xtype: 'arraystore',
fields: [ 'szId', 'szText' ],
data: [
[0, 'THIN'],
[1, 'ANTIALIAZED'],
[2, 'THICK']
]
},
valueField: 'szId',
displayField: 'szText',
value: {$CI['label_line_type']}
}]
},{
xtype: 'form',
title: 'Logo',
labelWidth: 180,
labelAlign: 'right',
disabled: true,
items:[{
xtype: 'slider',
fieldLabel: '{$Labels->GetLabel('_EVE_LOGO_POSX_')}',
id: 'LOGO_POSX',
width: 120,
minValue: 0,
maxValue: 100,
value: {$CI['logo_x']}
},{
xtype: 'slider',
fieldLabel: '{$Labels->GetLabel('_EVE_LOGO_POSY_')}',
id: 'LOGO_POSY',
width: 120,
minValue: 0,
maxValue: 100,
value: {$CI['logo_y']}
},{
xtype: 'numberfield',
fieldLabel: '{$Labels->GetLabel('_EVE_LOGO_WIDTH_')}',
id: 'LOGO_WIDTH',
width: 120,
minValue: 0,
maxValue: 256,
value: {$CI['logo_w']}
},{
xtype: 'numberfield',
fieldLabel: '{$Labels->GetLabel('_EVE_LOGO_HEIGHT_')}',
id: 'LOGO_HEIGHT',
width: 120,
minValue: 0,
maxValue: 256,
value: {$CI['logo_h']}
},{
xtype: 'panel',
id: 'eve_logo_ph',
html: '<center><img width="100px" id="eve_logo_img" src="/lib/controller/data/assets/images/7shields.png"></center>'
},{
xtype: 'panel',
html: '<input id="eve_logo_upload" style="width: 120px;" type="file" onchange="uploadEveLogo();"/>'
}]
}],
listeners: {
afterlayout: updateFramePreview
},
status: 'ok',
wTitle: '{$Labels->GetLabel('_EMBED_VIDEO_ENCODER_')}'
}
EFUFU;
$TPL = str_ireplace( '%%%NAME%%%',$Labels->GetLabel('_EVE_DESC_SHO_') , $TPL );
$TPL = str_ireplace( '%%%INFO%%%', $Labels->GetLabel('_EVE_DESC_LOO_'), $TPL );
$TPL = str_ireplace( '%%%LOINFO%%%','' , $TPL );
$TPL = str_ireplace( '%%%ENA_VAL%%%',$CR['enabled'], $TPL );
$Data['status'] = 'ok';
$Data['title'] = $Labels->GetLabel('_EMBED_VIDEO_ENCODER_');
$Data['content'] = json_decode( $TPL );
echo $TPL; //json_encode($Data);
break;
case 9: //Modem
$MANU = json_decode( `mmcli -L -J`, true );
//$TA = explode( "\n", $MANU );
$MODEMS_PARTS=array();
$MODEMS_PARTS[] ="[ -1, '-NO-MODEM-ASSIGNED-']";
foreach( $MANU['modem-list'] as $A ){
$CA = explode('/', $A );
$MID = intval( $CA[count($CA)-1] );
$MANU = json_decode( `mmcli -m $MID -J`, true );
//$CMD = "echo \"terrarium\" | sudo -S mmcli -m {$MID} --location-get -J";
//$LOFO = json_decode( `$CMD`, true );
//print_r( $MANU );
//exit();
$MODEMS_PARTS[] = '['.$MID.',\''. $MANU['modem']['generic']['model'].'\']';
};
$MODEMS = '[' . implode( ',', $MODEMS_PARTS ) .']';
$QS="SELECT * FROM `module_modem` WHERE `id`={$CR['aux_id']}";
$II = $DATABASE->Query( $QS );
$CI = $II[0];
$TPL =<<<EFUFU
{
xtype: 'form',
labelAlign: 'right',
autoScroll: 'auto',
labelWidth: 250,
items:[{
border: false,
frame: false,
xtype: 'panel',
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>'
},{
xtype: 'spacer',
height: 5
},{
xtype: 'combo',
fieldLabel: 'Selected Modem',
id: 'mod_dev',
width: 220,
lazyRender:true,
mode: 'local',
forceSelection: true,
triggerAction: 'all',
editable: false,
disableKeyFilter: true,
store: new Ext.data.ArrayStore({
fields: ['modem_id','modem_txt'],
data: {$MODEMS}
}),
value: '{$CI['modem_id']}',
valueField: 'modem_id',
displayField: 'modem_txt',
listeners:{
select: function( t, r, i ){
doModuleOperation( {$EID}, 4, r.data.modem_id, false );
}
}
},{
xtype: 'spacer',
height: 5
},{
xtype: 'combo',
fieldLabel: 'Working Mode',
id: 'mod_mode',
width: 220,
lazyRender:true,
mode: 'local',
forceSelection: true,
triggerAction: 'all',
editable: false,
disableKeyFilter: true,
store: new Ext.data.ArrayStore({
fields: ['wm_id','wm_txt'],
data: [[1,'Sending SMS'],[2,'Making Call']]
}),
value: ('{$CI['sms_enabled']}' =='1')?'1':'2',
valueField: 'wm_id',
displayField: 'wm_txt',
listeners:{
select: function( t, r, i ){
doModuleOperation( {$EID}, 5, r.data.wm_id, false );
}
}
},{
xtype: 'spacer',
height: 5
},{
xtype: 'numberfield',
id: 'trig_window',
name: 'trig_window',
fieldLabel: 'Call Hangup Dalay (seconds)',
width: 220,
value: '{$CI['call_hangup_wait']}',
listeners:{
change: function( t, n, o ){
doModuleOperation( {$EID}, 6, n, false );
}
}
},{
xtype: 'spacer',
height: 5
},{
xtype: 'grid',
id: 'phone_book_grid',
border: false,
frame: false,
autoScroll: true,
//width: '100%',
lazyRender: true,
tbar:[{
text: 'Add',
handler: addNewPhoneNumber
},{
text: 'Delete',
id: 'ph_bo_de_bu',
disabled: true,
handler: deletePhoneNumber
}],
height: 420,
ds: modem_pb_store,
cm: new Ext.grid.ColumnModel( modem_pb_ColModel_ops ),
sm: new Ext.grid.RowSelectionModel( modem_pb_SelModel_ops ),
viewConfig: {
forceFit: true
},
},{
xtype: 'spacer',
height: 5
}],
listeners:{
afterrender: loadPhoneBook
}
}
EFUFU;
$TPL = str_ireplace( '%%%NAME%%%',$Labels->GetLabel('_MODEM_DESC_SHO_') , $TPL );
$TPL = str_ireplace( '%%%INFO%%%', $Labels->GetLabel('_MODEM_DESC_LOO_'), $TPL );
$TPL = str_ireplace( '%%%LOINFO%%%',$R_nfo , $TPL );
$TPL = str_ireplace( '%%%ENA_VAL%%%',$CR['enabled'], $TPL );
echo $TPL;
break;
};
} else {
echo '{ xtype: \'panel\', html: \'Node '.$_POST['NODE'].' Loadded\'}';
};
} else {
header('location: /');
};
?>