11 changed files with 320 additions and 44 deletions
-
2lib/1.json
-
2lib/controller/doApplicationOperation.php
-
38lib/controller/doDatabaseOperation.php
-
20lib/controller/downloadSettings.php
-
35lib/controller/downloadVideo.php
-
5lib/javascript/clipchamp/player.js
-
6lib/javascript/jsapi_dynamic/mojo_map.js
-
91lib/javascript/jsapi_dynamic/mojo_reports.js
-
158lib/javascript/jsapi_dynamic/mojo_settings.js
-
BINstyle/assets/nosignal.mp4
-
7style/style.css
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,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,20 @@ |
|||
<?php |
|||
$NN = './data/'.md5(time()).'.db'; |
|||
$COM = "sqlite3 ./data/mysqlitedb.db '.clone {$NN}'"; |
|||
$JUJA = `$COM`; |
|||
if( file_exists( $NN ) ){ |
|||
$FD = fopen( $NN , "r" ); |
|||
if( $FD ){ |
|||
header( 'Content-Type: application/vnd.sqlite3;' ); |
|||
while(!feof( $FD ) ){ |
|||
echo fread( $FD, 2048 ); |
|||
}; |
|||
fclose( $FD ); |
|||
}; |
|||
unlink( $NN ); |
|||
} else { |
|||
echo "Error!"; |
|||
}; |
|||
|
|||
|
|||
?>
|
|||
@ -0,0 +1,35 @@ |
|||
<?php |
|||
function output_dummy( $DST ){ |
|||
$FD = fopen( $DST, "r" ); |
|||
if( $FD ){ |
|||
header( 'Content-Type: video/mp4;' ); |
|||
while(!feof( $FD ) ){ |
|||
echo fread( $FD, 2048 ); |
|||
}; |
|||
fclose( $FD ); |
|||
}; |
|||
}; |
|||
if( isset( $_POST['FLOC'] ) ){ |
|||
//'/lib/controller/' = 16 chars
|
|||
$SRC = substr( $_POST['FLOC'], 16 ); |
|||
$FPS = intval( $_POST['FFPS'] ); |
|||
|
|||
|
|||
if( file_exists( $SRC ) ){ |
|||
$DST = '../tmp/' . md5_file( $SRC ) . '.mp4'; |
|||
//echo $SRC . "->" . $DST . "\n\n"; exit();
|
|||
$COM = "ffmpeg -hide_banner -loglevel error -y -r {$FPS} -i {$SRC} -pix_fmt yuvj420p -b:v 4000k -c:v libx264 {$DST} 2>&1"; |
|||
$JUJA = `$COM`; |
|||
if( file_exists( $DST ) ){ |
|||
output_dummy( $DST ); |
|||
unlink( $DST ); |
|||
} else output_dummy( '../../style/assets/nosignal.mp4' ); |
|||
} else output_dummy( '../../style/assets/nosignal.mp4' ); |
|||
} else output_dummy( '../../style/assets/nosignal.mp4' ); |
|||
|
|||
//-crf 20 -r 9 -b:v 3500 -filter:v "setpts=2.0 * PTS" ^M
|
|||
|
|||
|
|||
|
|||
|
|||
?>
|
|||
Binary file not shown.
Write
Preview
Loading…
Cancel
Save
Reference in new issue