mirror of
https://github.com/45Drives/cockpit-navigator.git
synced 2025-07-31 01:24:37 +02:00
add byte total in footer for cwd
This commit is contained in:
parent
e26910e2bf
commit
202c0adf41
@ -147,7 +147,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="flex-row nav-footer">
|
<div class="flex-row nav-footer">
|
||||||
<div>
|
<div>
|
||||||
<span id="nav-num-dirs">-</span> Directories, <span id="nav-num-files">-</span> Files
|
<span id="nav-num-dirs">-</span> Directories, <span id="nav-num-files">-</span> Files (<span id="nav-num-bytes">-</span>)
|
||||||
</div>
|
</div>
|
||||||
<div class="flex-grow"></div>
|
<div class="flex-grow"></div>
|
||||||
<a href="https://45drives.com" target="_blank" title="Visit 45Drives.com">
|
<a href="https://45drives.com" target="_blank" title="Visit 45Drives.com">
|
||||||
|
@ -720,6 +720,7 @@ class NavWindow {
|
|||||||
|
|
||||||
var num_dirs = 0;
|
var num_dirs = 0;
|
||||||
var num_files = 0;
|
var num_files = 0;
|
||||||
|
var bytes_sum = 0;
|
||||||
var show_hidden = document.getElementById("nav-show-hidden").checked;
|
var show_hidden = document.getElementById("nav-show-hidden").checked;
|
||||||
this.start_load();
|
this.start_load();
|
||||||
var files = await this.pwd().get_children(this);
|
var files = await this.pwd().get_children(this);
|
||||||
@ -738,8 +739,10 @@ class NavWindow {
|
|||||||
files.forEach((file) => {
|
files.forEach((file) => {
|
||||||
if (file.nav_type === "dir")
|
if (file.nav_type === "dir")
|
||||||
num_dirs++;
|
num_dirs++;
|
||||||
else
|
else {
|
||||||
num_files++;
|
num_files++;
|
||||||
|
bytes_sum += file.stat["size"];
|
||||||
|
}
|
||||||
if(!file.is_hidden_file || show_hidden)
|
if(!file.is_hidden_file || show_hidden)
|
||||||
file.show();
|
file.show();
|
||||||
this.entries.push(file);
|
this.entries.push(file);
|
||||||
@ -749,6 +752,7 @@ class NavWindow {
|
|||||||
this.show_selected_properties();
|
this.show_selected_properties();
|
||||||
document.getElementById("nav-num-dirs").innerText = num_dirs.toString();
|
document.getElementById("nav-num-dirs").innerText = num_dirs.toString();
|
||||||
document.getElementById("nav-num-files").innerText = num_files.toString();
|
document.getElementById("nav-num-files").innerText = num_files.toString();
|
||||||
|
document.getElementById("nav-num-bytes"). innerText = format_bytes(bytes_sum);
|
||||||
this.stop_load();
|
this.stop_load();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user