From e77e55e10e2a4b08cf24c0c876a4bc31b1f9df20 Mon Sep 17 00:00:00 2001 From: Michael Quigley Date: Tue, 12 Dec 2023 11:58:51 -0500 Subject: [PATCH] updated caddy 'browse.html' template to latest v2.7.6 --- endpoints/proxy/browse.html | 446 ++++++++++++++++++------------------ 1 file changed, 229 insertions(+), 217 deletions(-) diff --git a/endpoints/proxy/browse.html b/endpoints/proxy/browse.html index bd04ff76..9f93217b 100755 --- a/endpoints/proxy/browse.html +++ b/endpoints/proxy/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 ".mp4" ".mov" ".m4v" ".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}} @@ -291,6 +299,7 @@ {{html .Name}} + @@ -789,19 +798,19 @@ footer { - - - + + + List - - - - - + + + + + Grid @@ -826,22 +835,22 @@ footer { {{- if and (eq .Sort "namedirfirst") (ne .Order "desc")}} - - + + {{- else if and (eq .Sort "namedirfirst") (ne .Order "asc")}} - - + + {{- else}} - - + + {{- end}} @@ -850,16 +859,16 @@ footer { Name - - + + {{- else if and (eq .Sort "name") (ne .Order "asc")}} Name - - + + {{- else}} @@ -870,11 +879,11 @@ footer {
- - - + + + - +
@@ -882,16 +891,16 @@ footer { Size - - + + {{- else if and (eq .Sort "size") (ne .Order "asc")}} Size - - + + {{- else}} @@ -905,16 +914,16 @@ footer { Modified - - + + {{- else if and (eq .Sort "time") (ne .Order "asc")}} Modified - - + + {{- else}} @@ -933,8 +942,8 @@ footer { - - + + Up @@ -1160,7 +1169,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}%`; + } }); }