Browse Source

Before Japan Full Upgrade

master
Evgeny Gagua 4 years ago
parent
commit
34260624f1
  1. 25
      lib/controller/addWidthTableRow.php
  2. 23
      lib/controller/getMaskSchedule.php
  3. 226
      lib/controller/getMaskScheduleEditor.php
  4. 252
      lib/controller/getNodeSettings.php
  5. 27
      lib/controller/getWidthTable.php
  6. 229
      lib/controller/getWidthTableEditor.php
  7. 3
      lib/controller/props/1_node_prop.js
  8. 8
      lib/controller/updateUserSssion.php
  9. 27
      lib/javascript/jsapi_dynamic/rgoose_main.js
  10. 93
      lib/javascript/jsapi_dynamic/rgoose_sysmap_editor.js
  11. BIN
      style/assets/mCamx4knTO6C4J_usFsMVw.png_500xaaaf.png
  12. BIN
      style/assets/mCamx4knTO6C4J_usFsMVw.spng_500xaf.png
  13. 44
      style/style.css

25
lib/controller/addWidthTableRow.php

@ -0,0 +1,25 @@
<?php
require_once('../ajax_asm.php');
if( $CUser->Data['id'] > 1 ){
if( isset( $_POST['NID'] ) ){
$NID = intval( $_POST['NID'] );
$SBM = ( $_POST['SBM'] == 'true' );
$RNG = floatval( $_POST['RNG'] );
$WDZ = floatval( $_POST['WDZ'] ) / 100.0;
if( $NID ){
if( $SBM ){
$QS = "SELECT `max_range` FROM `lrf_sensors` WHERE `id`={$NID}";
$RR = $DATABASE->Query( $QS );
$MR = floatval($RR[0]['max_range']);
$VAL = $RNG / $MR;
if( $VAL > 1.0 ) $VAL = 1.0;
} else {
$VAL = $RNG / 100.0;
if( $VAL > 1.0 ) $VAL = 1.0;
};
$QS = "INSERT INTO `lrf_detection_width_tables` SET `aux_id`={$NID}, `width_k`={$WDZ}, `range_k`={$VAL}";
$DATABASE->Query( $QS );
};
};
};
?>

23
lib/controller/getMaskSchedule.php

@ -0,0 +1,23 @@
<?php
require_once('../ajax_asm.php');
if( $CUser->Data['id'] > 1 ){
if( isset( $_POST['NID'] ) ){
$NID = intval( $_POST['NID'] );
$QS = "SELECT * FROM `lrf_mask_schedule` WHERE `sensor_id`={$NID} ORDER BY `time`, `date`";
$RR = $DATABASE->Query( $QS );
if( count( $RR ) ){
$Data['totalCount'] = count( $RR );
$Data['rows'] = array();
foreach( $RR as $R ){
$CC['id'] = intval( $R['id'] );
$CC['op_mask'] = intval( $R['op_mask'] );
$CC['day_mask'] = intval( $R['day_mask'] );
$Data['rows'][] = $CC;
};
echo json_encode( $Data );
} else {
echo "{ 'totalCount': 0, 'rows':[] }";
};
};
};
?>

226
lib/controller/getMaskScheduleEditor.php

