Browse Source

Japan Upgrade Version that sent (Mods Finale)

master
Evgeny Gagua 4 years ago
parent
commit
122338428a
  1. 4
      lib/ajax_asm.php
  2. 4
      lib/assembler.php
  3. 59
      lib/controller/addServerModule.php
  4. 72
      lib/controller/doModuleOperation.php
  5. 125
      lib/controller/getModuleEditor.php
  6. 55
      lib/controller/getModuleInfo.php
  7. 787
      lib/controller/getModuleSettings.php
  8. 101
      lib/controller/getNodeSettings.php
  9. 62
      lib/controller/updateServerModuleSettings.php
  10. 12
      lib/javascript/jsapi_dynamic/rgoose_main.js
  11. 72
      lib/javascript/jsapi_dynamic/rgoose_modules.js
  12. 63
      lib/javascript/jsapi_dynamic/rgoose_sysmap_editor.js
  13. 4
      lib/js_asm.php

4
lib/ajax_asm.php

@ -32,8 +32,8 @@ if( isset($_GET['Lang'])){
$UCL=$_GET['Lang']/1;
if ($UCL) $_SESSION['userlang']=$UCL; else $_SESSION['userlang']=$UserLang;
}
if( isset($_SESSION['userlang']) )$Labels=new Language($_SESSION['userlang'], '_php');
else $Labels=new Language( $UserLang, '_php');
if( isset($_SESSION['userlang']) )$Labels=new Language($_SESSION['userlang']);//, '_php');
else $Labels=new Language( $UserLang );//, '_php');
if( $UserLang == 3 || $UserLang == 255 ){
$RTL_SITE = true;

4
lib/assembler.php

@ -44,8 +44,8 @@ if( isset($_GET['Lang'])){
$UCL=$_GET['Lang']/1;
if ($UCL) $_SESSION['userlang']=$UCL; else $_SESSION['userlang']=$UserLang;
}
if( isset($_SESSION['userlang']) )$Labels=new Language($_SESSION['userlang'], '_php');
else $Labels=new Language( $UserLang, '_php');
if( isset($_SESSION['userlang']) )$Labels=new Language( $_SESSION['userlang'] ); // '_php');
else $Labels=new Language( $UserLang );// '_php');
if( $UserLang == 3 || $UserLang == 255 ){
$RTL_SITE = true;

59
lib/controller/addServerModule.php

@ -0,0 +1,59 @@
<?php
require_once('../ajax_asm.php');
$UID = intval($CUser->Data['id'] );
$ACCESS = intval($CUser->Data['access'] );
if( $UID > 1 && $ACCESS > 4 ){
$Data['status'] = 'nok';
$Z = intval( $_POST['SERVID'] );
$T = intval( $_POST['TYPE'] );
if( $Z && $T ){
$QS = "SELECT * FROM `server_module_types` WHERE `id`={$T}";
$ZZ = $DATABASE->Query( $QS );
if( count( $ZZ ) ){
$CTI = $ZZ[0];
$ADE = true;
if( $CTI['allow_multiply'] == 0 ){
$QS = "SELECT * FROM `server_modules` WHERE `server_id`={$Z} AND `type`={$T}";
$SS = $DATABASE->Query( $QS );
if( count( $SS ) ){
$ADE = false;
$Data['msg'] = 'This type of Module can be added only Once!';
};
};
if( $ADE ){
$QS = "INSERT INTO `server_modules` SET `server_id`={$Z}, `type`={$T}, `enabled`=0";
$DATABASE->Query( $QS );
$MID = $DATABASE->getLastInsertID();
$MCID = 0;
switch( $T ){
case 3:{
//Kafka
$QS = "INSERT INTO `modules_kafka` SET `brocker_port`=2929";
$DATABASE->Query( $QS );
$MCID = $DATABASE->getLastInsertID();
break;
};
case 9:{
//EmbedVido
$QS = "INSERT INTO `module_embed_video_settings` SET `web_port`=8972";
$DATABASE->Query( $QS );
$MCID = $DATABASE->getLastInsertID();
break;
};
};
$QS = "UPDATE `server_modules` SET `aux_id`={$MCID} WHERE `id`={$MID}";
$DATABASE->Query( $QS );
$Data['status'] = 'ok';
};
} else {
$Data['msg'] = 'Wrong Module Type is supplied!';
};
} else {
$Data['msg'] = 'No Server ID or Module Type is supplied!';
};
echo json_encode( $Data );
exit();
};
header('location: /');
?>

72
lib/controller/doModuleOperation.php

@ -0,0 +1,72 @@
<?php
require_once('../ajax_asm.php');
if( $CUser->Data['id'] > 1 ){
$Data = array();
$Data['success'] = false;
if( isset( $_POST['MID'] ) ) {
$MID = intval($_POST['MID']);
} else $MID = 0;
if( isset( $_POST['OPID'] ) ){
$CMD = intval( $_POST['OPID'] );
} else {
$CMD = 0;
};
if( isset( $_POST['OPCODE'] ) ){
$OPCODE = intval( $_POST['OPCODE'] );
} else {
$OPCODE = 0;
};
if( $MID > 0 && $CMD > 0 ){
$Data['success'] = true;
switch( $CMD ){
case 1: {
$QS = "SELECT * FROM `server_modules` WHERE `id`={$MID}";
$TT = $DATABASE->Query( $QS );
if( count( $TT ) ){
$JJ = $TT[0];
switch( $JJ['type'] ){
case 1:{//ZL
$QS = "DELETE FROM `media_servers` WHERE `id`={$JJ['aux_id']}";
$DATABASE->Query( $QS );
$QS = "DELETE FROM `media_server_streams` WHERE `media_server_id`={$JJ['aux_id']}";
$DATABASE->Query( $QS );
break;
};
case 3:{//Kafka
$QS = "DELETE FROM `modules_kafka` WHERE `id`={$JJ['aux_id']}";
$DATABASE->Query( $QS );
$QS = "DELETE FROM `module_kafka_settings` WHERE `module_id`={$JJ['aux_id']}";
$DATABASE->Query( $QS );
break;
};
case 9:{// Embed VIO
$QS = "DELETE FROM `module_embed_video_settings` WHERE `id`={$JJ['aux_id']}";
$DATABASE->Query( $QS );
break;
};
case 10:{// Modem Manager
$QS = "DELETE FROM `module_mm_settings` WHERE `id`={$JJ['aux_id']}";
$DATABASE->Query( $QS );
$QS = "DELETE FROM `module_mm_modems` WHERE `mmm_id`={$JJ['aux_id']}";
$DATABASE->Query( $QS );
break;
};
};
$QS = "DELETE FROM `server_modules` WHERE `id`={$MID}";
$DATABASE->Query( $QS );
};
break;
};
case 2: $QS = "UPDATE `server_modules` SET `enabled`={$OPCODE} WHERE `id`={$MID}"; break;
};
$DATABASE->Query( $QS, false );
$Data['query'] = $QS;
} else {
$Data['msg']='Wrong Parameters';
};
echo json_encode( $Data );
exit();
};
header('location: /');
?>

125
lib/controller/getModuleEditor.php

@ -9,13 +9,6 @@
$CR = $Result[0];
switch( $CR['type'] ){
case 1: //ZLMedia
$QS = "SELECT * FROM uart_settings WHERE id={$CR['aux_id']}";
$Result = $DATABASE->Query( $QS );
$Z = $Result[0];
$R_name = $Labels->GetLabel('_RES_HW_UART_DESC_');
$R_dev = $CR['device'];
$R_nfo = 'Speed: ' . $Z['speed'] . ', Bits: ' . $Z['bit'] . ', Parity: ' . $Z['parity'] . ', Stop Bit: '. $Z['stop_bit'];
$R_image = 'unnamed.png';
$TPL =<<<EFUFU
{
xtype: 'form',
@ -54,7 +47,12 @@
}),
value: %%%ENA_VAL%%%,
valueField: 'status_val',
displayField: 'status_txt'
displayField: 'status_txt',
listeners:{
select: function( t, r, i ){
if( r.data.status_val ) enableModule({$EID}); else disableModule({$EID});
}
}
},{
xtype: 'spacer',
height: 5
@ -65,6 +63,7 @@
width: '100%',
text: 'Edit Module Config',
handler: function(){
showModuleSettingsEditor({$EID});
}
},{
xtype: 'spacer',
@ -76,17 +75,7 @@
width: '100%',
text: 'Remove Module',
handler: function(){
}
},{
xtype: 'spacer',
height: 5
},{
xtype: 'button',
id: 'ua_apply_btn',
disabled: true,
width: '100%',
text: 'Apply Changes',
handler: function(){
removeModule({$EID});
}
}]
@ -143,7 +132,12 @@ $TPL =<<<EFUFU
}),
value: %%%ENA_VAL%%%,
valueField: 'status_val',
displayField: 'status_txt'
displayField: 'status_txt',
listeners:{
select: function( t, r, i ){
if( r.data.status_val ) enableModule({$EID}); else disableModule({$EID});
}
}
},{
xtype: 'spacer',
height: 5
@ -154,6 +148,7 @@ $TPL =<<<EFUFU
width: '100%',
text: 'Edit Module Config',
handler: function(){
showModuleSettingsEditor({$EID});
}
},{
xtype: 'spacer',
@ -165,17 +160,7 @@ $TPL =<<<EFUFU
width: '100%',
text: 'Remove Module',
handler: function(){
}
},{
xtype: 'spacer',
height: 5
},{
xtype: 'button',
id: 'ua_apply_btn',
disabled: true,
width: '100%',
text: 'Apply Changes',
handler: function(){
removeModule({$EID});
}
}]
@ -226,7 +211,12 @@ EFUFU;
}),
value: %%%ENA_VAL%%%,
valueField: 'status_val',
displayField: 'status_txt'
displayField: 'status_txt',
listeners:{
select: function( t, r, i ){
if( r.data.status_val ) enableModule({$EID}); else disableModule({$EID});
}
}
},{
xtype: 'spacer',
height: 5
@ -237,17 +227,7 @@ EFUFU;
width: '100%',
text: 'Remove Module',
handler: function(){
}
},{
xtype: 'spacer',
height: 5
},{
xtype: 'button',
id: 'ua_apply_btn',
disabled: true,
width: '100%',
text: 'Apply Changes',
handler: function(){
removeModule({$EID});
}
}]
@ -298,7 +278,12 @@ EFUFU;
}),
value: %%%ENA_VAL%%%,
valueField: 'status_val',
displayField: 'status_txt'
displayField: 'status_txt',
listeners:{
select: function( t, r, i ){
if( r.data.status_val ) enableModule({$EID}); else disableModule({$EID});
}
}
},{
xtype: 'spacer',
height: 5
@ -309,17 +294,7 @@ EFUFU;
width: '100%',
text: 'Remove Module',
handler: function(){
}
},{
xtype: 'spacer',
height: 5
},{
xtype: 'button',
id: 'ua_apply_btn',
disabled: true,
width: '100%',
text: 'Apply Changes',
handler: function(){
removeModule({$EID});
}
}]
}
@ -372,7 +347,12 @@ EFUFU;
}),
value: %%%ENA_VAL%%%,
valueField: 'status_val',
displayField: 'status_txt'
displayField: 'status_txt',
listeners:{
select: function( t, r, i ){
if( r.data.status_val ) enableModule({$EID}); else disableModule({$EID});
}
}
},{
xtype: 'spacer',
height: 5
@ -383,7 +363,7 @@ EFUFU;
width: '100%',
text: 'Edit Module Config',
handler: function(){
embedVideoEncoderSettings(0);
showModuleSettingsEditor({$EID});
}
},{
xtype: 'spacer',
@ -395,17 +375,7 @@ EFUFU;
width: '100%',
text: 'Remove Module',
handler: function(){
}
},{
xtype: 'spacer',
height: 5
},{
xtype: 'button',
id: 'ua_apply_btn',
disabled: true,
width: '100%',
text: 'Apply Changes',
handler: function(){
removeModule({$EID});
}
}]
@ -460,7 +430,12 @@ $TPL =<<<EFUFU
}),
value: %%%ENA_VAL%%%,
valueField: 'status_val',
displayField: 'status_txt'
displayField: 'status_txt',
listeners:{
select: function( t, r, i ){
if( r.data.status_val ) enableModule({$EID}); else disableModule({$EID});
}
}
},{
xtype: 'spacer',
height: 5
@ -482,17 +457,7 @@ $TPL =<<<EFUFU
width: '100%',
text: 'Remove Module',
handler: function(){
}
},{
xtype: 'spacer',
height: 5
},{
xtype: 'button',
id: 'ua_apply_btn',
disabled: true,
width: '100%',
text: 'Apply Changes',
handler: function(){
removeModule({$EID});
}
}]

