61 changed files with 2341 additions and 23301 deletions
-
4.gitignore
-
6index.php
-
2lib/1.json
-
3lib/assembler.php
-
60lib/controller/doApplicationOperation.php
-
38lib/controller/doDatabaseOperation.php
-
57lib/controller/doModuleOperations.php
-
223lib/controller/doPlatformOperations.php
-
69lib/controller/doSessionOperations.php
-
17lib/controller/getAddModuleWindow.php
-
202lib/controller/getApplicationSettings.php
-
32lib/controller/getHelpTopic.php
-
2lib/controller/getHistorySessionView.php
-
126lib/controller/getHistorySettings.php
-
12lib/controller/getLineEditor.php
-
2lib/controller/getMediaSettings.php
-
7lib/controller/getModuleEditor.php
-
60lib/controller/getMonitoringPlatformView.php
-
34lib/controller/getMonitoringSessionView.php
-
31lib/controller/getMonitoringStationView.php
-
36lib/controller/getMonitoringTrackView.php
-
340lib/controller/getPlatformEditor.php
-
869lib/controller/getSensorEditor.php
-
57lib/controller/getServerSettings.php
-
28lib/controller/getStationEditor.php
-
116lib/controller/getStatus.php
-
324lib/controller/importMojoReport.php
-
10lib/controller/listAccessLog.php
-
5lib/controller/listServerLog.php
-
124lib/controller/updateUser.php
-
17lib/defines.php
-
3lib/javascript/jsapi_dynamic/argus_logs.js
-
228lib/javascript/jsapi_dynamic/argus_monitoring.js
-
64lib/javascript/jsapi_dynamic/argus_reports.js
-
1191lib/javascript/jsapi_dynamic/argus_settings.js
-
346lib/javascript/jsapi_dynamic/loaders.html
-
993lib/javascript/jsapi_dynamic/mastbaum.js
-
1973lib/javascript/jsapi_dynamic/mojo_dashboard.js
-
269lib/javascript/jsapi_dynamic/mojo_logs.js
-
2561lib/javascript/jsapi_dynamic/mojo_map.js
-
94lib/javascript/jsapi_dynamic/mojo_metro.js
-
1593lib/javascript/jsapi_dynamic/mojo_reports.js
-
1664lib/javascript/jsapi_dynamic/rgoose_cameras.js
-
1299lib/javascript/jsapi_dynamic/rgoose_dashboard.js
-
2515lib/javascript/jsapi_dynamic/rgoose_devices.js
-
2370lib/javascript/jsapi_dynamic/rgoose_devices_.js
-
1255lib/javascript/jsapi_dynamic/rgoose_location_editor.js
-
479lib/javascript/jsapi_dynamic/rgoose_main.js
-
0lib/javascript/jsapi_dynamic/rgoose_map.js
-
575lib/javascript/jsapi_dynamic/rgoose_modules.js
-
1237lib/javascript/jsapi_dynamic/rgoose_reports.js
-
111lib/javascript/jsapi_dynamic/rgoose_single_ipi.js
-
569lib/javascript/jsapi_dynamic/rgoose_swupgrade.js
-
1170lib/javascript/jsapi_dynamic/rgoose_sysmap_editor.js
-
29lib/javascript/jsapi_dynamic/testus.js
-
56lib/php/argus/server.php
-
30lib/php/argus/templates.php
-
9lib/php/db/user_class.php
-
2lib/version.var
-
BINstyle/assets/bul_green_rst.png
-
44style/style.css
@ -1 +1,3 @@ |
|||||
lib/controller/data/* |
|
||||
|
lib/controller/data/* |
||||
|
lib/javascript/jsapi_dynamic/buba |
||||
|
lib/javascript/jsapi_dynamic/buba/* |
||||
2
lib/1.json
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,60 @@ |
|||||
|
<?php |
||||
|
require_once('../ajax_asm.php'); |
||||
|
if( $CUser->Data['id'] > 1 && $CUser->Data['access'] > 5 ){ |
||||
|
$Data = array(); |
||||
|
$Data['success'] = false; |
||||
|
if( isset( $_POST['OPID'] ) ){ |
||||
|
$CMD = intval( $_POST['OPID'] ); |
||||
|
} else { |
||||
|
$CMD = 0; |
||||
|
}; |
||||
|
if( $CMD > 0 ){ |
||||
|
switch( $CMD ){ |
||||
|
case 1:{ |
||||
|
$QS="INSERT INTO `mem_web_queue`(`cmd`,`aux_id`,`param`) VALUES(250,0,'')"; |
||||
|
$DATABASE->Query( $QS ); |
||||
|
}; |
||||
|
case 41:{ |
||||
|
$P = intval( $_POST['OPCODE'] ); |
||||
|
$QS = "UPDATE `system_props` SET `use_db_logging`={$P}"; |
||||
|
$DATABASE->Query( $QS ); |
||||
|
$Data['success'] = true; |
||||
|
break; |
||||
|
}; |
||||
|
case 42:{ |
||||
|
$P = intval( $_POST['OPCODE'] ); |
||||
|
$QS = "UPDATE `system_props` SET `encoder_limit`={$P}"; |
||||
|
$DATABASE->Query( $QS ); |
||||
|
$Data['success'] = true; |
||||
|
break; |
||||
|
}; |
||||
|
case 43:{ |
||||
|
$P = intval( $_POST['OPCODE'] ); |
||||
|
$QS = "UPDATE `system_props` SET `modbus_auto_rise`={$P}"; |
||||
|
$DATABASE->Query( $QS ); |
||||
|
$Data['success'] = true; |
||||
|
break; |
||||
|
}; |
||||
|
case 44:{ |
||||
|
$P = intval( $_POST['OPCODE'] ); |
||||
|
$QS = "UPDATE `system_props` SET `modbus_hazard_level`={$P}"; |
||||
|
$DATABASE->Query( $QS ); |
||||
|
$Data['success'] = true; |
||||
|
break; |
||||
|
}; |
||||
|
case 45:{ |
||||
|
$P = intval( $_POST['OPCODE'] ); |
||||
|
$QS = "UPDATE `system_props` SET `modbus_health_level`={$P}"; |
||||
|
$DATABASE->Query( $QS ); |
||||
|
$Data['success'] = true; |
||||
|
break; |
||||
|
}; |
||||
|
}; |
||||
|
} else { |
||||
|
$Data['msg']='Wrong Parameters!'; |
||||
|
}; |
||||
|
echo json_encode( $Data ); |
||||
|
exit(); |
||||
|
}; |
||||
|
header('location: /'); |
||||
|
?>
|
||||
@ -0,0 +1,38 @@ |
|||||
|
<?php |
||||
|
require_once('../ajax_asm.php'); |
||||
|
|
||||
|
function verbose( $ok=1,$info=""){ |
||||
|
// failure to upload throws 400 error
|
||||
|
if( $ok==0 ){ |
||||
|
http_response_code(400); |
||||
|
}; |
||||
|
die(json_encode(["ok"=>$ok, "info"=>$info])); |
||||
|
}; |
||||
|
if( $CUser->Data['id'] > 1 ){ |
||||
|
if( empty( $_FILES ) || $_FILES['db_file']['error'] ){ |
||||
|
verbose( 0, "Failed to move uploaded file.[" . $_FILES['db_file']['error'] . "]" ); |
||||
|
}; |
||||
|
$filePath = $SYSPath . 'lib/controller/data'; |
||||
|
if( !file_exists( $filePath ) ){ |
||||
|
if( !mkdir($filePath, 0777, true ) ){ |
||||
|
verbose( 0, "Failed to create $filePath" ); |
||||
|
}; |
||||
|
}; |
||||
|
if( file_exists( $_FILES['db_file']['tmp_name'] ) ){ |
||||
|
$MD5 = md5_file( $_FILES['db_file']['tmp_name'] ); |
||||
|
$TArr = explode( '.', $_FILES['db_file']['name'] ); |
||||
|
$EXT = 'db'; |
||||
|
$FNAME = $MD5 . '.' . $EXT; |
||||
|
copy( $_FILES['db_file']['tmp_name'], $filePath . '/' . $FNAME ); |
||||
|
@unlink( $_FILES['db_file']['tmp_name'] ); |
||||
|
|
||||
|
$RBASE = new SQLite_DB( '/dev/shm/argus/mem_db.db'); |
||||
|
$PARAM = $MD5; |
||||
|
$QS = "INSERT INTO `nodes_qcq`(`node_id`,`cmd`,`status`,`parameter`) VALUES(1,129,0,'{$PARAM}')"; |
||||
|
$RBASE->Query( $QS, false ); |
||||
|
verbose( 1, "ALL IS OK" ); |
||||
|
}; |
||||
|
} else { |
||||
|
verbose( 0, 'Access Denied!' ); |
||||
|
}; |
||||
|
?>
|
||||
@ -0,0 +1,202 @@ |
|||||
|
<?php |
||||
|
require_once('../ajax_asm.php'); |
||||
|
|
||||
|
if( $CUser->Data['id'] > 1 ){ |
||||
|
$Data['status'] = 'error'; |
||||
|
if( $CUser->Data['access'] > 5 ){ |
||||
|
$QS = "SELECT * FROM `system_props` WHERE `id`=1"; |
||||
|
$Result = $DATABASE->Query( $QS ); |
||||
|
$CS = $Result[0]; |
||||
|
$SKEL=<<<DATABOUNDARY |
||||
|
{ |
||||
|
xtype: 'panel', |
||||
|
border: false, |
||||
|
frame: false, |
||||
|
items:[{ |
||||
|
xtype: 'form', |
||||
|
labelAlign: 'right', |
||||
|
labelWidth: 180, |
||||
|
//height: PanelH - 30,
|
||||
|
items:[{ |
||||
|
xtype:'panel', |
||||
|
border: false, |
||||
|
frame: false, |
||||
|
html: '<table width="100%" border=0 class="setEd_infoPanel" id="LIBAV_LOGO"><tr><td width="200px"><div class="appis_logo_img"></div></td><td valign="middle">Application Settings</td></tr><tr><td colspan=2></td></tr></table><br/>' |
||||
|
},{ |
||||
|
xtype: 'spacer', |
||||
|
height: 10 |
||||
|
},{ |
||||
|
xtype: 'combo', |
||||
|
id: 'db_loging', |
||||
|
fieldLabel: '{$Labels->GetLabel('_DB_LOGGING_')}', |
||||
|
editable: false, |
||||
|
typeAhead: true, |
||||
|
triggerAction: 'all', |
||||
|
width: '100%', |
||||
|
lazyRender:true, |
||||
|
mode: 'local', |
||||
|
store: new Ext.data.ArrayStore({ |
||||
|
fields: ['cid', 'cnam'], |
||||
|
data: [['0',"Disabled"], ['1',"Enabled"]] |
||||
|
}), |
||||
|
valueField: 'cid', |
||||
|
displayField: 'cnam', |
||||
|
listeners:{ |
||||
|
focus: function( t ){ |
||||
|
loadHelpTopic( 'application_op_small', 32 ); |
||||
|
}, |
||||
|
select: function( t, r, i ){ |
||||
|
//alert('buba');
|
||||
|
doApplicationOperation( 41, r.data.cid ); |
||||
|
} |
||||
|
}, |
||||
|
value: '{$CS['use_db_logging']}' |
||||
|
},{ |
||||
|
xtype: 'spacer', |
||||
|
height: 10 |
||||
|
},{ |
||||
|
xtype: 'combo', |
||||
|
id: 'ses_window', |
||||
|
fieldLabel: '{$Labels->GetLabel('_APP_SESS_WND_')}', |
||||
|
editable: false, |
||||
|
typeAhead: true, |
||||
|
triggerAction: 'all', |
||||
|
width: '100%', |
||||
|
lazyRender:true, |
||||
|
mode: 'local', |
||||
|
store: new Ext.data.ArrayStore({ |
||||
|
fields: ['cid', 'cnam'], |
||||
|
data: [['1',"1 Minute"], ['2',"2 Minutes"], ['3',"3 Minutes"], ['4',"4 Minutes"],['5',"5 Minutes"]] |
||||
|
}), |
||||
|
valueField: 'cid', |
||||
|
displayField: 'cnam', |
||||
|
listeners:{ |
||||
|
focus: function( t ){ |
||||
|
loadHelpTopic( 'application_op_small', 33 ); |
||||
|
}, |
||||
|
select: function( t, r, i ){ |
||||
|
//alert('buba');
|
||||
|
//doApplicationOperation( 1, i );
|
||||
|
} |
||||
|
}, |
||||
|
value: 1//'{$CS['menc_container']}'
|
||||
|
},{ |
||||
|
xtype: 'spacer', |
||||
|
height: 10 |
||||
|
},{ |
||||
|
xtype: 'combo', |
||||
|
id: 'menc_cnt', |
||||
|
fieldLabel: '{$Labels->GetLabel('_APP_MENC_COUNT_')}', |
||||
|
editable: false, |
||||
|
typeAhead: true, |
||||
|
triggerAction: 'all', |
||||
|
width: '100%', |
||||
|
lazyRender:true, |
||||
|
mode: 'local', |
||||
|
store: new Ext.data.ArrayStore({ |
||||
|
fields: ['cid', 'cnam'], |
||||
|
data: [['1',"1"], ['2',"2"], ['3',"3"], ['4',"4"],['5',"5"],['6',"6"],['7',"7"],['8',"8"]] |
||||
|
}), |
||||
|
valueField: 'cid', |
||||
|
displayField: 'cnam', |
||||
|
listeners:{ |
||||
|
focus: function( t ){ |
||||
|
loadHelpTopic( 'application_op_small', 34 ); |
||||
|
}, |
||||
|
select: function( t, r, i ){ |
||||
|
//alert('buba');
|
||||
|
//doApplicationOperation( 1, i );
|
||||
|
} |
||||
|
}, |
||||
|
value: '{$CS['encoder_limit']}' |
||||
|
},{ |
||||
|
xtype: 'spacer', |
||||
|
height: 10 |
||||
|
},{ |
||||
|
xtype: 'numberfield', |
||||
|
fieldLabel: 'SCADA Auto Time', |
||||
|
editable: true, |
||||
|
width: 250, |
||||
|
value: '{$CS['modbus_auto_rise']}', |
||||
|
listeners:{ |
||||
|
focus: function( t ){ |
||||
|
loadHelpTopic( 'application_op_small', 35 ); |
||||
|
}, |
||||
|
change: function( t, r, i ){ |
||||
|
//alert('buba');
|
||||
|
doApplicationOperation( 43, r ); |
||||
|
} |
||||
|
} |
||||
|
},{ |
||||
|
xtype: 'spacer', |
||||
|
height: 10 |
||||
|
},{ |
||||
|
xtype: 'combo', |
||||
|
fieldLabel: 'SCADA Manual Activation', |
||||
|
editable: false, |
||||
|
typeAhead: true, |
||||
|
triggerAction: 'all', |
||||
|
width: '100%', |
||||
|
lazyRender:true, |
||||
|
mode: 'local', |
||||
|
store: new Ext.data.ArrayStore({ |
||||
|
fields: ['cid', 'cnam'], |
||||
|
data: [['0',"Disabled"], ['3',"Alert"], ['4',"Hazard"]] |
||||
|
}), |
||||
|
valueField: 'cid', |
||||
|
displayField: 'cnam', |
||||
|
listeners:{ |
||||
|
focus: function( t ){ |
||||
|
loadHelpTopic( 'application_op_small', 36 ); |
||||
|
}, |
||||
|
select: function( t, r, i ){ |
||||
|
//alert('buba');
|
||||
|
doApplicationOperation( 44, r.data.cid, true ); |
||||
|
} |
||||
|
}, |
||||
|
value: '{$CS['modbus_hazard_level']}' |
||||
|
},{ |
||||
|
xtype: 'spacer', |
||||
|
height: 10 |
||||
|
},{ |
||||
|
xtype: 'combo', |
||||
|
fieldLabel: 'SCADA Health Level', |
||||
|
editable: false, |
||||
|
typeAhead: true, |
||||
|
triggerAction: 'all', |
||||
|
width: '100%', |
||||
|
lazyRender:true, |
||||
|
mode: 'local', |
||||
|
store: new Ext.data.ArrayStore({ |
||||
|
fields: ['cid', 'cnam'], |
||||
|
data: [['0',"Disabled"],['1',"Camera Failure"],['2',"LRF Failure"],['3',"Sensor Communication"],['4',"Module SW Failure"],['5',"Module Network Failure"]] |
||||
|
}), |
||||
|
valueField: 'cid', |
||||
|
displayField: 'cnam', |
||||
|
listeners:{ |
||||
|
focus: function( t ){ |
||||
|
loadHelpTopic( 'application_op_small', 37 ); |
||||
|
}, |
||||
|
select: function( t, r, i ){ |
||||
|
//alert('buba');
|
||||
|
doApplicationOperation( 45, r.data.cid, true ); |
||||
|
} |
||||
|
}, |
||||
|
value: '{$CS['modbus_health_level']}' |
||||
|
},{ |
||||
|
xtype: 'spacer', |
||||
|
height: 10 |
||||
|
}] |
||||
|
}] |
||||
|
} |
||||
|
DATABOUNDARY; |
||||
|
$Data['status']= 'ok'; |
||||
|
$Data['content']=$SKEL; |
||||
|
} else { |
||||
|
$Data['msg']='Access Denied!'; |
||||
|
}; |
||||
|
echo json_encode( $Data ); |
||||
|
} else { |
||||
|
header('location: /'); |
||||
|
}; |
||||
|
?>
|
||||
@ -0,0 +1,126 @@ |
|||||
|
<?php |
||||
|
require_once('../ajax_asm.php'); |
||||
|
|
||||
|
if( $CUser->Data['id'] > 1 ){ |
||||
|
$Data['status'] = 'error'; |
||||
|
if( $CUser->Data['access'] > 5 ){ |
||||
|
$QS = "SELECT * FROM `system_props` WHERE `id`=1"; |
||||
|
$Result = $DATABASE->Query( $QS ); |
||||
|
$CS = $Result[0]; |
||||
|
$QS = "SELECT * FROM `session_statuses`"; |
||||
|
$Result = $DATABASE->Query( $QS ); |
||||
|
$JUJA = array( "['0','Disabled']", "['1','Unset']" ); //776497
|
||||
|
foreach( $Result as $R ){ |
||||
|
}; |
||||
|
$SKEL=<<<DATABOUNDARY |
||||
|
{ |
||||
|
xtype: 'panel', |
||||
|
border: false, |
||||
|
frame: false, |
||||
|
items:[{ |
||||
|
xtype: 'form', |
||||
|
labelAlign: 'right', |
||||
|
labelWidth: 250, |
||||
|
//height: PanelH - 30,
|
||||
|
items:[{ |
||||
|
xtype:'panel', |
||||
|
border: false, |
||||
|
frame: false, |
||||
|
html: '<table width="100%" border=0 class="setEd_infoPanel" id="LIBAV_LOGO"><tr><td width="200px"><div class="appis_logo_img"></div></td><td valign="middle">Reports/History Settings</td></tr><tr><td colspan=2></td></tr></table><br/>' |
||||
|
},{ |
||||
|
xtype: 'spacer', |
||||
|
height: 10 |
||||
|
},{ |
||||
|
xtype: 'combo', |
||||
|
id: 'hs_days', |
||||
|
fieldLabel: '{$Labels->GetLabel('_HAR_LEVEL_')}', |
||||
|
editable: false, |
||||
|
typeAhead: true, |
||||
|
triggerAction: 'all', |
||||
|
width: '100%', |
||||
|
lazyRender:true, |
||||
|
mode: 'local', |
||||
|
store: new Ext.data.ArrayStore({ |
||||
|
fields: ['cid', 'cnam'], |
||||
|
data: [['0',"Disabled"],['1',"Dissmised"],['2',"Alerts"]] |
||||
|
}), |
||||
|
valueField: 'cid', |
||||
|
displayField: 'cnam', |
||||
|
listeners:{ |
||||
|
focus: function( t ){ |
||||
|
loadHelpTopic( 'history_op_small', 32 ); |
||||
|
}, |
||||
|
select: function( t, r, i ){ |
||||
|
//alert('buba');
|
||||
|
//doApplicationOperation( 1, i );
|
||||
|
} |
||||
|
}, |
||||
|
value: '{$CS['histo_limit']}' |
||||
|
},{ |
||||
|
xtype: 'spacer', |
||||
|
height: 10 |
||||
|
},{ |
||||
|
xtype: 'numberfield', |
||||
|
id: 'hs_window', |
||||
|
fieldLabel: '{$Labels->GetLabel('_HAR_DAYS_')}', |
||||
|
listeners:{ |
||||
|
focus: function( t ){ |
||||
|
loadHelpTopic( 'history_op_small', 33 ); |
||||
|
}, |
||||
|
select: function( t, r, i ){ |
||||
|
//alert('buba');
|
||||
|
//doApplicationOperation( 1, i );
|
||||
|
} |
||||
|
}, |
||||
|
value: '{$CS['histo_days']}' |
||||
|
},{ |
||||
|
xtype: 'spacer', |
||||
|
height: 10 |
||||
|
},{ |
||||
|
xtype: 'numberfield', |
||||
|
id: 'hs_perc', |
||||
|
fieldLabel: '{$Labels->GetLabel('_HAR_FREE_PERC_')}', |
||||
|
listeners:{ |
||||
|
focus: function( t ){ |
||||
|
loadHelpTopic( 'history_op_small', 33 ); |
||||
|
}, |
||||
|
select: function( t, r, i ){ |
||||
|
//alert('buba');
|
||||
|
//doApplicationOperation( 1, i );
|
||||
|
} |
||||
|
}, |
||||
|
value: '{$CS['histo_perc']}' |
||||
|
},{ |
||||
|
xtype: 'spacer', |
||||
|
height: 10 |
||||
|
},{ |
||||
|
xtype: 'numberfield', |
||||
|
id: 'hs_megs', |
||||
|
fieldLabel: '{$Labels->GetLabel('_HAR_FREE_MEGS_')}', |
||||
|
listeners:{ |
||||
|
focus: function( t ){ |
||||
|
loadHelpTopic( 'history_op_small', 33 ); |
||||
|
}, |
||||
|
select: function( t, r, i ){ |
||||
|
//alert('buba');
|
||||
|
//doApplicationOperation( 1, i );
|
||||
|
} |
||||
|
}, |
||||
|
value: '{$CS['histo_megs']}' |
||||
|
},{ |
||||
|
xtype: 'spacer', |
||||
|
height: 10 |
||||
|
}] |
||||
|
}] |
||||
|
} |
||||
|
DATABOUNDARY; |
||||
|
$Data['status']= 'ok'; |
||||
|
$Data['content']=$SKEL; |
||||
|
} else { |
||||
|
$Data['msg']='Access Denied!'; |
||||
|
}; |
||||
|
echo json_encode( $Data ); |
||||
|
} else { |
||||
|
header('location: /'); |
||||
|
}; |
||||
|
?>
|
||||
@ -1,869 +0,0 @@ |
|||||
<?php |
|
||||
require_once('../ajax_asm.php'); |
|
||||
|
|
||||
if( $CUser->Data['id'] > 1 ){ |
|
||||
$EID = intval( $_POST['CID'] ); |
|
||||
$QS = "SELECT `sen`.*, `no`.`enable`, `no`.`name`, `no`.`id` as `node_id` FROM `lrf_sensors` `sen` LEFT JOIN `nodes` `no` ON( `no`.`aux_id`=`sen`.`id` AND `no`.`type`=`sen`.`type`) WHERE `sen`.`id`={$EID}"; |
|
||||
$Result = $DATABASE->Query( $QS, false ); |
|
||||
if( count( $Result ) ){ |
|
||||
$CR = $Result[0]; |
|
||||
$CR['ack_mask_type'] = intval( $CR['ack_mask_type'] ); |
|
||||
$CR['ack_mask_size'] = intval( $CR['ack_mask_size'] ); |
|
||||
$TTPL=<<<JOJOKA |
|
||||
{ |
|
||||
xtype: 'panel', |
|
||||
border: false, |
|
||||
frame: false, |
|
||||
items:[%%%ITEMS%%%] |
|
||||
} |
|
||||
JOJOKA; |
|
||||
$ITEMS = array(); |
|
||||
switch( $CR['type'] ){ |
|
||||
case 1: $NAME = '<b>'.$CR['name'].'</b><br/>ALS ' . $Labels->getLabel('SENSOR'); break; |
|
||||
case 2: $NAME = '<b>'.$CR['name'].'</b><br/>LFS ' . $Labels->getLabel('SENSOR'); break; |
|
||||
case 3: $NAME = '<b>'.$CR['name'].'</b><br/>PLS200 ' . $Labels->getLabel('SENSOR'); break; |
|
||||
case 4: $NAME = '<b>'.$CR['name'].'</b><br/>PLS360 ' . $Labels->getLabel('SENSOR'); break; |
|
||||
default: $NAME = '<b>'.$CR['name'].'</b><br/>Unknown Sensor'; |
|
||||
}; |
|
||||
$NAME .='<br/>communication errors per minute: '.$CR['com_epm']; |
|
||||
$INFO = '<table width="100%" border=0 style="font-weight: bold;"><tr><td width="130px" align="right">'.$Labels->GetLabel('_SERIAL_').':</td><td>'.(($CR['serial']!='')?$CR['serial']:'No Serial Defined').'</td></tr><tr><td align="right">'.$Labels->GetLabel('_VERSION_').':</td><td>'.(($CR['version']!='')?$CR['version']:'No Version Info').'</td></tr></table>'; |
|
||||
$ITEMS[0]="{ xtype:'panel', border: false, frame: false, html: '<table width=\"100%\" border=0 class=\"setEd_infoPanel\" id=\"SENSOR_".(($CR['enable']==1)?'A':'N')."\"><tr><td width=\"200px\"><div class=\"node_".$CR['type']."_img_sset\"></div></td><td valign=\"middle\">{$NAME}</td></tr><tr><td colspan=2>{$INFO}</td></tr></table><br/>'}"; |
|
||||
$QS="SELECT aux_id, device FROM resources WHERE ( type=1 OR type=129 )"; |
|
||||
$RR=$DATABASE->Query( $QS ); |
|
||||
if( count( $RR ) ){ |
|
||||
$RE=array(); |
|
||||
foreach( $RR as $R ){ |
|
||||
$RE[] = "[ {$R['aux_id']}, '{$R['device']}']"; |
|
||||
}; |
|
||||
$UARTS = implode( ',', $RE ); |
|
||||
} else { |
|
||||
$UARTS = "[0, \"".$Labels->GetLabel('_NO_UARTS_DEF_')."\"]"; |
|
||||
}; |
|
||||
$QS = "SELECT * FROM `lrf_ini_settings` WHERE `sensor_id`={$EID}"; |
|
||||
$RRR = $DATABASE->Query( $QS ); |
|
||||
if( count( $RRR ) ){ |
|
||||
$INI_S = $RRR[0]; |
|
||||
} else { |
|
||||
$INI_S = array(); |
|
||||
$INI_S['AUTORESET_ENABLE'] = 0; |
|
||||
$INI_S['AUTORESET_INTERLEAVE'] = 2000; |
|
||||
$INI_S['AUTORESET_TIMEOUT'] = 60000; |
|
||||
$INI_S['BOARD_TEMPERATURE'] = 1; |
|
||||
$INI_S['BOARD_ZEROSHIFT'] = 0; |
|
||||
$INI_S['BOARD_SPEED'] = 4; |
|
||||
$INI_S['RUN_DIR'] = 2; |
|
||||
$INI_S['NO_BLACK_TARGETS'] = 1; |
|
||||
$INI_S['JUST_MOVING_TARGETS'] = 0; |
|
||||
$INI_S['JUST_MOVING_RADIAL'] = 0; |
|
||||
$INI_S['JUST_MOVING_DISTANCE'] = 0; |
|
||||
if( stripos( $CR['version'], 'FF' )!== false ) { |
|
||||
$INI_S['FREEZ_FIRST_TH'] = 1; |
|
||||
$INI_S['SAVE_FIRST_TH'] = 1; |
|
||||
} else if( stripos( $CR['version'], 'FS' )!== false ){ |
|
||||
$INI_S['FREEZ_FIRST_TH'] = 1; |
|
||||
$INI_S['SAVE_FIRST_TH'] = 1; |
|
||||
} else if( stripos( $CR['version'], 'FD' )!== false ){ |
|
||||
$INI_S['FREEZ_FIRST_TH'] = 0; |
|
||||
$INI_S['SAVE_FIRST_TH'] = 0; |
|
||||
} else { |
|
||||
$INI_S['FREEZ_FIRST_TH'] = 0; |
|
||||
$INI_S['SAVE_FIRST_TH'] = 0; |
|
||||
}; |
|
||||
$QS = "INSERT INTO `lrf_ini_settings`(`sensor_id`,`AUTORESET_ENABLE`,`AUTORESET_INTERLEAVE`,`AUTORESET_TIMEOUT`,`BOARD_TEMPERATURE`,`BOARD_ZEROSHIFT`,`BOARD_SPEED`,`RUN_DIR`,`NO_BLACK_TARGETS`,`JUST_MOVING_TARGETS`,`JUST_MOVING_RADIAL`,`JUST_MOVING_DISTANCE`,`FREEZ_FIRST_TH`,`SAVE_FIRST_TH`) VALUES({$EID},0,0,0,0,0,4,2,0,0,0,0,{$INI_S['FREEZ_FIRST_TH']},{$INI_S['SAVE_FIRST_TH']})"; |
|
||||
$DATABASE->Query( $QS ); |
|
||||
}; |
|
||||
if( ( stripos( $CR['version'], 'FD' )!== false ) || ( stripos( $CR['version'], 'FS' )!== false ) || ( stripos( $CR['version'], 'FF' )!== false ) ){ |
|
||||
//Frozen TH
|
|
||||
if( stripos( $CR['version'], 'FD' )!== false ){ |
|
||||
$THF_OPERATION = ",{
|
|
||||
xtype: 'button', |
|
||||
text: '{$Labels->GetLabel('_SENS_ENA_FROTH_')}', |
|
||||
width: '100%', |
|
||||
iconCls: 'srv_op_fth_ble', |
|
||||
scale: 'large', |
|
||||
handler: function(){ |
|
||||
doSensorOperation( {$CR['id']}, 21, 0, true ); |
|
||||
} |
|
||||
}";
|
|
||||
} else { |
|
||||
if( stripos( $CR['version'], 'FS' )!== false ){ |
|
||||
$THF_OPERATION = ",{
|
|
||||
xtype: 'button', |
|
||||
text: '{$Labels->GetLabel('_SENS_FIN_FROTH_')}', |
|
||||
width: '100%', |
|
||||
iconCls: 'srv_op_fth_study', |
|
||||
scale: 'large', |
|
||||
handler: function(){ |
|
||||
doSensorOperation( {$CR['id']}, 24, 0, true ); |
|
||||
} |
|
||||
}";
|
|
||||
}; |
|
||||
if( stripos( $CR['version'], 'FF' )!== false ){ |
|
||||
$THF_OPERATION = ",{
|
|
||||
xtype: 'button', |
|
||||
text: '{$Labels->GetLabel('_SENS_DEL_FROTH_')}', |
|
||||
width: '100%', |
|
||||
iconCls: 'srv_op_fth_frozen', |
|
||||
scale: 'large', |
|
||||
handler: function(){ |
|
||||
doSensorOperation( {$CR['id']}, 23, 0, true ); |
|
||||
} |
|
||||
}";
|
|
||||
}; |
|
||||
$THF_OPERATION .= ",{
|
|
||||
xtype: 'button', |
|
||||
text: '{$Labels->GetLabel('_SENS_DIS_FROTH_')}', |
|
||||
width: '100%', |
|
||||
iconCls: 'srv_op_fth_ble', |
|
||||
scale: 'large', |
|
||||
handler: function(){ |
|
||||
doSensorOperation( {$CR['id']}, 22, 0, true ); |
|
||||
} |
|
||||
}";
|
|
||||
}; |
|
||||
} else { |
|
||||
$THF_OPERATION = ''; |
|
||||
} |
|
||||
$ED =<<<kokakskhkajhskr |
|
||||
{ |
|
||||
xtype: 'tabpanel', |
|
||||
activeTab: 0, |
|
||||
items:[{ |
|
||||
xtype: 'form', |
|
||||
title: '{$Labels->GetLabel('_GENERAL_')}', |
|
||||
labelWidth: 200, |
|
||||
border: false, |
|
||||
frame: false, |
|
||||
labelAlign: 'right', |
|
||||
height: PanelH - 283, |
|
||||
items:[{ |
|
||||
xtype: 'combo', |
|
||||
id: 'sens_se', |
|
||||
fieldLabel: "{$Labels->GetLabel('_SENS_STATUS_')}", |
|
||||
lazyRender: true, |
|
||||
mode: 'local', |
|
||||
forceSelection: true, |
|
||||
triggerAction: 'all', |
|
||||
editable: false, |
|
||||
disableKeyFilter: true, |
|
||||
store: new Ext.data.ArrayStore({ |
|
||||
fields: ['mode','mode_txt'], |
|
||||
data: [ |
|
||||
[0,'{$Labels->GetLabel('__DISABLED__')}'], |
|
||||
[1,'{$Labels->GetLabel('___ENABLED__')}'] |
|
||||
] |
|
||||
}), |
|
||||
valueField: 'mode', |
|
||||
displayField: 'mode_txt', |
|
||||
value: {$CR['enable']}, |
|
||||
width: 200, |
|
||||
listeners:{ |
|
||||
select: function( a, c, b ){ |
|
||||
doSensorOperation( {$CR['id']}, 1, b, true ); |
|
||||
} |
|
||||
} |
|
||||
},{ |
|
||||
xtype: 'combo', |
|
||||
id: 'sens_range', |
|
||||
fieldLabel: "{$Labels->GetLabel('SENS_RANGE')}", |
|
||||
lazyRender: true, |
|
||||
mode: 'local', |
|
||||
forceSelection: true, |
|
||||
triggerAction: 'all', |
|
||||
editable: false, |
|
||||
disableKeyFilter: true, |
|
||||
store: new Ext.data.ArrayStore({ |
|
||||
fields: ['range','range_txt'], |
|
||||
data: [ |
|
||||
[15,'15 {$Labels->GetLabel('_METERS_')}'], |
|
||||
[35,'35 {$Labels->GetLabel('_METERS_')}'], |
|
||||
[45,'45 {$Labels->GetLabel('_METERS_')}'], |
|
||||
[65,'65 {$Labels->GetLabel('_METERS_')}'], |
|
||||
[75,'75 {$Labels->GetLabel('_METERS_')}'], |
|
||||
[150,'150 {$Labels->GetLabel('_METERS_')}'], |
|
||||
[200,'200 {$Labels->GetLabel('_METERS_')}'], |
|
||||
[300,'300 {$Labels->GetLabel('_METERS_')}'], |
|
||||
[350,'350 {$Labels->GetLabel('_METERS_')}'] |
|
||||
] |
|
||||
}), |
|
||||
valueField: 'range', |
|
||||
displayField: 'range_txt', |
|
||||
value: {$CR['max_range']}, |
|
||||
width: 200, |
|
||||
listeners:{ |
|
||||
select: function( a, c, b ){ |
|
||||
doSensorOperation( {$CR['id']}, 2, b, true ); |
|
||||
} |
|
||||
} |
|
||||
},{ |
|
||||
xtype: 'numberfield', |
|
||||
id: 'sens_id', |
|
||||
fieldLabel: '{$Labels->GetLabel('_PROTO_DEVICE_ID_')}', |
|
||||
width: 200, |
|
||||
value: {$CR['device_id']}, |
|
||||
listeners:{ |
|
||||
change: function( a, c, b ){ |
|
||||
doSensorOperation( {$CR['id']}, 3, c, true ); |
|
||||
} |
|
||||
} |
|
||||
},{ |
|
||||
xtype: 'combo', |
|
||||
fieldLabel: '{$Labels->GetLabel('_UART_PORT_')}', |
|
||||
lazyRender: true, |
|
||||
id: 'uart_id', |
|
||||
mode: 'local', |
|
||||
disabled: false, |
|
||||
forceSelection: true, triggerAction: 'all', editable: false, disableKeyFilter: true, |
|
||||
store: new Ext.data.ArrayStore({ |
|
||||
fields: ['uart','uart_txt'], |
|
||||
data: [{$UARTS}] |
|
||||
}), |
|
||||
valueField: 'uart', |
|
||||
displayField: 'uart_txt', |
|
||||
value: {$CR['uart_id']}, |
|
||||
width: 200, |
|
||||
listeners:{ |
|
||||
select: function( a, c, b ){ |
|
||||
doSensorOperation( {$CR['id']}, 4, c.data.uart, true ); |
|
||||
} |
|
||||
} |
|
||||
},{ |
|
||||
xtype: 'combo', |
|
||||
id: 'ad_se', |
|
||||
fieldLabel: "{$Labels->GetLabel('AUTO_DRAW')}", |
|
||||
lazyRender: true, |
|
||||
mode: 'local', |
|
||||
forceSelection: true, |
|
||||
triggerAction: 'all', |
|
||||
editable: false, |
|
||||
disableKeyFilter: true, |
|
||||
store: new Ext.data.ArrayStore({ |
|
||||
fields: ['ad','ad_txt'], |
|
||||
data: [ |
|
||||
[0,'{$Labels->GetLabel('__DISABLED__')}'], |
|
||||
[10,'Each 10 Flips'], |
|
||||
[20,'Each 20 Flips'], |
|
||||
[30,'Each 30 Flips'], |
|
||||
[40,'Each 40 Flips'], |
|
||||
[50,'Each 50 Flips'], |
|
||||
[100,'Each 100 Flips'], |
|
||||
[200,'Each 200 Flips'] |
|
||||
] |
|
||||
}), |
|
||||
valueField: 'ad', |
|
||||
displayField: 'ad_txt', |
|
||||
value: {$CR['auto_draw']}, |
|
||||
width: 200, |
|
||||
listeners:{ |
|
||||
select: function( a, c, b ){ |
|
||||
doSensorOperation( {$CR['id']}, 5, b, true ); |
|
||||
} |
|
||||
} |
|
||||
},{ |
|
||||
xtype: 'numberfield', |
|
||||
id: 'basesh_id', |
|
||||
fieldLabel: 'Background {$Labels->GetLabel('__ZERO_SHIFT__')}', |
|
||||
width: 200, |
|
||||
value: {$CR['base_shift']}, |
|
||||
listeners:{ |
|
||||
change: function( a, c, b ){ |
|
||||
doSensorOperation( {$CR['id']}, 6, c, true ); |
|
||||
} |
|
||||
} |
|
||||
},{ |
|
||||
xtype: 'combo', |
|
||||
id: 'sens_at', |
|
||||
fieldLabel: "{$Labels->GetLabel('_SENS_ACKT_')}", |
|
||||
lazyRender: true, |
|
||||
mode: 'local', |
|
||||
forceSelection: true, |
|
||||
triggerAction: 'all', |
|
||||
editable: false, |
|
||||
disableKeyFilter: true, |
|
||||
store: new Ext.data.ArrayStore({ |
|
||||
fields: ['mode','mode_txt'], |
|
||||
data: [ |
|
||||
[0,'{$Labels->GetLabel('_MA_ROUND_')}'], |
|
||||
[1,'{$Labels->GetLabel('_MA_CIRCLE__')}'] |
|
||||
] |
|
||||
}), |
|
||||
valueField: 'mode', |
|
||||
displayField: 'mode_txt', |
|
||||
value: {$CR['ack_mask_type']}, |
|
||||
width: 200, |
|
||||
listeners:{ |
|
||||
select: function( a, c, b ){ |
|
||||
doSensorOperation( {$CR['id']}, 25, b, true ); |
|
||||
} |
|
||||
} |
|
||||
},{ |
|
||||
xtype: 'combo', |
|
||||
id: 'sens_as', |
|
||||
fieldLabel: "{$Labels->GetLabel('_SENS_ACKS_')}", |
|
||||
lazyRender: true, |
|
||||
mode: 'local', |
|
||||
forceSelection: true, |
|
||||
triggerAction: 'all', |
|
||||
editable: false, |
|
||||
disableKeyFilter: true, |
|
||||
store: new Ext.data.ArrayStore({ |
|
||||
fields: ['size','size_txt'], |
|
||||
data: [ |
|
||||
[10,'10 {$Labels->GetLabel('_METERS_')}'], |
|
||||
[20,'20 {$Labels->GetLabel('_METERS_')}'], |
|
||||
[30,'30 {$Labels->GetLabel('_METERS_')}'], |
|
||||
[40,'40 {$Labels->GetLabel('_METERS_')}'], |
|
||||
[50,'50 {$Labels->GetLabel('_METERS_')}'], |
|
||||
[60,'60 {$Labels->GetLabel('_METERS_')}'], |
|
||||
[70,'70 {$Labels->GetLabel('_METERS_')}'] |
|
||||
] |
|
||||
}), |
|
||||
valueField: 'size', |
|
||||
displayField: 'size_txt', |
|
||||
value: {$CR['ack_mask_size']}, |
|
||||
width: 200, |
|
||||
listeners:{ |
|
||||
select: function( a, c, b ){ |
|
||||
doSensorOperation( {$CR['id']}, 26, b, true ); |
|
||||
} |
|
||||
} |
|
||||
}] |
|
||||
},{ |
|
||||
xtype: 'form', |
|
||||
title: '{$Labels->GetLabel('_HARDWARE_')}', |
|
||||
labelWidth: 200, |
|
||||
border: false, |
|
||||
frame: false, |
|
||||
labelAlign: 'right', |
|
||||
height: PanelH - 283, |
|
||||
items:[{ |
|
||||
xtype: 'checkbox', |
|
||||
id: 'autores_ena', |
|
||||
fieldLabel: '{$Labels->GetLabel('_SENS_AUTOR_ENA_')}', |
|
||||
width: 200, |
|
||||
checked: {$INI_S['AUTORESET_ENABLE']}, |
|
||||
listeners:{ |
|
||||
check: function( a, c ){ |
|
||||
if( c ){ |
|
||||
doSensorOperation( {$CR['id']}, 7, 1, false ); |
|
||||
} else { |
|
||||
doSensorOperation( {$CR['id']}, 7, 0, false ); |
|
||||
}; |
|
||||
} |
|
||||
} |
|
||||
},{ |
|
||||
xtype: 'numberfield', |
|
||||
id: 'autores_il', |
|
||||
fieldLabel: '{$Labels->GetLabel('_SENS_AUTOR_INTER_')}', |
|
||||
width: 200, |
|
||||
value: {$INI_S['AUTORESET_INTERLEAVE']}, |
|
||||
listeners:{ |
|
||||
change: function( a, c, b ){ |
|
||||
doSensorOperation( {$CR['id']}, 8, c, false ); |
|
||||
} |
|
||||
} |
|
||||
},{ |
|
||||
xtype: 'numberfield', |
|
||||
id: 'autores_to', |
|
||||
fieldLabel: '{$Labels->GetLabel('_SENS_AUTOR_TO_')}', |
|
||||
width: 200, |
|
||||
value: {$INI_S['AUTORESET_TIMEOUT']}, |
|
||||
listeners:{ |
|
||||
change: function( a, c, b ){ |
|
||||
doSensorOperation( {$CR['id']}, 9, c, false ); |
|
||||
} |
|
||||
} |
|
||||
},{ |
|
||||
xtype: 'numberfield', |
|
||||
id: 'board_zsh', |
|
||||
fieldLabel: '{$Labels->GetLabel('_SENS_BZSHIFT_')}', |
|
||||
width: 200, |
|
||||
value: {$INI_S['BOARD_ZEROSHIFT']}, |
|
||||
listeners:{ |
|
||||
change: function( a, c, b ){ |
|
||||
doSensorOperation( {$CR['id']}, 10, c, false ); |
|
||||
} |
|
||||
} |
|
||||
},{ |
|
||||
xtype: 'numberfield', |
|
||||
id: 'board_temp', |
|
||||
fieldLabel: '{$Labels->GetLabel('_SENS_HTEMP_')}', |
|
||||
width: 200, |
|
||||
value: {$INI_S['BOARD_TEMPERATURE']}, |
|
||||
listeners:{ |
|
||||
change: function( a, c, b ){ |
|
||||
doSensorOperation( {$CR['id']}, 11, c, false ); |
|
||||
} |
|
||||
} |
|
||||
},{ |
|
||||
xtype: 'combo', |
|
||||
id: 'board_spd', |
|
||||
fieldLabel: "{$Labels->GetLabel('_SENS_SCANSPEED_')}", |
|
||||
lazyRender: true, |
|
||||
mode: 'local', |
|
||||
forceSelection: true, |
|
||||
triggerAction: 'all', |
|
||||
editable: false, |
|
||||
disableKeyFilter: true, |
|
||||
store: new Ext.data.ArrayStore({ |
|
||||
fields: ['sd','sd_txt'], |
|
||||
data: [ |
|
||||
[2,'2 Scans per second'], |
|
||||
[4,'4 Scans per second'], |
|
||||
[6,'6 Scans per second'], |
|
||||
[8,'8 Scans per second'], |
|
||||
[10,'10 Scans per second'], |
|
||||
[12,'12 Scans per second'] |
|
||||
] |
|
||||
}), |
|
||||
valueField: 'sd', |
|
||||
displayField: 'sd_txt', |
|
||||
value: {$INI_S['BOARD_SPEED']}, |
|
||||
width: 200, |
|
||||
listeners:{ |
|
||||
select: function( a, c, b ){ |
|
||||
doSensorOperation( {$CR['id']}, 12, b, false ); |
|
||||
} |
|
||||
} |
|
||||
},{ |
|
||||
xtype: 'checkbox', |
|
||||
id: 'nbt_ena', |
|
||||
fieldLabel: '{$Labels->GetLabel('_SENS_NOBLA_')}', |
|
||||
width: 200, |
|
||||
checked: {$INI_S['NO_BLACK_TARGETS']}, |
|
||||
listeners:{ |
|
||||
check: function( a, c ){ |
|
||||
if( c ){ |
|
||||
doSensorOperation( {$CR['id']}, 13, 1, false ); |
|
||||
} else { |
|
||||
doSensorOperation( {$CR['id']}, 13, 0, false ); |
|
||||
}; |
|
||||
} |
|
||||
} |
|
||||
},{ |
|
||||
xtype: 'checkbox', |
|
||||
id: 'jmt_ena', |
|
||||
fieldLabel: '{$Labels->GetLabel('_SENS_JUMOTA_')}', |
|
||||
width: 200, |
|
||||
checked: {$INI_S['JUST_MOVING_TARGETS']}, |
|
||||
listeners:{ |
|
||||
check: function( a, c ){ |
|
||||
if( c ){ |
|
||||
doSensorOperation( {$CR['id']}, 14, 1, false ); |
|
||||
} else { |
|
||||
doSensorOperation( {$CR['id']}, 14, 0, false ); |
|
||||
}; |
|
||||
} |
|
||||
} |
|
||||
},{ |
|
||||
xtype: 'checkbox', |
|
||||
id: 'jmt_rad', |
|
||||
fieldLabel: '{$Labels->GetLabel('_SENS_JUMORA_')}', |
|
||||
width: 200, |
|
||||
checked: {$INI_S['JUST_MOVING_RADIAL']}, |
|
||||
listeners:{ |
|
||||
check: function( a, c ){ |
|
||||
if( c ){ |
|
||||
doSensorOperation( {$CR['id']}, 15, 1, false ); |
|
||||
} else { |
|
||||
doSensorOperation( {$CR['id']}, 15, 0, false ); |
|
||||
}; |
|
||||
} |
|
||||
} |
|
||||
},{ |
|
||||
xtype: 'checkbox', |
|
||||
id: 'jmt_range', |
|
||||
fieldLabel: '{$Labels->GetLabel('_SENS_JUMODI_')}', |
|
||||
width: 200, |
|
||||
checked: {$INI_S['JUST_MOVING_DISTANCE']}, |
|
||||
listeners:{ |
|
||||
check: function( a, c ){ |
|
||||
if( c ){ |
|
||||
doSensorOperation( {$CR['id']}, 16, 1, false ); |
|
||||
} else { |
|
||||
doSensorOperation( {$CR['id']}, 16, 0, false ); |
|
||||
}; |
|
||||
} |
|
||||
} |
|
||||
},{ |
|
||||
xtype: 'checkbox', |
|
||||
id: 'fth_freeze', |
|
||||
fieldLabel: '{$Labels->GetLabel('_SENS_FFTH_')}', |
|
||||
width: 200, |
|
||||
checked: {$INI_S['FREEZ_FIRST_TH']}, |
|
||||
listeners:{ |
|
||||
check: function( a, c ){ |
|
||||
if( c ){ |
|
||||
doSensorOperation( {$CR['id']}, 17, 1, false ); |
|
||||
} else { |
|
||||
doSensorOperation( {$CR['id']}, 17, 0, false ); |
|
||||
}; |
|
||||
} |
|
||||
} |
|
||||
},{ |
|
||||
xtype: 'checkbox', |
|
||||
id: 'fth_save', |
|
||||
fieldLabel: '{$Labels->GetLabel('_SENS_SFTH_')}', |
|
||||
width: 200, |
|
||||
checked: {$INI_S['SAVE_FIRST_TH']}, |
|
||||
listeners:{ |
|
||||
check: function( a, c ){ |
|
||||
if( c ){ |
|
||||
doSensorOperation( {$CR['id']}, 18, 1, false ); |
|
||||
} else { |
|
||||
doSensorOperation( {$CR['id']}, 18, 0, false ); |
|
||||
}; |
|
||||
} |
|
||||
} |
|
||||
},{ |
|
||||
xtype: 'button', |
|
||||
text: '{$Labels->GetLabel('_SENS_APPLY_RES_')}', |
|
||||
width: '100%', |
|
||||
iconCls: 'srv_op_download', |
|
||||
scale: 'large', |
|
||||
handler: function(){ |
|
||||
doSensorOperation( {$CR['id']}, 20, 0, true ); |
|
||||
} |
|
||||
}] |
|
||||
},{ |
|
||||
xtype: 'panel', |
|
||||
title: '{$Labels->GetLabel('_POSITION_')}', |
|
||||
height: PanelH - 283, |
|
||||
items:[{ |
|
||||
xtype: 'panel', |
|
||||
id: 'sens_posrot', |
|
||||
height: PanelH - 283, |
|
||||
layout: 'table', |
|
||||
frame: false, |
|
||||
border: false, |
|
||||
layoutConfig: { |
|
||||
columns: 3 |
|
||||
}, |
|
||||
defaults: { |
|
||||
frame: false, |
|
||||
bodyStyle: 'padding:10px', |
|
||||
border: false |
|
||||
}, |
|
||||
items:[{ |
|
||||
html: '<table ><tr><td>{$Labels->GetLabel('_AXIS_ROT_')}</td><td><img width="32" src="/style/wicons/rotate-axis-x-512.png"></td></tr></table>' |
|
||||
},{ |
|
||||
xtype: 'numberfield', |
|
||||
decimalPrecision: 3, |
|
||||
value: {$CR['x_rot']}, |
|
||||
listeners:{ |
|
||||
change: function( a, c, b ){ |
|
||||
doSensorOperation( {$CR['id']}, 30, c ); |
|
||||
} |
|
||||
} |
|
||||
},{ |
|
||||
html: ' ' |
|
||||
},{ |
|
||||
html: '<table ><tr><td>{$Labels->GetLabel('_AXIS_ROT_')}</td><td><img width="32" src="/style/wicons/rotate-axis-y-512.png"></td></tr></table>' |
|
||||
},{ |
|
||||
xtype: 'numberfield', |
|
||||
decimalPrecision: 3, |
|
||||
value: {$CR['y_rot']}, |
|
||||
listeners:{ |
|
||||
change: function( a, c, b ){ |
|
||||
doSensorOperation( {$CR['id']}, 31, c ); |
|
||||
} |
|
||||
} |
|
||||
},{ |
|
||||
html: ' ' |
|
||||
},{ |
|
||||
html: '<table ><tr><td>{$Labels->GetLabel('_AXIS_ROT_')}</td><td><img width="32" src="/style/wicons/rotate-axis-z-512.png"></td></tr></table>' |
|
||||
},{ |
|
||||
xtype: 'numberfield', |
|
||||
decimalPrecision: 3, |
|
||||
value: {$CR['z_rot']}, |
|
||||
listeners:{ |
|
||||
change: function( a, c, b ){ |
|
||||
doSensorOperation( {$CR['id']}, 32, c ); |
|
||||
} |
|
||||
} |
|
||||
},{ |
|
||||
html: ' ' |
|
||||
},{ |
|
||||
html: '<table ><tr><td>Δ {$Labels->GetLabel('_FROM_ANCH_')}</td><td><img width="32" src="/style/wicons/rotate-position-x-512.png"></td></tr></table>' |
|
||||
},{ |
|
||||
xtype: 'numberfield', |
|
||||
decimalPrecision: 3, |
|
||||
value: {$CR['x']}, |
|
||||
listeners:{ |
|
||||
change: function( a, c, b ){ |
|
||||
doSensorOperation( {$CR['id']}, 33, c ); |
|
||||
} |
|
||||
} |
|
||||
},{ |
|
||||
html: ' ' |
|
||||
},{ |
|
||||
html: '<table ><tr><td>Δ {$Labels->GetLabel('_FROM_ANCH_')}</td><td><img width="32" src="/style/wicons/rotate-position-y-512.png"></td></tr></table>' |
|
||||
},{ |
|
||||
xtype: 'numberfield', |
|
||||
decimalPrecision: 3, |
|
||||
value: {$CR['y']}, |
|
||||
listeners:{ |
|
||||
change: function( a, c, b ){ |
|
||||
doSensorOperation( {$CR['id']}, 34, c ); |
|
||||
} |
|
||||
} |
|
||||
},{ |
|
||||
html: ' ' |
|
||||
},{ |
|
||||
html: '<table ><tr><td>Δ {$Labels->GetLabel('_FROM_ANCH_')}</td><td><img width="32" src="/style/wicons/rotate-position-z-512.png"></td></tr></table>' |
|
||||
},{ |
|
||||
xtype: 'numberfield', |
|
||||
decimalPrecision: 3, |
|
||||
value: {$CR['z']}, |
|
||||
listeners:{ |
|
||||
change: function( a, c, b ){ |
|
||||
doSensorOperation( {$CR['id']}, 35, c ); |
|
||||
} |
|
||||
} |
|
||||
},{ |
|
||||
html: ' ' |
|
||||
}] |
|
||||
}] |
|
||||
},{ |
|
||||
xtype: 'panel', |
|
||||
title: '{$Labels->GetLabel('_MAINTENENCE_')}', |
|
||||
height: PanelH - 283, |
|
||||
items:[{ |
|
||||
xtype: 'button', |
|
||||
text: '{$Labels->GetLabel('_SENS_DO_FULLR_')}', |
|
||||
width: '100%', |
|
||||
iconCls: 'srv_op_restart', |
|
||||
scale: 'large', |
|
||||
handler: function(){ |
|
||||
doDeviceOperation( {$CR['node_id']}, 1,'', true ); |
|
||||
} |
|
||||
},{ |
|
||||
xtype: 'button', |
|
||||
text: '{$Labels->GetLabel('_SENS_DO_READALL_')}', |
|
||||
width: '100%', |
|
||||
iconCls: 'srv_op_upload', |
|
||||
scale: 'large', |
|
||||
handler: function(){ |
|
||||
doDeviceOperation( {$CR['node_id']}, 128,'', true ); |
|
||||
} |
|
||||
},{ |
|
||||
xtype: 'button', |
|
||||
text: '{$Labels->GetLabel('_SENS_DO_SAVEALL_')}', |
|
||||
width: '100%', |
|
||||
iconCls: 'srv_op_download', |
|
||||
scale: 'large', |
|
||||
handler: function(){ |
|
||||
doDeviceOperation( {$CR['node_id']}, 129,'', true ); |
|
||||
} |
|
||||
}{$THF_OPERATION}] |
|
||||
},{ |
|
||||
xtype: 'panel', |
|
||||
title: '{$Labels->getLabel('_SND_FILES2_DEV__')}', |
|
||||
height: PanelH - 283, |
|
||||
items:[{ |
|
||||
title: '{$Labels->getLabel('_UPLOAD_PACKAGE_')}', |
|
||||
xtype: 'panel', |
|
||||
//height: 300,
|
|
||||
//flex: 1,
|
|
||||
frame: true, |
|
||||
border: false, |
|
||||
//layout: 'vbox',
|
|
||||
items:[{ |
|
||||
xtype:'button', |
|
||||
id: 'pickfiles_3', |
|
||||
width: '100%', |
|
||||
text: '{$Labels->GetLabel('_CHOOSEF_')}', |
|
||||
listeners:{ |
|
||||
afterrender: function(){ |
|
||||
muploader = new plupload.Uploader({ |
|
||||
runtimes : 'html5,html4', |
|
||||
browse_button : Ext.getDom('pickfiles_3'), |
|
||||
max_file_size : '1000mb', |
|
||||
chunk_size: '200kb', |
|
||||
max_retries: 3, |
|
||||
multi_selection: false, |
|
||||
max_file_count: 1, |
|
||||
url: '/lib/controller/uploadToDevice.php?DID={$EID}', |
|
||||
init: { |
|
||||
PostInit: function() { |
|
||||
}, |
|
||||
|
|
||||
FilesAdded: function( up, files ) { |
|
||||
Ext.getCmp('upload_files_btn').enable(); |
|
||||
Ext.getCmp('uploads_clr_btn').enable(); |
|
||||
plupload.each( files, function(file) { |
|
||||
uploads_store.loadData( [[ uploads_store_id, file.name, file.id, plupload.formatSize( file.size ), 0, 'N' ]], true ); |
|
||||
uploads_store_id++; |
|
||||
Ext.getCmp('upload_grid').doLayout(); |
|
||||
}); |
|
||||
}, |
|
||||
|
|
||||
UploadProgress: function(up, file) { |
|
||||
var pb = Ext.getCmp( 'progress_'+file.id ); |
|
||||
if( file.percent < 100 ){ |
|
||||
pb.updateProgress( file.percent / 100, file.percent + '%', false ); |
|
||||
} else { |
|
||||
pb.updateProgress( 1.0, 'Uploaded', false ); |
|
||||
uploads_store.removeAll(); |
|
||||
loadModuleFiles( {$EID} ); |
|
||||
}; |
|
||||
}, |
|
||||
|
|
||||
Error: function(up, err) { |
|
||||
Ext.Msg.show({ |
|
||||
title:'Upload Status', |
|
||||
msg: "Error #" + err.code + ": " + err.message, |
|
||||
buttons: Ext.Msg.OK, |
|
||||
icon: Ext.MessageBox.ERROR |
|
||||
}); |
|
||||
} |
|
||||
} |
|
||||
}); |
|
||||
muploader.init(); |
|
||||
//Ext.getCmp('uploaded_grid').hide();
|
|
||||
//Ext.getCmp('upload_progres_panel').show();
|
|
||||
devUploadID = {$CR['id']}; |
|
||||
fetchDeviceUploadStatus(); |
|
||||
//loadModuleFiles( {$EID} );
|
|
||||
} |
|
||||
} |
|
||||
},{ |
|
||||
height: 200, |
|
||||
xtype: 'grid', |
|
||||
id: 'upload_grid', |
|
||||
border: false, |
|
||||
frame: false, |
|
||||
mode: 'local', |
|
||||
lazyRender: true, |
|
||||
width: '100%', |
|
||||
autoScroll: true, |
|
||||
ds: uploads_store, |
|
||||
cm: new Ext.grid.ColumnModel( fileUploadsColModel_ops ), |
|
||||
sm: new Ext.grid.RowSelectionModel( fileUploadsSelModel_ops ), |
|
||||
viewConfig: { |
|
||||
forceFit: true |
|
||||
}, |
|
||||
bbar: [{ |
|
||||
text: '{$Labels->GetLabel('_CLEAR_')}', |
|
||||
id: 'uploads_clr_btn', |
|
||||
disabled: true, |
|
||||
handler: function(){ |
|
||||
muploader.splice(); |
|
||||
uploads_store.removeAll(); |
|
||||
uploads_store_id = 0; |
|
||||
Ext.getCmp('uploads_clr_btn').disable(); |
|
||||
Ext.getCmp('upload_files_btn').disable(); |
|
||||
} |
|
||||
},{ |
|
||||
xtype:'button', |
|
||||
id: 'upload_files_btn', |
|
||||
disabled: true, |
|
||||
text: '{$Labels->GetLabel('_UPLOA2MODULE_')}', |
|
||||
handler: function(){ |
|
||||
if( muploader!= null ){ |
|
||||
muploader.start(); |
|
||||
Ext.getCmp('upload_files_btn').disable(); |
|
||||
}; |
|
||||
} |
|
||||
}] |
|
||||
},{ |
|
||||
xtype: 'panel', |
|
||||
height: 20 |
|
||||
},{ |
|
||||
title: '{$Labels->GetLabel('_FISONMODULE_')}', |
|
||||
height: 200, |
|
||||
xtype: 'grid', |
|
||||
id: 'uploaded_grid', |
|
||||
border: false, |
|
||||
hidden: true, |
|
||||
frame: false, |
|
||||
mode: 'local', |
|
||||
lazyRender: true, |
|
||||
width: '100%', |
|
||||
autoScroll: true, |
|
||||
ds: uploaded_store, |
|
||||
cm: new Ext.grid.ColumnModel( fileModuleColModel_ops ), |
|
||||
sm: new Ext.grid.RowSelectionModel( fileUploadsSelModel_ops ), |
|
||||
viewConfig: { |
|
||||
forceFit: true |
|
||||
}, |
|
||||
bbar: [{ |
|
||||
text: '{$Labels->GetLabel('_CLEAR_')}', |
|
||||
id: 'oploaded_clr_btn', |
|
||||
disabled: false, |
|
||||
handler: function(){ |
|
||||
|
|
||||
//muploader.splice();
|
|
||||
uploaded_store.removeAll(); |
|
||||
uploaded_store_id = 0; |
|
||||
} |
|
||||
},{ |
|
||||
text: '{$Labels->GetLabel('_RESETSTATUS_')}', |
|
||||
id: 'oploaded_rst_btn', |
|
||||
disabled: true, |
|
||||
handler: function(){ |
|
||||
//muploader.splice();
|
|
||||
//uploaded_store.removeAll();
|
|
||||
//uploaded_store_id = 0;
|
|
||||
} |
|
||||
},{ |
|
||||
text: '{$Labels->GetLabel('_ISSURES_')}', |
|
||||
id: 'oploaded_sres_btn', |
|
||||
disabled: true, |
|
||||
handler: function(){ |
|
||||
//muploader.splice();
|
|
||||
//uploaded_store.removeAll();
|
|
||||
//uploaded_store_id = 0;
|
|
||||
} |
|
||||
},{ |
|
||||
xtype:'button', |
|
||||
//disabled: true,
|
|
||||
id: 'oploaded_snd_btn', |
|
||||
text: '{$Labels->GetLabel('_SENDTOSENS_')}', |
|
||||
handler: function(){ |
|
||||
doDeviceOperation( {$CR['node_id']}, 120,'', true ); |
|
||||
Ext.getCmp('uploaded_grid').hide(); |
|
||||
Ext.getCmp('upload_progres_panel').show(); |
|
||||
|
|
||||
devUploadID = {$CR['id']}; |
|
||||
fetchDeviceUploadStatus(); |
|
||||
} |
|
||||
}] |
|
||||
},{ |
|
||||
xtype: 'panel', |
|
||||
id: 'upload_progres_panel', |
|
||||
hidden: false, |
|
||||
items:[{ |
|
||||
id: 'upp_ttext', |
|
||||
html: 'Sending 3 file(s) to the device' |
|
||||
},{ |
|
||||
id: 'upp_ctext_', |
|
||||
html: '<table width="100%" height="50" border=0><tr><td width="100"> </td><td width="50" align="right" height="50"><svg version="1.1" id="L3" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 100 100" enable-background="new 0 0 0 0" xml:space="preserve"><circle fill="none" stroke="#fff" stroke-width="4" cx="50" cy="50" r="44" style="opacity:0.5;"/><circle fill="#fff" stroke="#e74c3c" stroke-width="3" cx="8" cy="54" r="6" ><animateTransform attributeName="transform" dur="2s" type="rotate" from="0 50 48" to="360 50 52" repeatCount="indefinite" /></circle></svg></td><td align="left" id="upp_ctext"></td></tr></table>' |
|
||||
},{ |
|
||||
xtype: 'progress', |
|
||||
id: 'upp_pbar', |
|
||||
width: '100%', |
|
||||
value: 0.0 |
|
||||
}] |
|
||||
}] |
|
||||
}] |
|
||||
}], |
|
||||
bbar:[{ |
|
||||
text: '{$Labels->GetLabel('_REMOVE_SENSOR_')}', |
|
||||
handler: function(){ |
|
||||
doSensorOperation( {$CR['id']}, 255,'', true ); |
|
||||
} |
|
||||
}] |
|
||||
} |
|
||||
kokakskhkajhskr; |
|
||||
$ITEMS[1] = $ED; |
|
||||
$CONTENT = implode(',',$ITEMS); |
|
||||
$TTPL = str_ireplace( '%%%ITEMS%%%', $CONTENT, $TTPL ); |
|
||||
echo $TTPL; |
|
||||
} else { |
|
||||
echo '{ xtype: \'panel\', html: \'Node '.$_POST['NODE'].' Loadded\'}'; |
|
||||
}; |
|
||||
} else { |
|
||||
header('location: /'); |
|
||||
}; |
|
||||
?>
|
|
||||
@ -0,0 +1,324 @@ |
|||||
|
<?php |
||||
|
|
||||
|
error_reporting( E_ALL ); |
||||
|
require_once('../settings.php'); |
||||
|
require_once('../defines.php'); |
||||
|
require_once('../php/argus/server.php'); |
||||
|
$DATAPATH = $SYSPath . 'lib/controller/data/reports/'; |
||||
|
function generateUUIDv4(): string |
||||
|
{ |
||||
|
// Generate 16 random bytes
|
||||
|
$data = random_bytes(16); |
||||
|
|
||||
|
// Set the version to 4 (0100 in binary)
|
||||
|
// The 6th byte (index 5 in a 0-indexed array) contains the version information.
|
||||
|
// We clear the top 4 bits and then set the version bits to 0100 (4).
|
||||
|
$data[6] = chr(ord($data[6]) & 0x0f | 0x40); |
||||
|
|
||||
|
// Set the variant to 2 (10 in binary, RFC 4122)
|
||||
|
// The 8th byte (index 7 in a 0-indexed array) contains the variant information.
|
||||
|
// We clear the top 2 bits and then set the variant bits to 10 (2).
|
||||
|
$data[8] = chr(ord($data[8]) & 0x3f | 0x80); |
||||
|
|
||||
|
// Format the byte string into a UUID string with hyphens
|
||||
|
// vsprintf is used with a format string to insert the hexadecimal representation
|
||||
|
// of the byte chunks into the correct positions.
|
||||
|
return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($data), 4)); |
||||
|
} |
||||
|
|
||||
|
function createSession( $TID, $STS, $ETS ){ |
||||
|
global $DATABASE; |
||||
|
$STSS = intval( $STS / 1000 ); |
||||
|
$STSM = $STS % 1000; |
||||
|
$ETSS = intval( $ETS / 1000 ); |
||||
|
$UUID = generateUUIDv4(); |
||||
|
$QS = "INSERT INTO `sessions` SET `ts`={$STSS}, `ts_ms`={$STSM}, `lts`={$ETSS}, `uuid`='{$UUID}', `track_id`={$TID}, `status`=5, `final`='Y'"; |
||||
|
$DATABASE->Query( $QS ); |
||||
|
return $DATABASE->getLastInsertID(); |
||||
|
}; |
||||
|
|
||||
|
function makeSureSessionDirIsOk( $TID, $TS ){ |
||||
|
global $DATAPATH; |
||||
|
$status = true; |
||||
|
$Y = date( 'Y', $TS ); |
||||
|
$M = date( 'm', $TS ); |
||||
|
$D = date( 'd', $TS ); |
||||
|
$CP = $DATAPATH . $TID; |
||||
|
if( !file_exists( $CP ) ) { |
||||
|
$status = mkdir( $CP ); |
||||
|
chown( $CP, 'www-data' ); |
||||
|
chgrp( $CP, 'www-data' ); |
||||
|
chmod( $CP, 0765 ); |
||||
|
}; |
||||
|
$CP .= '/'.$Y; |
||||
|
if( $status ) if( !file_exists( $CP ) ) { |
||||
|
$status = mkdir( $CP ); |
||||
|
chown( $CP, 'www-data' ); |
||||
|
chgrp( $CP, 'www-data' ); |
||||
|
chmod( $CP, 0765 ); |
||||
|
}; |
||||
|
$CP .= '/'.$M; |
||||
|
if( $status ) if( !file_exists( $CP ) ) { |
||||
|
$status = mkdir( $CP ); |
||||
|
chown( $CP, 'www-data' ); |
||||
|
chgrp( $CP, 'www-data' ); |
||||
|
chmod( $CP, 0765 ); |
||||
|
}; |
||||
|
$CP .= '/'.$D; |
||||
|
if( $status ) if( !file_exists( $CP ) ) { |
||||
|
$status = mkdir( $CP ); |
||||
|
chown( $CP, 'www-data' ); |
||||
|
chgrp( $CP, 'www-data' ); |
||||
|
chmod( $CP, 0765 ); |
||||
|
}; |
||||
|
if( $status ) return $CP . '/'; |
||||
|
return false; |
||||
|
}; |
||||
|
|
||||
|
function getSessionBasePath( $SID ){ |
||||
|
global $DATABASE, $DATAPATH; |
||||
|
$OO = intval( $SID ); |
||||
|
if( $OO ){ |
||||
|
$QS = "SELECT `ts`,`track_id` FROM `sessions` WHERE `id`={$OO}"; |
||||
|
$RR = $DATABASE->Query( $QS ); |
||||
|
if( count( $RR ) ){ |
||||
|
$CTRC = intval( $RR[0]['track_id'] ); |
||||
|
$CSTS = intval( $RR[0]['ts'] ); |
||||
|
return makeSureSessionDirIsOk( $CTRC, $CSTS ); |
||||
|
}; |
||||
|
}; |
||||
|
return false; |
||||
|
}; |
||||
|
function updateSessionStatEvt( $SID ){ |
||||
|
global $DATABASE; |
||||
|
$QS = "UPDATE `sessions` SET `evt_cnt`=`evt_cnt`+1 WHERE `id`={$SID}"; |
||||
|
$DATABASE->Query( $QS ); |
||||
|
}; |
||||
|
function updateSessionStatVid( $SID ){ |
||||
|
global $DATABASE; |
||||
|
$QS = "UPDATE `sessions` SET `vid_cnt`=`vid_cnt`+1 WHERE `id`={$SID}"; |
||||
|
$DATABASE->Query( $QS ); |
||||
|
}; |
||||
|
function addVideoFileToMediaConvertion( $FN, $W, $H, $FPS, $FMT, $STS, $MID, $SID ){ |
||||
|
global $DATABASE; |
||||
|
if( !intval( $SID ) ) return false; |
||||
|
if( !file_exists( $FN ) ) return false; |
||||
|
if( ( $BD = getSessionBasePath( $SID ) ) === false ) return false; |
||||
|
$UUID = generateUUIDv4(); |
||||
|
$DST = $BD . $UUID . '.'. $FMT; |
||||
|
if( copy( $FN, $DST ) ){ |
||||
|
//unlink( $FN );
|
||||
|
$STSS = intval( $STS / 1000 ); |
||||
|
$STSM = $STS % 1000; |
||||
|
$QS = "INSERT INTO `media_queue` SET `module_id`={$MID}, `session_id`={$SID}, `ts`={$STSS}, `tsms`={$STSM}, `uuid`='{$UUID}', `width`={$W}, `height`={$H}, `fps`={$FPS}, `fmt`='$FMT', `status`=1"; |
||||
|
echo $QS . "\n"; |
||||
|
$DATABASE->Query( $QS ); |
||||
|
return true; |
||||
|
}; |
||||
|
return false; |
||||
|
}; |
||||
|
|
||||
|
function copyEventsToReport( $SID, $MID, $STS, $ETS, $RecTypes = array(10,11,12,13,14,36)){ |
||||
|
global $RBASE; |
||||
|
$STSS = intval( $STS / 1000 ); |
||||
|
$STSM = $STS % 1000; |
||||
|
$ETSS = intval( $STS / 1000 ); |
||||
|
$ETSM = $ETS % 1000; |
||||
|
if( ( $BD = getSessionBasePath( $SID ) ) === false ) return false; |
||||
|
if( !file_exists( $BD.'report.db' ) ){ |
||||
|
$LBASE = new SQLite_DB( $BD.'report.db' ); |
||||
|
chown( $BD.'report.db', 'www-data' ); |
||||
|
chgrp( $BD.'report.db', 'www-data' ); |
||||
|
chmod( $BD.'report.db', 0670 ); |
||||
|
|
||||
|
$LBASE->Query("CREATE TABLE IF NOT EXISTS \"events\" ( \"id\" INTEGER NOT NULL, \"session_id\" INTEGER NOT NULL, \"module_id\" INTEGER NOT NULL, \"ts\" INTEGER NOT NULL, \"ts_ms\" INTEGER NOT NULL, \"evt_type\" INTEGER NOT NULL, \"azimuth\" REAL, \"elevation\" REAL, \"range\" REAL, \"area\" REAL, PRIMARY KEY(\"id\" AUTOINCREMENT) )"); |
||||
|
$LBASE->Query("CREATE TABLE IF NOT EXISTS \"videos\" ( \"id\" INTEGER NOT NULL, \"session_id\" INTEGER NOT NULL, \"module_id\" INTEGER NOT NULL, \"uuid\" TEXT NOT NULL UNIQUE, \"ts\" INTEGER NOT NULL, \"ts_ms\" INTEGER NOT NULL, \"ext\" TEXT NOT NULL, \"fps\" INTEGER NOT NULL, PRIMARY KEY(\"id\" AUTOINCREMENT) )"); |
||||
|
} else { |
||||
|
$LBASE = new SQLite_DB( $BD.'report.db' ); |
||||
|
}; |
||||
|
$QS = "SELECT * FROM `events` WHERE `evt_type` IN( 10,11,12,13,14,36) AND (`ts`*1000+`ts_ms`)<={$ETS} AND (`ts`*1000+`ts_ms`)>={$STS} ORDER BY (`ts`*1000+`ts_ms`)"; |
||||
|
$Data = $RBASE->Query( $QS ); |
||||
|
foreach( $Data as $Datum ){ |
||||
|
$QS="INSERT INTO `events`( `session_id`,`module_id`,`ts`,`ts_ms`,`evt_type`,`azimuth`,`elevation`,`range`,`area` ) VALUES({$SID},{$MID},{$Datum['ts']},{$Datum['ts_ms']},{$Datum['evt_type']},{$Datum['azimuth']},{$Datum['elevation']},{$Datum['range']},{$Datum['area']})"; |
||||
|
echo $QS . "\n"; |
||||
|
$LBASE->Query( $QS ); |
||||
|
updateSessionStatEvt($SID); |
||||
|
}; |
||||
|
unset( $LBASE ); |
||||
|
}; |
||||
|
|
||||
|
$MODE = 1; // targets
|
||||
|
$MODE = 2; // ROI
|
||||
|
$MODE = 3; // ALL
|
||||
|
// SET DATA CONNECTION AND GLOBAL USER VARIABLES
|
||||
|
$TT_123 = explode( '.', PHP_VERSION ); |
||||
|
if( $TT_123[0] == '4' ){ |
||||
|
require_once( '../php/db/MySQL_class.php' ); |
||||
|
$DATABASE = new MySQL_DB($DBHost, $DBName, $DBUser, $DBPassword); |
||||
|
} elseif( $TT_123[0] > '4' ){ |
||||
|
require_once( '../php/db/MySQLi_class.php' ); |
||||
|
$DATABASE = new MySQLi_DB($DBHost, $DBName, $DBUser, $DBPassword); |
||||
|
} else { |
||||
|
exit(); |
||||
|
}; |
||||
|
require_once( '../php/db/internal.php' ); |
||||
|
require_once( '../php/db/SQLite_Class.php'); |
||||
|
if( count( $argv ) < 2 ){ |
||||
|
echo "No Parameters are set!\n\tThe Right Usage is:\n\n\t{$argv[0]} <module_id> <report_folder>\n\n"; |
||||
|
$QS = "SELECT `mm`.`id`, `mm`.`name`, `mt`.`platform_id`, `mt`.`short` FROM `metro_modules` `mm` LEFT JOIN `metro_tracks` `mt` ON ( `mm`.`track_id` = `mt`.`id`) ORDER BY `mm`.`id`"; |
||||
|
$Res = $DATABASE->Query( $QS ); |
||||
|
if( count( $Res ) ){ |
||||
|
echo "\tAvealable Modules are:\n"; |
||||
|
foreach( $Res as $R ){ |
||||
|
$MID = intval( $R['id'] ); |
||||
|
$PID = intval( $R['platform_id'] ); |
||||
|
$QS = "SELECT `st`.`name`, `pl`.`name` as `pl_name` FROM `metro_platforms` `pl` LEFT JOIN `metro_stations` `st` ON( `pl`.`station_id`=`st`.`id`) WHERE `pl`.`id`={$PID}"; |
||||
|
$JJ = $DATABASE->Query( $QS ); |
||||
|
echo "\t\t{$MID}\t[{$JJ[0]['name']}]:[{$JJ[0]['pl_name']}]:[{$R['short']}]:[{$R['name']}]\n"; |
||||
|
}; |
||||
|
} else { |
||||
|
echo "However No Modules are existed!!!\n"; |
||||
|
}; |
||||
|
} elseif( count( $argv ) < 3 ) { |
||||
|
$SMID = intval( $argv[1] ); |
||||
|
if($SMID){ |
||||
|
echo "Insuffision Parameters are set!\n\tThe Right Usage is:\n\n\t{$argv[0]} {$argv[1]} <report_folder>\n\n"; |
||||
|
} else { |
||||
|
echo "Wrong Parameter is set!\n\tThe Right Usage is:\n\n\t{$argv[0]} <module_id> <report_folder>\n\n"; |
||||
|
exit(); |
||||
|
}; |
||||
|
$QS = "SELECT `mm`.`id`, `mm`.`name`, `mt`.`platform_id`, `mt`.`short` FROM `metro_modules` `mm` LEFT JOIN `metro_tracks` `mt` ON ( `mm`.`track_id` = `mt`.`id`) WHERE `mm`.`id`={$SMID}"; |
||||
|
$Res = $DATABASE->Query( $QS ); |
||||
|
if( count( $Res ) ){ |
||||
|
echo "\tSelected Module is:\n\n"; |
||||
|
$R = $Res[0]; |
||||
|
$MID = intval( $R['id'] ); |
||||
|
$PID = intval( $R['platform_id'] ); |
||||
|
$QS = "SELECT `st`.`name`, `pl`.`name` as `pl_name` FROM `metro_platforms` `pl` LEFT JOIN `metro_stations` `st` ON( `pl`.`station_id`=`st`.`id`) WHERE `pl`.`id`={$PID}"; |
||||
|
$JJ = $DATABASE->Query( $QS ); |
||||
|
echo "\t\t{$MID}\t[{$JJ[0]['name']}]:[{$JJ[0]['pl_name']}]:[{$R['short']}]:[{$R['name']}]\n\n"; |
||||
|
} else { |
||||
|
echo "\tThe Module ID is also WRONG!!!\n"; |
||||
|
}; |
||||
|
} else { |
||||
|
$SMID = intval( $argv[1] ); |
||||
|
$FID = $argv[2]; |
||||
|
$EX = 0; |
||||
|
if( !file_exists( $FID ) ){ |
||||
|
echo "Insuffision Parameters are set!\n\tThe Right Usage is:\n\n\t{$argv[0]} {$argv[1]} <report_folder>\n\n"; |
||||
|
} else { |
||||
|
if( !file_exists( $FID . '/report.db' ) ){ |
||||
|
} else { |
||||
|
$EX = 1; |
||||
|
} |
||||
|
}; |
||||
|
$QS = "SELECT `mm`.`id`, `mm`.`track_id`, `mm`.`name`, `mt`.`platform_id`, `mt`.`short` FROM `metro_modules` `mm` LEFT JOIN `metro_tracks` `mt` ON ( `mm`.`track_id` = `mt`.`id`) WHERE `mm`.`id`={$SMID}"; |
||||
|
$Res = $DATABASE->Query( $QS ); |
||||
|
if( count( $Res ) ){ |
||||
|
echo "\tSelected Module is:\n\n"; |
||||
|
$R = $Res[0]; |
||||
|
$MID = intval( $R['id'] ); |
||||
|
$TID = intval( $R['track_id'] ); |
||||
|
$PID = intval( $R['platform_id'] ); |
||||
|
$QS = "SELECT `st`.`name`, `pl`.`name` as `pl_name` FROM `metro_platforms` `pl` LEFT JOIN `metro_stations` `st` ON( `pl`.`station_id`=`st`.`id`) WHERE `pl`.`id`={$PID}"; |
||||
|
$JJ = $DATABASE->Query( $QS ); |
||||
|
echo "\t\t{$MID}\t[{$JJ[0]['name']}]:[{$JJ[0]['pl_name']}]:[{$R['short']}]:[{$R['name']}]\n\n"; |
||||
|
} else { |
||||
|
$EX = 0; |
||||
|
echo "\tThe Module ID is also WRONG!!!\n"; |
||||
|
}; |
||||
|
if( $EX ){ |
||||
|
$RBASE = new SQLite_DB( $FID . '/report.db' ); |
||||
|
$QS = "SELECT COUNT(`id`) AS `cnt` FROM `events`"; |
||||
|
$R = $RBASE->Query( $QS ); |
||||
|
if( count( $R ) ){ |
||||
|
echo "\t{$R[0]['cnt']} Tottal Events in Database!\n"; |
||||
|
$QS = "SELECT COUNT(`id`) AS `cnt` FROM `events` WHERE `evt_type` IN( 10,11,12,13,14 )"; |
||||
|
$R = $RBASE->Query( $QS ); |
||||
|
$RTC = intval( $R[0]['cnt'] ); |
||||
|
echo "\t{$RTC} Real Target Events in Database!\n"; |
||||
|
$QS = "SELECT COUNT(`id`) AS `cnt` FROM `events` WHERE `evt_type`=36"; |
||||
|
$R = $RBASE->Query( $QS ); |
||||
|
$ITC = intval( $R[0]['cnt'] ); |
||||
|
echo "\t{$ITC} ROI Events in Database!\n"; |
||||
|
$QS = "SELECT COUNT(`id`) AS `cnt` FROM `videos`"; |
||||
|
$R = $RBASE->Query( $QS ); |
||||
|
$VC = intval( $R[0]['cnt'] ); |
||||
|
echo "\t{$VC} Videos in Database!\n"; |
||||
|
///////////////////////////////////////////////
|
||||
|
echo "\tWORKING .... \n"; |
||||
|
$QS = "SELECT `vv`.`id`, `vv`.`md5`, `vv`.`uts`, `vv`.`uts_ms`,`vv`.`ext`,`vv`.`fps` FROM `videos` `vv`"; |
||||
|
$Data = $RBASE->Query( $QS ); |
||||
|
$SES_START = 0; |
||||
|
$SES_END = 0; |
||||
|
$SESS_ID = 0; |
||||
|
$SESS_VC = 0; |
||||
|
$CVIDEOS = array(); |
||||
|
if( count( $Data ) ){ |
||||
|
foreach( $Data as $Datum ){ |
||||
|
$VNAM = $FID . '/' . $Datum['md5'] . '.'. $Datum['ext']; |
||||
|
$Datum['FN'] = $VNAM; |
||||
|
if( file_exists( $VNAM ) ){ |
||||
|
$FSIZ = filesize( $VNAM ); |
||||
|
$VID = intval( $Datum['id'] ); |
||||
|
$VTS = intval( $Datum['uts'] ) * 1000 + intval( $Datum['uts_ms'] ); |
||||
|
$Datum['STS'] = $VTS; |
||||
|
$CVIDEOS[] = $Datum; |
||||
|
if( $SES_START == 0 ){ |
||||
|
$SES_START = $VTS; |
||||
|
$SES_END = $VTS+60000; |
||||
|
$SESS_VC = 1; |
||||
|
} else { |
||||
|
if( $VTS < $SES_END ){ |
||||
|
if( $VTS < $SES_START ){ |
||||
|
$SES_START = $VTS; |
||||
|
} else { |
||||
|
if( ( $VTS+60000 ) > $SES_END ) $SES_END = $VTS+60000; |
||||
|
}; |
||||
|
$SESS_VC++; |
||||
|
} else { |
||||
|
// Close Old Session and Start New One
|
||||
|
//Add session
|
||||
|
$CSID = createSession( $TID, $SES_START, $SES_END ); |
||||
|
if( $CSID ){ |
||||
|
echo "Session [{$SESS_ID}] Created as [{$CSID}]\n"; |
||||
|
foreach( $CVIDEOS as $V ){ |
||||
|
addVideoFileToMediaConvertion( $V['FN'], 1280, 720, $V['fps'], $V['ext'], $V['STS'], $MID, $CSID ); |
||||
|
updateSessionStatVid( $CSID ); |
||||
|
}; |
||||
|
copyEventsToReport( $CSID, $MID, $SES_START, $SES_END ); |
||||
|
$CVIDEOS = array(); |
||||
|
}; |
||||
|
$SESS_ID++; |
||||
|
$SES_START = $VTS; |
||||
|
$SES_END = $VTS+60000; |
||||
|
$SESS_VC = 1; |
||||
|
}; |
||||
|
}; |
||||
|
}; |
||||
|
}; |
||||
|
// Last Session
|
||||
|
$CSID = createSession( $TID, $SES_START, $SES_END ); |
||||
|
if( $CSID ){ |
||||
|
echo "Session [{$SESS_ID}] Created as [{$CSID}]\n"; |
||||
|
foreach( $CVIDEOS as $V ){ |
||||
|
addVideoFileToMediaConvertion( $V['FN'], 1280, 720, $V['fps'], $V['ext'], $V['STS'], $MID, $CSID ); |
||||
|
updateSessionStatVid( $CSID ); |
||||
|
}; |
||||
|
copyEventsToReport( $CSID, $MID, $SES_START, $SES_END ); |
||||
|
$CVIDEOS = array(); |
||||
|
}; |
||||
|
}; |
||||
|
} else { |
||||
|
echo "\tNo Events in Database!!!\n"; |
||||
|
} |
||||
|
}; |
||||
|
}; |
||||
|
//$REPORT = new SQLite_DB( '/srv/www/web/lib/controller/data/mysqlitedb.db');
|
||||
|
|
||||
|
|
||||
|
function analyseReportDB( $DBF ){ |
||||
|
|
||||
|
}; |
||||
|
|
||||
|
?>
|
||||
@ -0,0 +1,124 @@ |
|||||
|
<?php |
||||
|
require_once('../ajax_asm.php'); |
||||
|
if( $CUser->Data['id'] > 1 ){ |
||||
|
$DATA = array(); |
||||
|
$DATA['success'] = false; |
||||
|
if( $CUser->Data['access'] > 4 ){ |
||||
|
$COP = intval( $_POST['OP'] ); |
||||
|
switch( $COP ){ |
||||
|
case 0:{ |
||||
|
//add new
|
||||
|
$NLO = $DATABASE->escape( $_POST['NLO'] ); |
||||
|
$PWD = $_POST['PW1']; |
||||
|
$RWD = $_POST['PW2']; |
||||
|
$ACC = intval($_POST['ACC']); |
||||
|
if( $PWD == '' ){ |
||||
|
$DATA['msg'] = 'No Password defined!'; |
||||
|
} else { |
||||
|
if( $_POST['NLO'] == '' ){ |
||||
|
$DATA['msg'] = 'No Login defined!'; |
||||
|
} else { |
||||
|
if( $PWD == $RWD ){ |
||||
|
$M5 = md5( $PWD ); |
||||
|
$CTS = time(); |
||||
|
$QS="INSERT INTO `users`(`create_ts`,`login_id`,`pwd_hash`,`status`,`access`) VALUES ( {$CTS},'{$NLO}','{$M5}','A',{$ACC})"; |
||||
|
$DATABASE->Query( $QS ); |
||||
|
$DATA['success'] = true; |
||||
|
} else { |
||||
|
$DATA['msg'] = 'Passwords does not match!'; |
||||
|
}; |
||||
|
}; |
||||
|
}; |
||||
|
break; |
||||
|
}; |
||||
|
case 1:{ |
||||
|
//change old
|
||||
|
$UID = intval($_POST['SUID']); |
||||
|
if( $UID ){ |
||||
|
$OLO = $DATABASE->escape( $_POST['OLO'] ); |
||||
|
$NLO = $DATABASE->escape( $_POST['NLO'] ); |
||||
|
$PWD = $_POST['PW1']; |
||||
|
$RWD = $_POST['PW2']; |
||||
|
$ACC = intval($_POST['ACC']); |
||||
|
if( $PWD == '' ){ |
||||
|
$QS="UPDATE `users` SET `login_id`='{$NLO}', `access`={$ACC} WHERE id={$UID}"; |
||||
|
$DATABASE->Query( $QS ); |
||||
|
$DATA['success'] = true; |
||||
|
} else { |
||||
|
if( $PWD == $RWD ){ |
||||
|
$M5 = md5( $PWD ); |
||||
|
$QS="UPDATE `users` SET `login_id`='{$NLO}', `pwdMD5`='{$M5}', `access`={$ACC} WHERE id={$UID}"; |
||||
|
$DATABASE->Query( $QS ); |
||||
|
$DATA['success'] = true; |
||||
|
} else { |
||||
|
$DATA['msg'] = 'Passwords does not match!'; |
||||
|
}; |
||||
|
}; |
||||
|
} else { |
||||
|
$DATA['msg'] = 'Wrong User ID!'; |
||||
|
}; |
||||
|
break; |
||||
|
}; |
||||
|
case 2:{ |
||||
|
$UID = intval($_POST['SUID']); |
||||
|
if( $UID ){ |
||||
|
if( $UID != $CUser->Data['id'] ){ |
||||
|
if( $UID > 1 ){ |
||||
|
$QS="UPDATE `users` SET `status`='D' WHERE id={$UID}"; |
||||
|
$DATABASE->Query( $QS ); |
||||
|
$DATA['success'] = true; |
||||
|
} else { |
||||
|
$DATA['msg'] = 'You Can not change Guest account!'; |
||||
|
}; |
||||
|
} else { |
||||
|
$DATA['msg'] = 'You Can not block yoreself account!'; |
||||
|
}; |
||||
|
} else { |
||||
|
$DATA['msg'] = 'Wrong User ID!'; |
||||
|
}; |
||||
|
break; |
||||
|
}; |
||||
|
case 3:{ |
||||
|
$UID = intval($_POST['SUID']); |
||||
|
if( $UID ){ |
||||
|
if( $UID > 1 ){ |
||||
|
$QS="UPDATE `users` SET `status`='A' WHERE id={$UID}"; |
||||
|
$DATABASE->Query( $QS ); |
||||
|
$DATA['success'] = true; |
||||
|
} else { |
||||
|
$DATA['msg'] = 'You Can not change Guest account!'; |
||||
|
}; |
||||
|
} else { |
||||
|
$DATA['msg'] = 'Wrong User ID!'; |
||||
|
}; |
||||
|
break; |
||||
|
}; |
||||
|
case 4:{ |
||||
|
$UID = intval($_POST['SUID']); |
||||
|
if( $UID ){ |
||||
|
if( $UID != $CUser->Data['id'] ){ |
||||
|
if( $UID > 1 ){ |
||||
|
$QS="DELETE FROM `users` WHERE id={$UID}"; |
||||
|
$DATABASE->Query( $QS ); |
||||
|
$DATA['success'] = true; |
||||
|
} else { |
||||
|
$DATA['msg'] = 'You Can not remove Guest account!'; |
||||
|
}; |
||||
|
} else { |
||||
|
$DATA['msg'] = 'You Can not remove yoreself account!'; |
||||
|
}; |
||||
|
} else { |
||||
|
$DATA['msg'] = 'Wrong User ID!'; |
||||
|
}; |
||||
|
break; |
||||
|
}; |
||||
|
default: $DATA['msg'] = 'Wrong Operation!'; break; |
||||
|
}; |
||||
|
} else { |
||||
|
$DATA['msg'] = 'Access Permition Denied!'; |
||||
|
}; |
||||
|
echo json_encode( $DATA ); |
||||
|
exit(); |
||||
|
}; |
||||
|
header('location: /'); |
||||
|
?>
|
||||
1191
lib/javascript/jsapi_dynamic/argus_settings.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -1,346 +0,0 @@ |
|||||
<!-- Loader1 --> |
|
||||
|
|
||||
<svg version="1.1" id="L1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 100 100" enable-background="new 0 0 100 100" xml:space="preserve"> |
|
||||
<circle fill="none" stroke="#fff" stroke-width="6" stroke-miterlimit="15" stroke-dasharray="14.2472,14.2472" cx="50" cy="50" r="47" > |
|
||||
<animateTransform |
|
||||
attributeName="transform" |
|
||||
attributeType="XML" |
|
||||
type="rotate" |
|
||||
dur="5s" |
|
||||
from="0 50 50" |
|
||||
to="360 50 50" |
|
||||
repeatCount="indefinite" /> |
|
||||
</circle> |
|
||||
<circle fill="none" stroke="#fff" stroke-width="1" stroke-miterlimit="10" stroke-dasharray="10,10" cx="50" cy="50" r="39"> |
|
||||
<animateTransform |
|
||||
attributeName="transform" |
|
||||
attributeType="XML" |
|
||||
type="rotate" |
|
||||
dur="5s" |
|
||||
from="0 50 50" |
|
||||
to="-360 50 50" |
|
||||
repeatCount="indefinite" /> |
|
||||
</circle> |
|
||||
<g fill="#fff"> |
|
||||
<rect x="30" y="35" width="5" height="30"> |
|
||||
<animateTransform |
|
||||
attributeName="transform" |
|
||||
dur="1s" |
|
||||
type="translate" |
|
||||
values="0 5 ; 0 -5; 0 5" |
|
||||
repeatCount="indefinite" |
|
||||
begin="0.1"/> |
|
||||
</rect> |
|
||||
<rect x="40" y="35" width="5" height="30" > |
|
||||
<animateTransform |
|
||||
attributeName="transform" |
|
||||
dur="1s" |
|
||||
type="translate" |
|
||||
values="0 5 ; 0 -5; 0 5" |
|
||||
repeatCount="indefinite" |
|
||||
begin="0.2"/> |
|
||||
</rect> |
|
||||
<rect x="50" y="35" width="5" height="30" > |
|
||||
<animateTransform |
|
||||
attributeName="transform" |
|
||||
dur="1s" |
|
||||
type="translate" |
|
||||
values="0 5 ; 0 -5; 0 5" |
|
||||
repeatCount="indefinite" |
|
||||
begin="0.3"/> |
|
||||
</rect> |
|
||||
<rect x="60" y="35" width="5" height="30" > |
|
||||
<animateTransform |
|
||||
attributeName="transform" |
|
||||
dur="1s" |
|
||||
type="translate" |
|
||||
values="0 5 ; 0 -5; 0 5" |
|
||||
repeatCount="indefinite" |
|
||||
begin="0.4"/> |
|
||||
</rect> |
|
||||
<rect x="70" y="35" width="5" height="30" > |
|
||||
<animateTransform |
|
||||
attributeName="transform" |
|
||||
dur="1s" |
|
||||
type="translate" |
|
||||
values="0 5 ; 0 -5; 0 5" |
|
||||
repeatCount="indefinite" |
|
||||
begin="0.5"/> |
|
||||
</rect> |
|
||||
</g> |
|
||||
</svg> |
|
||||
|
|
||||
|
|
||||
<!-- Loader 2 --> |
|
||||
|
|
||||
<svg version="1.1" id="L2" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" |
|
||||
viewBox="0 0 100 100" enable-background="new 0 0 100 100" xml:space="preserve"> |
|
||||
<circle fill="none" stroke="#fff" stroke-width="4" stroke-miterlimit="10" cx="50" cy="50" r="48"/> |
|
||||
<line fill="none" stroke-linecap="round" stroke="#fff" stroke-width="4" stroke-miterlimit="10" x1="50" y1="50" x2="85" y2="50.5"> |
|
||||
<animateTransform |
|
||||
attributeName="transform" |
|
||||
dur="2s" |
|
||||
type="rotate" |
|
||||
from="0 50 50" |
|
||||
to="360 50 50" |
|
||||
repeatCount="indefinite" /> |
|
||||
</line> |
|
||||
<line fill="none" stroke-linecap="round" stroke="#fff" stroke-width="4" stroke-miterlimit="10" x1="50" y1="50" x2="49.5" y2="74"> |
|
||||
<animateTransform |
|
||||
attributeName="transform" |
|
||||
dur="15s" |
|
||||
type="rotate" |
|
||||
from="0 50 50" |
|
||||
to="360 50 50" |
|
||||
repeatCount="indefinite" /> |
|
||||
</line> |
|
||||
</svg> |
|
||||
|
|
||||
|
|
||||
<!-- Loader 3 --> |
|
||||
|
|
||||
<svg version="1.1" id="L3" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" |
|
||||
viewBox="0 0 100 100" enable-background="new 0 0 0 0" xml:space="preserve"> |
|
||||
<circle fill="none" stroke="#fff" stroke-width="4" cx="50" cy="50" r="44" style="opacity:0.5;"/> |
|
||||
<circle fill="#fff" stroke="#e74c3c" stroke-width="3" cx="8" cy="54" r="6" > |
|
||||
<animateTransform |
|
||||
attributeName="transform" |
|
||||
dur="2s" |
|
||||
type="rotate" |
|
||||
from="0 50 48" |
|
||||
to="360 50 52" |
|
||||
repeatCount="indefinite" /> |
|
||||
|
|
||||
</circle> |
|
||||
</svg> |
|
||||
|
|
||||
|
|
||||
<!-- Loader 4 --> |
|
||||
|
|
||||
<svg version="1.1" id="L4" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" |
|
||||
viewBox="0 0 100 100" enable-background="new 0 0 0 0" xml:space="preserve"> |
|
||||
<circle fill="#fff" stroke="none" cx="6" cy="50" r="6"> |
|
||||
<animate |
|
||||
attributeName="opacity" |
|
||||
dur="1s" |
|
||||
values="0;1;0" |
|
||||
repeatCount="indefinite" |
|
||||
begin="0.1"/> |
|
||||
</circle> |
|
||||
<circle fill="#fff" stroke="none" cx="26" cy="50" r="6"> |
|
||||
<animate |
|
||||
attributeName="opacity" |
|
||||
dur="1s" |
|
||||
values="0;1;0" |
|
||||
repeatCount="indefinite" |
|
||||
begin="0.2"/> |
|
||||
</circle> |
|
||||
<circle fill="#fff" stroke="none" cx="46" cy="50" r="6"> |
|
||||
<animate |
|
||||
attributeName="opacity" |
|
||||
dur="1s" |
|
||||
values="0;1;0" |
|
||||
repeatCount="indefinite" |
|
||||
begin="0.3"/> |
|
||||
</circle> |
|
||||
</svg> |
|
||||
|
|
||||
<!-- Loader 5 --> |
|
||||
|
|
||||
<svg version="1.1" id="L5" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" |
|
||||
viewBox="0 0 100 100" enable-background="new 0 0 0 0" xml:space="preserve"> |
|
||||
<circle fill="#fff" stroke="none" cx="6" cy="50" r="6"> |
|
||||
<animateTransform |
|
||||
attributeName="transform" |
|
||||
dur="1s" |
|
||||
type="translate" |
|
||||
values="0 15 ; 0 -15; 0 15" |
|
||||
repeatCount="indefinite" |
|
||||
begin="0.1"/> |
|
||||
</circle> |
|
||||
<circle fill="#fff" stroke="none" cx="30" cy="50" r="6"> |
|
||||
<animateTransform |
|
||||
attributeName="transform" |
|
||||
dur="1s" |
|
||||
type="translate" |
|
||||
values="0 10 ; 0 -10; 0 10" |
|
||||
repeatCount="indefinite" |
|
||||
begin="0.2"/> |
|
||||
</circle> |
|
||||
<circle fill="#fff" stroke="none" cx="54" cy="50" r="6"> |
|
||||
<animateTransform |
|
||||
attributeName="transform" |
|
||||
dur="1s" |
|
||||
type="translate" |
|
||||
values="0 5 ; 0 -5; 0 5" |
|
||||
repeatCount="indefinite" |
|
||||
begin="0.3"/> |
|
||||
</circle> |
|
||||
</svg> |
|
||||
|
|
||||
|
|
||||
<!-- Loader 6 --> |
|
||||
|
|
||||
<svg version="1.1" id="L6" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" |
|
||||
viewBox="0 0 100 100" enable-background="new 0 0 100 100" xml:space="preserve"> |
|
||||
<rect fill="none" stroke="#fff" stroke-width="4" x="25" y="25" width="50" height="50"> |
|
||||
<animateTransform |
|
||||
attributeName="transform" |
|
||||
dur="0.5s" |
|
||||
from="0 50 50" |
|
||||
to="180 50 50" |
|
||||
type="rotate" |
|
||||
id="strokeBox" |
|
||||
attributeType="XML" |
|
||||
begin="rectBox.end"/> |
|
||||
</rect> |
|
||||
<rect x="27" y="27" fill="#fff" width="46" height="50"> |
|
||||
<animate |
|
||||
attributeName="height" |
|
||||
dur="1.3s" |
|
||||
attributeType="XML" |
|
||||
from="50" |
|
||||
to="0" |
|
||||
id="rectBox" |
|
||||
fill="freeze" |
|
||||
begin="0s;strokeBox.end"/> |
|
||||
</rect> |
|
||||
</svg> |
|
||||
|
|
||||
<!-- Loader 7 --> |
|
||||
|
|
||||
<svg version="1.1" id="L7" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" |
|
||||
viewBox="0 0 100 100" enable-background="new 0 0 100 100" xml:space="preserve"> |
|
||||
<path fill="#fff" d="M31.6,3.5C5.9,13.6-6.6,42.7,3.5,68.4c10.1,25.7,39.2,38.3,64.9,28.1l-3.1-7.9c-21.3,8.4-45.4-2-53.8-23.3 |
|
||||
c-8.4-21.3,2-45.4,23.3-53.8L31.6,3.5z"> |
|
||||
<animateTransform |
|
||||
attributeName="transform" |
|
||||
attributeType="XML" |
|
||||
type="rotate" |
|
||||
dur="2s" |
|
||||
from="0 50 50" |
|
||||
to="360 50 50" |
|
||||
repeatCount="indefinite" /> |
|
||||
</path> |
|
||||
<path fill="#fff" d="M42.3,39.6c5.7-4.3,13.9-3.1,18.1,2.7c4.3,5.7,3.1,13.9-2.7,18.1l4.1,5.5c8.8-6.5,10.6-19,4.1-27.7 |
|
||||
c-6.5-8.8-19-10.6-27.7-4.1L42.3,39.6z"> |
|
||||
<animateTransform |
|
||||
attributeName="transform" |
|
||||
attributeType="XML" |
|
||||
type="rotate" |
|
||||
dur="1s" |
|
||||
from="0 50 50" |
|
||||
to="-360 50 50" |
|
||||
repeatCount="indefinite" /> |
|
||||
</path> |
|
||||
<path fill="#fff" d="M82,35.7C74.1,18,53.4,10.1,35.7,18S10.1,46.6,18,64.3l7.6-3.4c-6-13.5,0-29.3,13.5-35.3s29.3,0,35.3,13.5 |
|
||||
L82,35.7z"> |
|
||||
<animateTransform |
|
||||
attributeName="transform" |
|
||||
attributeType="XML" |
|
||||
type="rotate" |
|
||||
dur="2s" |
|
||||
from="0 50 50" |
|
||||
to="360 50 50" |
|
||||
repeatCount="indefinite" /> |
|
||||
</path> |
|
||||
</svg> |
|
||||
|
|
||||
<!-- Loader 8 --> |
|
||||
|
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" |
|
||||
viewBox="0 0 100 100" enable-background="new 0 0 100 100" xml:space="preserve"> |
|
||||
<rect fill="#fff" width="3" height="100" transform="translate(0) rotate(180 3 50)"> |
|
||||
<animate |
|
||||
attributeName="height" |
|
||||
attributeType="XML" |
|
||||
dur="1s" |
|
||||
values="30; 100; 30" |
|
||||
repeatCount="indefinite"/> |
|
||||
</rect> |
|
||||
<rect x="17" fill="#fff" width="3" height="100" transform="translate(0) rotate(180 20 50)"> |
|
||||
<animate |
|
||||
attributeName="height" |
|
||||
attributeType="XML" |
|
||||
dur="1s" |
|
||||
values="30; 100; 30" |
|
||||
repeatCount="indefinite" |
|
||||
begin="0.1s"/> |
|
||||
</rect> |
|
||||
<rect x="40" fill="#fff" width="3" height="100" transform="translate(0) rotate(180 40 50)"> |
|
||||
<animate |
|
||||
attributeName="height" |
|
||||
attributeType="XML" |
|
||||
dur="1s" |
|
||||
values="30; 100; 30" |
|
||||
repeatCount="indefinite" |
|
||||
begin="0.3s"/> |
|
||||
</rect> |
|
||||
<rect x="60" fill="#fff" width="3" height="100" transform="translate(0) rotate(180 58 50)"> |
|
||||
<animate |
|
||||
attributeName="height" |
|
||||
attributeType="XML" |
|
||||
dur="1s" |
|
||||
values="30; 100; 30" |
|
||||
repeatCount="indefinite" |
|
||||
begin="0.5s"/> |
|
||||
</rect> |
|
||||
<rect x="80" fill="#fff" width="3" height="100" transform="translate(0) rotate(180 76 50)"> |
|
||||
<animate |
|
||||
attributeName="height" |
|
||||
attributeType="XML" |
|
||||
dur="1s" |
|
||||
values="30; 100; 30" |
|
||||
repeatCount="indefinite" |
|
||||
begin="0.1s"/> |
|
||||
</rect> |
|
||||
</svg> |
|
||||
|
|
||||
|
|
||||
<!-- Loader 9 --> |
|
||||
|
|
||||
<svg version="1.1" id="L9" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" |
|
||||
viewBox="0 0 100 100" enable-background="new 0 0 0 0" xml:space="preserve"> |
|
||||
<rect x="20" y="50" width="4" height="10" fill="#fff"> |
|
||||
<animateTransform attributeType="xml" |
|
||||
attributeName="transform" type="translate" |
|
||||
values="0 0; 0 20; 0 0" |
|
||||
begin="0" dur="0.6s" repeatCount="indefinite" /> |
|
||||
</rect> |
|
||||
<rect x="30" y="50" width="4" height="10" fill="#fff"> |
|
||||
<animateTransform attributeType="xml" |
|
||||
attributeName="transform" type="translate" |
|
||||
values="0 0; 0 20; 0 0" |
|
||||
begin="0.2s" dur="0.6s" repeatCount="indefinite" /> |
|
||||
</rect> |
|
||||
<rect x="40" y="50" width="4" height="10" fill="#fff"> |
|
||||
<animateTransform attributeType="xml" |
|
||||
attributeName="transform" type="translate" |
|
||||
values="0 0; 0 20; 0 0" |
|
||||
begin="0.4s" dur="0.6s" repeatCount="indefinite" /> |
|
||||
</rect> |
|
||||
</svg> |
|
||||
|
|
||||
|
|
||||
<!-- Loader 10 --> |
|
||||
|
|
||||
<svg version="1.1" id="L9" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" |
|
||||
viewBox="0 0 100 100" enable-background="new 0 0 0 0" xml:space="preserve"> |
|
||||
<path fill="#fff" d="M73,50c0-12.7-10.3-23-23-23S27,37.3,27,50 M30.9,50c0-10.5,8.5-19.1,19.1-19.1S69.1,39.5,69.1,50"> |
|
||||
<animateTransform |
|
||||
attributeName="transform" |
|
||||
attributeType="XML" |
|
||||
type="rotate" |
|
||||
dur="1s" |
|
||||
from="0 50 50" |
|
||||
to="360 50 50" |
|
||||
repeatCount="indefinite" /> |
|
||||
</path> |
|
||||
</svg> |
|
||||
|
|
||||
<!-- follow me template --> |
|
||||
<div class="made-with-love"> |
|
||||
Made with |
|
||||
<i>?</i> by |
|
||||
<a target="_blank" href="https://codepen.io/nikhil8krishnan">Nikhil Krishnan</a> |
|
||||
</div> |
|
||||
@ -1,993 +0,0 @@ |
|||||
//<?php require_once('../../js_asm.php'); ?>
|
|
||||
|
|
||||
function getWidth() { |
|
||||
return Math.max( |
|
||||
document.body.scrollWidth, |
|
||||
document.documentElement.scrollWidth, |
|
||||
document.body.offsetWidth, |
|
||||
document.documentElement.offsetWidth, |
|
||||
document.documentElement.clientWidth |
|
||||
); |
|
||||
} |
|
||||
|
|
||||
function getHeight() { |
|
||||
return Math.max( |
|
||||
document.body.scrollHeight, |
|
||||
document.documentElement.scrollHeight, |
|
||||
document.body.offsetHeight, |
|
||||
document.documentElement.offsetHeight, |
|
||||
document.documentElement.clientHeight |
|
||||
); |
|
||||
} |
|
||||
|
|
||||
function trace( message ){ |
|
||||
//if( console ){
|
|
||||
console.log( message ); |
|
||||
//};
|
|
||||
} |
|
||||
//https://www.pornhub.com/view_video.php?viewkey=ph5a8a095f04fc7
|
|
||||
function makeFullScreen() { |
|
||||
var divObj = document.getElementById("theImage"); |
|
||||
//Use the specification method before using prefixed versions
|
|
||||
if (divObj.requestFullscreen) { |
|
||||
divObj.requestFullscreen(); |
|
||||
} else if (divObj.msRequestFullscreen) { |
|
||||
divObj.msRequestFullscreen(); |
|
||||
} else if (divObj.mozRequestFullScreen) { |
|
||||
divObj.mozRequestFullScreen(); |
|
||||
} else if (divObj.webkitRequestFullscreen) { |
|
||||
divObj.webkitRequestFullscreen(); |
|
||||
} else { |
|
||||
console.log("Fullscreen API is not supported"); |
|
||||
}; |
|
||||
} |
|
||||
|
|
||||
var ScreanWidth = getWidth(); |
|
||||
|
|
||||
trace('Width: ' + getWidth() ); |
|
||||
trace('Height: ' + getHeight() ); |
|
||||
|
|
||||
var panelWidth = ScreanWidth*0.9; |
|
||||
var iW = <?=getPictureWidth();?>; |
|
||||
var iH = <?=getPictureHeight();?>; |
|
||||
var imgWidth = panelWidth - 16; |
|
||||
var imgHeight = ( imgWidth / iW ) * iH; |
|
||||
var GEWindow = null; |
|
||||
var VCWindow = null; |
|
||||
var DCWindow = null; |
|
||||
var DBWindow = null; |
|
||||
var BG_Array = null; |
|
||||
var VideoWindow = null; |
|
||||
var VideoPlayer = null; |
|
||||
var VideoIsPlaying = false; |
|
||||
var VideoIsLooped = false; |
|
||||
var VideoFlash = null; |
|
||||
//https://www.w3schools.com/graphics/canvas_drawing.asp
|
|
||||
var updateInterval; |
|
||||
var lastId = -1; |
|
||||
var DetectorEnabled = false; |
|
||||
var SelectedEvent = null; |
|
||||
var VideoPosInterval = null; |
|
||||
|
|
||||
var Settings_SST = 1212; |
|
||||
var Settings_OFFSET = 1212; |
|
||||
var Settings_MAXRANGE = 1212; |
|
||||
var Settings_L2L = 1212; |
|
||||
var Settings_MINSPEED = 1212; |
|
||||
|
|
||||
var EvtGroupRecord = Ext.data.Record.create([ |
|
||||
'id', |
|
||||
'ts', |
|
||||
'type', |
|
||||
'cnt', |
|
||||
'has_image', |
|
||||
'video' |
|
||||
]); |
|
||||
var EvtListRecord = Ext.data.Record.create([ |
|
||||
'id', |
|
||||
'ts', |
|
||||
'type', |
|
||||
'range', |
|
||||
'speed', |
|
||||
'f_lrf', |
|
||||
's_lrf' |
|
||||
]); |
|
||||
var EvtListDataStore = new Ext.data.Store({ |
|
||||
reader: new Ext.data.JsonReader({ |
|
||||
// The metadata property, with configuration options:
|
|
||||
//totalProperty: "results", // the property which contains the total dataset size (optional)
|
|
||||
root: "rows", // the property which contains an Array of row objects
|
|
||||
idProperty: "id" // the property within each row object that provides an ID for the record (optional)
|
|
||||
}, |
|
||||
EvtListRecord // Ext.data.Record constructor that provides mapping for JSON object
|
|
||||
) |
|
||||
}); |
|
||||
var EvtGroupDataStore = new Ext.data.Store({ |
|
||||
reader: new Ext.data.JsonReader({ |
|
||||
// The metadata property, with configuration options:
|
|
||||
//totalProperty: "results", // the property which contains the total dataset size (optional)
|
|
||||
root: "rows", // the property which contains an Array of row objects
|
|
||||
idProperty: "id" // the property within each row object that provides an ID for the record (optional)
|
|
||||
}, |
|
||||
EvtGroupRecord // Ext.data.Record constructor that provides mapping for JSON object
|
|
||||
) |
|
||||
}); |
|
||||
|
|
||||
function smooth(ctx, points){ |
|
||||
if(points == undefined || points.length == 0) |
|
||||
{ |
|
||||
return true; |
|
||||
} |
|
||||
if(points.length == 1) |
|
||||
{ |
|
||||
ctx.moveTo(points[0].x, points[0].y); |
|
||||
ctx.lineTo(points[0].x, points[0].y); |
|
||||
return true; |
|
||||
} |
|
||||
if(points.length == 2) |
|
||||
{ |
|
||||
ctx.moveTo(points[0].x, points[0].y); |
|
||||
ctx.lineTo(points[1].x, points[1].y); |
|
||||
return true; |
|
||||
} |
|
||||
ctx.moveTo(points[0].x, points[0].y); |
|
||||
for (var i = 1; i < points.length - 2; i ++) |
|
||||
{ |
|
||||
var xc = (points[i].x + points[i + 1].x) / 2; |
|
||||
var yc = (points[i].y + points[i + 1].y) / 2; |
|
||||
ctx.quadraticCurveTo(points[i].x, points[i].y, xc, yc); |
|
||||
} |
|
||||
ctx.quadraticCurveTo(points[i].x, points[i].y, points[i+1].x, points[i+1].y); |
|
||||
} |
|
||||
|
|
||||
function drawCurve(points, tension) { |
|
||||
ctx.beginPath(); |
|
||||
ctx.moveTo(points[0].x, points[0].y); |
|
||||
|
|
||||
var t = (tension != null) ? tension : 1; |
|
||||
for (var i = 0; i < points.length - 1; i++) { |
|
||||
var p0 = (i > 0) ? points[i - 1] : points[0]; |
|
||||
var p1 = points[i]; |
|
||||
var p2 = points[i + 1]; |
|
||||
var p3 = (i != points.length - 2) ? points[i + 2] : p2; |
|
||||
|
|
||||
var cp1x = p1.x + (p2.x - p0.x) / 6 * t; |
|
||||
var cp1y = p1.y + (p2.y - p0.y) / 6 * t; |
|
||||
|
|
||||
var cp2x = p2.x - (p3.x - p1.x) / 6 * t; |
|
||||
var cp2y = p2.y - (p3.y - p1.y) / 6 * t; |
|
||||
|
|
||||
ctx.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, p2.x, p2.y); |
|
||||
} |
|
||||
ctx.stroke(); |
|
||||
} |
|
||||
|
|
||||
function clearLiveBip(){ |
|
||||
var canvas = document.getElementById("StatusCanvas"); |
|
||||
var ctx = canvas.getContext("2d"); |
|
||||
ctx.fillStyle = "#FF0000"; |
|
||||
ctx.fillRect(5, 5, 10, 10); |
|
||||
} |
|
||||
|
|
||||
function drawStatus(){ |
|
||||
var canvas = document.getElementById("StatusCanvas"); |
|
||||
var ctx = canvas.getContext("2d"); |
|
||||
ctx.fillStyle = "#00FF00"; |
|
||||
ctx.fillRect(5, 5, 10, 10); |
|
||||
} |
|
||||
|
|
||||
function drawBackgrounds(){ |
|
||||
if( !DBWindow ) return; |
|
||||
var canvas = document.getElementById("RangeBGCanvas"); |
|
||||
if( canvas ){ |
|
||||
var ctx = canvas.getContext("2d"); |
|
||||
var x = canvas.width; |
|
||||
var y = canvas.height; |
|
||||
if( ctx ){ |
|
||||
if( !BG_Array ){ |
|
||||
// No Data!
|
|
||||
ctx.font = "30px Arial"; |
|
||||
|
|
||||
ctx.fillStyle = "#F0F0F0"; |
|
||||
ctx.fillRect(0, 0, x, y); |
|
||||
ctx.strokeStyle = "#E0E0E0"; |
|
||||
ctx.lineWidth = 2; |
|
||||
ctx.strokeRect(2, 2, x-4, y-4); |
|
||||
ctx.beginPath(); |
|
||||
ctx.moveTo(2, 2); |
|
||||
ctx.lineTo(x-2, y-2); |
|
||||
ctx.moveTo(2, y-2); |
|
||||
ctx.lineTo(x-2, 2); |
|
||||
ctx.stroke(); |
|
||||
ctx.fillStyle = "#000000"; |
|
||||
ctx.fillText("No DATA!", ( x - ctx.measureText("No DATA!").width )>>> 1, y >>> 1 ); |
|
||||
} else { |
|
||||
ctx.fillStyle = "#F0F0F0"; |
|
||||
ctx.fillRect(0, 0, x, y); |
|
||||
var grd = ctx.createLinearGradient(0, 0, 0, y-20); |
|
||||
grd.addColorStop(0, "#00FF00"); |
|
||||
grd.addColorStop(1, "#0000FF"); |
|
||||
ctx.fillStyle = grd; |
|
||||
var bw = ( x - 27 ) / 9; |
|
||||
var mx = y - 20; |
|
||||
ctx.font = "10px Arial"; |
|
||||
ctx.strokeStyle = "#000000"; |
|
||||
for( i = 0; i < 9; i++ ){ |
|
||||
var cy = ( BG_Array[i] * mx ) / 1024; |
|
||||
ctx.fillRect( 13 + i*bw, 10, bw-3, cy ); |
|
||||
ctx.strokeText((i+1)+":"+BG_Array[i], 13 + bw / 5 + i*bw, cy >>> 1 ); |
|
||||
}; |
|
||||
}; |
|
||||
}; |
|
||||
}; |
|
||||
} |
|
||||
|
|
||||
function ChangeHandler( me, nv, ov ){ |
|
||||
if( nv != ov ){ |
|
||||
//alert( 'Changes:' + me.name + ' ' + nv + ' '+ ov );
|
|
||||
Ext.Ajax.request({ |
|
||||
url: '/lib/controller/setVideoSourceParam.php', |
|
||||
params: { |
|
||||
param: me.name, |
|
||||
oval: ov, |
|
||||
nval: nv |
|
||||
}, |
|
||||
success: function( response, opts ){ |
|
||||
// If the response is JSON, you have to decode it
|
|
||||
//var obj = Ext.decode(response.responseText);
|
|
||||
//Ext.fly('some_div').update('Success!');
|
|
||||
}, |
|
||||
failure: function( response, opts ) { |
|
||||
//Ext.fly('some_div').update('Fail!');
|
|
||||
}/*, |
|
||||
callback: function(options,success,response){ |
|
||||
// use this if you need to perform your own success/failure checking
|
|
||||
}*/ |
|
||||
}); |
|
||||
}; |
|
||||
}; |
|
||||
|
|
||||
function showDetectionConfigWindow(){ |
|
||||
if( DCWindow == null ){ |
|
||||
DCWindow = new Ext.Window({ |
|
||||
title: 'Detection Parameters', |
|
||||
width: 600, |
|
||||
height: 220, |
|
||||
closeAction: 'hide', |
|
||||
y: 120, |
|
||||
modal: true, |
|
||||
items:[{ |
|
||||
xtype: 'form', |
|
||||
labelAlign: 'right', |
|
||||
labelWidth: 250, |
|
||||
items: [{ |
|
||||
xtype: 'numberfield', |
|
||||
id: 'sst_data', |
|
||||
fieldLabel: 'Detection SST', |
|
||||
emptyText: 'No Data' |
|
||||
},{ |
|
||||
xtype: 'numberfield', |
|
||||
id: 'offset_data', |
|
||||
fieldLabel: 'Detection Offset', |
|
||||
emptyText: 'No Data' |
|
||||
},{ |
|
||||
xtype: 'numberfield', |
|
||||
id: 'max_data', |
|
||||
fieldLabel: 'Maximal Range', |
|
||||
emptyText: 'No Data' |
|
||||
},{ |
|
||||
xtype: 'numberfield', |
|
||||
id: 'l2l_data', |
|
||||
fieldLabel: 'Distance beetween Layers', |
|
||||
emptyText: 'No Data', |
|
||||
disabled: true |
|
||||
},{ |
|
||||
xtype: 'numberfield', |
|
||||
id: 'minspeed_data', |
|
||||
fieldLabel: 'Minimal Speed', |
|
||||
emptyText: 'No Data', |
|
||||
disabled: true |
|
||||
}], |
|
||||
buttons:[{ |
|
||||
text: 'Submit', |
|
||||
tooltip:'Set Detection Settings to Device', |
|
||||
iconCls:'silk-tick', |
|
||||
handler: function(){ |
|
||||
Settings_SST = Ext.getCmp('sst_data').getValue(); |
|
||||
Settings_OFFSET = Ext.getCmp('offset_data').getValue(); |
|
||||
Settings_MAXRANGE = Ext.getCmp('max_data').getValue(); |
|
||||
Settings_L2L = Ext.getCmp('l2l_data').getValue(); |
|
||||
Settings_MINSPEED = Ext.getCmp('minspeed_data').getValue(); |
|
||||
Ext.Ajax.request({ |
|
||||
url: '/lib/controller/setDetectorParam.php', |
|
||||
params: { |
|
||||
data_sst: Settings_SST, |
|
||||
data_offset: Settings_OFFSET, |
|
||||
data_maxrange: Settings_MAXRANGE, |
|
||||
data_l2l: Settings_L2L, |
|
||||
data_minspeed: Settings_MINSPEED, |
|
||||
}, |
|
||||
success: function( response, opts ){ |
|
||||
// If the response is JSON, you have to decode it
|
|
||||
//var obj = Ext.decode(response.responseText);
|
|
||||
//Ext.fly('some_div').update('Success!');
|
|
||||
DCWindow.hide(); |
|
||||
}, |
|
||||
failure: function( response, opts ) { |
|
||||
DCWindow.hide(); |
|
||||
Ext.Msg.alert('Status', 'Error Creating AJAX Connection.<br>Code: CENDL00221'); |
|
||||
} |
|
||||
}); |
|
||||
} |
|
||||
},{ |
|
||||
text: 'Cancel', |
|
||||
tooltip:'Do Not Change Anything!', |
|
||||
iconCls:'silk-cancel', |
|
||||
handler: function(){ |
|
||||
DCWindow.hide(); |
|
||||
} |
|
||||
}] |
|
||||
}] |
|
||||
}); |
|
||||
}; |
|
||||
DCWindow.show(); |
|
||||
Ext.getCmp('sst_data').setValue( Settings_SST ); |
|
||||
Ext.getCmp('offset_data').setValue( Settings_OFFSET ); |
|
||||
Ext.getCmp('max_data').setValue( Settings_MAXRANGE ); |
|
||||
Ext.getCmp('l2l_data').setValue( Settings_L2L ); |
|
||||
Ext.getCmp('minspeed_data').setValue( Settings_MINSPEED ); |
|
||||
}; |
|
||||
|
|
||||
function showDetectionBackgroundWindow(){ |
|
||||
if( DBWindow == null ){ |
|
||||
DBWindow = new Ext.Window({ |
|
||||
title: 'Detection Background Ranges', |
|
||||
width: 614, |
|
||||
height: 514, |
|
||||
y: 120, |
|
||||
modal: true, |
|
||||
closeAction: 'hide', |
|
||||
html: '<canvas id="RangeBGCanvas" width="600px" height="480px"></canvas>' |
|
||||
}); |
|
||||
}; |
|
||||
DBWindow.show(); |
|
||||
drawBackgrounds(); |
|
||||
}; |
|
||||
|
|
||||
function videoPositionUpdater(){ |
|
||||
if(!VideoPlayer) return; |
|
||||
var cPos = VideoPlayer.currentTime; |
|
||||
}; |
|
||||
|
|
||||
function setVideoToPlay( src ){ |
|
||||
if( VideoPlayer != null ){ |
|
||||
delete VideoPlayer; |
|
||||
}; |
|
||||
if( VideoFlash != null ){ |
|
||||
swfobject.removeSWF( "vidflash" ); |
|
||||
Ext.getCmp('video-panel').removeAll( true ); |
|
||||
Ext.getCmp('video-panel').add({ html:'<div id="divvidflash" style="background: black;"></div>'}); |
|
||||
Ext.getCmp('video-panel').update(); |
|
||||
}; |
|
||||
var att = { data: "/lib/flash/player_flv_html5.swf?4", width: iW, height: iH, id: "vidflash", name: "vidflash"}; |
|
||||
var params = { flashvars: "listener=VideoPlayer&src="+src, swliveconnect: "true"}; |
|
||||
VideoFlash = swfobject.createSWF( att, params, "divvidflash" ); |
|
||||
VideoPlayer = new FlashFLVPlayer( VideoFlash ); |
|
||||
// Events
|
|
||||
VideoPlayer.addEventListener("loadstart", function(event) { |
|
||||
trace("[event] loadstart"); |
|
||||
}); |
|
||||
VideoPlayer.addEventListener("load", function(event) { |
|
||||
trace("[event] load"); |
|
||||
}); |
|
||||
VideoPlayer.addEventListener("play", function(event) { |
|
||||
trace("[event] play"); |
|
||||
}); |
|
||||
VideoPlayer.addEventListener("ended", function(event) { |
|
||||
if( VideoIsLooped ) VideoPlayer.currentTime = 0; |
|
||||
}); |
|
||||
VideoPlayer.addEventListener("pause", function(event) { |
|
||||
trace("[event] pause"); |
|
||||
}); |
|
||||
VideoPlayer.addEventListener("playing", function(event) { |
|
||||
trace("[event] playing"); |
|
||||
}); |
|
||||
VideoPlayer.addEventListener("seeked", function(event) { |
|
||||
trace("[event] seeked"); |
|
||||
}); |
|
||||
VideoPlayer.addEventListener("loadedmetadata", function(event) { |
|
||||
trace("[event] loadedmetadata"); |
|
||||
//$('#videoWidth').text(VideoPlayer.videoWidth);
|
|
||||
//$('#videoHeight').text(VideoPlayer.videoHeight);
|
|
||||
}); |
|
||||
VideoPlayer.addEventListener("durationchange", function(event) { |
|
||||
trace("[event] durationchange : " + VideoPlayer.duration); |
|
||||
//$('#duration').text(VideoPlayer.duration);
|
|
||||
}); |
|
||||
VideoPlayer.addEventListener("timeupdate", function(event) { |
|
||||
trace("[event] timeupdate : " + video.currentTime); |
|
||||
}); |
|
||||
VideoPlayer.addEventListener("error", function(event) { |
|
||||
trace("[event] error : " + VideoPlayer.networkState); |
|
||||
}); |
|
||||
VideoPlayer.addEventListener("canplay", function(event) { |
|
||||
trace("[event] canplay"); |
|
||||
}); |
|
||||
VideoPlayer.addEventListener("canplaythrough", function(event) { |
|
||||
trace("[event] canplaythrough"); |
|
||||
}); |
|
||||
VideoPlayer.addEventListener("volumechange", function(event) { |
|
||||
trace("[event] volumechange : " + VideoPlayer.volume); |
|
||||
}); |
|
||||
// VideoPosition
|
|
||||
VideoPosInterval = window.setInterval( videoPositionUpdater, 100 ); |
|
||||
} |
|
||||
|
|
||||
function showVideoConfigWindow(){ |
|
||||
if( VCWindow == null ){ |
|
||||
VCWindow = new Ext.Window({ |
|
||||
title: 'Video Configuration', |
|
||||
width: 500, |
|
||||
height: 600, |
|
||||
y: 120, |
|
||||
modal: true, |
|
||||
closeAction: 'hide', |
|
||||
items: new Ext.TabPanel({ |
|
||||
activeTab: 0, |
|
||||
enableTabScroll: true, |
|
||||
autoScroll: true, |
|
||||
items: [ |
|
||||
<?php |
|
||||
$CC = getVideoSourcesCount(); |
|
||||
if( $CC ){ |
|
||||
$DD = array(); |
|
||||
//$CC++;
|
|
||||
for( $index = 0; $index < $CC; $index++ ){ |
|
||||
$ID = getVideoSourceID( $index ); |
|
||||
$DD[] = buildExtJSForm( getDeviceCtrl( $ID ), $ID ); |
|
||||
}; |
|
||||
$KU = implode( ',', $DD ); |
|
||||
echo $KU; |
|
||||
}; |
|
||||
?> |
|
||||
] |
|
||||
}) |
|
||||
}); |
|
||||
}; |
|
||||
VCWindow.show(); |
|
||||
} |
|
||||
|
|
||||
function GetEventsLog( gid ){ |
|
||||
//clearLiveBip();
|
|
||||
Ext.Ajax.request({ |
|
||||
url: '/lib/controller/listEvents.php', |
|
||||
success: function( response, opts ){ |
|
||||
var obj = Ext.decode( response.responseText ); |
|
||||
EvtListDataStore.removeAll(); |
|
||||
if( obj.empty != true ){ |
|
||||
EvtListDataStore.loadData( obj ); |
|
||||
}; |
|
||||
}, |
|
||||
failure: function( response, opts ){ |
|
||||
Ext.Msg.alert('Status', 'Error Creating AJAX Connection.<br>Code: CENDL00225'); |
|
||||
}, |
|
||||
headers: { |
|
||||
'author': 'gagua' |
|
||||
}, |
|
||||
params: { id: gid } |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
function GetGroupedEvents( gid ){ |
|
||||
Ext.Ajax.request({ |
|
||||
url: '/lib/controller/listEventGroups.php', |
|
||||
success: function( response, opts ){ |
|
||||
var obj = Ext.decode( response.responseText ); |
|
||||
if( obj.SW_OK ){ |
|
||||
Ext.getCmp('rec-test').enable(); |
|
||||
Ext.getCmp('lrf-rst').enable(); |
|
||||
Ext.getCmp('ena-dis').enable(); |
|
||||
if( obj.MODE ) { |
|
||||
DetectorEnabled = true; |
|
||||
Ext.getCmp('ena-dis').setText('Disable Detection'); |
|
||||
Ext.getCmp('ena-dis').setIconClass('silk-cancel'); |
|
||||
} else { |
|
||||
DetectorEnabled = false; |
|
||||
Ext.getCmp('ena-dis').setText('Enable Detection'); |
|
||||
Ext.getCmp('ena-dis').setIconClass('silk-accept'); |
|
||||
}; |
|
||||
} else { |
|
||||
Ext.getCmp('rec-test').disable(); |
|
||||
}; |
|
||||
Settings_SST = obj.LRF_SST; |
|
||||
Settings_OFFSET = obj.LRF_OFFSET; |
|
||||
Settings_MAXRANGE = obj.LRF_MAX; |
|
||||
Settings_L2L = obj.LRF_DISTANCE; |
|
||||
Settings_MINSPEED = obj.LRF_SPEED; |
|
||||
BG_Array = obj.LRF_BG; |
|
||||
drawBackgrounds(); |
|
||||
drawStatus(); |
|
||||
if( obj.empty == true ){ |
|
||||
if( lastId != 0 ){ |
|
||||
lastId = 0; |
|
||||
EvtGroupDataStore.removeAll(); |
|
||||
//EvtListDataStore.sync();
|
|
||||
}; |
|
||||
} else { |
|
||||
if( lastId != obj.rows[0].id ){ |
|
||||
lastId = obj.rows[0].id; |
|
||||
//todo: Optimise to add just new arived items
|
|
||||
EvtGroupDataStore.loadData( obj ); |
|
||||
//EvtListDataStore.sync();
|
|
||||
}; |
|
||||
}; |
|
||||
}, |
|
||||
failure: function( response, opts ){ |
|
||||
Ext.Msg.alert('Status', 'Error Creating AJAX Connection.<br>Code: CENDL00225'); |
|
||||
}, |
|
||||
headers: { |
|
||||
'author': 'gagua' |
|
||||
}, |
|
||||
params: { last_id: lastId } |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
function makeAlarm(){ |
|
||||
Ext.Ajax.request({ |
|
||||
url: '/lib/controller/postAlarm.php', |
|
||||
success: function( response, opts ){ |
|
||||
}, |
|
||||
failure: function( response, opts ){ |
|
||||
Ext.Msg.alert('Status', 'Error Creating AJAX Connection.<br>Code: CENDL00213'); |
|
||||
}, |
|
||||
headers: { |
|
||||
'my-header': 'foo' |
|
||||
}, |
|
||||
params: { last_id: lastId } |
|
||||
}); |
|
||||
} |
|
||||
|
|
||||
function resetDetector(){ |
|
||||
Ext.Ajax.request({ |
|
||||
url: '/lib/controller/resetDetector.php', |
|
||||
success: function( response, opts ){ |
|
||||
}, |
|
||||
failure: function( response, opts ){ |
|
||||
Ext.Msg.alert('Status', 'Error Creating AJAX Connection.<br>Code: CENDL00213'); |
|
||||
}, |
|
||||
headers: { |
|
||||
'my-header': 'foo' |
|
||||
}, |
|
||||
params: { last_id: lastId } |
|
||||
}); |
|
||||
} |
|
||||
|
|
||||
function detectionEnable(){ |
|
||||
if( DetectorEnabled ){ |
|
||||
chucha = '/lib/controller/disableDetector.php'; |
|
||||
} else { |
|
||||
chucha = '/lib/controller/enableDetector.php'; |
|
||||
}; |
|
||||
Ext.Ajax.request({ |
|
||||
url: chucha, |
|
||||
success: function( response, opts ){ |
|
||||
}, |
|
||||
failure: function( response, opts ){ |
|
||||
Ext.Msg.alert('Status', 'Error Creating AJAX Connection.<br>Code: CENDL00213'); |
|
||||
}, |
|
||||
headers: { |
|
||||
'my-header': 'foo' |
|
||||
}, |
|
||||
params: { last_id: lastId } |
|
||||
}); |
|
||||
} |
|
||||
|
|
||||
function IconRenderer( type ){ |
|
||||
switch( type ){ |
|
||||
case 255: |
|
||||
return '<img width="16px" src="/style/icons/icons/information.png"/>'; |
|
||||
case 251: |
|
||||
return '<img width="16px" src="/style/icons/icons/arrow_refresh.png"/>'; |
|
||||
case 250: |
|
||||
return '<img width="16px" src="/style/icons/icons/information.png"/>'; |
|
||||
case 0: |
|
||||
return '<img width="16px" src="/style/icons/icons/tick.png"/>'; |
|
||||
case 1: |
|
||||
return '<img width="16px" src="/style/icons/icons/house.png"/>'; |
|
||||
case 2: |
|
||||
return '<img width="16px" src="/style/icons/icons/house_link.png"/>'; |
|
||||
case 3: |
|
||||
return '<img width="16px" src="/style/icons/icons/shield_delete.png"/>'; |
|
||||
case 4: |
|
||||
return '<img width="16px" src="/style/icons/icons/shield_add.png"/>'; |
|
||||
case 5: |
|
||||
return '<img width="16px" src="/style/icons/icons/asterisk_yellow.png"/>'; |
|
||||
case 6: |
|
||||
return '<img width="16px" src="/style/icons/icons/asterisk_orange.png"/>'; |
|
||||
case 7: |
|
||||
return '<img width="16px" src="/style/icons/icons/information.png"/>'; |
|
||||
case 8: |
|
||||
return '<img width="16px" src="/style/icons/icons/information.png"/>'; |
|
||||
default: |
|
||||
return '<img width="16px" src="/style/icons/icons/help.png"/>'; |
|
||||
}; |
|
||||
}; |
|
||||
|
|
||||
function TypeRenderer( type ){ |
|
||||
switch( type ){ |
|
||||
case 255: return 'System Shutted Down'; |
|
||||
case 251: return 'Sensor Reset issued by Operator'; |
|
||||
case 250: return 'Log Cleared by Operator'; |
|
||||
case 0: return 'System Started'; |
|
||||
case 1: return 'System Started Disarmed'; |
|
||||
case 2: return 'System Started Armed'; |
|
||||
case 3: return 'Disarmed by Operator'; |
|
||||
case 4: return 'Armed by Operator'; |
|
||||
case 5: return 'Alarm'; |
|
||||
case 6: return 'Alarm Test by Operator'; |
|
||||
case 7: return 'Parameters Changed by Operator'; |
|
||||
case 8: return 'Log Cleared by Operator'; |
|
||||
default: return 'Unusual Event'; |
|
||||
}; |
|
||||
}; |
|
||||
|
|
||||
function LrfRenderer( value, metadata, record, rowIndex, colIndex, store ){ |
|
||||
var R = value / 1; |
|
||||
if( R > 0 ){ |
|
||||
var RV = '<svg width="120" height="16">'; |
|
||||
if( R == 1024 ){ |
|
||||
for( i=0; i < 9; i++ ){ |
|
||||
RV = RV + '<circle cx="'+( 120 - ( ( i + 1 ) * 12 + 5 ) )+'" cy="8" r="5" stroke="black" stroke-width="2" fill="darkgrey" />'; |
|
||||
}; |
|
||||
} else { |
|
||||
R--; |
|
||||
for( i=0; i < 9; i++ ){ |
|
||||
if( ( R & ( 1 << i ) ) == 0 ){ |
|
||||
RV = RV + '<circle cx="'+( 120 - ( ( i + 1 ) * 12 + 5 ) )+'" cy="8" r="5" stroke="green" stroke-width="2" fill="grey" />'; |
|
||||
} else { |
|
||||
RV = RV + '<circle cx="'+( 120 - ( ( i + 1 ) * 12 + 5 ) )+'" cy="8" r="5" stroke="red" stroke-width="2" fill="yellow" />'; |
|
||||
}; |
|
||||
}; |
|
||||
}; |
|
||||
return RV + '</svg>'; |
|
||||
}; |
|
||||
return ''; |
|
||||
}; |
|
||||
|
|
||||
function VideoRenderer( value, metadata, record, rowIndex, colIndex, store ){ |
|
||||
if( value ){ |
|
||||
//return '<a href="#" onclick="ViewVideoPreview(\'' + record.data.video + '\');"><img width="16px" src="/style/icons/icons/film.png" alt="' + record.data.video + '" /></a>';
|
|
||||
return '<a href="#" onclick="showEventGroupWindow(\'' + record.data.video + '\','+record.data.id+');"><img width="16px" src="/style/icons/icons/film.png" alt="' + record.data.video + '" /></a>'; |
|
||||
}; |
|
||||
return ''; |
|
||||
}; |
|
||||
|
|
||||
var EvtGroupColModel = new Ext.grid.ColumnModel([ |
|
||||
/*{header: "", width: 38, sortable: false, locked: true, menuDisabled: true, fixed: true, align: 'left', renderer: IconRenderer, dataIndex: 'icon'}, |
|
||||
{header: "Device ID", width: 120, sortable: true, align: 'center', css: 'vertical-align: middle;', dataIndex: 'device_id'}, |
|
||||
{header: "Vehicle ID", width: 120, sortable: true, align: 'left', css: 'vertical-align: middle;', dataIndex: 'name'}, |
|
||||
{header: "Status", width: 95, sortable: true, align: 'center', css: 'vertical-align: middle;', renderer: DevStatusRenderer, dataIndex: 'status'}, |
|
||||
{header: "SMS", width: 36, sortable: false, menuDisabled: true, align: 'center', fixed: true, css: 'vertical-align: middle;', renderer: SMSRenderer, dataIndex: 'sms'}, |
|
||||
{header: "Active Since", width: 85, sortable: true, css: 'vertical-align: middle;', renderer: Ext.util.Format.dateRenderer('m/d/Y'), dataIndex: 'created'}, |
|
||||
{header: "Last Activity", width: 85, sortable: true, css: 'vertical-align: middle;', renderer: Ext.util.Format.dateRenderer('m/d/Y'), dataIndex: 'last_access'}*/ |
|
||||
{header: "", width: 24, sortable: false, menuDisabled: true, align: 'center', fixed: true, css: 'vertical-align: middle;', renderer: IconRenderer, dataIndex: 'type' }, |
|
||||
{header: "Time Stamp", width: 160, sortable: false, menuDisabled: true, align: 'center', fixed: true, css: 'vertical-align: middle;', renderer: Ext.util.Format.dateRenderer('d-m-Y H:i:s'), dataIndex: 'ts' }, |
|
||||
{header: "Event Description", width: 200, sortable: false, menuDisabled: true, align: 'left', css: 'vertical-align: middle;', renderer: TypeRenderer, dataIndex: 'type' }, |
|
||||
{header: "Grouped Events", width: 60, sortable: false, menuDisabled: true, align: 'center', css: 'vertical-align: middle;', dataIndex: 'cnt' }, |
|
||||
/*{header: "Range", width: 60, sortable: false, menuDisabled: true, align: 'center', fixed: true, css: 'vertical-align: middle;', dataIndex: 'range' }, |
|
||||
{header: "LVL 0", width: 130, sortable: false, menuDisabled: true, align: 'center', fixed: true, css: 'vertical-align: middle;', renderer: LrfRenderer, dataIndex: 'f_lrf' }, |
|
||||
{header: "LVL 1", width: 130, sortable: false, menuDisabled: true, align: 'center', fixed: true, css: 'vertical-align: middle;', renderer: LrfRenderer, dataIndex: 's_lrf' }, |
|
||||
{header: "Speed", width: 60, sortable: false, menuDisabled: true, align: 'center', fixed: true, css: 'vertical-align: middle;', dataIndex: 'lrf_id' }, |
|
||||
*/ |
|
||||
{header: "Video", width: 50, sortable: false, menuDisabled: true, align: 'center', fixed: true, css: 'vertical-align: middle;', renderer: VideoRenderer, dataIndex: 'has_image' } |
|
||||
]); |
|
||||
|
|
||||
var EvtGroupSelModel = new Ext.grid.RowSelectionModel({ |
|
||||
singleSelect: true, |
|
||||
listeners: { |
|
||||
rowselect: function(sm, row, rec) { |
|
||||
if (!SelectedEvent){ |
|
||||
SelectedEvent = rec; |
|
||||
SelectedEvent.sm = sm; |
|
||||
SelectedEvent.rowId = row; |
|
||||
} else { |
|
||||
SelectedEvent = rec; |
|
||||
SelectedEvent.sm = sm; |
|
||||
SelectedEvent.rowId = row; |
|
||||
}; |
|
||||
} |
|
||||
} |
|
||||
}); |
|
||||
|
|
||||
|
|
||||
var EvtListColModel = new Ext.grid.ColumnModel([ |
|
||||
{header: "", width: 24, sortable: false, menuDisabled: true, align: 'center', fixed: true, css: 'vertical-align: middle;', renderer: IconRenderer, dataIndex: 'type' }, |
|
||||
{header: "Time Stamp", width: 160, sortable: false, menuDisabled: true, align: 'center', fixed: true, css: 'vertical-align: middle;', renderer: Ext.util.Format.dateRenderer('d-m-Y H:i:s'), dataIndex: 'ts' }, |
|
||||
{header: "Event Description", sortable: false, menuDisabled: true, align: 'left', css: 'vertical-align: middle;', renderer: TypeRenderer, dataIndex: 'type' }, |
|
||||
{header: "Range", width: 60, sortable: false, menuDisabled: true, align: 'center', fixed: true, css: 'vertical-align: middle;', dataIndex: 'range' }, |
|
||||
{header: "LVL 0", width: 130, sortable: false, menuDisabled: true, align: 'center', fixed: true, css: 'vertical-align: middle;', renderer: LrfRenderer, dataIndex: 'f_lrf' }, |
|
||||
{header: "LVL 1", width: 130, sortable: false, menuDisabled: true, align: 'center', fixed: true, css: 'vertical-align: middle;', renderer: LrfRenderer, dataIndex: 's_lrf' }, |
|
||||
{header: "Speed", width: 60, sortable: false, menuDisabled: true, align: 'center', fixed: true, css: 'vertical-align: middle;', dataIndex: 'speed' } |
|
||||
]); |
|
||||
|
|
||||
var EvtListSelModel = new Ext.grid.RowSelectionModel({ |
|
||||
singleSelect: true, |
|
||||
listeners: { |
|
||||
rowselect: function(sm, row, rec) { |
|
||||
if (!SelectedEvent){ |
|
||||
SelectedEvent = rec; |
|
||||
SelectedEvent.sm = sm; |
|
||||
SelectedEvent.rowId = row; |
|
||||
} else { |
|
||||
SelectedEvent = rec; |
|
||||
SelectedEvent.sm = sm; |
|
||||
SelectedEvent.rowId = row; |
|
||||
}; |
|
||||
} |
|
||||
} |
|
||||
}); |
|
||||
|
|
||||
|
|
||||
function showEventGroupWindow( vsrc, gid ){ |
|
||||
if( GEWindow == null ){ |
|
||||
GEWindow = new Ext.Window({ |
|
||||
title: 'Event Viewer', |
|
||||
width: iW+20, |
|
||||
height: iH+300, |
|
||||
modal: true, |
|
||||
y: 120, |
|
||||
resizable: false, |
|
||||
closeAction: 'hide', |
|
||||
items: [{ |
|
||||
xtype: 'panel', |
|
||||
id: 'video-panel', |
|
||||
html: '<div id="divvidflash" style="background: black; width: '+iW+'px; height: '+iH+'px;"></div>', |
|
||||
bbar: [{ |
|
||||
iconCls: 'silk-start', |
|
||||
handler: function(){ |
|
||||
if( VideoPlayer ){ |
|
||||
VideoPlayer.currentTime = 0; |
|
||||
}; |
|
||||
} |
|
||||
},{ |
|
||||
text: 'Play', |
|
||||
iconCls: 'silk-play', |
|
||||
handler: function(){ |
|
||||
if( VideoPlayer ){ |
|
||||
if( VideoIsPlaying ){ |
|
||||
VideoPlayer.pause(); |
|
||||
VideoIsPlaying = false; |
|
||||
} else { |
|
||||
VideoPlayer.play(); |
|
||||
VideoIsPlaying = true; |
|
||||
}; |
|
||||
}; |
|
||||
} |
|
||||
},{ |
|
||||
iconCls: 'silk-replay', |
|
||||
enableToggle: true, |
|
||||
handler: function(){ |
|
||||
if( VideoPlayer ){ |
|
||||
VideoIsLooped = !VideoIsLooped; |
|
||||
}; |
|
||||
} |
|
||||
}] |
|
||||
},{ |
|
||||
xtype: 'grid', |
|
||||
title: 'Events Log', |
|
||||
frame: false, |
|
||||
id: 'grp_grid', |
|
||||
forceFit: true, |
|
||||
ds: EvtListDataStore, |
|
||||
cm: EvtListColModel, |
|
||||
sm: EvtListSelModel, |
|
||||
//autoExpandColumn: 'login',
|
|
||||
height: 235, |
|
||||
width: '100%', |
|
||||
border: false, |
|
||||
listeners: { |
|
||||
render: function(g) { |
|
||||
//g.getSelectionModel().selectRow(0);
|
|
||||
}, |
|
||||
delay: 10 // Allow rows to be rendered.
|
|
||||
}, |
|
||||
viewConfig: { |
|
||||
forceFit:true |
|
||||
}, |
|
||||
}], |
|
||||
listeners: { |
|
||||
beforehide : function(component) { |
|
||||
if( VideoFlash != null ){ |
|
||||
if(VideoPosInterval) clearInterval( VideoPosInterval ); |
|
||||
VideoPosInterval = null; |
|
||||
swfobject.removeSWF( "vidflash" ); |
|
||||
Ext.getCmp('video-panel').removeAll( true ); |
|
||||
Ext.getCmp('video-panel').add({ html:'<div id="divvidflash"></div>'}); |
|
||||
VideoFlash = null; |
|
||||
VideoIsPlaying = false; |
|
||||
}; |
|
||||
} |
|
||||
} |
|
||||
}); |
|
||||
}; |
|
||||
GEWindow.show(); |
|
||||
setVideoToPlay( vsrc ); |
|
||||
GetEventsLog( gid ); |
|
||||
} |
|
||||
|
|
||||
|
|
||||
Ext.onReady(function() { |
|
||||
var panel = new Ext.Panel({ |
|
||||
renderTo: 'content', |
|
||||
width: panelWidth, |
|
||||
|
|
||||
items:[ { |
|
||||
xtype: 'panel', |
|
||||
id: '121', |
|
||||
title:'Video', |
|
||||
frame: true, |
|
||||
html:'<img id="theImage" border=0 src="/cgi-bin/nph-video" width="'+panelWidth+'px" rel="shadowbox" onClick="makeFullScreen();">', |
|
||||
width: imgWidth+12, |
|
||||
height: imgHeight+75, |
|
||||
anchor:'right 50%', |
|
||||
fbar: [{ |
|
||||
text: 'Force Alarm', |
|
||||
id: 'rec-test', |
|
||||
disabled: true, |
|
||||
iconCls: 'silk-belladd', |
|
||||
handler: function(){ |
|
||||
Ext.Msg.show({ |
|
||||
title:'Test Record Frames?', |
|
||||
msg: 'You are about to record 240 frames. Would you like to do so?', |
|
||||
buttons: Ext.Msg.YESNOCANCEL, |
|
||||
fn: function(btn, text){ |
|
||||
if( btn == 'yes' ) makeAlarm(); |
|
||||
}, |
|
||||
animEl: '121', |
|
||||
icon: Ext.MessageBox.QUESTION |
|
||||
}); |
|
||||
} |
|
||||
},{ |
|
||||
iconCls: 'silk-cog', |
|
||||
text: 'Video Config', |
|
||||
handler: showVideoConfigWindow |
|
||||
}] |
|
||||
},{ |
|
||||
title: 'Detector Settings', |
|
||||
xtype: 'form', |
|
||||
layout: 'form', |
|
||||
layoutConfig: { |
|
||||
type: 'hbox', |
|
||||
padding: '5', |
|
||||
align: 'center' |
|
||||
}, |
|
||||
//html: '<table width="100%" border=0><tr><td>Offset:</td><td><?=20;?></td><td>Max Distance:</td><td>3.00</td><td>Layer Distance:</td><td>0.5</td></tr></table>',
|
|
||||
width: panelWidth, |
|
||||
buttons:[{ |
|
||||
xtype: 'panel', |
|
||||
html: '<canvas id="StatusCanvas" width="120px" height="20px"></canvas>' |
|
||||
},{ |
|
||||
text: 'Show Detection Backgrounds', |
|
||||
iconCls: 'silk-chart', |
|
||||
handler: showDetectionBackgroundWindow |
|
||||
},{ |
|
||||
text: 'Change Detection Settings', |
|
||||
iconCls: 'silk-cog', |
|
||||
handler: showDetectionConfigWindow |
|
||||
},{ |
|
||||
text: 'Reset Sensor', |
|
||||
id: 'lrf-rst', |
|
||||
disabled: true, |
|
||||
iconCls: 'silk-arrow-refresh', |
|
||||
handler: function(){ |
|
||||
Ext.Msg.show({ |
|
||||
title:'Reset Detector?', |
|
||||
msg: 'You are about to reset detector. The system will be blind for 1 second. Would you like to do so?', |
|
||||
buttons: Ext.Msg.YESNOCANCEL, |
|
||||
fn: function(btn, text){ |
|
||||
if( btn == 'yes' ) resetDetector(); |
|
||||
}, |
|
||||
animEl: '121', |
|
||||
icon: Ext.MessageBox.WARNING |
|
||||
}); |
|
||||
} |
|
||||
},{ |
|
||||
text: 'Enable Detection', |
|
||||
disabled: true, |
|
||||
id: 'ena-dis', |
|
||||
iconCls: 'silk-accept', |
|
||||
handler: detectionEnable |
|
||||
}] |
|
||||
},{ |
|
||||
xtype: 'grid', |
|
||||
title: 'Events Log', |
|
||||
frame: true, |
|
||||
id: 'mygrid', |
|
||||
forceFit: true, |
|
||||
ds: EvtGroupDataStore, |
|
||||
cm: EvtGroupColModel, |
|
||||
sm: EvtGroupSelModel, |
|
||||
//autoExpandColumn: 'login',
|
|
||||
height: 350, |
|
||||
width: '100%', |
|
||||
border: false, |
|
||||
listeners: { |
|
||||
render: function(g) { |
|
||||
g.getSelectionModel().selectRow(0); |
|
||||
}, |
|
||||
delay: 10 // Allow rows to be rendered.
|
|
||||
}, |
|
||||
viewConfig: { |
|
||||
forceFit:true |
|
||||
}, |
|
||||
bbar: [{ |
|
||||
tooltip:'Clear Log Messages', |
|
||||
id: 'clrList', |
|
||||
text: 'Clear', |
|
||||
iconCls:'silk-cross', |
|
||||
handler: function(){ |
|
||||
Ext.Msg.show({ |
|
||||
title:'Clear Log Messages?', |
|
||||
msg: 'You are about to clear log. All data and pictures will be deleted. Would you like to do so?', |
|
||||
buttons: Ext.Msg.YESNOCANCEL, |
|
||||
fn: function(btn, text){ |
|
||||
if( btn == 'yes' ){ |
|
||||
Ext.Ajax.request({ |
|
||||
url: '/lib/controller/clearLOG.php', |
|
||||
success: function( response, opts ){ |
|
||||
var obj = Ext.decode( response.responseText ); |
|
||||
}, |
|
||||
failure: function( response, opts ){ |
|
||||
Ext.Msg.alert('Status', 'Error Creating AJAX Connection.<br>Code: CENDL00215'); |
|
||||
}, |
|
||||
headers: { |
|
||||
'my-header': 'foo' |
|
||||
}, |
|
||||
params: { last_id: lastId } |
|
||||
}); |
|
||||
}; |
|
||||
}, |
|
||||
animEl: 'mygrid', |
|
||||
icon: Ext.MessageBox.WARNING |
|
||||
}); |
|
||||
}, |
|
||||
disabled: false |
|
||||
}] |
|
||||
}] |
|
||||
}); |
|
||||
|
|
||||
|
|
||||
Ext.ux.SliderTip = Ext.extend(Ext.Tip, { |
|
||||
minWidth: 10, |
|
||||
offsets : [0, -10], |
|
||||
init : function(slider){ |
|
||||
slider.on('dragstart', this.onSlide, this); |
|
||||
slider.on('drag', this.onSlide, this); |
|
||||
slider.on('dragend', this.hide, this); |
|
||||
slider.on('destroy', this.destroy, this); |
|
||||
}, |
|
||||
|
|
||||
onSlide : function(slider){ |
|
||||
this.show(); |
|
||||
this.body.update(this.getText(slider)); |
|
||||
this.doAutoWidth(); |
|
||||
this.el.alignTo(slider.thumb, 'b-t?', this.offsets); |
|
||||
}, |
|
||||
|
|
||||
getText : function(slider){ |
|
||||
return String(slider.getValue()); |
|
||||
} |
|
||||
}); |
|
||||
|
|
||||
STip = new Ext.ux.SliderTip({ |
|
||||
getText: function(slider){ |
|
||||
return String.format('<b>More Than {0} '+SPEED_TYPE+'</b>', slider.getValue()); |
|
||||
} |
|
||||
}); |
|
||||
|
|
||||
Ext.QuickTips.init(); |
|
||||
// turn on validation errors beside the field globally
|
|
||||
Ext.form.Field.prototype.msgTarget = 'under'; |
|
||||
|
|
||||
updateInterval = setInterval( GetGroupedEvents, 1000 ); |
|
||||
}); |
|
||||
1973
lib/javascript/jsapi_dynamic/mojo_dashboard.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -1,269 +0,0 @@ |
|||||
//<?php require_once('../../js_asm.php'); ?>
|
|
||||
|
|
||||
var um_selected_log_id = 0; |
|
||||
|
|
||||
var um_server_log_store = new Ext.data.JsonStore({ |
|
||||
root: 'records', |
|
||||
totalProperty: 'totalCount', |
|
||||
idProperty: 'id', |
|
||||
remoteSort: true, |
|
||||
fields: [{ |
|
||||
name: 'id', |
|
||||
type: 'int' |
|
||||
},{ |
|
||||
name: 'type', |
|
||||
type: 'string' |
|
||||
},{ |
|
||||
name: 'ts', |
|
||||
type: 'string' |
|
||||
},{ |
|
||||
name: 'ptr', |
|
||||
type: 'string' |
|
||||
},{ |
|
||||
name: 'module', |
|
||||
type: 'string' |
|
||||
},{ |
|
||||
name: 'msg', |
|
||||
type: 'string' |
|
||||
}], |
|
||||
proxy : new Ext.data.HttpProxy({ |
|
||||
method: 'POST', |
|
||||
prettyUrls: false, |
|
||||
url: '/lib/controller/listServerLog.php', |
|
||||
headers: { |
|
||||
UID: <?=$UserID;?>, |
|
||||
SID: '<?=$Session;?>' |
|
||||
} |
|
||||
}) |
|
||||
}); |
|
||||
|
|
||||
var um_server_log_col_model_opt = { |
|
||||
columns: [ |
|
||||
{header: "<?=$Labels->GetLabel("_ID_");?>", width: 50, sortable: false, menuDisabled: true, align: 'center', fixed: true, css: 'vertical-align: middle;', dataIndex: 'id' }, |
|
||||
{header: "<?=$Labels->GetLabel("_DATETIME_");?>", width: 150, sortable: false, fixed: true, menuDisabled: true, align: 'left', css: 'vertical-align: middle;', dataIndex: 'ts' }, |
|
||||
{header: "<?=$Labels->GetLabel("_POINTER_");?>", width: 100, sortable: false, fixed: true, menuDisabled: true, /*renderer: camCapRenderer,*/ dataIndex: 'ptr' }, |
|
||||
{header: "<?=$Labels->GetLabel("_MODULE_");?>", width: 100, sortable: false, fixed: true, menuDisabled: true, /*renderer: camCapRenderer,*/ dataIndex: 'module' }, |
|
||||
{header: "<?=$Labels->GetLabel("_INFO_");?>", resizable: true, sortable: false, fixed: false, flex: 1, menuDisabled: true, align: 'left', css: 'vertical-align: middle;', dataIndex: 'msg' } |
|
||||
], |
|
||||
defaults: { |
|
||||
sortable: false, |
|
||||
menuDisabled: true, |
|
||||
width: 100 |
|
||||
} |
|
||||
}; |
|
||||
|
|
||||
|
|
||||
var um_log_sel_model_opt = { |
|
||||
singleSelect: true, |
|
||||
listeners: { |
|
||||
rowselect: function(sm, row, rec) { |
|
||||
um_selected_log_id = rec.data.id; |
|
||||
} |
|
||||
} |
|
||||
}; |
|
||||
|
|
||||
|
|
||||
var um_access_log_store = new Ext.data.JsonStore({ |
|
||||
root: 'records', |
|
||||
totalProperty: 'totalCount', |
|
||||
idProperty: 'id', |
|
||||
remoteSort: true, |
|
||||
fields: [{ |
|
||||
name: 'id', |
|
||||
type: 'int' |
|
||||
},{ |
|
||||
name: 'user', |
|
||||
type: 'string' |
|
||||
},{ |
|
||||
name: 'ts', |
|
||||
type: 'string' |
|
||||
},{ |
|
||||
name: 'cmd', |
|
||||
type: 'int' |
|
||||
},{ |
|
||||
name: 'data_line', |
|
||||
type: 'string' |
|
||||
}], |
|
||||
proxy : new Ext.data.HttpProxy({ |
|
||||
method: 'POST', |
|
||||
prettyUrls: false, |
|
||||
url: '/lib/controller/listAccessLog.php', |
|
||||
headers: { |
|
||||
UID: <?=$UserID;?>, |
|
||||
SID: '<?=$Session;?>' |
|
||||
} |
|
||||
}) |
|
||||
}); |
|
||||
|
|
||||
function um_action_renderer( val ){ |
|
||||
switch( val ){ |
|
||||
case 1: return "<?=$Labels->GetLabel("_LOGIN_");?>"; |
|
||||
case 13: return "<?=$Labels->GetLabel("_ACCESS_DENIED_");?>"; |
|
||||
case 145: return "<?=$Labels->GetLabel("_SCREEN_RESIZE_");?>"; |
|
||||
}; |
|
||||
return "unknown action"; |
|
||||
}; |
|
||||
|
|
||||
var um_access_log_col_model_opt = { |
|
||||
columns: [ |
|
||||
{header: "<?=$Labels->GetLabel("_ID_");?>", width: 50, sortable: false, menuDisabled: true, align: 'center', fixed: true, css: 'vertical-align: middle;', dataIndex: 'id' }, |
|
||||
{header: "<?=$Labels->GetLabel("_USER_");?>",width: 80, sortable: false, fixed: true, menuDisabled: true, /*renderer: camCapRenderer,*/ dataIndex: 'user' }, |
|
||||
{header: "<?=$Labels->GetLabel("_DATETIME_");?>", width: 150, sortable: false, renderer: unix_ts_renderer, fixed: true, menuDisabled: true, align: 'left', css: 'vertical-align: middle;', dataIndex: 'ts' }, |
|
||||
{header: "<?=$Labels->GetLabel("_ACTION_");?>", width: 150, sortable: false, fixed: true, menuDisabled: true, align: 'left', css: 'vertical-align: middle;', renderer: um_action_renderer, dataIndex: 'cmd' }, |
|
||||
{header: "<?=$Labels->GetLabel("_INFO_");?>", resizable: true, sortable: false, fixed: false, flex: 1, dataindex: 'data_line' } |
|
||||
], |
|
||||
defaults: { |
|
||||
sortable: false, |
|
||||
menuDisabled: true, |
|
||||
width: 100 |
|
||||
} |
|
||||
}; |
|
||||
var um_access_log_sel_model_opt = { |
|
||||
singleSelect: true, |
|
||||
listeners: { |
|
||||
rowselect: function(sm, row, rec) { |
|
||||
um_selected_log_id = rec.data.id; |
|
||||
} |
|
||||
} |
|
||||
}; |
|
||||
|
|
||||
function loadAccessLog(){ |
|
||||
if( tlInterval!= null ){ |
|
||||
window.clearInterval( tlInterval ); |
|
||||
tlInterval = null; |
|
||||
timelineObj = null; |
|
||||
}; |
|
||||
var tPanel = Ext.getCmp('main_content'); |
|
||||
tPanel.removeAll( true ); |
|
||||
Ext.getCmp('main_content').setTitle( '<?=$Labels->GetLabel("_ACC_LOG_");?>' ); |
|
||||
tPanel.add({ |
|
||||
columnWidth: 1.0, |
|
||||
frame: false, |
|
||||
border: false, |
|
||||
items: [{ |
|
||||
xtype: 'panel', |
|
||||
layout: 'fit', |
|
||||
layoutConfig: { |
|
||||
align : 'stretch', |
|
||||
pack : 'start' |
|
||||
}, |
|
||||
height: PanelH-5, |
|
||||
flex: 1, |
|
||||
frame: false, |
|
||||
border: false, |
|
||||
items:{ |
|
||||
frame: false, |
|
||||
height: PanelH-5, |
|
||||
xtype: 'grid', |
|
||||
forceFit: true, |
|
||||
viewConfig: { |
|
||||
forceFit: true, |
|
||||
getRowClass: function( record, rowIndex, rowParams, store){ |
|
||||
switch( record.get('cmd') ){ |
|
||||
case 1: return 'row-level01'; |
|
||||
case 2: return 'row-level02'; |
|
||||
case 3: return 'row-level03'; |
|
||||
case 4: return 'row-level04'; |
|
||||
case 145: return 'row-level05'; |
|
||||
}; |
|
||||
return ''; |
|
||||
} |
|
||||
}, |
|
||||
ds: um_access_log_store, |
|
||||
cm: new Ext.grid.ColumnModel( um_access_log_col_model_opt ), |
|
||||
sm: new Ext.grid.RowSelectionModel( um_log_sel_model_opt ) |
|
||||
},tbar: [{ |
|
||||
xtype: 'button', |
|
||||
id: 'um_access_reload_btn', |
|
||||
text: '<?=$Labels->GetLabel("_RELOAD_");?>', |
|
||||
handler: function(){ |
|
||||
um_access_log_store.reload(); |
|
||||
} |
|
||||
}] |
|
||||
}] |
|
||||
}); |
|
||||
tPanel.doLayout(); |
|
||||
um_selected_log_id = 0; |
|
||||
um_access_log_store.reload(); |
|
||||
}; |
|
||||
|
|
||||
function loadServerLog(){ |
|
||||
if( tlInterval!= null ){ |
|
||||
window.clearInterval( tlInterval ); |
|
||||
tlInterval = null; |
|
||||
timelineObj = null; |
|
||||
}; |
|
||||
var tPanel = Ext.getCmp('main_content'); |
|
||||
tPanel.removeAll( true ); |
|
||||
Ext.getCmp('main_content').setTitle( '<?=$Labels->GetLabel("_SERV_LOG_");?>' ); |
|
||||
tPanel.add({ |
|
||||
columnWidth: 1.0, |
|
||||
frame: false, |
|
||||
border: false, |
|
||||
items: [{ |
|
||||
xtype: 'panel', |
|
||||
layout: 'fit', |
|
||||
layoutConfig: { |
|
||||
align : 'stretch', |
|
||||
pack : 'start' |
|
||||
}, |
|
||||
height: PanelH-5, |
|
||||
flex: 1, |
|
||||
frame: false, |
|
||||
border: false, |
|
||||
items:{ |
|
||||
frame: false, |
|
||||
height: PanelH-5, |
|
||||
xtype: 'grid', |
|
||||
forceFit: true, |
|
||||
viewConfig: { |
|
||||
forceFit: true, |
|
||||
getRowClass: function( record, rowIndex, rowParams, store){ |
|
||||
switch( record.get('type') ){ |
|
||||
case '01': return 'row-level01'; |
|
||||
case '02': return 'row-level02'; |
|
||||
case '03': return 'row-level03'; |
|
||||
case '04': return 'row-level04'; |
|
||||
case '05': return 'row-level05'; |
|
||||
}; |
|
||||
return ''; |
|
||||
} |
|
||||
}, |
|
||||
ds: um_server_log_store, |
|
||||
cm: new Ext.grid.ColumnModel( um_server_log_col_model_opt ), |
|
||||
sm: new Ext.grid.RowSelectionModel( um_log_sel_model_opt ) |
|
||||
},tbar: [{ |
|
||||
xtype: 'button', |
|
||||
id: 'um_server_reload_btn', |
|
||||
text: '<?=$Labels->GetLabel("_RELOAD_");?>', |
|
||||
handler: function(){ |
|
||||
um_server_log_store.reload(); |
|
||||
} |
|
||||
},{ |
|
||||
xtype: 'button', |
|
||||
id: 'um_server_clean_btn', |
|
||||
text: '<?=$Labels->GetLabel("_CLEAR_");?>', |
|
||||
handler: function(){ |
|
||||
Ext.Ajax.request({ |
|
||||
url: '/lib/controller/clearServerLog.php', |
|
||||
params: { |
|
||||
NID: NID, |
|
||||
UID: <?=$UserID;?>, |
|
||||
SID: '<?=$Session;?>' |
|
||||
}, |
|
||||
success: function( response, opts ){ |
|
||||
um_server_log_store.reload(); |
|
||||
} |
|
||||
}); |
|
||||
} |
|
||||
}] |
|
||||
}] |
|
||||
}); |
|
||||
tPanel.doLayout(); |
|
||||
um_selected_log_id = 0; |
|
||||
um_server_log_store.reload(); |
|
||||
tlInterval = window.setInterval( um_server_log_store.reload, 333, 0 ); |
|
||||
}; |
|
||||
|
|
||||
|
|
||||
|
|
||||
2561
lib/javascript/jsapi_dynamic/mojo_map.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -1,94 +0,0 @@ |
|||||
//<?php require_once('../../js_asm.php'); ?>
|
|
||||
|
|
||||
|
|
||||
|
|
||||
function loadMetroControlUpper(){ |
|
||||
|
|
||||
Ext.Ajax.request({ |
|
||||
url: '/lib/controller/getMetroUpperSensorEditor.php', |
|
||||
params: { |
|
||||
UID: <?=$UserID;?>, |
|
||||
SID: '<?=$Session;?>' |
|
||||
}, |
|
||||
success: function( response, opts ){ |
|
||||
var data = Ext.decode( response.responseText ); |
|
||||
var tComp = Ext.getCmp('main_content'); |
|
||||
if( data.status == 'ok' ){ |
|
||||
if( tComp!= null ){ |
|
||||
var content = Ext.decode( data.content ); |
|
||||
tComp.removeAll( true ); |
|
||||
tComp.add( content ); |
|
||||
tComp.doLayout(); |
|
||||
}; |
|
||||
} else { |
|
||||
if( tComp!= null ){ |
|
||||
tComp.removeAll( true ); |
|
||||
tComp.add( data ); |
|
||||
tComp.doLayout(); |
|
||||
}; |
|
||||
}; |
|
||||
}, |
|
||||
failure: function(){ |
|
||||
} |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
function loadMetroControlBottom(){ |
|
||||
Ext.Ajax.request({ |
|
||||
url: '/lib/controller/getMetroBottomSensorEditor.php', |
|
||||
params: { |
|
||||
UID: <?=$UserID;?>, |
|
||||
SID: '<?=$Session;?>' |
|
||||
}, |
|
||||
success: function( response, opts ){ |
|
||||
var data = Ext.decode( response.responseText ); |
|
||||
var tComp = Ext.getCmp('main_content'); |
|
||||
if( data.status == 'ok' ){ |
|
||||
if( tComp!= null ){ |
|
||||
var content = Ext.decode( data.content ); |
|
||||
tComp.removeAll( true ); |
|
||||
tComp.add( content ); |
|
||||
tComp.doLayout(); |
|
||||
}; |
|
||||
} else { |
|
||||
if( tComp!= null ){ |
|
||||
tComp.removeAll( true ); |
|
||||
tComp.add( data ); |
|
||||
tComp.doLayout(); |
|
||||
}; |
|
||||
}; |
|
||||
}, |
|
||||
failure: function(){ |
|
||||
} |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
function loadMetroControlFusion(){ |
|
||||
Ext.Ajax.request({ |
|
||||
url: '/lib/controller/getMetroFusionEditor.php', |
|
||||
params: { |
|
||||
UID: <?=$UserID;?>, |
|
||||
SID: '<?=$Session;?>' |
|
||||
}, |
|
||||
success: function( response, opts ){ |
|
||||
var data = Ext.decode( response.responseText ); |
|
||||
var tComp = Ext.getCmp('main_content'); |
|
||||
if( data.status == 'ok' ){ |
|
||||
if( tComp!= null ){ |
|
||||
var content = Ext.decode( data.content ); |
|
||||
tComp.removeAll( true ); |
|
||||
tComp.add( content ); |
|
||||
tComp.doLayout(); |
|
||||
}; |
|
||||
} else { |
|
||||
if( tComp!= null ){ |
|
||||
tComp.removeAll( true ); |
|
||||
tComp.add( data ); |
|
||||
tComp.doLayout(); |
|
||||
}; |
|
||||
}; |
|
||||
}, |
|
||||
failure: function(){ |
|
||||
} |
|
||||
}); |
|
||||
}; |
|
||||
1593
lib/javascript/jsapi_dynamic/mojo_reports.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
1664
lib/javascript/jsapi_dynamic/rgoose_cameras.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
1299
lib/javascript/jsapi_dynamic/rgoose_dashboard.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
2515
lib/javascript/jsapi_dynamic/rgoose_devices.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
2370
lib/javascript/jsapi_dynamic/rgoose_devices_.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
1255
lib/javascript/jsapi_dynamic/rgoose_location_editor.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -1,479 +0,0 @@ |
|||||
//<?php require_once('../../js_asm.php'); ?>
|
|
||||
|
|
||||
function ssShowSS() { |
|
||||
ssStopTimer(); |
|
||||
document.removeEventListener( "mousemove", ssResetTimer ); |
|
||||
document.removeEventListener( "mousedown", ssResetTimer ); |
|
||||
document.removeEventListener( "keypress", ssResetTimer ); |
|
||||
document.removeEventListener( "touchmove", ssResetTimer ); |
|
||||
|
|
||||
document.addEventListener( "mousemove", ssHideSS, false ); |
|
||||
document.addEventListener( "mousedown", ssHideSS, false ); |
|
||||
document.addEventListener( "keypress", ssHideSS, false ); |
|
||||
document.addEventListener( "touchmove", ssHideSS, false ); |
|
||||
document.getElementById('ss_bg').className='ss_bg_overlay'; |
|
||||
document.getElementById('ss_content').className='ss_overlay'; |
|
||||
ssShowTime(); |
|
||||
if( ssInterval == null ){ |
|
||||
ssInterval = window.setInterval( ssShowTime, 333 ); |
|
||||
}; |
|
||||
ssIsActive = true; |
|
||||
}; |
|
||||
function ssShowTime(){ |
|
||||
document.getElementById('ss_content').style.fontSize = '240px'; |
|
||||
var currentdate = new Date(); |
|
||||
var cTime = (( currentdate.getHours()<10 )? '0'+currentdate.getHours(): currentdate.getHours() ) + ":" + (( currentdate.getMinutes()<10 )? '0'+currentdate.getMinutes(): currentdate.getMinutes() ) + ":" + (( currentdate.getSeconds()<10 )? '0'+currentdate.getSeconds(): currentdate.getSeconds() ); |
|
||||
document.getElementById('ss_content').innerHTML= cTime; |
|
||||
}; |
|
||||
function ssResetTimer() { |
|
||||
ssStopTimer(); |
|
||||
ssStartTimer(); |
|
||||
}; |
|
||||
|
|
||||
function ssStartTimer() { |
|
||||
if( ssTimer == null ){ |
|
||||
ssTimer = window.setTimeout( ssShowSS, ssTimeOut ); |
|
||||
}; |
|
||||
}; |
|
||||
function ssStopTimer() { |
|
||||
if( ssTimer ){ |
|
||||
window.clearTimeout( ssTimer ); |
|
||||
ssTimer = null; |
|
||||
}; |
|
||||
}; |
|
||||
|
|
||||
function ssSetupTimer() { |
|
||||
document.addEventListener( "mousemove", ssResetTimer, false); |
|
||||
document.addEventListener( "mousedown", ssResetTimer, false); |
|
||||
document.addEventListener( "keypress", ssResetTimer, false); |
|
||||
document.addEventListener( "touchmove", ssResetTimer, false); |
|
||||
ssStartTimer(); |
|
||||
}; |
|
||||
|
|
||||
function ssHideSS(){ |
|
||||
document.getElementById('ss_bg').className='ss_hidden'; |
|
||||
document.getElementById('ss_content').className='ss_hidden'; |
|
||||
document.removeEventListener( "mousemove", ssHideSS ); |
|
||||
document.removeEventListener( "mousedown", ssHideSS ); |
|
||||
document.removeEventListener( "keypress", ssHideSS ); |
|
||||
document.removeEventListener( "touchmove", ssHideSS ); |
|
||||
if( ssInterval != null ){ |
|
||||
window.clearInterval( ssInterval ); |
|
||||
ssInterval = null; |
|
||||
}; |
|
||||
ssSetupTimer(); |
|
||||
ssIsActive = false; |
|
||||
}; |
|
||||
|
|
||||
|
|
||||
|
|
||||
var sndBeep = new Howl({ |
|
||||
src: [ |
|
||||
'/style/assets/audio/beep-07a.mp3', |
|
||||
'/style/assets/audio/beep-07a.wav' |
|
||||
], |
|
||||
loop: false, |
|
||||
volume: 0.99, |
|
||||
onend: function() { |
|
||||
//console.log('Finished!');
|
|
||||
} |
|
||||
}); |
|
||||
var sndExcl = new Howl({ |
|
||||
src: [ |
|
||||
'/style/assets/audio/button-42.mp3', |
|
||||
'/style/assets/audio/button-42.wav' |
|
||||
], |
|
||||
loop: false, |
|
||||
volume: 0.99 |
|
||||
}); |
|
||||
|
|
||||
function playSound( t ){ |
|
||||
if( SoundEnable ){ |
|
||||
switch( t ){ |
|
||||
case 1:{ |
|
||||
sndBeep.play(); |
|
||||
break; |
|
||||
}; |
|
||||
default:{ |
|
||||
sndExcl.play(); |
|
||||
}; |
|
||||
}; |
|
||||
}; |
|
||||
}; |
|
||||
|
|
||||
function doRefresh(){ |
|
||||
window.location="/?t="+123; |
|
||||
}; |
|
||||
|
|
||||
function doLogout(){ |
|
||||
window.location = '/login.php?UID=1'; |
|
||||
}; |
|
||||
|
|
||||
function stopStatusUpdater(){ |
|
||||
if( tlInterval!= null ){ |
|
||||
window.clearInterval( tlInterval ); |
|
||||
tlInterval = null; |
|
||||
}; |
|
||||
}; |
|
||||
|
|
||||
function failureAJAXFunction( responce, opts ){ |
|
||||
if( tlInterval!= null ){ |
|
||||
window.clearInterval( tlInterval ); |
|
||||
tlInterval = null; |
|
||||
}; |
|
||||
playSound(); |
|
||||
Ext.Msg.show({ |
|
||||
title:'<?=$Labels->GetLabel('_REQ_FAILURE_');?>', |
|
||||
msg: '<?=$Labels->GetLabel('_AJX_REQFAILURE_');?>', |
|
||||
buttons: Ext.Msg.OK, |
|
||||
icon: Ext.MessageBox.INFO |
|
||||
}); |
|
||||
doLogout(); |
|
||||
}; |
|
||||
|
|
||||
function updateUserScreenResolution( x, y ){ |
|
||||
Ext.Ajax.request({ |
|
||||
url: '/lib/controller/updateUserSettings.php', |
|
||||
params: { |
|
||||
UID: <?=$UserID;?>, |
|
||||
SID: '<?=$Session;?>', |
|
||||
SSS: 15, |
|
||||
WID: x, |
|
||||
HEI: y |
|
||||
}, |
|
||||
success: function( response, opts ){ |
|
||||
doRefresh(); |
|
||||
}, |
|
||||
failure: failureAJAXFunction |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
function setUserContent( c_id ){ |
|
||||
initView = c_id; |
|
||||
Ext.Ajax.request({ |
|
||||
url: '/lib/controller/updateUserSettings.php', |
|
||||
params: { |
|
||||
UID: <?=$UserID;?>, |
|
||||
SID: '<?=$Session;?>', |
|
||||
SSS: 26, |
|
||||
CID: initView |
|
||||
}, |
|
||||
failure: failureAJAXFunction |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
function updateUserContent(){ |
|
||||
cid = content_lvl3 + content_lvl2 * 10 + content_lvl1*100 + content_lvl0*1000; |
|
||||
if( initView != cid ) setUserContent( cid ); |
|
||||
}; |
|
||||
|
|
||||
var gSessionValidatorInterval = null; |
|
||||
|
|
||||
function sessionValidator(){ |
|
||||
Ext.Ajax.request({ |
|
||||
url: '/lib/controller/validateUserSession.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") { |
|
||||
winW2 = window.innerWidth; |
|
||||
winH2 = window.innerHeight; |
|
||||
if ( winH2<700 ) winH2=700; |
|
||||
}; |
|
||||
if (navigator.appName.indexOf("Microsoft")!=-1) { |
|
||||
winW2 = document.body.offsetWidth; |
|
||||
winH2 = document.body.offsetHeight; |
|
||||
if ( winH2<700 ) winH2=700; |
|
||||
}; |
|
||||
}; |
|
||||
if ( winW2 != winW || winH2!=winH ){ |
|
||||
updateUserScreenResolution( winW2, winH2 ); |
|
||||
}; |
|
||||
}; |
|
||||
|
|
||||
|
|
||||
|
|
||||
var NotificationStack = null; |
|
||||
|
|
||||
function tryKeepScreenAlive(minutes) { |
|
||||
navigator.wakeLock.request("screen").then(lock => { |
|
||||
setTimeout(() => lock.release(), minutes * 60 * 1000); |
|
||||
}); |
|
||||
} |
|
||||
|
|
||||
function showContent( cid ){ |
|
||||
if( cid != initView ) setUserContent( cid ); |
|
||||
var lvl0 = Math.floor( initView / 1000 ); |
|
||||
var lvl1 = Math.floor( ( initView % 1000 )/ 100 ); |
|
||||
var lvl2 = Math.floor( ( initView % 100 )/ 10 ); |
|
||||
var lvl3 = initView % 10; |
|
||||
if( lvl3 != content_lvl3 ){ content_lvl3 = lvl3; }; |
|
||||
if( lvl2 != content_lvl2 ){ content_lvl2 = lvl2; }; |
|
||||
if( lvl1 != content_lvl1 ){ content_lvl1 = lvl1; }; |
|
||||
|
|
||||
if( lvl0 != content_lvl0 ){ |
|
||||
content_lvl0 = lvl0; |
|
||||
switch( lvl0 ){ |
|
||||
case 0:{ |
|
||||
var tt = Ext.getCmp('tbtn_0'); |
|
||||
tt.toggle( true, false ); |
|
||||
var tP = Ext.getCmp('left_side_menu'); |
|
||||
if( tP.isVisible() ) tP.setVisible( false ); |
|
||||
initMonitoring(); |
|
||||
Ext.getCmp('main_viewport').doLayout(); |
|
||||
break; |
|
||||
}; |
|
||||
case 1:{ |
|
||||
var tt = Ext.getCmp('tbtn_1'); |
|
||||
tt.toggle( true, false ); |
|
||||
var tP = Ext.getCmp('left_side_menu'); |
|
||||
tP.setVisible( true ); |
|
||||
Ext.getCmp('main_viewport').doLayout(); |
|
||||
break; |
|
||||
}; |
|
||||
case 2:{ |
|
||||
var tt = Ext.getCmp('tbtn_2'); |
|
||||
tt.toggle( true, false ); |
|
||||
var tP = Ext.getCmp('left_side_menu'); |
|
||||
if( !tP.isVisible() ) tP.setVisible( true ); |
|
||||
var tZ = Ext.getCmp('right_side_menu'); |
|
||||
if( tZ.isVisible() ) tZ.setVisible( false ); |
|
||||
initSettingsView(); |
|
||||
Ext.getCmp('main_viewport').doLayout(); |
|
||||
break; |
|
||||
}; |
|
||||
}; |
|
||||
}; |
|
||||
}; |
|
||||
|
|
||||
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}); |
|
||||
//window.onresize = doCheckWindowSize;
|
|
||||
Ext.QuickTips.init(); |
|
||||
|
|
||||
if( ssEnabled ){ |
|
||||
ssSetupTimer(); |
|
||||
$(window).focus(function() { |
|
||||
ssResetTimer(); |
|
||||
}); |
|
||||
$(window).blur(function() { |
|
||||
ssStopTimer(); |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
|
|
||||
var viewport = new Ext.Viewport({ |
|
||||
id: 'main_viewport', |
|
||||
layout:'border', |
|
||||
frame: false, |
|
||||
border: false, |
|
||||
items: [{ |
|
||||
xtype: 'panel', |
|
||||
region: 'north', |
|
||||
baseCls: 'x-plain', |
|
||||
height: 60, |
|
||||
//layout: 'fit',
|
|
||||
layout: 'hbox', |
|
||||
frame: false, |
|
||||
border: false, |
|
||||
items:[{ |
|
||||
xtype: 'panel', |
|
||||
width: '100%', |
|
||||
layout: 'table', |
|
||||
baseCls: 'x-plain', |
|
||||
layoutConfig: { |
|
||||
columns: 11 |
|
||||
}, |
|
||||
frame: false, |
|
||||
border: true, |
|
||||
margins: {top:10, right:10, bottom:10, left:10}, |
|
||||
items:[{ |
|
||||
xtype: 'panel', |
|
||||
baseCls: 'x-plain', |
|
||||
frame: false, |
|
||||
border: false, |
|
||||
margins: {top:5, right:20, bottom:0, left:20}, |
|
||||
html: '<img src="/style/assets/argus_logo_text.png" height="42px">' |
|
||||
},{ |
|
||||
xtype: 'spacer', |
|
||||
width: 10 |
|
||||
},{ |
|
||||
xtype: 'button', |
|
||||
text: '<?=$Labels->GetLabel('_MONITORING_');?>', |
|
||||
id: 'tbtn_0', |
|
||||
iconCls: 'mon', |
|
||||
scale: 'large', |
|
||||
enableToggle: true, |
|
||||
//pressed: (Math.floor(initView/100)==0),
|
|
||||
allowDepress: false, |
|
||||
toggleGroup: 'gopa_gopa', |
|
||||
toggleHandler: function( bt, state ){ |
|
||||
if( state ) showContent( 0 ); |
|
||||
} |
|
||||
},{ |
|
||||
xtype: 'spacer', |
|
||||
width: 10 |
|
||||
},{ |
|
||||
xtype: 'button', |
|
||||
text: '<?=$Labels->GetLabel('_REPO_HISTORY_');?>', |
|
||||
id: 'tbtn_1', |
|
||||
iconCls: 'rep', |
|
||||
scale: 'large', |
|
||||
enableToggle: true, |
|
||||
//pressed: (Math.floor(initView/100)==1),
|
|
||||
allowDepress: false, |
|
||||
toggleGroup: 'gopa_gopa', |
|
||||
toggleHandler: function( bt, state ){ |
|
||||
if( state ) { |
|
||||
content_lvl0 = 2000; |
|
||||
updateUserContent(); |
|
||||
}; |
|
||||
} |
|
||||
},{ |
|
||||
xtype: 'spacer', |
|
||||
width: 10 |
|
||||
},{ |
|
||||
xtype: 'button', |
|
||||
text: '<?=$Labels->GetLabel('_SETTINGS_');?>', |
|
||||
id: 'tbtn_2', |
|
||||
iconCls: 'cog', |
|
||||
scale: 'large', |
|
||||
enableToggle: true, |
|
||||
allowDepress: false, |
|
||||
toggleGroup: 'gopa_gopa', |
|
||||
toggleHandler: function( bt, state ){ |
|
||||
if( state ) showContent( 2000 ); |
|
||||
} |
|
||||
},{ |
|
||||
xtype: 'spacer', |
|
||||
width: 10 |
|
||||
},{ |
|
||||
xtype: 'panel', |
|
||||
baseCls: 'x-plain', |
|
||||
frame: false, |
|
||||
border: false, |
|
||||
margins: {top:5, right:0, bottom:0, left:0}, |
|
||||
width: PanelW-700, |
|
||||
html: '<p style="font-family: \'Ubuntu\';font-size: 24px;">'+ap_title+'</p>' |
|
||||
},{ |
|
||||
xtype: 'spacer', |
|
||||
width: 10 |
|
||||
},<?php |
|
||||
if( $AP_DATA['type'] == 1 ){ |
|
||||
?>{ |
|
||||
xtype: 'button', |
|
||||
id: 'logout_btn', |
|
||||
text: 'Logout', |
|
||||
iconCls: 'lout', |
|
||||
scale: 'large', |
|
||||
style:'text-align: right;', |
|
||||
handler: doLogout |
|
||||
}<?php |
|
||||
} else { |
|
||||
?>{ |
|
||||
xtype: 'button', |
|
||||
id: 'snd_mode_btn', |
|
||||
text: 'Sound', |
|
||||
iconCls: 'snd'+SoundMode, |
|
||||
scale: 'large', |
|
||||
style:'text-align: right;', |
|
||||
handler: function(){ |
|
||||
if( SoundMode == 0 ){ |
|
||||
SoundMode = 3; |
|
||||
} else { |
|
||||
SoundMode --; |
|
||||
}; |
|
||||
Ext.getCmp('snd_mode_btn').setIconClass( 'snd'+SoundMode ); |
|
||||
} |
|
||||
}<?php |
|
||||
}; |
|
||||
?> |
|
||||
] |
|
||||
}] |
|
||||
},{ |
|
||||
xtype: 'panel', |
|
||||
id:'left_side_menu', |
|
||||
region:'west', |
|
||||
bsaseCls:'x-plain', |
|
||||
//title: '<?=$Labels->GetLabel('_SEC_SYSTEM_');?>',
|
|
||||
collapsible: true, |
|
||||
split:true, |
|
||||
width:180, |
|
||||
minWidth: 180, |
|
||||
maxWidth: 180, |
|
||||
hidden: (Math.floor(initView/100)==0), |
|
||||
layout:'accordion', |
|
||||
margins: '5 0 5 5', |
|
||||
cmargins:'5 5 5 5', |
|
||||
layoutConfig:{ |
|
||||
animate: true//,
|
|
||||
//activeOnTop: true
|
|
||||
}, |
|
||||
items: [] |
|
||||
},{ |
|
||||
xtype: 'panel', |
|
||||
region:'center', |
|
||||
margins: '5 5 5 0', |
|
||||
id: 'main_content', |
|
||||
//title: '<?=$Labels->GetLabel('_SYS_DASHBOARD_');?>',
|
|
||||
items:[{ |
|
||||
xtype: 'portal', |
|
||||
id: 'main_portal', |
|
||||
frame: false, |
|
||||
border: false, |
|
||||
items:{ |
|
||||
html: '' |
|
||||
}//,
|
|
||||
//listeners:{
|
|
||||
// drop: function( a ){
|
|
||||
// updateDashBoardItemLayout( a.panel.id, a.columnIndex, a.position );
|
|
||||
// }
|
|
||||
//}
|
|
||||
}] |
|
||||
},{ |
|
||||
xtype: 'panel', |
|
||||
region:'east', |
|
||||
id:'right_side_menu', |
|
||||
//title: '',
|
|
||||
margins: '5 5 5 0', |
|
||||
//id: 'help_content',
|
|
||||
frame: false, |
|
||||
border: false, |
|
||||
collapsible: false, |
|
||||
split:true, |
|
||||
width:200, |
|
||||
minWidth: 150, |
|
||||
maxWidth: 200, |
|
||||
items:[] |
|
||||
}] |
|
||||
}); |
|
||||
showContent( initView ); |
|
||||
}); |
|
||||
@ -1,575 +0,0 @@ |
|||||
//<?php require_once('../../js_asm.php'); ?>
|
|
||||
|
|
||||
var addMediaServerDialog = null; |
|
||||
function addMediaServer(){ |
|
||||
if( addMediaServerDialog == null ){ |
|
||||
addMediaServerDialog = new Ext.Window({ |
|
||||
modal: true, |
|
||||
title: '<?=$Labels->GetLabel("_ADD_MEDIA_SERVER_");?>', |
|
||||
width: 800, |
|
||||
height: 600, |
|
||||
layout: 'fit', |
|
||||
closeAction: 'hide', |
|
||||
items:{ |
|
||||
xtype: 'panel', |
|
||||
html: 'KOKO' |
|
||||
},bbar: [{ |
|
||||
text: '<?=$Labels->GetLabel("_CANCEL_");?>', |
|
||||
handler: function(){ |
|
||||
addMediaServerDialog.hide(); |
|
||||
} |
|
||||
},{ |
|
||||
id: 'con_to_src', |
|
||||
text: '<?=$Labels->GetLabel("_ADD_");?>', |
|
||||
disabled: false, |
|
||||
handler: connectToSeleced |
|
||||
}] |
|
||||
}); |
|
||||
}; |
|
||||
addMediaServerDialog.show(); |
|
||||
}; |
|
||||
|
|
||||
var embedVideoEncoderId = 0; |
|
||||
|
|
||||
function updateFramePreview(){ |
|
||||
var canvas = document.getElementById("eve_frame_preview"); |
|
||||
if( canvas != null ){ |
|
||||
var ctx = canvas.getContext("2d"); |
|
||||
|
|
||||
ctx.beginPath(); |
|
||||
ctx.fillStyle = "#eeeeee"; |
|
||||
ctx.rect( 0, 0, 760, 400 ); |
|
||||
ctx.fill(); |
|
||||
ctx.closePath(); |
|
||||
var f_w = 320; |
|
||||
var f_h = 240; |
|
||||
var f_p = 0; |
|
||||
var fsid = Ext.getCmp('FRM_SIZE').getValue(); |
|
||||
switch( fsid ){ |
|
||||
case 1: f_w = 640; f_h = 480; f_p = 0; break; |
|
||||
case 2: f_w = 800; f_h = 600; f_p = 0; break; |
|
||||
case 3: f_w = 1280; f_h = 720; f_p = 1; break; |
|
||||
case 4: f_w = 1024; f_h = 768; f_p = 0; break; |
|
||||
case 5: f_w = 1920; f_h = 1080; f_p = 1; break; |
|
||||
}; |
|
||||
ctx.beginPath(); |
|
||||
ctx.fillStyle = "#000000"; |
|
||||
ctx.font = "20px Arial"; |
|
||||
ctx.textAlign = "center"; |
|
||||
ctx.textBaseline = "middle"; |
|
||||
ctx.fillText( f_w+'x'+f_h, 380, 10 ); |
|
||||
ctx.fill(); |
|
||||
ctx.fillStyle = "#0000FF"; |
|
||||
if( f_p ){ |
|
||||
var t_w = 16 * ( 360 / 9 ); |
|
||||
ctx.rect( (760-t_w)/2, 20, t_w, 360 ); |
|
||||
} else { |
|
||||
var t_w = 4 * ( 360 / 3 ); |
|
||||
ctx.rect( (760-t_w)/2, 20, t_w, 360 ); |
|
||||
}; |
|
||||
ctx.fill(); |
|
||||
ctx.closePath(); |
|
||||
if( Ext.getCmp('eve_show_logo').getValue() ){ |
|
||||
var image = document.getElementById('eve_logo_img'); |
|
||||
if( image.complete && image.naturalHeight !== 0 ){ |
|
||||
var i_w = Ext.getCmp('LOGO_WIDTH').getValue(); |
|
||||
var i_h = Ext.getCmp('LOGO_HEIGHT').getValue(); |
|
||||
ctx.drawImage( image, 120, 120, i_w, i_h ); |
|
||||
}; |
|
||||
}; |
|
||||
|
|
||||
}; |
|
||||
}; |
|
||||
|
|
||||
async function uploadFile() { |
|
||||
let formData = new FormData(); |
|
||||
formData.append("file", fileupload.files[0]); |
|
||||
await fetch( '/upload.php', { |
|
||||
method: "POST", |
|
||||
body: formData |
|
||||
}); |
|
||||
alert('The file has been uploaded successfully.'); |
|
||||
} |
|
||||
|
|
||||
function uploadEveLogo(){ |
|
||||
if( embedVideoEncoderId > -1 ){ |
|
||||
var llMask = new Ext.LoadMask( Ext.getCmp('eve_logo_ph').getEl(), {msg:"Please wait..."}); |
|
||||
llMask.show(); |
|
||||
var formData = new FormData(); |
|
||||
var img_upload = document.getElementById('eve_logo_upload'); |
|
||||
formData.append("file", img_upload.files[0]); |
|
||||
formData.append("type", 'eve_logo'); |
|
||||
formData.append("id", embedVideoEncoderId ); |
|
||||
$.ajax({ |
|
||||
type: 'POST', |
|
||||
url: '/lib/controller/uploadAsset.php', |
|
||||
data: formData, |
|
||||
cache: false, |
|
||||
contentType: false, |
|
||||
processData: false, |
|
||||
success: function( data ){ |
|
||||
llMask.hide(); |
|
||||
console.log("success"); |
|
||||
console.log( data ); |
|
||||
}, |
|
||||
error: function( data ){ |
|
||||
llMask.hide(); |
|
||||
console.log("error"); |
|
||||
console.log(data); |
|
||||
} |
|
||||
}); |
|
||||
/* |
|
||||
Ext.Ajax.request({ |
|
||||
url: SITE_URL+'upload/', |
|
||||
headers: {'Content-type':'multipart/form-data'}, |
|
||||
form: filefield.up('form').getForm(), |
|
||||
isUpload: true, |
|
||||
success: function(response, options) { console.log(arguments); }, |
|
||||
failure: function(response, options) { console.log(arguments); } |
|
||||
}); |
|
||||
*/ |
|
||||
|
|
||||
}; |
|
||||
}; |
|
||||
|
|
||||
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({ |
|
||||
modal: true, |
|
||||
title: '<?=$Labels->GetLabel('_EMBED_VIDEO_ENCODER_');?>', |
|
||||
width: 792, |
|
||||
height: 700, |
|
||||
layout: 'fit', |
|
||||
closeAction: 'hide', |
|
||||
resizable: false, |
|
||||
items:[{ |
|
||||
layout: 'table', |
|
||||
border: false, |
|
||||
frame: false, |
|
||||
autoScroll: true, |
|
||||
defaults: { |
|
||||
bodyStyle:'padding: 0px', |
|
||||
border: false, |
|
||||
}, |
|
||||
layoutConfig: { |
|
||||
columns: 4 |
|
||||
}, |
|
||||
items:[{ |
|
||||
id: 'eve_frm_prev', |
|
||||
html: '<canvas id="eve_frame_preview" width="760" height="400" style="background: #eeeeee; display: block; margin: 0 auto;"></canvas>', |
|
||||
height: 400, |
|
||||
width: 760, |
|
||||
border: true, |
|
||||
colspan: 4 |
|
||||
},{ |
|
||||
html: '<p><?=$Labels->GetLabel('_OUTPUT_FRAME_SIZE_');?>:</p>' |
|
||||
},{ |
|
||||
xtype: 'combo', |
|
||||
id: 'FRM_SIZE', |
|
||||
width: 120, |
|
||||
typeAhead: true, |
|
||||
triggerAction: 'all', |
|
||||
lazyRender:true, |
|
||||
mode: 'local', |
|
||||
store: new Ext.data.ArrayStore({ |
|
||||
id: 0, |
|
||||
fields: [ 'szId', 'szText' ], |
|
||||
data: [ |
|
||||
[0, '320x240'], |
|
||||
[1, '640x480'], |
|
||||
[2, '800x600'], |
|
||||
[3, '1280x720'], |
|
||||
[4, '1024x768'], |
|
||||
[5, '1920x1080'] |
|
||||
] |
|
||||
}), |
|
||||
valueField: 'szId', |
|
||||
displayField: 'szText', |
|
||||
value: 0, |
|
||||
listeners:{ |
|
||||
beforeselect: updateFramePreview, |
|
||||
//blur: updateFramePreview,
|
|
||||
change: updateFramePreview |
|
||||
} |
|
||||
},{ |
|
||||
html: '<p><?=$Labels->GetLabel('_EVE_COMPRESS_QUA_');?>:</p>' |
|
||||
},{ |
|
||||
xtype: 'slider', |
|
||||
id: 'COMP_QUAL', |
|
||||
width: 120, |
|
||||
minValue: 0, |
|
||||
maxValue: 100, |
|
||||
value: 70 |
|
||||
},{ |
|
||||
html: '<p><?=$Labels->GetLabel('_EVE_SHOW_TS_');?>:</p>' |
|
||||
},{ |
|
||||
xtype: 'checkbox', |
|
||||
id: 'eve_show_ts', |
|
||||
value: 0, |
|
||||
handler: updateFramePreview |
|
||||
},{ |
|
||||
html: '<p><?=$Labels->GetLabel('_EVE_TS_POSX_');?>:</p>' |
|
||||
},{ |
|
||||
xtype: 'slider', |
|
||||
id: 'TS_POSX', |
|
||||
width: 120, |
|
||||
minValue: 0, |
|
||||
maxValue: 100, |
|
||||
value: 1.0 |
|
||||
},{ |
|
||||
html: '<p><?=$Labels->GetLabel('_EVE_TS_POSY_');?>:</p>' |
|
||||
},{ |
|
||||
xtype: 'slider', |
|
||||
id: 'TS_POSY', |
|
||||
width: 120, |
|
||||
minValue: 0, |
|
||||
maxValue: 100, |
|
||||
value: 1.0 |
|
||||
},{ |
|
||||
html: '<p><?=$Labels->GetLabel('_EVE_TRANSO_TS_');?>:</p>' |
|
||||
},{ |
|
||||
xtype: 'checkbox', |
|
||||
id: 'eve_transp_ts', |
|
||||
value: 0 |
|
||||
},{ |
|
||||
html: '<p><?=$Labels->GetLabel('_EVE_FONT_TS_');?>:</p>' |
|
||||
},{ |
|
||||
xtype: 'combo', |
|
||||
id: 'TS_FONT', |
|
||||
width: 120, |
|
||||
typeAhead: true, |
|
||||
triggerAction: 'all', |
|
||||
lazyRender:true, |
|
||||
mode: 'local', |
|
||||
store: new Ext.data.ArrayStore({ |
|
||||
id: 0, |
|
||||
fields: [ 'szId', 'szText' ], |
|
||||
data: [ |
|
||||
[0, 'SIMPLEX'], |
|
||||
[1, 'PLAIN'], |
|
||||
[2, 'DUPLEX'], |
|
||||
[3, 'COMPLEX'], |
|
||||
[4, 'TRIPLEX'], |
|
||||
[5, 'COMPLEX_SMALL'], |
|
||||
[6, 'SCRIPT_SIMPLEX'], |
|
||||
[7, 'SCRIPT_COMPLEX'] |
|
||||
] |
|
||||
}), |
|
||||
valueField: 'szId', |
|
||||
displayField: 'szText', |
|
||||
value: 0 |
|
||||
},{ |
|
||||
html: '<p><?=$Labels->GetLabel('_EVE_TS_FSCALE_');?>:</p>' |
|
||||
},{ |
|
||||
xtype: 'slider', |
|
||||
id: 'TS_FSCALE', |
|
||||
width: 120, |
|
||||
minValue: 0.0, |
|
||||
maxValue: 4.0, |
|
||||
value: 1.0 |
|
||||
},{ |
|
||||
html: '<p><?=$Labels->GetLabel('_EVE_TS_FTHICK_');?>:</p>' |
|
||||
},{ |
|
||||
xtype: 'slider', |
|
||||
id: 'TS_FTHICK', |
|
||||
width: 120, |
|
||||
minValue: 1, |
|
||||
maxValue: 8.0, |
|
||||
value: 1.0 |
|
||||
},{ |
|
||||
html: '<p><?=$Labels->GetLabel('_EVE_TS_LINE_T_');?>:</p>' |
|
||||
},{ |
|
||||
xtype: 'combo', |
|
||||
id: 'TS_LINET', |
|
||||
width: 120, |
|
||||
typeAhead: true, |
|
||||
triggerAction: 'all', |
|
||||
lazyRender:true, |
|
||||
mode: 'local', |
|
||||
store: new Ext.data.ArrayStore({ |
|
||||
id: 0, |
|
||||
fields: [ 'szId', 'szText' ], |
|
||||
data: [ |
|
||||
[0, 'THIN'], |
|
||||
[1, 'ANTIALIAZED'], |
|
||||
[2, 'THICK'] |
|
||||
] |
|
||||
}), |
|
||||
valueField: 'szId', |
|
||||
displayField: 'szText', |
|
||||
value: 0 |
|
||||
},{ |
|
||||
html: '<p><?=$Labels->GetLabel('_EVE_SHOW_LBL_');?>:</p>' |
|
||||
},{ |
|
||||
xtype: 'checkbox', |
|
||||
id: 'eve_show_lbl', |
|
||||
value: 0, |
|
||||
handler: updateFramePreview |
|
||||
},{ |
|
||||
html: '<p><?=$Labels->GetLabel('_EVE_LBL_POSX_');?>:</p>' |
|
||||
},{ |
|
||||
xtype: 'slider', |
|
||||
id: 'LBL_POSX', |
|
||||
width: 120, |
|
||||
minValue: 0, |
|
||||
maxValue: 100, |
|
||||
value: 1.0 |
|
||||
},{ |
|
||||
html: '<p><?=$Labels->GetLabel('_EVE_LBL_POSY_');?>:</p>' |
|
||||
},{ |
|
||||
xtype: 'slider', |
|
||||
id: 'LBL_POSY', |
|
||||
width: 120, |
|
||||
minValue: 0, |
|
||||
maxValue: 100, |
|
||||
value: 1.0 |
|
||||
},{ |
|
||||
html: '<p><?=$Labels->GetLabel('_EVE_TRANSO_LBL_');?>:</p>' |
|
||||
},{ |
|
||||
xtype: 'checkbox', |
|
||||
id: 'eve_transp_lbl', |
|
||||
value: 0 |
|
||||
},{ |
|
||||
html: '<p><?=$Labels->GetLabel('_EVE_FONT_LBL_');?>:</p>' |
|
||||
},{ |
|
||||
xtype: 'combo', |
|
||||
id: 'LBL_FONT', |
|
||||
width: 120, |
|
||||
typeAhead: true, |
|
||||
triggerAction: 'all', |
|
||||
lazyRender:true, |
|
||||
mode: 'local', |
|
||||
store: new Ext.data.ArrayStore({ |
|
||||
id: 0, |
|
||||
fields: [ 'szId', 'szText' ], |
|
||||
data: [ |
|
||||
[0, 'SIMPLEX'], |
|
||||
[1, 'PLAIN'], |
|
||||
[2, 'DUPLEX'], |
|
||||
[3, 'COMPLEX'], |
|
||||
[4, 'TRIPLEX'], |
|
||||
[5, 'COMPLEX_SMALL'], |
|
||||
[6, 'SCRIPT_SIMPLEX'], |
|
||||
[7, 'SCRIPT_COMPLEX'] |
|
||||
] |
|
||||
}), |
|
||||
valueField: 'szId', |
|
||||
displayField: 'szText', |
|
||||
value: 0 |
|
||||
},{ |
|
||||
html: '<p><?=$Labels->GetLabel('_EVE_LBL_FSCALE_');?>:</p>' |
|
||||
},{ |
|
||||
xtype: 'slider', |
|
||||
id: 'LBL_FSCALE', |
|
||||
width: 120, |
|
||||
minValue: 0.0, |
|
||||
maxValue: 4.0, |
|
||||
value: 1.0 |
|
||||
},{ |
|
||||
html: '<p><?=$Labels->GetLabel('_EVE_LBL_FTHICK_');?>:</p>' |
|
||||
},{ |
|
||||
xtype: 'slider', |
|
||||
id: 'LBL_FTHICK', |
|
||||
width: 120, |
|
||||
minValue: 1, |
|
||||
maxValue: 8.0, |
|
||||
value: 1.0 |
|
||||
},{ |
|
||||
html: '<p><?=$Labels->GetLabel('_EVE_LBL_LINE_T_');?>:</p>' |
|
||||
},{ |
|
||||
xtype: 'combo', |
|
||||
id: 'LBL_LINET', |
|
||||
width: 120, |
|
||||
typeAhead: true, |
|
||||
triggerAction: 'all', |
|
||||
lazyRender:true, |
|
||||
mode: 'local', |
|
||||
store: new Ext.data.ArrayStore({ |
|
||||
id: 0, |
|
||||
fields: [ 'szId', 'szText' ], |
|
||||
data: [ |
|
||||
[0, 'THIN'], |
|
||||
[1, 'ANTIALIAZED'], |
|
||||
[2, 'THICK'] |
|
||||
] |
|
||||
}), |
|
||||
valueField: 'szId', |
|
||||
displayField: 'szText', |
|
||||
value: 0 |
|
||||
},{ |
|
||||
html: '<p><?=$Labels->GetLabel('_EVE_SHOW_LOGO_');?>:</p>' |
|
||||
},{ |
|
||||
xtype: 'checkbox', |
|
||||
id: 'eve_show_logo', |
|
||||
value: 0, |
|
||||
handler: updateFramePreview |
|
||||
},{ |
|
||||
html: '<p><?=$Labels->GetLabel('_EVE_LOGO_POSX_');?>:</p>' |
|
||||
},{ |
|
||||
xtype: 'slider', |
|
||||
id: 'LOGO_POSX', |
|
||||
width: 120, |
|
||||
minValue: 0, |
|
||||
maxValue: 100, |
|
||||
value: 1.0 |
|
||||
},{ |
|
||||
html: '<p><?=$Labels->GetLabel('_EVE_LOGO_POSY_');?>:</p>' |
|
||||
},{ |
|
||||
xtype: 'slider', |
|
||||
id: 'LOGO_POSY', |
|
||||
width: 120, |
|
||||
minValue: 0, |
|
||||
maxValue: 100, |
|
||||
value: 1.0 |
|
||||
},{ |
|
||||
html: '<p><?=$Labels->GetLabel('_EVE_LOGO_WIDTH_');?>:</p>' |
|
||||
},{ |
|
||||
xtype: 'numberfield', |
|
||||
id: 'LOGO_WIDTH', |
|
||||
width: 120, |
|
||||
minValue: 0, |
|
||||
maxValue: 256, |
|
||||
value: 1.0 |
|
||||
},{ |
|
||||
html: '<p><?=$Labels->GetLabel('_EVE_LOGO_HEIGHT_');?>:</p>' |
|
||||
},{ |
|
||||
xtype: 'numberfield', |
|
||||
id: 'LOGO_HEIGHT', |
|
||||
width: 120, |
|
||||
minValue: 0, |
|
||||
maxValue: 256, |
|
||||
value: 1.0 |
|
||||
},{ |
|
||||
id: 'eve_logo_ph', |
|
||||
html: '<center><img width="100px" id="eve_logo_img" src="/lib/controller/data/assets/images/7shields.png"></center>' |
|
||||
},{ |
|
||||
html: '<input id="eve_logo_upload" style="width: 120px;" type="file" onchange="uploadEveLogo();"/>' |
|
||||
},{ |
|
||||
html: '<p><?=$Labels->GetLabel('_EVE_PORT_');?>:</p>' |
|
||||
},{ |
|
||||
xtype: 'numberfield', |
|
||||
id: 'WA_PORT', |
|
||||
width: 120, |
|
||||
minValue: 1000, |
|
||||
maxValue: 65535, |
|
||||
value: 8080 |
|
||||
}] |
|
||||
}], |
|
||||
bbar: [{ |
|
||||
text: '<?=$Labels->GetLabel("_CANCEL_");?>', |
|
||||
handler: function(){ |
|
||||
embedVideoEncoderSettingsWindow.hide(); |
|
||||
} |
|
||||
},{ |
|
||||
id: 'con_to_src', |
|
||||
text: '<?=$Labels->GetLabel("_OK_");?>', |
|
||||
disabled: false, |
|
||||
handler: function(){ |
|
||||
|
|
||||
} |
|
||||
}] |
|
||||
}); |
|
||||
}; |
|
||||
embedVideoEncoderSettingsWindow.show(); |
|
||||
updateFramePreview(); |
|
||||
/* |
|
||||
Ext.Ajax.request({ |
|
||||
url: '/lib/controller/getModuleSettings.php', |
|
||||
params: { |
|
||||
MID: ModuleID, |
|
||||
UID: <?=$UserID;?>, |
|
||||
SID: '<?=$Session;?>', |
|
||||
}, |
|
||||
success: function( response, opts ){ |
|
||||
var data = Ext.decode( response.responseText ); |
|
||||
if( data.error = false ){ |
|
||||
embedVideoEncoderSettingsWindow.show(); |
|
||||
Ext.getCmp('setting_master_ip').setValue( data.ip_address ); |
|
||||
Ext.getCmp('setting_master_port').setValue( data.port ); |
|
||||
Ext.getCmp('setting_slave_ip').setValue( data.aux_ip_address ); |
|
||||
Ext.getCmp('setting_slave_port').setValue( data.aux_port ); |
|
||||
Ext.getCmp('setting_lat').setValue( data.lat ); |
|
||||
Ext.getCmp('setting_lon').setValue( data.lon ); |
|
||||
Ext.getCmp('setting_alt').setValue( data.alt ); |
|
||||
Ext.getCmp('setting_roll').setValue( data.roll ); |
|
||||
Ext.getCmp('setting_pitch').setValue( data.pitch ); |
|
||||
Ext.getCmp('setting_yaw').setValue( data.yaw ); |
|
||||
} else { |
|
||||
Ext.Msg.show({ |
|
||||
title:'<?=$Labels->GetLabel("_ERROR_MSG_");?>', |
|
||||
msg: data.error_message, |
|
||||
buttons: Ext.Msg.OK, |
|
||||
fn: function(){ |
|
||||
//SettingsLidar3D.hide();
|
|
||||
}, |
|
||||
icon: Ext.MessageBox.ERROR |
|
||||
}); |
|
||||
}; |
|
||||
}, |
|
||||
failure: failureAJAXFunction |
|
||||
}); |
|
||||
* / |
|
||||
};*/ |
|
||||
1237
lib/javascript/jsapi_dynamic/rgoose_reports.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -1,111 +0,0 @@ |
|||||
//<?php require_once('../../js_asm.php'); ?>
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
function loadSingleIPI(){ |
|
||||
if( tlInterval!= null ){ |
|
||||
window.clearInterval( tlInterval ); |
|
||||
tlInterval = null; |
|
||||
timelineObj = null; |
|
||||
}; |
|
||||
setUserContent( 11 ); |
|
||||
var tPanel = Ext.getCmp('main_portal'); |
|
||||
tPanel.removeAll( true ); |
|
||||
Ext.getCmp('main_content').setTitle( 'Single IPI Monitoring' ); |
|
||||
tPanel.add({ |
|
||||
columnWidth: 1,//0.83
|
|
||||
frame: false, |
|
||||
border: false, |
|
||||
items: [{ |
|
||||
title: '<?=$Labels->getLabel('_VIDEO_MONITORING_');?>', |
|
||||
<?php |
|
||||
$QS = "SELECT * FROM `nodes` WHERE `type` IN (10,11,12,13)"; |
|
||||
$RetVal = $DATABASE->Query( $QS ); |
|
||||
?> |
|
||||
frame: false, |
|
||||
border: false, |
|
||||
collapsible: false, |
|
||||
draggable: false, |
|
||||
layout: 'vbox', |
|
||||
layoutConfig: { |
|
||||
align : 'stretch', |
|
||||
pack : 'start', |
|
||||
}, |
|
||||
height: PanelH-300, |
|
||||
items:[{ |
|
||||
height: PanelH-325, |
|
||||
flex: 1, |
|
||||
frame: false, |
|
||||
border: false, |
|
||||
layout: 'fit', |
|
||||
items:{ |
|
||||
id: 'event_map', |
|
||||
html: |
|
||||
<?php |
|
||||
if( count( $RetVal ) == 1 ){ |
|
||||
$CN = $RetVal[0]; |
|
||||
$NODEID = intval( $CN['id'] ); |
|
||||
$CAMID = intval( $CN['aux_id'] ); |
|
||||
$STREAMID = intval( $CN['aux_parameter'] ); |
|
||||
$QS="SELECT * FROM `module_embed_video_settings` WHERE `id`=1"; |
|
||||
$S=$DATABASE->Query( $QS ); |
|
||||
$MODULE_DATA = $S[0]; |
|
||||
$FU = 'http://' . $_SERVER['SERVER_ADDR'].':' . $MODULE_DATA['web_port'] .'/stream?id='. $STREAMID; |
|
||||
echo "'<img onmouseover=\"ptzCtrl(\'img-{$NODEID}\');\" ondblclick=\"fullScreen(\'img-{$NODEID}\');\" style=\"cursor: zoom-in\" id=\"img-{$NODEID}\" src=\"{$FU}\" widtsh=\"%%%WIDTH%%%\" height=\"100%\"/>'"; |
|
||||
} else if( count( $RetVal ) ){ |
|
||||
echo "' Too Many Cameras are Defined For this Site'"; |
|
||||
} else { |
|
||||
echo "' No Cameras Defined On the Site!'"; |
|
||||
}; |
|
||||
?> |
|
||||
} |
|
||||
}] |
|
||||
},{ |
|
||||
frame: false, |
|
||||
border: true, |
|
||||
collapsible: false, |
|
||||
draggable: false, |
|
||||
layout: 'hbox', |
|
||||
items:[{ |
|
||||
title: 'Event Log', |
|
||||
height: 303, |
|
||||
xtype: 'grid', |
|
||||
border: false, |
|
||||
frame: false, |
|
||||
collapsible: false, |
|
||||
draggable: false, |
|
||||
ds: eventsListStore, |
|
||||
cm: new Ext.grid.ColumnModel( eventsListColModel_ops ), |
|
||||
sm: new Ext.grid.RowSelectionModel( eventsListSelModel_ops ), |
|
||||
bbar: [{ |
|
||||
text: 'Clear', |
|
||||
handler: function(){ |
|
||||
Ext.Ajax.request({ |
|
||||
url: '/lib/controller/clearEventCloud.php', |
|
||||
params: { |
|
||||
UID: <?=$UserID;?>, |
|
||||
SID: '<?=$Session;?>' |
|
||||
}, |
|
||||
success: function( response, opts ){ |
|
||||
}, |
|
||||
failure: function( response, opts ) { |
|
||||
} |
|
||||
}); |
|
||||
} |
|
||||
}] |
|
||||
}] |
|
||||
}] |
|
||||
}); |
|
||||
//tPanel.add({
|
|
||||
// columnWidth: 0.17,
|
|
||||
// title: 'Event Information',
|
|
||||
// frame: true,
|
|
||||
// id: 'prop_content',
|
|
||||
// border: false,
|
|
||||
// items: [{
|
|
||||
// html:'<div class="setEd_infoPanel" id="NUNU"><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>'
|
|
||||
// }]
|
|
||||
//});
|
|
||||
tPanel.doLayout(); |
|
||||
}; |
|
||||
@ -1,569 +0,0 @@ |
|||||
//<?php require_once('../../js_asm.php'); ?>
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
var muploader = null; |
|
||||
|
|
||||
var uploads_store_id = 0; |
|
||||
var uploads_store = new Ext.data.ArrayStore({ |
|
||||
autoDestroy: false, |
|
||||
storeId: 'up_store', |
|
||||
idIndex: 0, |
|
||||
fields: [ |
|
||||
{name: 'id', type: 'int' }, |
|
||||
{name: 'file_name', type: 'string'}, |
|
||||
{name: 'file_id', type: 'string'}, |
|
||||
{name: 'size', type: 'string'}, |
|
||||
{name: 'progress', type: 'int'}, |
|
||||
{name: 'status', type: 'string' } |
|
||||
] |
|
||||
}); |
|
||||
|
|
||||
var uploaded_store_id = 0; |
|
||||
var uploaded_store = new Ext.data.ArrayStore({ |
|
||||
autoDestroy: false, |
|
||||
storeId: 'mod_store', |
|
||||
idIndex: 0, |
|
||||
fields: [ |
|
||||
{name: 'id', type: 'int' }, |
|
||||
{name: 'file_name', type: 'string'}, |
|
||||
{name: 'size', type: 'int'}, |
|
||||
{name: 'status', type: 'int'}, |
|
||||
{name: 'ts', type: 'string' }, |
|
||||
{name: 'memo', type: 'string' } |
|
||||
] |
|
||||
}); |
|
||||
|
|
||||
function progressRenderer( value, meta, record ){ |
|
||||
Ext.defer( function( id ){ |
|
||||
var p = new Ext.ProgressBar({ |
|
||||
id: 'progress_'+id, |
|
||||
renderTo: 'div_'+id, |
|
||||
animate: false, |
|
||||
width: '100%', |
|
||||
value: 0, |
|
||||
text: 'Upload Pending', |
|
||||
}); |
|
||||
}, 50, undefined, [ record.data.file_id ] ); |
|
||||
return '<div id="div_' + record.data.file_id + '"></div>'; |
|
||||
}; |
|
||||
|
|
||||
var fileUploadsColModel_ops = { |
|
||||
columns: [ |
|
||||
{header: "ID", width: 50, align: 'center', css: 'vertical-align: middle;', dataIndex: 'id' }, |
|
||||
{header: "File Name", width: 280, fixed: false, align: 'left', css: 'vertical-align: middle;', dataIndex: 'file_name' }, |
|
||||
{header: "Size", width: 80, align: 'left', css: 'vertical-align: middle;', dataIndex: 'size' }, |
|
||||
{header: "Progress", width: 150, renderer: progressRenderer, dataIndex: 'progress' }, |
|
||||
{header: " ", width: 50, dataIndex: 'status3' } |
|
||||
], |
|
||||
defaults: { |
|
||||
sortable: false, |
|
||||
fixed: true, |
|
||||
menuDisabled: true, |
|
||||
width: 100 |
|
||||
} |
|
||||
}; |
|
||||
|
|
||||
function loadModuleFiles( sensorID ){ |
|
||||
Ext.Ajax.request({ |
|
||||
url: '/lib/controller/getDeviceFiles.php', |
|
||||
params: { |
|
||||
UID: <?=$UserID;?>, |
|
||||
SID: '<?=$Session;?>', |
|
||||
DID: sensorID |
|
||||
}, |
|
||||
success: function( response, opts ){ |
|
||||
var data = Ext.decode( response.responseText ); |
|
||||
uploaded_store.removeAll(); |
|
||||
uploaded_store.loadData( data.files ); |
|
||||
}, |
|
||||
failure: failureAJAXFunction |
|
||||
}); |
|
||||
}; |
|
||||
function onModuleFileRenderer( value, meta, record ){ |
|
||||
if( value == 0 ){ |
|
||||
rv = '<img title="Ready to Upload" alt="Ready to Upload" src="/style/assets/bul_green.png">'; |
|
||||
} else { |
|
||||
if( value < 101 ){ |
|
||||
rv = '<img title="Uploading" alt="Uploading" src="/style/assets/bul_gray.png">'; |
|
||||
} else { |
|
||||
rv = '<img title="Already Uploaded" alt="Already Uploaded" src="/style/assets/bul_blue.png">'; |
|
||||
}; |
|
||||
}; |
|
||||
return rv; |
|
||||
}; |
|
||||
|
|
||||
var fileModuleColModel_ops = { |
|
||||
columns: [ |
|
||||
{header: "ID", width: 50, align: 'center', css: 'vertical-align: middle;', dataIndex: 'id' }, |
|
||||
{header: "File Name", width: 60, fixed: false, align: 'left', css: 'vertical-align: middle;', dataIndex: 'file_name' }, |
|
||||
{header: "Size", width: 80, renderer: plupload.formatSize, align: 'left', css: 'vertical-align: middle;', dataIndex: 'size' }, |
|
||||
{header: "Time", width: 150, align: 'left', css: 'vertical-align: middle;', dataIndex: 'ts' }, |
|
||||
{header: "Status", width: 50, renderer: onModuleFileRenderer, dataIndex: 'status' }, |
|
||||
{header: "Memo", dataIndex: 'memo' } |
|
||||
], |
|
||||
defaults: { |
|
||||
sortable: false, |
|
||||
fixed: true, |
|
||||
menuDisabled: true, |
|
||||
width: 100 |
|
||||
} |
|
||||
}; |
|
||||
|
|
||||
var fileUploadsSelModel_ops = { |
|
||||
singleSelect: true |
|
||||
}; |
|
||||
|
|
||||
|
|
||||
|
|
||||
function archiveTypeRenderer( value, meta, record ){ |
|
||||
var alt_txt = ''; |
|
||||
var img_src = ''; |
|
||||
if( record.data.bk_type == 3 ){ |
|
||||
alt_txt = 'Full System Snapeshot'; |
|
||||
img_src = '/style/icons/icons/rosette.png'; |
|
||||
} else { |
|
||||
alt_txt = 'Database Backup'; |
|
||||
img_src = '/style/icons/icons/database.png'; |
|
||||
}; |
|
||||
return '<div><img alt="'+alt_txt+'" src="'+img_src+'"></div>'; |
|
||||
}; |
|
||||
|
|
||||
var taskIsArmed = false; |
|
||||
|
|
||||
var archives_store = new Ext.data.JsonStore({ |
|
||||
root: 'backups', |
|
||||
totalProperty: 'totalCount', |
|
||||
idProperty: 'id', |
|
||||
//remoteSort: true,
|
|
||||
autoLoad: true, |
|
||||
//url: '/lib/php/setup_toolkit/list_vault.php',
|
|
||||
storeId: 'a_store', |
|
||||
fields: [{ |
|
||||
name: 'id', |
|
||||
type: 'int' |
|
||||
},{ |
|
||||
name: 'bk_type', |
|
||||
type: 'int' |
|
||||
},{ |
|
||||
name: 'file_name', |
|
||||
type: 'string' |
|
||||
},{ |
|
||||
name: 'base_version', |
|
||||
type: 'string' |
|
||||
},{ |
|
||||
name: 'ts', |
|
||||
type: 'string' |
|
||||
},{ |
|
||||
name: 'size', |
|
||||
type: 'string' |
|
||||
}], |
|
||||
proxy : new Ext.data.HttpProxy({ |
|
||||
method: 'POST', |
|
||||
prettyUrls: false, |
|
||||
url: '/lib/php/setup_toolkit/list_vault.php', |
|
||||
headers: { |
|
||||
UID: <?=$UserID;?>, |
|
||||
SID: '<?=$Session;?>' |
|
||||
} |
|
||||
}) |
|
||||
}); |
|
||||
|
|
||||
|
|
||||
var archivesColModel_ops = { |
|
||||
columns: [ |
|
||||
{header: "Type", width: 50, align: 'center', css: 'vertical-align: middle;', renderer: archiveTypeRenderer, dataIndex: 'bk_type' }, |
|
||||
{header: "Version", width: 150, align: 'center', css: 'vertical-align: middle;', dataIndex: 'base_version' }, |
|
||||
{header: "Name", width: 280, align: 'left', css: 'vertical-align: middle;', dataIndex: 'file_name' }, |
|
||||
{header: "Date", width: 120, align: 'left', css: 'vertical-align: middle;', dataIndex: 'ts' }, |
|
||||
{header: "Size", width: 80, align: 'left', css: 'vertical-align: middle;', dataIndex: 'size' } |
|
||||
], |
|
||||
defaults: { |
|
||||
sortable: false, |
|
||||
fixed: true, |
|
||||
menuDisabled: true, |
|
||||
width: 100 |
|
||||
} |
|
||||
}; |
|
||||
|
|
||||
var selectedArchiveRecord = null; |
|
||||
|
|
||||
var archivesSelModel_ops = { |
|
||||
singleSelect: true, |
|
||||
listeners: { |
|
||||
rowselect: function(sm, row, rec ) { |
|
||||
//loadEventProperties( rec.data );
|
|
||||
//SelectedEvent = rec.data.id;
|
|
||||
//alert( SelectedEvent );
|
|
||||
//var CB = Ext.getCmp('con_to_src');
|
|
||||
//CB.enable();
|
|
||||
selectedArchiveRecord = rec; |
|
||||
if( rec.data.bk_type!=3 ){ |
|
||||
|
|
||||
} else { |
|
||||
|
|
||||
}; |
|
||||
} |
|
||||
} |
|
||||
}; |
|
||||
|
|
||||
var initial_md5 = ''; |
|
||||
|
|
||||
function updateTaskStatus(){ |
|
||||
Ext.Ajax.request({ |
|
||||
url: '/lib/php/setup_toolkit/getTaskStatus.php', |
|
||||
params: { |
|
||||
UID: <?=$UserID;?>, |
|
||||
SID: '<?=$Session;?>', |
|
||||
IMD: initial_md5 |
|
||||
}, |
|
||||
success: function( response, opts ){ |
|
||||
var data = Ext.decode(response.responseText); |
|
||||
switch( data.status ){ |
|
||||
case 0:{ |
|
||||
Ext.getCmp('ch_ta_btn').disable(); |
|
||||
if( taskIsArmed ){ |
|
||||
taskIsArmed = false; |
|
||||
archives_store.reload(); |
|
||||
}; |
|
||||
break; |
|
||||
}; |
|
||||
case 1:{ |
|
||||
Ext.getCmp('ch_ta_btn').enable(); |
|
||||
taskIsArmed = true; |
|
||||
break; |
|
||||
}; |
|
||||
case 2:{ |
|
||||
Ext.getCmp('ch_ta_btn').disable(); |
|
||||
break; |
|
||||
}; |
|
||||
}; |
|
||||
Ext.getCmp('ctask_status').update( '<p>'+data.msg +': ' + data.status_desc+'</p>' ); |
|
||||
if( initial_md5 != data.log_md5 ){ |
|
||||
initial_md5 = data.log_md5; |
|
||||
Ext.getCmp('task_log').setRawValue( data.status_log ); |
|
||||
}; |
|
||||
}, |
|
||||
failure: failureAJAXFunction |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
function createNewTask( task_id, param = '' ){ |
|
||||
Ext.Ajax.request({ |
|
||||
url: '/lib/php/setup_toolkit/createNewTask.php', |
|
||||
params: { |
|
||||
UID: <?=$UserID;?>, |
|
||||
SID: '<?=$Session;?>', |
|
||||
TID: task_id, |
|
||||
PRM: param |
|
||||
}, |
|
||||
success: function( response, opts ){ |
|
||||
var data = Ext.decode(response.responseText); |
|
||||
if( data.status == 0 ){ |
|
||||
Ext.Msg.show({ |
|
||||
title:'Error', |
|
||||
msg: data.error, |
|
||||
buttons: Ext.Msg.OK, |
|
||||
icon: Ext.MessageBox.ERROR |
|
||||
}); |
|
||||
}; |
|
||||
}, |
|
||||
failure: failureAJAXFunction |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
function deleteNewTask(){ |
|
||||
Ext.Ajax.request({ |
|
||||
url: '/lib/php/setup_toolkit/cleanNewTask.php', |
|
||||
params: { |
|
||||
UID: <?=$UserID;?>, |
|
||||
SID: '<?=$Session;?>' |
|
||||
}, |
|
||||
success: function( response, opts ){ |
|
||||
var data = Ext.decode(response.responseText); |
|
||||
if( data.status == 0 ){ |
|
||||
Ext.Msg.show({ |
|
||||
title:'Error', |
|
||||
msg: data.error, |
|
||||
buttons: Ext.Msg.OK, |
|
||||
icon: Ext.MessageBox.ERROR |
|
||||
}); |
|
||||
}; |
|
||||
}, |
|
||||
failure: failureAJAXFunction |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
function loadUpgradeManagmenet(){ |
|
||||
if( tlInterval!= null ){ |
|
||||
window.clearInterval( tlInterval ); |
|
||||
tlInterval = null; |
|
||||
timelineObj = null; |
|
||||
}; |
|
||||
setUserContent( 5 ); |
|
||||
initial_md5 = ''; |
|
||||
Ext.getCmp('main_content').setTitle( '<?=$Labels->GetLabel('_SWU_DASHBOARD_');?>' ); |
|
||||
var tPanel = Ext.getCmp('main_portal'); |
|
||||
tPanel.removeAll(true); |
|
||||
tPanel.add({ |
|
||||
columnWidth: 1.0, |
|
||||
frame: false, |
|
||||
border: false, |
|
||||
items: [{ |
|
||||
frame: false, |
|
||||
border: false, |
|
||||
collapsible: false, |
|
||||
draggable: false, |
|
||||
layout: 'vbox', |
|
||||
//layoutConfig: {
|
|
||||
// align : 'stretch',
|
|
||||
// pack : 'start',
|
|
||||
//},
|
|
||||
height: PanelH, |
|
||||
items:[{ |
|
||||
title: '<?=$Labels->getLabel('_MAP_MONITORING_');?>', |
|
||||
xtype: 'panel', |
|
||||
height: PanelH-300, |
|
||||
//flex: 1,
|
|
||||
frame: true, |
|
||||
width: '100%', |
|
||||
border: false, |
|
||||
layout: { |
|
||||
type: 'table', |
|
||||
columns: 2, |
|
||||
tableAttrs: { |
|
||||
valign: 'top', |
|
||||
style: 'valign:top;width:100%;' |
|
||||
} |
|
||||
}, |
|
||||
defaults: { |
|
||||
frame: true, |
|
||||
border: false, |
|
||||
height: ( PanelH-400 ) / 2, |
|
||||
style: 'margin: 5px;width:400px;display:block;' |
|
||||
}, |
|
||||
items:[{ |
|
||||
title: 'Current System Info', |
|
||||
width: '100%', |
|
||||
//flex: 1,
|
|
||||
html: '<p>Current Web Version: <b><?=$ARGUS_WEB_VERSION;?></b></p>' |
|
||||
},{ |
|
||||
title: 'Tasks', |
|
||||
//width: 400,
|
|
||||
layout: 'vbox', |
|
||||
items:[{ |
|
||||
xtype: 'button', |
|
||||
width: '100%', |
|
||||
text: 'Create Database Backup', |
|
||||
handler: function(){ |
|
||||
createNewTask( 2 ); |
|
||||
} |
|
||||
},{ |
|
||||
xtype: 'button', |
|
||||
width: '100%', |
|
||||
text: 'Create Full Snapeshot', |
|
||||
handler: function(){ |
|
||||
createNewTask( 255 ); |
|
||||
} |
|
||||
}] |
|
||||
},{ |
|
||||
title: 'Archives', |
|
||||
height: 250, |
|
||||
width: '100%', |
|
||||
tbar:[{ |
|
||||
text: 'Restore', |
|
||||
id: 'ar_restore_btn', |
|
||||
handler: function(){ |
|
||||
createNewTask(1, selectedArchiveRecord.data.file_name ); |
|
||||
} |
|
||||
},{ |
|
||||
text: 'Download', |
|
||||
id: 'ar_download_btn', |
|
||||
handler: function(){ |
|
||||
if( selectedArchiveRecord!= null ){ |
|
||||
window.open( '/lib/php/setup_toolkit/vault/'+selectedArchiveRecord.data.base_version + '/'+ selectedArchiveRecord.data.file_name ); |
|
||||
}; |
|
||||
} |
|
||||
},{ |
|
||||
text: 'Delete', |
|
||||
id: 'ar_delete_btn', |
|
||||
handler: function(){ |
|
||||
createNewTask(100, selectedArchiveRecord.data.file_name ); |
|
||||
} |
|
||||
}], |
|
||||
items:[{ |
|
||||
xtype: 'grid', |
|
||||
id: 'archives_grid', |
|
||||
border: false, |
|
||||
frame: false, |
|
||||
autoScroll: true, |
|
||||
//width: '100%',
|
|
||||
lazyRender: true, |
|
||||
height: 210, |
|
||||
ds: archives_store, |
|
||||
cm: new Ext.grid.ColumnModel( archivesColModel_ops ), |
|
||||
sm: new Ext.grid.RowSelectionModel( archivesSelModel_ops ), |
|
||||
viewConfig: { |
|
||||
// forceFit: true
|
|
||||
} |
|
||||
}] |
|
||||
},{ |
|
||||
title: 'Task Status', |
|
||||
height: 250, |
|
||||
//flex: 1,
|
|
||||
items:[{ |
|
||||
xtype: 'spacer', |
|
||||
height: 4 |
|
||||
},{ |
|
||||
id: 'ctask_status', |
|
||||
border: true, |
|
||||
html: '' |
|
||||
},{ |
|
||||
xtype: 'spacer', |
|
||||
height: 4 |
|
||||
},{ |
|
||||
xtype: 'textarea', |
|
||||
id: 'task_log', |
|
||||
height: ( PanelH-320 ) / 2 - 120, |
|
||||
style: 'font-size:9px;width:100%;margin-bottom:4px;', |
|
||||
readOnly: true, |
|
||||
autoScroll: true, |
|
||||
value: '' |
|
||||
},{ |
|
||||
xtype: 'progress', |
|
||||
id: 'task_progress', |
|
||||
value: 1.0, |
|
||||
text: 'idle', |
|
||||
disabled: true |
|
||||
}], |
|
||||
tbar:[{ |
|
||||
text: 'Cancel Task', |
|
||||
id: 'ch_ta_btn', |
|
||||
disabled: true, |
|
||||
handler: deleteNewTask |
|
||||
}] |
|
||||
}] |
|
||||
|
|
||||
},{ |
|
||||
title: '<?=$Labels->getLabel('_UPLOAD_PACKAGE_');?>', |
|
||||
xtype: 'panel', |
|
||||
height: 300, |
|
||||
//flex: 1,
|
|
||||
frame: true, |
|
||||
border: false, |
|
||||
//layout: 'vbox',
|
|
||||
items:[{ |
|
||||
xtype:'button', |
|
||||
id: 'pickfiles', |
|
||||
width: '100%', |
|
||||
text: 'Choose File' |
|
||||
},{ |
|
||||
height: 200, |
|
||||
xtype: 'grid', |
|
||||
id: 'upload_grid', |
|
||||
border: false, |
|
||||
frame: false, |
|
||||
mode: 'local', |
|
||||
lazyRender: true, |
|
||||
width: '100%', |
|
||||
autoScroll: true, |
|
||||
ds: uploads_store, |
|
||||
cm: new Ext.grid.ColumnModel( fileUploadsColModel_ops ), |
|
||||
sm: new Ext.grid.RowSelectionModel( fileUploadsSelModel_ops ), |
|
||||
viewConfig: { |
|
||||
forceFit: true |
|
||||
}, |
|
||||
bbar: [{ |
|
||||
text: 'Clear', |
|
||||
width: '100%', |
|
||||
handler: function(){ |
|
||||
muploader.splice(); |
|
||||
uploads_store.removeAll(); |
|
||||
} |
|
||||
}] |
|
||||
},{ |
|
||||
xtype:'button', |
|
||||
id: 'umpalumpa', |
|
||||
width: '100%', |
|
||||
disabled: true, |
|
||||
text: 'Upload', |
|
||||
handler: function(){ |
|
||||
if( muploader!= null ){ |
|
||||
muploader.start(); |
|
||||
}; |
|
||||
} |
|
||||
}], |
|
||||
listeners:{ |
|
||||
afterrender: function(){ |
|
||||
muploader = new plupload.Uploader({ |
|
||||
runtimes : 'html5,html4', |
|
||||
browse_button : Ext.getDom('pickfiles'), // you can pass in id...
|
|
||||
//container: document.getElementById('upupu'), // ... or DOM Element itself
|
|
||||
max_file_size : '1000mb', |
|
||||
chunk_size: '200kb', |
|
||||
max_retries: 3, |
|
||||
multi_selection: false, |
|
||||
max_file_count: 1, |
|
||||
// Fake server response here
|
|
||||
url: '/lib/php/setup_toolkit/upload.php', |
|
||||
//url: "/echo/json",
|
|
||||
|
|
||||
//flash_swf_url : 'http://rawgithub.com/moxiecode/moxie/master/bin/flash/Moxie.cdn.swf',
|
|
||||
//silverlight_xap_url : 'http://rawgithub.com/moxiecode/moxie/master/bin/silverlight/Moxie.cdn.xap',
|
|
||||
filters : [ |
|
||||
//{title : "Image files", extensions : "jpg,gif,png"},
|
|
||||
{title : "Archive files", extensions : "rar,zip,gz,bz2"} |
|
||||
], |
|
||||
|
|
||||
init: { |
|
||||
PostInit: function() { |
|
||||
//$('filelist').innerHTML = '';
|
|
||||
|
|
||||
//$('uploadfiles').onclick = function() {
|
|
||||
// uploader.start();
|
|
||||
// return false;
|
|
||||
//};
|
|
||||
}, |
|
||||
|
|
||||
FilesAdded: function( up, files ) { |
|
||||
Ext.getCmp('umpalumpa').enable(); |
|
||||
plupload.each( files, function(file) { |
|
||||
uploads_store.loadData( [[ uploads_store_id, file.name, file.id, plupload.formatSize( file.size ), 0, 'N' ]], true ); |
|
||||
uploads_store_id++; |
|
||||
Ext.getCmp('upload_grid').doLayout(); |
|
||||
}); |
|
||||
}, |
|
||||
|
|
||||
UploadProgress: function(up, file) { |
|
||||
var pb = Ext.getCmp( 'progress_'+file.id ); |
|
||||
if( file.percent < 100 ){ |
|
||||
pb.updateProgress( file.percent / 100, file.percent + '%', false ); |
|
||||
} else { |
|
||||
pb.updateProgress( 1.0, 'Uploaded', false ); |
|
||||
}; |
|
||||
}, |
|
||||
|
|
||||
Error: function(up, err) { |
|
||||
Ext.Msg.show({ |
|
||||
title:'Upload Status', |
|
||||
msg: "Error #" + err.code + ": " + err.message, |
|
||||
buttons: Ext.Msg.OK, |
|
||||
icon: Ext.MessageBox.ERROR |
|
||||
}); |
|
||||
} |
|
||||
} |
|
||||
}); |
|
||||
muploader.init(); |
|
||||
} |
|
||||
} |
|
||||
}] |
|
||||
}] |
|
||||
}); |
|
||||
muploader = null; |
|
||||
uploads_store.removeAll(); |
|
||||
tPanel.doLayout(); |
|
||||
archives_store.load();//{params:{start:0, limit:50, src: 'arch', fil: selecredActiveSourceFilter }});
|
|
||||
updateTaskStatus(); |
|
||||
tlInterval = window.setInterval( updateTaskStatus, 333 ); |
|
||||
}; |
|
||||
1170
lib/javascript/jsapi_dynamic/rgoose_sysmap_editor.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -1,29 +0,0 @@ |
|||||
http://192.168.1.82:9989/onvif…..;subtype=0
|
|
||||
|
|
||||
subtype= |
|
||||
|
|
||||
0 for Main Stream |
|
||||
|
|
||||
1 for Extra Stream ;) |
|
||||
|
|
||||
<img alt=”” src=”camera1.jpg” width=”800″ height=”450″ border=”1″ name=”refresh” ></a> |
|
||||
<script language=”JavaScript” type=”text/javascript”> |
|
||||
|
|
||||
var t = 60 // interval in seconds
|
|
||||
image = “camera1.jpg” //name of the image
|
|
||||
|
|
||||
|
|
||||
|
|
||||
function Start() { |
|
||||
var tester=new Image(image); |
|
||||
|
|
||||
tester.onload |
|
||||
{ |
|
||||
tmp = new Date(); |
|
||||
tmp = “?”+tmp.getTime() |
|
||||
document.images[“refresh”].src = image+tmp |
|
||||
} |
|
||||
setTimeout(“Start()”, t*1000) |
|
||||
} |
|
||||
Start(); |
|
||||
</script> |
|
||||
@ -1 +1 @@ |
|||||
20241231 |
|
||||
|
20251012 |
||||
Binary file not shown.
|
Before Width: 32 | Height: 12 | Size: 582 B After Width: 32 | Height: 12 | Size: 555 B |
Write
Preview
Loading…
Cancel
Save
Reference in new issue