Commit c8d22df3 authored by Oleg Dzhimiev's avatar Oleg Dzhimiev

download logs and camogm log enable

parent cd3cb7e8
......@@ -59,6 +59,7 @@ $res_xml = "";
$debug=true;
$run_camogm=false;
$camogm_log_en = false;
$start = false;
$stop = false;
$mount = false;
......@@ -92,6 +93,7 @@ foreach($_GET as $key=>$value) {
case "test" : $test=true; break;
case "run_camogm" : $run_camogm = true; break;
case "camogm_log_en" : $camogm_log_en = true; break;
case "fast_rec" : $rec_fast = true; break;
case "norm_rec" : $rec_norm = true; break;
case "exit" : $exit = true; break;
......@@ -223,6 +225,13 @@ function set_fast_recording($ip){
fopen("http://{$ip}/camogm_interface.php?cmd=setjpeg", 'r');
}
if ($camogm_log_en){
for ($i=0;$i<count($unique_cams);$i++) {
file_get_contents("http://{$unique_cams[$i]['ip']}/eyesis4pi_interface.php?cmd=camogm_debug", 'r');
}
print("ok");
}
//CAMOGM
if ($run_camogm) {
for ($i=0;$i<count($unique_cams);$i++) {
......
......@@ -252,6 +252,13 @@ function tab3_init(){
c += "<button title='set recording to raw partitions (/dev/sda2)' id='other_fast_rec'>Fast REC</button>";
c += "<button title='reset raw partitions write pointers' id='other_reset_rec'>Reset Fast REC</button>";
c +="</div>";
c += "<br/><b>Logs:</b><div>";
c += "<button title='enable recorder log' id='other_rec_log_en'>Enable camogm log</button>";
c += "<button title='download system logs' id='other_log_dl'>Download logs</button>";
c +="</div>";
c += "<br/><b>System:</b><div><button id='other_reboot' title='System reboot'>Reboot</button></div>";
......@@ -264,9 +271,46 @@ function tab3_init(){
$("#other_fast_rec").on("click",system_fast_rec);
$("#other_norm_rec").on("click",system_norm_rec);
$("#other_rec_log_en").on("click",camogm_log_en);
$("#other_log_dl").on("click",logs_download);
}
// TAB 3: end
function camogm_log_en(){
console.log("enable camogm log");
var url = "eyesis4pi_control.php?camogm_log_en&rq="+cams_to_str();
$.ajax({
url: url,
success: function(data){
console.log(data);
}
});
}
function logs_download(){
tmp_cams = get_unique_cams();
for (var i=0;i<tmp_cams.length;i++){
logs_download_single(tmp_cams[i]);
}
}
function logs_download_single(tmp_cam){
var link = document.createElement('a');
link.setAttribute('download', null);
link.style.display = 'none';
document.body.appendChild(link);
link.setAttribute('href', "http://"+tmp_cam["ip"]+"/eyesis4pi_interface.php?cmd=logs_download");
link.click();
document.body.removeChild(link);
}
function system_reboot(){
console.log("system reboot");
var url = "eyesis4pi_control.php?reboot&rq="+cams_to_str();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment