mirror of
https://github.com/45Drives/cockpit-navigator.git
synced 2025-07-30 00:55:30 +02:00
add footer and file/dir count
This commit is contained in:
parent
72411a542d
commit
fd1cbd101f
@ -139,6 +139,10 @@ body::-webkit-scrollbar-thumb {
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
|
||||
.spacer-stretchy {
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
.nav-hidden {
|
||||
display: none;
|
||||
}
|
||||
@ -148,6 +152,7 @@ body::-webkit-scrollbar-thumb {
|
||||
background-color: var(--container);
|
||||
color: var(--font);
|
||||
padding: 1em;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
.navigation-bar {
|
||||
@ -291,11 +296,15 @@ body::-webkit-scrollbar-thumb {
|
||||
background-color: var(--textarea-bg);
|
||||
}
|
||||
|
||||
.nav-footer {
|
||||
flex: 1;
|
||||
align-items: baseline;
|
||||
justify-content: flex-start;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.nav-toggle {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: 1.5em;
|
||||
margin-right: 1.9em;
|
||||
justify-self: flex-end;
|
||||
}
|
||||
|
||||
.switch {
|
||||
|
@ -127,15 +127,21 @@
|
||||
<button class="pf-c-button pf-m-primary" id="nav-apply-edit-btn"><i class="fas fa-save"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="nav-toggle">
|
||||
<div class="nav-btn-group">
|
||||
<i class="fas fa-sun" id="houston-theme-icon"></i>
|
||||
<div class="horizontal-spacer-sm"></div>
|
||||
<label class="switch">
|
||||
<input type="checkbox" id="toggle-theme">
|
||||
<span class="slider round"></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex-row nav-footer">
|
||||
<div>
|
||||
<span id="nav-num-dirs">0</span> Directories, <span id="nav-num-files">0</span> Files
|
||||
</div>
|
||||
<div class="spacer-stretchy"></div>
|
||||
<div class="nav-toggle">
|
||||
<div class="nav-btn-group">
|
||||
<i class="fas fa-sun" id="houston-theme-icon"></i>
|
||||
<div class="horizontal-spacer-sm"></div>
|
||||
<label class="switch">
|
||||
<input type="checkbox" id="toggle-theme">
|
||||
<span class="slider round"></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -423,6 +423,8 @@ class NavWindow {
|
||||
}
|
||||
}
|
||||
async refresh() {
|
||||
var num_dirs = 0;
|
||||
var num_files = 0;
|
||||
this.start_load();
|
||||
var files = await this.pwd().get_children(this);
|
||||
while (this.entries.length) {
|
||||
@ -430,12 +432,18 @@ class NavWindow {
|
||||
entry.destroy();
|
||||
}
|
||||
files.forEach((file) => {
|
||||
if (file.nav_type === "dir")
|
||||
num_dirs++;
|
||||
else
|
||||
num_files++;
|
||||
file.show();
|
||||
this.entries.push(file);
|
||||
});
|
||||
document.getElementById("pwd").value = this.pwd().path_str();
|
||||
this.set_selected(this.pwd());
|
||||
this.show_selected_properties();
|
||||
document.getElementById("nav-num-dirs").innerText = num_dirs.toString();
|
||||
document.getElementById("nav-num-files").innerText = num_files.toString();
|
||||
this.stop_load();
|
||||
}
|
||||
pwd() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user