fileserver: Browse can show symlink target if enabled (#5973)

* Added optional subdirective to browse allowing to reveal symlink paths.

* Update modules/caddyhttp/fileserver/browsetplcontext.go

---------

Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
This commit is contained in:
Aziz Rmadi 2024-02-05 22:31:26 -06:00 committed by GitHub
parent a7479302fc
commit feb07a7b59
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 50 additions and 18 deletions

View file

@ -962,7 +962,15 @@ footer {
<td>
<a href="{{html .URL}}">
{{template "icon" .}}
{{- if not .SymlinkPath}}
<span class="name">{{html .Name}}</span>
{{- else}}
<span class="name">{{html .Name}} <svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-arrow-narrow-right" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M5 12l14 0" />
<path d="M15 16l4 -4" />
<path d="M15 8l4 4" />
</svg> {{html .SymlinkPath}}</span>
{{- end}}
</a>
</td>
{{- if .IsDir}}