55
lib/controller/getModuleInfo.php

@ -0,0 +1,55 @@
<?php
require_once('../ajax_asm.php');
if( $CUser->Data['id'] > 1 ){
$EID = intval( $_POST['MID'] );
switch( $EID ){
case 1: //ZLMedia
$TPL ='<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>';
$TPL = str_ireplace( '%%%NAME%%%',$Labels->GetLabel('_ZL_MEDIA_DESC_SHO_') , $TPL );
$TPL = str_ireplace( '%%%INFO%%%', $Labels->GetLabel('_ZL_MEDIA_DESC_LOO_'), $TPL );
echo $TPL;
break;
case 2: //DCB USB
echo "TBD";
break;
case 3: //Kafka
$TPL ='<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>';
$TPL = str_ireplace( '%%%NAME%%%',$Labels->GetLabel('_KAFKA_DESC_SHO_') , $TPL );
$TPL = str_ireplace( '%%%INFO%%%', $Labels->GetLabel('_KAFKA_DESC_LOO_'), $TPL );
echo $TPL;
break;
case 4:
case 5:
case 6:
echo "TBD";
break;
case 7: // SSDP
$TPL ='<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>';
$TPL = str_ireplace( '%%%NAME%%%',$Labels->GetLabel('_SSDP_DESC_SHO_') , $TPL );
$TPL = str_ireplace( '%%%INFO%%%', $Labels->GetLabel('_SSDP_DESC_LOO_'), $TPL );
echo $TPL;
break;
case 8: // Onvif
$TPL ='<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>';
$TPL = str_ireplace( '%%%NAME%%%',$Labels->GetLabel('_ONVIF_DESC_SHO_') , $TPL );
$TPL = str_ireplace( '%%%INFO%%%', $Labels->GetLabel('_ONVIF_DESC_LOO_'), $TPL );
echo $TPL;
break;
case 9://Embed Video Encoder
$TPL ='<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>';
$TPL = str_ireplace( '%%%NAME%%%',$Labels->GetLabel('_EVE_DESC_SHO_') , $TPL );
$TPL = str_ireplace( '%%%INFO%%%', $Labels->GetLabel('_EVE_DESC_LOO_'), $TPL );
echo $TPL;
break;
case 10: //Modem
$TPL ='<table width="100%" border=0 class="setEd_infoPanel" id="KAFKA"><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>';
$TPL = str_ireplace( '%%%NAME%%%',$Labels->GetLabel('_KAFKA_DESC_SHO_') , $TPL );
$TPL = str_ireplace( '%%%INFO%%%', $Labels->GetLabel('_KAFKA_DESC_LOO_'), $TPL );
echo $TPL;
break;
};
} else {
header('location: /');
};
?>

