Repo size in admin panel (#1482)
* Implementation of the feature to view repository size in admin panel * Move GetRepoSize to git module * Repository.RepoSize -> Repository.Size * RepoSize -> Size in template * Redo a few bits and pieces * Update size when syncing mirror or forking * Remove GetRepoSize * Changed fatal errors to error message * Copy migration code from Gogs * make fmt
This commit is contained in:
parent
54f0293f0a
commit
be6edaddcb
8 changed files with 119 additions and 0 deletions
|
@ -82,6 +82,9 @@ func NewFuncMap() []template.FuncMap {
|
|||
"DateFmtShort": func(t time.Time) string {
|
||||
return t.Format("Jan 02, 2006")
|
||||
},
|
||||
"SizeFmt": func(s int64) string {
|
||||
return base.FileSize(s)
|
||||
},
|
||||
"List": List,
|
||||
"SubStr": func(str string, start, length int) string {
|
||||
if len(str) == 0 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue