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