787
lib/controller/getModuleSettings.php

@ -0,0 +1,787 @@
<?php
require_once('../ajax_asm.php');
if( $CUser->Data['id'] > 1 ){
$EID = intval( $_POST['MID'] );
$QS = "SELECT * FROM server_modules WHERE id = {$EID}";
$Result = $DATABASE->Query( $QS, false );
if( count( $Result ) ){
$CR = $Result[0];
switch( $CR['type'] ){
case 1: //ZLMedia
$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="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>'
},{
xtype: 'spacer',
height: 5
},{
border: false,
frame: false,
xtype: 'panel',
html: '<table width="100%" border=0 class="setEd_infoPanel" id="UART"><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_edit_btn',
disabled: false,
width: '100%',
text: 'Edit Module Config',
handler: function(){
}
},{
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('_ZL_MEDIA_DESC_SHO_') , $TPL );
$TPL = str_ireplace( '%%%INFO%%%', $Labels->GetLabel('_ZL_MEDIA_DESC_LOO_'), $TPL );
$TPL = str_ireplace( '%%%LOINFO%%%','' , $TPL );
$TPL = str_ireplace( '%%%ENA_VAL%%%',$CR['enabled'], $TPL );
echo $TPL;
break;
case 2: //DCB USB
break;
case 3: //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,
items:[{
xtype: 'form',
title: '{$Labels->GetLabel('_KAFKA_BROKER_')}',
labelWidth: 200,
labelAlign: 'right',
border: false,
frame: false,
items:[{
xtype: 'spacer',
height: 10
},{
xtype: 'textfield',
fieldLabel: 'Broker Address',
value: '{$CI['brocker_address']}'
},{
xtype: 'numberfield',
fieldLabel: 'Broker Port',
value: {$CI['brocker_port']}
},{
xtype: 'checkbox',
fieldLabel: 'Use SSL',
checked: {$USSL}
},{
xtype: 'panel',
html: 'CA certificate file for verifying the broker\'s certificate [cert]'
},{
xtype: 'panel',
html: 'Client\'s certificate [pem]'
},{
xtype: 'panel',
html: 'Client\'s key [key]'
},{
xtype: 'panel',
html: 'Key password, if any'
}]
},{
title: '{$Labels->GetLabel('_KAFKA_TOP_EVTS_')}',
html: ''
}],
status: 'ok',
wTitle: '{$Labels->GetLabel('_KAFKA_DESC_SHO_')}'
}
EFUFU;
echo $TPL;
break;
case 7: // 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 8: // 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 9://Embed Video Encoder
$QS="SELECT * FROM `module_embed_video_settings` 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('_OUTPUT_FRAME_SIZE_')}',
id: 'FRM_SIZE',
//width: 120,
typeAhead: true,
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 10: //Modem
$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">');
$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="KAFKA"><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
},{
border: false,
frame: false,
xtype: 'panel',
html: '<table width="100%" border=0 class="setEd_infoPanel" id="KAFKA"><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_edit_btn',
disabled: false,
width: '100%',
text: 'Edit Module Config',
handler: function(){
}
},{
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('_KAFKA_DESC_SHO_') , $TPL );
$TPL = str_ireplace( '%%%INFO%%%', $Labels->GetLabel('_KAFKA_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: /');
};
?>

