.
This commit is contained in:
@@ -71,13 +71,13 @@ while (mysqli_stmt_fetch($stmt)) {
|
|||||||
$printer["print_status"]="Drucken";
|
$printer["print_status"]="Drucken";
|
||||||
$printer["view"]=1;
|
$printer["view"]=1;
|
||||||
}
|
}
|
||||||
$printer["progress"]=100*intval($json["progress"]["printTime"])/(intval($json["progress"]["printTime"])+intval($json["progress"]["printTimeLeft"])+1);
|
$printer["progress"]=ceil(100*intval($json["progress"]["printTime"])/(intval($json["progress"]["printTime"])+intval($json["progress"]["printTimeLeft"])+1));
|
||||||
}else if($cancel==1){
|
}else if($cancel==1){
|
||||||
exec("curl --max-time 10 $url/api/job?apikey=$apikey > /var/www/html/user_files/" . $_SESSION["username"] . "/json.json");
|
exec("curl --max-time 10 $url/api/job?apikey=$apikey > /var/www/html/user_files/" . $_SESSION["username"] . "/json.json");
|
||||||
$fg = file_get_contents("/var/www/html/user_files/" . $_SESSION["username"] . "/json.json");
|
$fg = file_get_contents("/var/www/html/user_files/" . $_SESSION["username"] . "/json.json");
|
||||||
$json = json_decode($fg, true);
|
$json = json_decode($fg, true);
|
||||||
//$printer["progress"] = (int) $json['progress']['completion'];
|
//$printer["progress"] = (int) $json['progress']['completion'];
|
||||||
$printer["progress"]=100*intval($json["progress"]["printTime"])/(intval($json["progress"]["printTime"])+intval($json["progress"]["printTimeLeft"])+1);
|
$printer["progress"]=ceil(100*intval($json["progress"]["printTime"])/(intval($json["progress"]["printTime"])+intval($json["progress"]["printTimeLeft"])+1));
|
||||||
$printer["file"] = short_path($json["job"]["file"]["name"], 10, 10);
|
$printer["file"] = short_path($json["job"]["file"]["name"], 10, 10);
|
||||||
$printer["print_time_total"] = seconds_to_time(intval($json["job"]["estimatedPrintTime"]));
|
$printer["print_time_total"] = seconds_to_time(intval($json["job"]["estimatedPrintTime"]));
|
||||||
$printer["print_time_left"] = seconds_to_time(intval($json["progress"]["printTimeLeft"]));
|
$printer["print_time_left"] = seconds_to_time(intval($json["progress"]["printTimeLeft"]));
|
||||||
@@ -95,7 +95,7 @@ while (mysqli_stmt_fetch($stmt)) {
|
|||||||
if($json['state']=="Starting print from SD" or $json['state']=="Printing" or $json['state']=="Printing from SD" or $system_status==99){
|
if($json['state']=="Starting print from SD" or $json['state']=="Printing" or $json['state']=="Printing from SD" or $system_status==99){
|
||||||
$printer["print_status"]="Von anderer Quelle aus gestartet.";
|
$printer["print_status"]="Von anderer Quelle aus gestartet.";
|
||||||
//$printer["progress"] = (int) $json['progress']['completion'];
|
//$printer["progress"] = (int) $json['progress']['completion'];
|
||||||
$printer["progress"]=100*intval($json["progress"]["printTime"])/(intval($json["progress"]["printTime"])+intval($json["progress"]["printTimeLeft"])+1);
|
$printer["progress"]=ceil(100*intval($json["progress"]["printTime"])/(intval($json["progress"]["printTime"])+intval($json["progress"]["printTimeLeft"])+1));
|
||||||
$printer["file"] = short_path($json["job"]["file"]["name"], 10, 10);
|
$printer["file"] = short_path($json["job"]["file"]["name"], 10, 10);
|
||||||
$printer["full_file"]=$json["job"]["file"]["name"];
|
$printer["full_file"]=$json["job"]["file"]["name"];
|
||||||
$printer["print_time_total"] = seconds_to_time(intval($json["job"]["estimatedPrintTime"]));
|
$printer["print_time_total"] = seconds_to_time(intval($json["job"]["estimatedPrintTime"]));
|
||||||
|
|||||||
Reference in New Issue
Block a user