---
modules/caddyhttp/fileserver/browse.html | 443 ++++++++++++++++---------------
1 file changed, 227 insertions(+), 216 deletions(-)
diff --git a/modules/caddyhttp/fileserver/browse.html b/modules/caddyhttp/fileserver/browse.html
index 0b558ce..88036d0 100644
--- a/modules/caddyhttp/fileserver/browse.html
+++ b/modules/caddyhttp/fileserver/browse.html
@@ -1,288 +1,296 @@
{{- define "icon"}}
{{- if .IsDir}}
-
+ {{- if .IsSymlink}}
+
+ {{- else}}
+
+ {{- end}}
{{- else if or (eq .Name "LICENSE") (eq .Name "README")}}
{{- else if .HasExt ".jpg" ".jpeg" ".png" ".gif" ".webp" ".tiff" ".bmp" ".heif" ".heic" ".svg"}}
{{- if eq .Tpl.Layout "grid"}}
{{- else}}
{{- end}}
{{- else if .HasExt ".mp4" ".mov" ".mpeg" ".mpg" ".avi" ".ogg" ".webm" ".mkv" ".vob" ".gifv" ".3gp"}}
{{- else if .HasExt ".mp3" ".m4a" ".aac" ".ogg" ".flac" ".wav" ".wma" ".midi" ".cda"}}
{{- else if .HasExt ".pdf"}}
{{- else if .HasExt ".csv" ".tsv"}}
{{- else if .HasExt ".txt" ".doc" ".docx" ".odt" ".fodt" ".rtf"}}
{{- else if .HasExt ".xls" ".xlsx" ".ods" ".fods"}}
{{- else if .HasExt ".ppt" ".pptx" ".odp" ".fodp"}}
{{- else if .HasExt ".zip" ".gz" ".xz" ".tar" ".7z" ".rar" ".xz" ".zst"}}
{{- else if .HasExt ".deb" ".dpkg"}}
{{- else if .HasExt ".rpm" ".exe" ".flatpak" ".appimage" ".jar" ".msi" ".apk"}}
{{- else if .HasExt ".ps1"}}
{{- else if .HasExt ".py" ".pyc" ".pyo"}}
{{- else if .HasExt ".bash" ".sh" ".com" ".bat" ".dll" ".so"}}
{{- else if .HasExt ".dmg"}}
{{- else if .HasExt ".iso" ".img"}}
{{- else if .HasExt ".md" ".mdown" ".markdown"}}
{{- else if .HasExt ".ttf" ".otf" ".woff" ".woff2" ".eof"}}
{{- else if .HasExt ".go"}}
{{- else if .HasExt ".html" ".htm"}}
{{- else if .HasExt ".js"}}
{{- else if .HasExt ".css"}}
{{- else if .HasExt ".json" ".json5" ".jsonc"}}
{{- else if .HasExt ".ts"}}
{{- else if .HasExt ".sql"}}
{{- else if .HasExt ".db" ".sqlite" ".bak" ".mdb"}}
{{- else if .HasExt ".eml" ".email" ".mailbox" ".mbox" ".msg"}}
{{- else if .HasExt ".crt" ".pem" ".x509" ".cer" ".ca-bundle"}}
{{- else if .HasExt ".key" ".keystore" ".jks" ".p12" ".pfx" ".pub"}}
{{- else}}
{{- if .IsSymlink}}
{{- else}}
{{- end}}
{{- end}}
@@ -789,19 +797,19 @@ footer {
List
Grid
@@ -826,22 +834,22 @@ footer {
{{- if and (eq .Sort "namedirfirst") (ne .Order "desc")}}
{{- else if and (eq .Sort "namedirfirst") (ne .Order "asc")}}
{{- else}}
{{- end}}
@@ -850,16 +858,16 @@ footer {
Name
{{- else if and (eq .Sort "name") (ne .Order "asc")}}
Name
{{- else}}
@@ -870,11 +878,11 @@ footer {
@@ -882,16 +890,16 @@ footer {
Size
{{- else if and (eq .Sort "size") (ne .Order "asc")}}
Size
{{- else}}
@@ -905,16 +913,16 @@ footer {
Modified
{{- else if and (eq .Sort "time") (ne .Order "asc")}}
Modified
{{- else}}
@@ -933,8 +941,8 @@ footer {
|
Up
@@ -1075,7 +1083,10 @@ footer {
});
document.querySelectorAll('.size').forEach(el => {
const size = Number(el.dataset.size);
- el.querySelector('.sizebar-bar').style.width = `${size/largest * 100}%`;
+ const sizebar = el.querySelector('.sizebar-bar');
+ if (sizebar) {
+ sizebar.style.width = `${size/largest * 100}%`;
+ }
});
}
--
cgit v1.2.3
|