update
This commit is contained in:
@@ -85,7 +85,7 @@ func listDir(dir string) ([]FileInfo, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Href := filepath.Join(dir, name)
|
Href := filepath.Join(dir, name)
|
||||||
//Href = strings.Replace(Href, filepath.Join(rootPath), "", -1)
|
Href = strings.Replace(Href, filepath.Join(rootPath), "", -1)
|
||||||
|
|
||||||
size := fileInfo.Size()
|
size := fileInfo.Size()
|
||||||
formattedSize := formatFileSize(size)
|
formattedSize := formatFileSize(size)
|
||||||
|
|||||||
@@ -12,9 +12,9 @@
|
|||||||
{{range .}}
|
{{range .}}
|
||||||
<tr>
|
<tr>
|
||||||
{{if .IsDir}}
|
{{if .IsDir}}
|
||||||
<td><a href="/{{.Href}}">/{{.Name}}</a></td>
|
<td><a href="{{.Href}}">/{{.Name}}</a></td>
|
||||||
{{else}}
|
{{else}}
|
||||||
<td><a href="/{{.Href}}">{{.Name}}</a></td>
|
<td><a href="{{.Href}}">{{.Name}}</a></td>
|
||||||
{{end}}
|
{{end}}
|
||||||
<td>{{.Size}}</td>
|
<td>{{.Size}}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
Reference in New Issue
Block a user