@ -0,0 +1,226 @@
<?php
require_once('../ajax_asm.php');
if( $CUser->Data['id'] > 1 ){
$EID = intval( $_POST['DID'] );
$TPL =<<<EFUFU
{
title: 'Mask Schedule Editor',
frame: true,
border: false,
xtype: 'editorgrid',
id: 'tw_grid',
cm: new Ext.grid.ColumnModel({
columns: [
{header: "1", tooltip:"First Mask", width: 22, sortable: false, fixed: true, menuDisabled: true, renderer: renderer_mask_0, dataIndex: 'op_mask' },
{header: "2", width: 22, sortable: false, fixed: true, menuDisabled: true, renderer: renderer_mask_1, dataIndex: 'op_mask' },
{header: "3", width: 22, sortable: false, fixed: true, menuDisabled: true, renderer: renderer_mask_2, dataIndex: 'op_mask' },
{header: "4", width: 22, sortable: false, fixed: true, menuDisabled: true, renderer: renderer_mask_3, dataIndex: 'op_mask' },
{header: "5", width: 22, sortable: false, fixed: true, menuDisabled: true, renderer: renderer_mask_4, dataIndex: 'op_mask' },
{header: "SA", tooltip:"Saturday", width: 32, sortable: false, fixed: true, menuDisabled: true, renderer: renderer_day_0, dataIndex: 'day_mask' },
{header: "SU", tooltip:"Sunday", width: 32, sortable: false, fixed: true, menuDisabled: true, renderer: renderer_day_1, dataIndex: 'day_mask' },
{header: "MO", tooltip:"Monday", width: 34, sortable: false, fixed: true, menuDisabled: true, renderer: renderer_day_2, dataIndex: 'day_mask' },
{header: "TW", tooltip:"Twesday", width: 32, sortable: false, fixed: true, menuDisabled: true, renderer: renderer_day_3, dataIndex: 'day_mask' },
{header: "WE", tooltip:"Wensday",width: 34, sortable: false, fixed: true, menuDisabled: true, renderer: renderer_day_4, dataIndex: 'day_mask' },
{header: "TH", tooltip:"Thusday",width: 32, sortable: false, fixed: true, menuDisabled: true, renderer: renderer_day_5, dataIndex: 'day_mask' },
{header: "FR", tooltip:"Friday",width: 32, sortable: false, fixed: true, menuDisabled: true, renderer: renderer_day_6, dataIndex: 'day_mask' },
{header: '<img src="/style/icons/fam/bell.png">', tooltip:"Special Date", width: 32, sortable: false, fixed: true, menuDisabled: true, renderer: renderer_day_s, dataIndex: 'day_mask' },
],
defaults: {
sortable: true,
menuDisabled: true,
width: 100
}/*,
listeners: {
hiddenchange: function(cm, colIndex, hidden) {
//saveConfig(colIndex, hidden);
}
}*/
}),
sm: new Ext.grid.RowSelectionModel({
singleSelect: true,
listeners: {
rowselect: function(sm, row, rec ) {
}
}
}),
ds: new Ext.data.JsonStore({
root: 'rows',
totalProperty: 'totalCount',
idProperty: 'id',
autoLoad: true,
fields: [{
name: 'id',
type: 'int'
},{
name: 'op_mask',
type: 'int'
},{
name: 'day_mask',
type: 'int'
}],
baseParams:{
UID: {$UserID},
SID: '{$Session}',
NID: {$EID}
},
proxy:
new Ext.data.HttpProxy({
method: 'POST',
noCache: false,
type: 'ajax',
prettyUrls: false,
url: '/lib/controller/getMaskSchedule.php'
})
}),
tbar:[{
text: 'Add Row',
handler: function(){
var wiwin = new Ext.Window({
title: 'Add Row',
width: 300,
height: 220,
modal: true,
layout: 'fit',
items:{
xtype: 'form',
id: 'm_a_w_f',
border: false,
frame: true,
labelWidth: 160,
hideLabel: false,
items:[{
xtype: 'radio',
fieldLabel: 'Range by Meters',
id: 'ra_ty_me',
name: 'ra_ra_ty',
checked: true,
listeners:{
check: function( t, n ){
if( n ){
Ext.getCmp('ra_ra_vam').enable();
Ext.getCmp('ra_ra_vap').disable();
} else {
Ext.getCmp('ra_ra_vap').enable();
Ext.getCmp('ra_ra_vam').disable();
};
}
}
},{
xtype: 'radio',
fieldLabel: 'Range by Percents',
id: 'ra_ty_pe',
name: 'ra_ra_ty',
checked: false
},{
xtype: 'numberfield',
id: 'ra_ra_vam',
fieldLabel: 'Range [m]',
hideLabel: false,
width: 60,
listeners:{
change: function( t, n, o ){
var cmm = Ext.getCmp('node_range').getValue() / 100;
if( cmm > 0 ){
Ext.getCmp('ra_ra_vap').setValue( n / cmm );
} else {
Ext.getCmp('ra_ra_vap').setValue( 0 );
};
}
}
},{
xtype: 'numberfield',
id: 'ra_ra_vap',
fieldLabel: 'Range [%]',
hideLabel: false,
disabled: true,
minValue: 1,
maxValue: 100,
width: 60,
listeners:{
change: function( t, n, o ){
var cmm = Ext.getCmp('node_range').getValue() / 100;
if( cmm > 0 ){
Ext.getCmp('ra_ra_vam').setValue( n * cmm );
} else {
Ext.getCmp('ra_ra_vam').setValue( 0 );
};
}
}
},{
xtype: 'numberfield',
id: 'wi_wi_va',
fieldLabel: 'Width [%]',
width: 60,
minValue: 1,
maxValue: 5000,
value: 100
}]
},
bbar:[{
text: 'Cancel',
handler: function(){
wiwin.close();
}
},{
text: 'Add',
handler: function(){
var CT = Ext.getCmp('ra_ty_me').getValue();
if( CT ){
var CV = Ext.getCmp('ra_ra_vam').getValue();
} else {
var CV = Ext.getCmp('ra_ra_vap').getValue();
};
var CW = Ext.getCmp('wi_wi_va').getValue();
Ext.Ajax.request({
url: '/lib/controller/addWidthTableRow.php',
params: {
UID: {$UserID},
SID: '{$Session}',
NID: {$EID},
SBM: CT,
RNG: CV,
WDZ: CW
},
success: function( response, opts ){
//get DS and reload!
},
failure: failureAJAXFunction
});
}
}]
});
wiwin.show();
var cmm = Ext.getCmp('node_range').getValue();
Ext.getCmp('ra_ra_vam').setRawValue( cmm );
Ext.getCmp('ra_ra_vap').setRawValue( 100 );
}
},{
text: 'Remove Row',
handler: function(){
}
},{
text: 'Clear Table',
handler: function(){
}
}]
}
EFUFU;
$TPL = str_ireplace( '%%%NAME%%%', $R_name, $TPL );
$TPL = str_ireplace( '%%%INFO%%%', $R_dev, $TPL );
$TPL = str_ireplace( '%%%SPD%%%', $Labels->GetLabel('UART_COM_SPEED'), $TPL );
$TPL = str_ireplace( '%%%SPD_VAL%%%', $Z['speed'], $TPL );
$TPL = str_ireplace( '%%%BITS_VAL%%%',$Z['bit'], $TPL );
$TPL = str_ireplace( '%%%PARITY_VAL%%%',$Z['parity'], $TPL );
$TPL = str_ireplace( '%%%STOPS_VAL%%%',$Z['stop_bit'], $TPL );
$TPL = str_ireplace( '%%%%RES_ID%%%',$EID, $TPL );
$TPL = str_ireplace( '%%%USER_ID%%%',$UserID, $TPL );
$TPL = str_ireplace( '%%%SESSION%%%',$Session, $TPL );
echo $TPL;
} else {
header('location: /');
};
?>

