diff options
Diffstat (limited to 'routers/web/admin/admin.go')
-rw-r--r-- | routers/web/admin/admin.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/routers/web/admin/admin.go b/routers/web/admin/admin.go index 797ba8798d..3e050e6949 100644 --- a/routers/web/admin/admin.go +++ b/routers/web/admin/admin.go @@ -110,6 +110,16 @@ func updateSystemStatus() { sysStatus.NumGC = m.NumGC } +func prepareDeprecatedWarningsAlert(ctx *context.Context) { + if len(setting.DeprecatedWarnings) > 0 { + content := setting.DeprecatedWarnings[0] + if len(setting.DeprecatedWarnings) > 1 { + content += fmt.Sprintf(" (and %d more)", len(setting.DeprecatedWarnings)-1) + } + ctx.Flash.Error(content, true) + } +} + // Dashboard show admin panel dashboard func Dashboard(ctx *context.Context) { ctx.Data["Title"] = ctx.Tr("admin.dashboard") @@ -120,6 +130,7 @@ func Dashboard(ctx *context.Context) { updateSystemStatus() ctx.Data["SysStatus"] = sysStatus ctx.Data["SSH"] = setting.SSH + prepareDeprecatedWarningsAlert(ctx) ctx.HTML(http.StatusOK, tplDashboard) } |