mirror of
https://github.com/45Drives/cockpit-navigator.git
synced 2025-07-29 16:45:13 +02:00
fix xfr rate and ETA and show ETA in (hh:)mm:ss
This commit is contained in:
parent
48c422e043
commit
1300292544
@ -41,7 +41,6 @@ export class FileUpload {
|
||||
this.reader = new FileReader();
|
||||
this.chunks = this.slice_file(file);
|
||||
this.chunk_index = 0;
|
||||
this.timestamp = Date.now();
|
||||
this.modal_prompt = new ModalPrompt();
|
||||
this.using_webkit = true;
|
||||
this.make_html_element();
|
||||
@ -127,6 +126,7 @@ export class FileUpload {
|
||||
}
|
||||
|
||||
async upload() {
|
||||
this.timestamp = Date.now();
|
||||
this.dom_element.style.display = "flex";
|
||||
this.proc = cockpit.spawn(["/usr/share/cockpit/navigator/scripts/write-chunks.py3", this.path], {err: "out", superuser: "try"});
|
||||
this.proc.fail((e, data) => {
|
||||
@ -164,7 +164,7 @@ export class FileUpload {
|
||||
}
|
||||
this.done();
|
||||
}
|
||||
this.update_rates_interval = setInterval(this.display_xfr_rate.bind(this), 2000);
|
||||
this.update_rates_interval = setInterval(this.display_xfr_rate.bind(this), 1000);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -70,9 +70,7 @@ export function format_time_remaining(seconds_) {
|
||||
if (hours) {
|
||||
out = String(hours).padStart(2, '0') + ":";
|
||||
}
|
||||
if (minutes) {
|
||||
out += String(minutes).padStart(2, '0') + ":";
|
||||
}
|
||||
out += String(minutes).padStart(2, '0') + ":";
|
||||
out += String(seconds).padStart(2, '0');
|
||||
return out;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user