252
lib/controller/getNodeSettings.php

@ -220,6 +220,258 @@
<?php
break;
};
case 1:
case 2:
case 3:
case 4:{
//Serial Devices
$QS = "SELECT * FROM `lrf_sensors` WHERE `id`={$Node['aux_id']}";
$RR=$DATABASE->Query( $QS );
$NData = $RR[0];
$NIFO = $Labels->GetLabel( 'SERV_BLD_TAG' ).':'. $NData['version'];
?>
{
xtype: 'tabpanel',
frame: false,
id: 'node_settings_content',
border: false,
activeTab: 0,
items: [{
xtype: 'panel',
title: 'General Info',
layout: 'hbox',
items:[{
xtype: 'panel',
flex: 1,
height: 303,
autoScroll: false,
html: '<table width="100%" border=0><tr><td height="290px" align="center" valign="middle"><div id="node_pic" class="node_<?=$Node['type'];?>_img_set"></div></td></tr></table>'
},{
xtype: 'form',
id: '_ed_small',
flex: 1,
height: 303,
autoScroll: false,
//layout: 'vbox',
labelWidth: 120,
labelAlign: 'right',
items:[{
xtype: 'textfield',
fieldLabel: "<?=$Labels->GetLabel( 'SENS_NAME' );?>",
id: 'node_name',
value: '<?=$Node['name'];?>',
listeners:{
change: function(){
settingsChangeNotifier( 'node_name' );
Ext.getCmp('sasa_bo').enable();
}
}
},{
xtype: 'combo',
fieldLabel: "<?=$Labels->GetLabel( 'SENS_TYPE' );?>",
id: 'node_type',
lazyRender: true,
mode: 'local',
forceSelection: true,
triggerAction: 'all',
editable: false,
disableKeyFilter: true,
store: new Ext.data.ArrayStore({
fields: ['aa_t','aa_txt'],
data: [
[1,'ALS Sensor'],
[2,'LFS Sensor'],
[3,'PLS 200 Sensor'],
[4,'PLS 360 Sensor']
]
}),
valueField: 'aa_t',
displayField: 'aa_txt',
value: '<?=$Node['type'];?>',
listeners:{
select: function( t, r, i ){
var n = r.data.aa_t;
//var b = t.getValue();
//if( n != b ){
document.getElementById('node_pic').className = 'node_'+ n +'_img_set';
settingsChangeNotifier( 'node_type' );
Ext.getCmp('sasa_bo').enable();
//};
},
change: function( t, n, o ){
document.getElementById('node_pic').className = 'node_'+ n +'_img_set';
settingsChangeNotifier( 'node_type' );
Ext.getCmp('sasa_bo').enable();
}
}
},{
xtype: 'numberfield',
fieldLabel: "<?=$Labels->GetLabel( 'SENS_RANGE' );?>",
id: 'node_range',
value: '<?=$NData['max_range'];?>',
listeners:{
change: function( t, n, o ){
settingsChangeNotifier( 'node_range' );
Ext.getCmp('sasa_bo').enable();
}
}
},{
xtype: 'panel',
width: '100%',
html: '<div class="sideInfo_item" id="INFO_ON"><?=$Labels->GetLabel( 'SETIAL_TAG' ).': '.$NData['serial'];?></div>'
},{
xtype: 'panel',
width: '100%',
html: '<div class="setEd_infoPanel" id="INFO_IPS"><?=$NIFO;?></div>'
},{
xtype: 'button',
id: 'sasa_bo',
width: '100%',
disabled: true,
text: 'Apply Changes',
handler: function(){
}
}]
}]
},{
xtype: 'panel',
title: 'Resources',
layout: 'hbox',
items:[{
xtype: 'panel',
flex: 1,
height: 303,
autoScroll: 'auto',
//layout: 'fit',
items:[<?php
$QS = "SELECT * FROM resources WHERE `node_id`={$Z}";
$Result = $DATABASE->Query( $QS, false );
$SockDataParts = array();
if( count( $Result ) ){
foreach( $Result as $R ){
switch( $R['type'] ){
case 1:
//Uart
$SockDataParts[] = '{ xtype: \'panel\', boder: false, frame: false, html: \'<a class="sideInfo_item" id="UART_'.(($R['active']==0)?'N':'O').'" onclick="editResource('.$R['id'].');">'.$Labels->GetLabel('UART_LINE_PROP').' '.(($R['used']==0)?'':'<img title="used" src="/style/icons/icons/link.png">').'</a>\'}';
break;
case 6:
//USB DC
$SockDataParts[] = '{ xtype: \'panel\', boder: false, frame: false, html: \'<a class="sideInfo_item" id="USBDC_'.(($R['active']==0)?'N':'O').'" onclick="editResource('.$R['id'].');">'.$Labels->GetLabel('UART_LINE_PROP').' '.(($R['used']==0)?'':'<img title="used" src="/style/icons/icons/link.png">').'</a>\'}';
break;
case 31:
//Video Grabber
$SockDataParts[] = '{ xtype: \'panel\', boder: false, frame: false, html: \'<a class="sideInfo_item" id="VIDEO_'.(($R['active']==0)?'N':'O').'" onclick="editResource('.$R['id'].');">'.$Labels->GetLabel('FRAMEGRAB_PROP').' '.(($R['used']==0)?'':'<img title="used" src="/style/icons/icons/link.png">').'</a>\'}';
break;
case 100:
//Loopback
$SockDataParts[] = '{ xtype: \'panel\', boder: false, frame: false, html: \'<a class="sideInfo_item" id="NET_'.(($R['active']==0)?'N':'O').'" onclick="editResource('.$R['id'].');">'.$Labels->GetLabel('LOOPBACK_PROP').' '.(($R['used']==0)?'':'<img title="used" src="/style/icons/icons/link.png">').'</a>\'}';
break;
case 101:
//Ethernet Interface
$SockDataParts[] = '{ xtype: \'panel\', boder: false, frame: false, html: \'<a class="sideInfo_item" id="NET_'.(($R['active']==0)?'N':'O').'" onclick="editResource('.$R['id'].');">'.$Labels->GetLabel('ETHERNET_PROP').' '.(($R['used']==0)?'':'<img title="used" src="/style/icons/icons/link.png">').'</a>\'}';
break;
case 102:
//WiFi Interface
$SockDataParts[] = '{ xtype: \'panel\', boder: false, frame: false, html: \'<a class="sideInfo_item" id="NET_'.(($R['active']==0)?'N':'O').'" onclick="editResource('.$R['id'].');">'.$Labels->GetLabel('WIFI_PROP').' '.(($R['used']==0)?'':'<img title="used" src="/style/icons/icons/link.png">').'</a>\'}';
break;
case 103:
//Virtual IP Interface
$SockDataParts[] = '{ xtype: \'panel\', boder: false, frame: false, html: \'<a class="sideInfo_item" id="NET_'.(($R['active']==0)?'N':'O').'" onclick="editResource('.$R['id'].');">'.$Labels->GetLabel('VIRTUALIP_PROP').' '.(($R['used']==0)?'':'<img title="used" src="/style/icons/icons/link.png">').'</a>\'}';
break;
case 104:
//VPN Interface
$SockDataParts[] = '{ xtype: \'panel\', boder: false, frame: false, html: \'<a class="sideInfo_item" id="NET_'.(($R['active']==0)?'N':'O').'" onclick="editResource('.$R['id'].');">'.$Labels->GetLabel('VPN_TUN_PROP').' '.(($R['used']==0)?'':'<img title="used" src="/style/icons/icons/link.png">').'</a>\'}';
break;
case 105:
//WAN Interface
$SockDataParts[] = '{ xtype: \'panel\', boder: false, frame: false, html: \'<a class="sideInfo_item" id="NET_'.(($R['active']==0)?'N':'O').'" onclick="editResource('.$R['id'].');">'.$Labels->GetLabel('WAN_LINE_PROP').' '.(($R['used']==0)?'':'<img title="used" src="/style/icons/icons/link.png">').'</a>\'}';
break;
//Media Encoder Sink
case 131: // Video Encoder Sink
$SockDataParts[] = '{ xtype: \'panel\', boder: false, frame: false, html: \'<a class="sideInfo_item" id="MEDIA_'.(($R['active']==0)?'N':'O').'">'.'Video Sink'.' '.(($R['used']==0)?'':'<img title="used" src="/style/icons/icons/link.png">').'</a>\'}';
break;
case 132: // Audio Encoder Sink
$SockDataParts[] = '{ xtype: \'panel\', boder: false, frame: false, html: \'<a class="sideInfo_item" id="MEDIA_'.(($R['active']==0)?'N':'O').'">'.'Audio Sink'.' '.(($R['used']==0)?'':'<img title="used" src="/style/icons/icons/link.png">').'</a>\'}';
break;
default:
$SockDataParts[] = '{ xtype: \'panel\', boder: false, frame: false, html: \'<a align="center" style="padding: 5px; color: black; background-color: grey;">'.$R['device'].' '.(($R['used']==0)?'':'<img title="used" src="/style/icons/icons/link.png">').'</a>\'}';
};
};
echo implode( ',', $SockDataParts );
};
?>]
},{
xtype: 'panel',
id: 'res_ed_small',
flex: 1,
height: 303,
layout: 'fit',
items:[{
html:'<div class="setEd_infoPanel" id="NUNU"><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>'
}]
}]
},{
xtype: 'panel',
title: 'Detection Settings',
layout: 'hbox',
items:[{
xtype: 'panel',
flex: 1,
height: 303,
autoScroll: 'auto',
//layout: 'fit',
items:[<?php
$QS = "SELECT DISTINCT `profile_id` FROM `lrf_detection_profiles` WHERE `aux_id`={$Node['aux_id']} ORDER BY `profile_id`";
$ZUBI = $DATABASE->Query( $QS );
$Proparts = array();
foreach( $ZUBI as $Z ){
switch( $Z['profile_id'] ){
case 1: $MOMO = 'Low Sensitivity Profile'; break;
case 2: $MOMO = 'Medium Sensitivity Profile'; break;
case 3: $MOMO = 'High Sensitivity Profile'; break;
default: $MOMO = 'Factory Profile'; break;
};
$Proparts[] = '{ xtype: \'panel\', boder: false, frame: false, html: \'<a class="sideInfo_item" id="VIDEO_'.(($R['active']==0)?'N':'O').'" onclick="editResource('.$R['id'].');">'.$MOMO.' '.(($R['used']==0)?'':'<img title="used" src="/style/icons/icons/link.png">').'</a>\'}';
};
if( count( $ZUBI ) > 1 ){
$Proparts[] = '{ xtype: \'panel\', boder: false, frame: false, html: \'<a class="sideInfo_item" id="VIDEO_O" onclick="editWidthTable('.$Node['aux_id'].');">'."Profiles Schedule".' '.(($R['used']==0)?'':'<img title="used" src="/style/icons/icons/link.png">').'</a>\'}';
};
$Proparts[] = '{ xtype: \'panel\', boder: false, frame: false, html: \'<a class="sideInfo_item" id="VIDEO_O" onclick="editWidthTable('.$Node['aux_id'].');">'."Width Table".' '.(($R['used']==0)?'':'<img title="used" src="/style/icons/icons/link.png">').'</a>\'}';
// Check if Masks Exists
$QS = "SELECT `id` FROM `lrf_masks` WHERE `sensor_id`={$Node['aux_id']}";
$MM = $DATABASE->Query( $QS );
if( count( $MM ) ){
$Proparts[] = '{ xtype: \'panel\', boder: false, frame: false, html: \'<a class="sideInfo_item" id="VIDEO_O" onclick="editMaskSchedule('.$Node['aux_id'].');">'."Mask Schedule".' '.(($R['used']==0)?'':'<img title="used" src="/style/icons/icons/link.png">').'</a>\'}';
};
echo implode( ',', $Proparts );
?>]
},{
xtype: 'panel',
id: 'dep_ed_small',
flex: 1,
height: 303,
layout: 'fit',
items:[{
html:'<div class="setEd_infoPanel" id="NUNU"><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>'
}]
}]
},{
xtype: 'panel',
title: 'Embed Options',
layout: 'hbox',
items:[{
}]
},{
xtype: 'panel',
title: 'Advanced',
layout: 'hbox',
items:[{
}]
}]
}
<?php
break;
};
};
} else {
echo "{}";

27
lib/controller/getWidthTable.php

@ -0,0 +1,27 @@
<?php
require_once('../ajax_asm.php');
if( $CUser->Data['id'] > 1 ){
if( isset( $_POST['NID'] ) ){
$NID = intval( $_POST['NID'] );
$QS = "SELECT * FROM `lrf_detection_width_tables` WHERE `aux_id`={$NID} ORDER BY `range_k`";
$RR = $DATABASE->Query( $QS );
if( count( $RR ) ){
$QS = "SELECT `max_range` FROM `lrf_sensors` WHERE `id`={$NID}";
$ZZ = $DATABASE->Query( $QS );
$MR = floatval( $ZZ[0]['max_range'] );
$Data['totalCount'] = count( $RR );
$Data['rows'] = array();
foreach( $RR as $R ){
$CC['id'] = intval( $R['id'] );
$CC['width'] = intval( 100.0 * floatval($R['width_k']));
$CC['range'] = intval( 100.0 * floatval($R['range_k']));
$CC['range_m'] = intval( $MR * floatval($R['range_k']) );
$Data['rows'][] = $CC;
};
echo json_encode( $Data );
} else {
echo "{ 'totalCount': 0, 'rows':[] }";
};
};
};
?>

229
lib/controller/getWidthTableEditor.php

@ -0,0 +1,229 @@
<?php
require_once('../ajax_asm.php');
if( $CUser->Data['id'] > 1 ){
$EID = intval( $_POST['DID'] );
$TPL =<<<EFUFU
{
title: 'Width Table Editor',
frame: true,
border: false,
xtype: 'editorgrid',
id: 'tw_grid',
cm: new Ext.grid.ColumnModel({
columns: [
{header: "Width [%]", width: 100, sortable: false, menuDisabled: true, align: 'center', fixed: true, css: 'vertical-align: middle;', dataIndex: 'width' },
{header: "Range [%]", width: 100, sortable: false, fixed: true, menuDisabled: true, /*renderer: camCapRenderer,*/ dataIndex: 'range' },
{header: "Range [m]", width: 100, sortable: false, fixed: true, menuDisabled: true, /*renderer: camCapRenderer,*/ dataIndex: 'range_m' },
],
defaults: {
sortable: true,
menuDisabled: true,
width: 100
}/*,
listeners: {
hiddenchange: function(cm, colIndex, hidden) {
//saveConfig(colIndex, hidden);
}
}*/
}),
sm: new Ext.grid.RowSelectionModel({
singleSelect: true,
listeners: {
rowselect: function(sm, row, rec ) {
//loadEventProperties( rec.data );
//SelectedEvent = rec.data.id;
//SelectedRow = row;
//alert( SelectedEvent );
//var CB = Ext.getCmp('con_to_src');
//CB.enable();
}
}
}),
ds: new Ext.data.JsonStore({
root: 'rows',
totalProperty: 'totalCount',
idProperty: 'id',
autoLoad: true,
fields: [{
name: 'id',
type: 'int'
},{
name: 'width',
type: 'int'
},{
name: 'range',
type: 'int'
},{
name: 'range_m',
type: 'int'
}],
baseParams:{
UID: {$UserID},
SID: '{$Session}',
NID: {$EID}
},
proxy:
new Ext.data.HttpProxy({
method: 'POST',
noCache: false,
type: 'ajax',
prettyUrls: false,
url: '/lib/controller/getWidthTable.php',
headers: {
UIDZ: {$UserID},
SIDZ: '{$Session}',
NIDZ: {$EID}
}
})
}),
tbar:[{
text: 'Add Row',
handler: function(){
var wiwin = new Ext.Window({
title: 'Add Row',
width: 300,
height: 220,
modal: true,
layout: 'fit',
items:{
xtype: 'form',
id: 'm_a_w_f',
border: false,
frame: true,
labelWidth: 160,
hideLabel: false,
items:[{
xtype: 'radio',
fieldLabel: 'Range by Meters',
id: 'ra_ty_me',
name: 'ra_ra_ty',
checked: true,
listeners:{
check: function( t, n ){
if( n ){
Ext.getCmp('ra_ra_vam').enable();
Ext.getCmp('ra_ra_vap').disable();
} else {
Ext.getCmp('ra_ra_vap').enable();
Ext.getCmp('ra_ra_vam').disable();
};
}
}
},{
xtype: 'radio',
fieldLabel: 'Range by Percents',
id: 'ra_ty_pe',
name: 'ra_ra_ty',
checked: false
},{
xtype: 'numberfield',
id: 'ra_ra_vam',
fieldLabel: 'Range [m]',
hideLabel: false,
width: 60,
listeners:{
change: function( t, n, o ){
var cmm = Ext.getCmp('node_range').getValue() / 100;
if( cmm > 0 ){
Ext.getCmp('ra_ra_vap').setValue( n / cmm );
} else {
Ext.getCmp('ra_ra_vap').setValue( 0 );
};
}
}
},{
xtype: 'numberfield',
id: 'ra_ra_vap',
fieldLabel: 'Range [%]',
hideLabel: false,
disabled: true,
minValue: 1,
maxValue: 100,
width: 60,
listeners:{
change: function( t, n, o ){
var cmm = Ext.getCmp('node_range').getValue() / 100;
if( cmm > 0 ){
Ext.getCmp('ra_ra_vam').setValue( n * cmm );
} else {
Ext.getCmp('ra_ra_vam').setValue( 0 );
};
}
}
},{
xtype: 'numberfield',
id: 'wi_wi_va',
fieldLabel: 'Width [%]',
width: 60,
minValue: 1,
maxValue: 5000,
value: 100
}]
},
bbar:[{
text: 'Cancel',
handler: function(){
wiwin.close();
}
},{
text: 'Add',
handler: function(){
var CT = Ext.getCmp('ra_ty_me').getValue();
if( CT ){
var CV = Ext.getCmp('ra_ra_vam').getValue();
} else {
var CV = Ext.getCmp('ra_ra_vap').getValue();
};
var CW = Ext.getCmp('wi_wi_va').getValue();
Ext.Ajax.request({
url: '/lib/controller/addWidthTableRow.php',
params: {
UID: {$UserID},
SID: '{$Session}',
NID: {$EID},
SBM: CT,
RNG: CV,
WDZ: CW
},
success: function( response, opts ){
//get DS and reload!
},
failure: failureAJAXFunction
});
}
}]
});
wiwin.show();
var cmm = Ext.getCmp('node_range').getValue();
Ext.getCmp('ra_ra_vam').setRawValue( cmm );
Ext.getCmp('ra_ra_vap').setRawValue( 100 );
}
},{
text: 'Remove Row',
handler: function(){
}
},{
text: 'Clear Table',
handler: function(){
}
}]
}
EFUFU;
$TPL = str_ireplace( '%%%NAME%%%', $R_name, $TPL );
$TPL = str_ireplace( '%%%INFO%%%', $R_dev, $TPL );
$TPL = str_ireplace( '%%%SPD%%%', $Labels->GetLabel('UART_COM_SPEED'), $TPL );
$TPL = str_ireplace( '%%%SPD_VAL%%%', $Z['speed'], $TPL );
$TPL = str_ireplace( '%%%BITS_VAL%%%',$Z['bit'], $TPL );
$TPL = str_ireplace( '%%%PARITY_VAL%%%',$Z['parity'], $TPL );
$TPL = str_ireplace( '%%%STOPS_VAL%%%',$Z['stop_bit'], $TPL );
$TPL = str_ireplace( '%%%%RES_ID%%%',$EID, $TPL );
$TPL = str_ireplace( '%%%USER_ID%%%',$UserID, $TPL );
$TPL = str_ireplace( '%%%SESSION%%%',$Session, $TPL );
echo $TPL;
} else {
header('location: /');
};
?>

3
lib/controller/props/1_node_prop.js

@ -14,7 +14,8 @@
text: 'Change Settings',
width: '100%',
handler: function(){
LRF2D2_settings();
//LRF2D2_settings();
showSettings(%%%NODEID%%%);
}
},{
xtype:'fieldset',

8
lib/controller/updateUserSssion.php

@ -0,0 +1,8 @@
<?php
require_once('../ajax_asm.php');
if( $CUser->Data['id'] > 1 ){
echo "{'sessionIsValid': true }";
} else {
echo "{'sessionIsValid': false }";
};
?>

27
lib/javascript/jsapi_dynamic/rgoose_main.js

@ -103,6 +103,32 @@ function setUserContent( c_id ){
});
};
var gSessionValidatorInterval = null;
function sessionValidator(){
Ext.Ajax.request({
url: '/lib/controller/updateUserSssion.php',
params: {
UID: <?=$UserID;?>,
SID: '<?=$Session;?>'
},
success: function( response, opts ){
var data = Ext.decode(response.responseText);
if( !data.sessionIsValid ){
playSound();
Ext.Msg.show({
title:'<?=$Labels->GetLabel('_REQ_FAILURE_');?>',
msg: '<?=$Labels->GetLabel('_AJX_REQFAILURE_');?>',
buttons: Ext.Msg.OK,
icon: Ext.MessageBox.INFO
});
doLogout();
};
},
failure: failureAJAXFunction
});
};
function doCheckWindowSize(){
if (parseInt(navigator.appVersion)>3) {
if (navigator.appName=="Netscape") {
@ -127,6 +153,7 @@ var NotificationStack = null;
Ext.onReady(function(){
doCheckWindowSize();
gSessionValidatorInterval = window.setInterval( sessionValidator, 1000 );
NotificationStack = new PNotify.Stack({dir1: 'down', firstpos1: 25});
//window.onresize = doCheckWindowSize;
Ext.QuickTips.init();

93
lib/javascript/jsapi_dynamic/rgoose_sysmap_editor.js

@ -212,6 +212,99 @@ function editModule( mid ){
};
};
function editWidthTable( did ){
var loadEditor = true;
if( settingsAreChanged ){
Ext.Msg.show({
title:'<?=$Labels->GetLabel('_SETTINGS_CHANGED_');?>',
msg: '<?=$Labels->GetLabel('_SET_CHANGED_WOULD_SAVE_');?>',
buttons: Ext.Msg.YESNO,
icon: Ext.MessageBox.WARNING,
fn: function(btn, text){
if( btn == 'yes' ){
cleanupChangeNotifier();
} else {
loadEditor = false;
};
}
});
};
if( loadEditor ){
Ext.Ajax.request({
url: '/lib/controller/getWidthTableEditor.php',
params: {
DID: did,
UID: <?=$UserID;?>,
SID: '<?=$Session;?>',
},
success: function( response, opts ){
var data = Ext.decode(response.responseText);
var resourceEdPanel = Ext.getCmp('dep_ed_small');
if( resourceEdPanel ){
resourceEdPanel.removeAll( true );
resourceEdPanel.add( data );
resourceEdPanel.doLayout();
};
},
failure: failureAJAXFunction
});
};
};
function renderer_mask_0( a ){ return ( a & 1 )?'<img src="/style/icons/fam/accept.png">':'<img src="/style/icons/icons/cancel.png">';};
function renderer_mask_1( a ){ return ( a & ( 1 << 1 ) )?'<img src="/style/icons/fam/accept.png">':'<img src="/style/icons/icons/cancel.png">';};
function renderer_mask_2( a ){ return ( a & ( 1 << 2 ) )?'<img src="/style/icons/fam/accept.png">':'<img src="/style/icons/icons/cancel.png">';};
function renderer_mask_3( a ){ return ( a & ( 1 << 3 ) )?'<img src="/style/icons/fam/accept.png">':'<img src="/style/icons/icons/cancel.png">';};
function renderer_mask_4( a ){ return ( a & ( 1 << 4 ) )?'<img src="/style/icons/fam/accept.png">':'<img src="/style/icons/icons/cancel.png">';};
function renderer_day_0( a ){ return ( a & 1 )?'<img src="/style/icons/icons/clock.png">':'';};
function renderer_day_1( a ){ return ( a & ( 1 << 1 ) )?'<img src="/style/icons/icons/clock.png">':'';};
function renderer_day_2( a ){ return ( a & ( 1 << 2 ) )?'<img src="/style/icons/icons/clock.png">':'';};
function renderer_day_3( a ){ return ( a & ( 1 << 3 ) )?'<img src="/style/icons/icons/clock.png">':'';};
function renderer_day_4( a ){ return ( a & ( 1 << 4 ) )?'<img src="/style/icons/icons/clock.png">':'';};
function renderer_day_5( a ){ return ( a & ( 1 << 5 ) )?'<img src="/style/icons/icons/clock.png">':'';};
function renderer_day_6( a ){ return ( a & ( 1 << 6 ) )?'<img src="/style/icons/icons/clock.png">':'';};
function renderer_day_s( a ){ return ( a & ( 1 << 7 ) )?'<img src="/style/icons/icons/clock.png">':'';};
function editMaskSchedule( did ){
var loadEditor = true;
if( settingsAreChanged ){
Ext.Msg.show({
title:'<?=$Labels->GetLabel('_SETTINGS_CHANGED_');?>',
msg: '<?=$Labels->GetLabel('_SET_CHANGED_WOULD_SAVE_');?>',
buttons: Ext.Msg.YESNO,
icon: Ext.MessageBox.WARNING,
fn: function(btn, text){
if( btn == 'yes' ){
cleanupChangeNotifier();
} else {
loadEditor = false;
};
}
});
};
if( loadEditor ){
Ext.Ajax.request({
url: '/lib/controller/getMaskScheduleEditor.php',
params: {
DID: did,
UID: <?=$UserID;?>,
SID: '<?=$Session;?>',
},
success: function( response, opts ){
var data = Ext.decode(response.responseText);
var resourceEdPanel = Ext.getCmp('dep_ed_small');
if( resourceEdPanel ){
resourceEdPanel.removeAll( true );
resourceEdPanel.add( data );
resourceEdPanel.doLayout();
};
},
failure: failureAJAXFunction
});
};
};
function reloadNetworkData(){
Ext.Ajax.request({
url: '/lib/controller/getNetwork.php',

BIN
style/assets/mCamx4knTO6C4J_usFsMVw.png_500xaaaf.png

Binary file not shown.

After

Width: 244  |  Height: 354  |  Size: 98 KiB

BIN
style/assets/mCamx4knTO6C4J_usFsMVw.spng_500xaf.png

Binary file not shown.

After

Width: 244  |  Height: 322  |  Size: 83 KiB

44
style/style.css

@ -666,4 +666,48 @@ A.CalendarDS:hover {
background-position: 25px 15px;
background-size: 220px 220px;
}
.node_1_img_set{
display: block;
border-radius: 128px;
width: 256px;
height: 256px;
background-color: #fff343;
background-image: url('assets/!cid_ii_jvmzuzrm9.png');
background-repeat: no-repeat;
background-position: 17px 15px;
background-size: 220px 220px;
}
.node_2_img_set{
display: block;
border-radius: 128px;
width: 256px;
height: 256px;
background-color: #fff343;
background-image: url('assets/!cid_ii_jvmzuzqb2.png');
background-repeat: no-repeat;
background-position: 17px 15px;
background-size: 220px 220px;
}
.node_3_img_set{
display: block;
border-radius: 128px;
width: 256px;
height: 256px;
background-color: #fff343;
background-image: url('assets/!cid_ii_jvmzuzqh3.png');
background-repeat: no-repeat;
background-position: 17px 15px;
background-size: 220px 220px;
}
.node_4_img_set{
display: block;
border-radius: 128px;
width: 256px;
height: 256px;
background-color: #fff343;
background-image: url('assets/!cid_ii_jvmzuzqx6.png');
background-repeat: no-repeat;
background-position: 17px 15px;
background-size: 220px 220px;
}
Loading…
Cancel
Save