Skip to content

Commit ec47bdc

Browse files
enable human readable sizes again/fix mobile design and add second sorting arrow
Co-Authored-By: David <[email protected]>
1 parent 1326238 commit ec47bdc

File tree

3 files changed

+32
-5
lines changed

3 files changed

+32
-5
lines changed

rootfs/html/fancyindex/footer.html

+12-2
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
document.querySelector("h1").after(input);
99
var items = [].slice.call(document.querySelectorAll("#list tbody tr"));
1010
function filterItems(item, filter) {
11-
return !item.querySelector("td").textContent.trim().includes(filter);
11+
return !item.querySelector("td").textContent.trim().toLowerCase().includes(filter);
1212
}
1313
input.addEventListener("keyup", function () {
1414
items.forEach((item) => {
1515
item.hidden = false;
1616
});
1717
items
18-
.filter((item) => filterItems(item, this.value.trim()))
18+
.filter((item) => filterItems(item, this.value.trim().toLowerCase()))
1919
.forEach((item) => {
2020
item.hidden = true;
2121
});
@@ -25,6 +25,16 @@
2525
tableDiv.id = "tableDiv";
2626
tableDiv.appendChild(document.querySelector("table"));
2727
document.getElementById("search").after(tableDiv);
28+
29+
var headers = document.querySelectorAll("th");
30+
headers.forEach((header) => {
31+
var links = header.querySelectorAll("a");
32+
var ascendingLink = document.createElement("a");
33+
ascendingLink.innerHTML = "&nbsp;↑&nbsp;";
34+
ascendingLink.href = links[0].href;
35+
links[0].removeAttribute("href");
36+
links[1].after(ascendingLink);
37+
});
2838
</script>
2939
</body>
3040
</html>

rootfs/html/fancyindex/header.html

+19-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!doctype html>
1+
<!DOCTYPE html>
22
<html>
33
<head>
44
<title>Directory index</title>
@@ -109,6 +109,8 @@
109109
border-bottom-width: 1px;
110110
border-bottom-style: solid;
111111
line-height: 2.5rem;
112+
padding: 0.4rem;
113+
overflow-wrap: break-word;
112114
}
113115

114116
tr a {
@@ -147,13 +149,28 @@
147149
#box {
148150
padding-right: 1rem;
149151
padding-left: 1rem;
150-
margin: 2rem;
152+
margin: 0.5rem;
153+
margin-top: 1.5rem;
151154
margin-bottom: 0rem;
152155
}
153156

154157
th {
155158
padding-right: 0rem;
156159
}
160+
161+
#search {
162+
font-size: 16px;
163+
margin-left: auto;
164+
margin-right: auto;
165+
}
166+
167+
table {
168+
font-size: medium;
169+
}
170+
171+
td {
172+
max-width: 10rem;
173+
}
157174
}
158175
</style>
159176
<div id="box">

rootfs/usr/local/nginx/conf/nginx.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ http {
100100
fancyindex off;
101101
fancyindex_localtime on;
102102
fancyindex_show_path on;
103-
fancyindex_exact_size on;
103+
fancyindex_exact_size off;
104104
fancyindex_show_dotfiles off;
105105
fancyindex_hide_symlinks off;
106106
fancyindex_case_sensitive on;

0 commit comments

Comments
 (0)