diff --git a/modules/caddyhttp/fileserver/browsetpl.go b/modules/caddyhttp/fileserver/browsetpl.go index 14d39960..567e8dd7 100644 --- a/modules/caddyhttp/fileserver/browsetpl.go +++ b/modules/caddyhttp/fileserver/browsetpl.go @@ -228,7 +228,7 @@ footer { } - + @@ -379,6 +379,16 @@ footer { var filterEl = document.getElementById('filter'); filterEl.focus(); + function initFilter() { + if (!filterEl.value) { + var filterParam = new URL(window.location.href).searchParams.get('filter'); + if (filterParam) { + filterEl.value = filterParam; + } + } + filter(); + } + function filter() { var q = filterEl.value.trim().toLowerCase(); var elems = document.querySelectorAll('tr.file');