|
|
@@ -8,11 +8,9 @@ import (
|
|
|
"gitote/gitote/pkg/form"
|
|
|
"gitote/gitote/pkg/setting"
|
|
|
"gitote/gitote/pkg/template"
|
|
|
- "gitote/gitote/pkg/tool"
|
|
|
"io"
|
|
|
"net/http"
|
|
|
"path"
|
|
|
- "runtime"
|
|
|
"strings"
|
|
|
"time"
|
|
|
|
|
|
@@ -223,17 +221,6 @@ func (c *Context) ServeContent(name string, r io.ReadSeeker, params ...interface
|
|
|
http.ServeContent(c.Resp, c.Req.Request, name, modtime, r)
|
|
|
}
|
|
|
|
|
|
-var sysStatus struct {
|
|
|
- MemAllocated string
|
|
|
-}
|
|
|
-
|
|
|
-func updateSystemStatus() {
|
|
|
- m := new(runtime.MemStats)
|
|
|
- runtime.ReadMemStats(m)
|
|
|
-
|
|
|
- sysStatus.MemAllocated = tool.FileSize(int64(m.Alloc))
|
|
|
-}
|
|
|
-
|
|
|
// Contexter initializes a classic context for a request.
|
|
|
func Contexter() macaron.Handler {
|
|
|
return func(ctx *macaron.Context, l i18n.Locale, cache cache.Cache, sess session.Store, f *session.Flash, x csrf.CSRF) {
|
|
|
@@ -249,14 +236,12 @@ func Contexter() macaron.Handler {
|
|
|
},
|
|
|
Org: &Organization{},
|
|
|
}
|
|
|
- updateSystemStatus()
|
|
|
|
|
|
if strings.Title(macaron.Env) == "Development" {
|
|
|
c.Data["Lab"] = 1
|
|
|
} else {
|
|
|
c.Data["Lab"] = 0
|
|
|
}
|
|
|
- c.Data["AdminBar"] = sysStatus
|
|
|
c.Data["Link"] = template.EscapePound(c.Link)
|
|
|
c.Data["PageStartTime"] = time.Now()
|
|
|
|