101
lib/controller/getNodeSettings.php

@ -2,6 +2,7 @@
require_once('../ajax_asm.php');
if( $CUser->Data['id'] > 1 ){
$Z = intval( $_POST['NID'] );
$CT = intval( $_POST['TAB'] );
if( $Z ){
$QS = "SELECT * FROM `nodes` WHERE `id`={$Z}";
$NN = $DATABASE->Query( $QS );
@ -28,7 +29,7 @@
frame: false,
id: 'node_settings_content',
border: false,
activeTab: 0,
activeTab: <?=$CT;?>,
items: [{
xtype: 'panel',
title: 'General Info',
@ -163,7 +164,103 @@
height: 303,
autoScroll: 'auto',
tbar:[{
text: 'Add Module'
text: 'Add Module',
handler: function(){
var addModuleWindow = new Ext.Window({
id: 'huha_boa',
title: 'Add Server Module',
modal: true,
width: 400,
height: 300,
items:[{
xtype: 'form',
items: [{
xtype: 'combo',
fieldLabel: "<?=$Labels->GetLabel( 'MOD_TYPE' );?>",
id: 'mod_type',
lazyRender: true,
mode: 'local',
forceSelection: true,
triggerAction: 'all',
editable: false,
disableKeyFilter: true,
store: new Ext.data.ArrayStore({
fields: ['az_t','az_txt'],
data: [<?php
$QS = "SELECT * FROM `server_module_types`";
$MM = $DATABASE->Query( $QS );
$MIMO = array();
foreach( $MM as $M ) $MIMO[]="[{$M['id']},'".$Labels->GetLabel($M['name'])."']";
echo implode( ',', $MIMO );
?>]
}),
valueField: 'az_t',
displayField: 'az_txt',
value: 1,
listeners:{
select: function( t, r, i ){
var n = r.data.az_t;
Ext.Ajax.request({
url: '/lib/controller/getModuleInfo.php',
params: {
MID: n,
UID: <?=$UserID;?>,
SID: '<?=$Session;?>'
},
success: function( response, opts ){
Ext.getCmp('infopan').update( response.responseText );
}
});
}
}
},{
xtype: 'panel',
id: 'infopan',
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"><?=$Labels->GetLabel('_ZL_MEDIA_DESC_SHO_');?></td></tr><tr><td colspan=2><?=$Labels->GetLabel('_ZL_MEDIA_DESC_LOO_');?></td></tr></table>'
}]
}],
bbar:[{
text: 'Cancel',
handler: function(){
addModuleWindow.close();
}
},{
text: 'Add Module',
handler: function(){
var mtyp = Ext.getCmp('mod_type').getValue();
Ext.Ajax.request({
url: '/lib/controller/addServerModule.php',
params: {
SERVID: <?=$Node['aux_id'];?>,
TYPE: mtyp,
UID: <?=$UserID;?>,
SID: '<?=$Session;?>'
},
success: function( response, opts ){
// If the response is JSON, you have to decode it
var data = Ext.decode(response.responseText);
if( data.status == 'ok' ){
addModuleWindow.close();
showSettings( SelectedNodeID, 2 );
} else {
Ext.Msg.show({
title:'<?=$Labels->GetLabel("_INFO_MSG_");?>',
msg: data.msg,
buttons: Ext.Msg.OK,//YESNOCANCEL,
fn: function(){
//SettingsLidar3D.hide();
},
icon: Ext.MessageBox.INFO //QUESTION
});
}
},
failure: failureAJAXFunction
});
}
}]
});
addModuleWindow.show();
}
}],
items:[<?php
$QS = "SELECT * FROM server_modules WHERE `server_id`={$Node['aux_id']}";

62
lib/controller/updateServerModuleSettings.php

@ -0,0 +1,62 @@
<?php
require_once('../ajax_asm.php');
if( $CUser->Data['id'] > 1 ){
$Data['success'] = false;
$Data['msg']= 'Module Not Selected!';
if( isset( $_POST['MID'] ) ){
$MID = intval($_POST['MID']);
if( $MID ){
$Data['msg']='Module Does Not Exists!';
$QS = "SELECT * FROM `server_modules` WHERE `id`={$MID}";
$RR = $DATABASE->Query( $QS );
if( count( $RR ) ){
$CMD = $RR[0];
$Data['success'] = true;
$Data['msg']='';
switch( $CMD['type'] ){
case 9:{
// EVE
$SiW = array( 320, 640, 800, 1280, 1024, 1920 );
$SiH = array( 240, 480, 600, 720, 768, 1080 );
$SIZE = intval( $_POST['SIZE'] );
$PORT = intval( $_POST['PORT'] );
$COMP = intval( $_POST['COMPRESSION'] );
$TS_X = intval( $_POST['TS_POSX'] );
$TS_Y = intval( $_POST['TS_POSY'] );
$TS_FF = intval( $_POST['TS_FONT'] );
$TS_FS = intval( $_POST['TS_FONT_SCALE'] );
$TS_FT = intval( $_POST['TS_FONT_THICK'] );
$TS_LT = intval( $_POST['TS_LINE'] );
$TS_TS = intval( $_POST['TS_TRANS'] );
$LB_X = intval( $_POST['LBL_POSX'] );
$LB_Y = intval( $_POST['LBL_POSY'] );
$LB_FF = intval( $_POST['LBL_FONT'] );
$LB_FS = intval( $_POST['LBL_FONT_SCALE'] );
$LB_FT = intval( $_POST['LBL_FONT_THICK'] );
$LB_LT = intval( $_POST['LBL_LINE'] );
$LB_TS = intval( $_POST['LBL_TRANS'] );
$LO_X = intval( $_POST['LOG_POSX'] );
$LO_Y = intval( $_POST['LOG_POSY'] );
$LO_W = intval( $_POST['LOG_W'] );
$LO_H = intval( $_POST['LOG_H'] );
if( $_POST['SHOW1'] ) $STS = 1; else $STS = 0;
if( $_POST['SHOW2'] ) $SLB = 1; else $SLB = 0;
if( $_POST['SHOW3'] ) $SLG = 0; else $SLG = 0;
if( $_POST['TS_TRANS'] ) $TS_TS = 1; else $TS_TS = 0;
if( $_POST['LBL_TRANS'] ) $LB_TS = 1; else $LB_TS = 0;
$QS = "UPDATE `module_embed_video_settings` SET `web_port`={$PORT}, `width`={$SiW[$SIZE]}, `height`={$SiH[$SIZE]}, `compression_quality`={$COMP}, `show_ts`={$STS}, `show_label`={$SLB}, `show_logo`={$SLG}, `ts_x`={$TS_X}, `ts_y`={$TS_Y}, `ts_font_face`={$TS_FF}, `ts_font_thickness`={$TS_FT}, `ts_line_type`={$TS_LT}, `ts_transperant`={$TS_TS}, `label_x`={$LB_X}, `label_y`={$LB_Y}, `label_font_face`={$LB_FF}, `label_font_thickness`={$LB_FT}, `label_line_type`={$LB_LT}, `label_transperant`={$LB_TS}, `logo_x`={$LO_X}, `logo_y`={$LO_Y}, `logo_w`={$LO_W}, `logo_h`={$LO_H} WHERE `id`={$CMD['aux_id']}";
$DATABASE->Query( $QS );
break;
};
};
};
};
};
echo json_encode( $Data );
exit();
};
header( 'location: /');
?>

12
lib/javascript/jsapi_dynamic/rgoose_main.js

@ -151,7 +151,19 @@ function doCheckWindowSize(){
var NotificationStack = null;
function tryKeepScreenAlive(minutes) {
navigator.wakeLock.request("screen").then(lock => {
setTimeout(() => lock.release(), minutes * 60 * 1000);
});
}
Ext.onReady(function(){
if ('wakeLock' in navigator) {
// Screen Wake Lock API supported
tryKeepScreenAlive(10);
};
doCheckWindowSize();
gSessionValidatorInterval = window.setInterval( sessionValidator, 1000 );
NotificationStack = new PNotify.Stack({dir1: 'down', firstpos1: 25});

72
lib/javascript/jsapi_dynamic/rgoose_modules.js

@ -29,8 +29,8 @@ function addMediaServer(){
addMediaServerDialog.show();
};
var embedVideoEncoderSettingsWindow = null;
var embedVideoEncoderId = 0;
function updateFramePreview(){
var canvas = document.getElementById("eve_frame_preview");
if( canvas != null ){
@ -44,7 +44,7 @@ function updateFramePreview(){
var f_w = 320;
var f_h = 240;
var f_p = 0;
var fsid = Ext.getCmp('FRM_SIZE').getValue();
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;
@ -80,6 +80,7 @@ function updateFramePreview(){
};
};
async function uploadFile() {
let formData = new FormData();
formData.append("file", fileupload.files[0]);
@ -131,6 +132,69 @@ function uploadEveLogo(){
};
};
var moduleSettingsEditorWindow = null;
function showModuleSettingsEditor( ModuleID ){
if( moduleSettingsEditorWindow == null ){
moduleSettingsEditorWindow = new Ext.Window({
modal: true,
id: 'mo_se_ed_wi',
title: '',
width: 792,
height: 700,
layout: 'fit',
closeAction: 'hide',
resizable: false,
items:[],
buttons: [{
text: '<?=$Labels->GetLabel("_CANCEL_");?>',
handler: function(){
moduleSettingsEditorWindow.hide();
}
},{
id: 'con_to_src',
text: '<?=$Labels->GetLabel("_OK_");?>',
disabled: false,
handler: function(){
Ext.getCmp('mod_set_content').saveSettings();
}
}]
});
};
moduleSettingsEditorWindow.show();
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.status = 'ok' ){
moduleSettingsEditorWindow.setTitle( data.wTitle );
moduleSettingsEditorWindow.removeAll( true );
moduleSettingsEditorWindow.add( data );
moduleSettingsEditorWindow.doLayout();
} else {
moduleSettingsEditorWindow.close();
moduleSettingsEditorWindow = null;
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
});
};
/*
function embedVideoEncoderSettings( ModuleID ){
if( embedVideoEncoderSettingsWindow == null ){
embedVideoEncoderSettingsWindow = new Ext.Window({
@ -507,5 +571,5 @@ function embedVideoEncoderSettings( ModuleID ){
},
failure: failureAJAXFunction
});
*/
};
* /
};*/

63
lib/javascript/jsapi_dynamic/rgoose_sysmap_editor.js

@ -80,11 +80,12 @@ function showResourceInfo( rid ){
};
var settingsWindow = null;
function showSettings( nid ){
function showSettings( nid, tab = 0 ){
Ext.Ajax.request({
url: '/lib/controller/getNodeSettings.php',
params: {
NID: nid,
TAB: tab,
UID: <?=$UserID;?>,
SID: '<?=$Session;?>',
},
@ -126,9 +127,10 @@ function showSettings( nid ){
}]
});
};
settingsWindow.show();
settingsWindow.removeAll( true );
settingsWindow.add( data );
settingsWindow.show();
settingsWindow.doLayout();
},
failure: failureAJAXFunction
});
@ -340,6 +342,63 @@ function createNode( STYPE ){
});
};
function removeModule( ID ){
Ext.Msg.show({
title:'Q!',
msg: 'Are you sure delete this Module?',
buttons: Ext.Msg.YESNOCANCEL,
fn: function( btn, text ){
if( btn == 'yes' ){
Ext.Ajax.request({
url: '/lib/controller/doModuleOperation.php',
params: {
OPID: 1,
MID: ID,
UID: <?=$UserID;?>,
SID: '<?=$Session;?>'
},
success: function(){
showSettings( SelectedNodeID, 2 );
}
});
};
},
icon: Ext.MessageBox.QUESTION
});
};
function enableModule( ID ){
Ext.Ajax.request({
url: '/lib/controller/doModuleOperation.php',
params: {
OPID: 2,
OPCODE: 1,
MID: ID,
UID: <?=$UserID;?>,
SID: '<?=$Session;?>'
},
success: function(){
showSettings( SelectedNodeID, 2 );
}
});
};
function disableModule( ID ){
Ext.Ajax.request({
url: '/lib/controller/doModuleOperation.php',
params: {
OPID: 2,
OPCODE: 0,
MID: ID,
UID: <?=$UserID;?>,
SID: '<?=$Session;?>'
},
success: function(){
showSettings( SelectedNodeID, 2 );
}
});
};
var addSensor_window = null;
function addSerialSensor( sensorType ){
if( addSensor_window!= null ){

4
lib/js_asm.php

@ -33,8 +33,8 @@ if( isset($_GET['Lang'])){
$UCL=$_GET['Lang']/1;
if ($UCL) $_SESSION['userlang']=$UCL; else $_SESSION['userlang']=$UserLang;
}
if( isset($_SESSION['userlang']) )$Labels=new Language($_SESSION['userlang'], '_js');
else $Labels=new Language( $UserLang, '_js');
if( isset($_SESSION['userlang']) )$Labels=new Language($_SESSION['userlang']);//, '_js');
else $Labels=new Language( $UserLang );//, '_js');
if( $UserLang == 3 || $UserLang == 255 ){
$RTL_SITE = true;

Loading…
Cancel
Save