feat: report dir size correctly
This commit is contained in:
parent
961cbdd48d
commit
d3210878ea
@ -53,9 +53,13 @@ func HandleList(c *fiber.Ctx) error {
|
||||
|
||||
entries := make([]html.Entry, 0, len(config.Config.ServeDirs))
|
||||
for _, key := range keys {
|
||||
dirEntrySize, err := RecursivelyGetSize(config.Config.ServeDirs[key])
|
||||
if err != nil {
|
||||
return c.Status(fiber.StatusInternalServerError).SendString(err.Error())
|
||||
}
|
||||
entries = append(entries, html.Entry{
|
||||
Name: key,
|
||||
Size: -1,
|
||||
Size: dirEntrySize,
|
||||
IsDir: true,
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user