temps restant + video + download link + left click + show next frame done
This commit is contained in:
@@ -11,6 +11,8 @@ const ProgressBar = {
|
||||
let str_camera = obj_data.str_camera || "-";
|
||||
let nb_frame = obj_data.nb_frame || 0;
|
||||
let str_status = obj_data.str_status || "idle";
|
||||
let nb_avg_render_ms = obj_data.nb_avg_render_ms || 0;
|
||||
let nb_remaining = obj_data.nb_remaining || 0;
|
||||
|
||||
let nb_percent = 0;
|
||||
if (nb_total > 0) {
|
||||
@@ -40,6 +42,20 @@ const ProgressBar = {
|
||||
let obj_frame_label = document.getElementById("label_current_frame");
|
||||
obj_frame_label.textContent = nb_frame !== null && nb_frame !== undefined ? String(nb_frame) : "-";
|
||||
|
||||
let obj_time_label = document.getElementById("label_progress_time");
|
||||
if (nb_avg_render_ms > 0 && nb_remaining > 0 && str_status === "running") {
|
||||
let nb_remaining_ms = nb_avg_render_ms * nb_remaining;
|
||||
let str_remaining = ProgressBar._format_duration(nb_remaining_ms);
|
||||
let obj_eta = new Date(Date.now() + nb_remaining_ms);
|
||||
let str_eta_hours = String(obj_eta.getHours()).padStart(2, "0");
|
||||
let str_eta_minutes = String(obj_eta.getMinutes()).padStart(2, "0");
|
||||
obj_time_label.textContent = "Restant : " + str_remaining + " — Fin : " + str_eta_hours + ":" + str_eta_minutes;
|
||||
} else if (str_status === "idle" && nb_current >= nb_total && nb_total > 0) {
|
||||
obj_time_label.textContent = "Termine";
|
||||
} else {
|
||||
obj_time_label.textContent = "";
|
||||
}
|
||||
|
||||
RenderQueue.update_progress(obj_data);
|
||||
},
|
||||
|
||||
@@ -50,5 +66,30 @@ const ProgressBar = {
|
||||
document.getElementById("label_progress_status").textContent = "En attente";
|
||||
document.getElementById("label_current_camera").textContent = "-";
|
||||
document.getElementById("label_current_frame").textContent = "-";
|
||||
document.getElementById("label_progress_time").textContent = "";
|
||||
},
|
||||
|
||||
_format_duration: (nb_ms) => {
|
||||
let nb_total_seconds = Math.ceil(nb_ms / 1000);
|
||||
let nb_days = Math.floor(nb_total_seconds / 86400);
|
||||
nb_total_seconds %= 86400;
|
||||
let nb_hours = Math.floor(nb_total_seconds / 3600);
|
||||
nb_total_seconds %= 3600;
|
||||
let nb_minutes = Math.floor(nb_total_seconds / 60);
|
||||
let nb_seconds = nb_total_seconds % 60;
|
||||
|
||||
let str_result = "";
|
||||
if (nb_days > 0) {
|
||||
str_result += nb_days + "j ";
|
||||
}
|
||||
if (nb_hours > 0 || nb_days > 0) {
|
||||
str_result += nb_hours + "h ";
|
||||
}
|
||||
if (nb_minutes > 0 || nb_hours > 0 || nb_days > 0) {
|
||||
str_result += nb_minutes + "m ";
|
||||
}
|
||||
str_result += nb_seconds + "s";
|
||||
|
||||
return str_result;
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user