mirror of
https://github.com/gogs/gogs.git
synced 2026-07-13 21:11:40 +02:00
lfs: show configs in admin ui (#6128)
* Rename template consts * Display new DB options * Display LFS configs
This commit is contained in:
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -359,14 +359,21 @@ func Init(customConf string) error {
|
||||
}
|
||||
I18n.dateLangs = File.Section("i18n.datelang").KeysHash()
|
||||
|
||||
// *************************
|
||||
// ----- LFS settings -----
|
||||
// *************************
|
||||
|
||||
if err = File.Section("lfs").MapTo(&LFS); err != nil {
|
||||
return errors.Wrap(err, "mapping [lfs] section")
|
||||
}
|
||||
LFS.ObjectsPath = ensureAbs(LFS.ObjectsPath)
|
||||
|
||||
handleDeprecated()
|
||||
|
||||
if err = File.Section("cache").MapTo(&Cache); err != nil {
|
||||
return errors.Wrap(err, "mapping [cache] section")
|
||||
} else if err = File.Section("http").MapTo(&HTTP); err != nil {
|
||||
return errors.Wrap(err, "mapping [http] section")
|
||||
} else if err = File.Section("lfs").MapTo(&LFS); err != nil {
|
||||
return errors.Wrap(err, "mapping [lfs] section")
|
||||
} else if err = File.Section("release").MapTo(&Release); err != nil {
|
||||
return errors.Wrap(err, "mapping [release] section")
|
||||
} else if err = File.Section("webhook").MapTo(&Webhook); err != nil {
|
||||
|
||||
@@ -22,9 +22,9 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
DASHBOARD = "admin/dashboard"
|
||||
CONFIG = "admin/config"
|
||||
MONITOR = "admin/monitor"
|
||||
tmplDashboard = "admin/dashboard"
|
||||
tmplConfig = "admin/config"
|
||||
tmplMonitor = "admin/monitor"
|
||||
)
|
||||
|
||||
// initTime is the time when the application was initialized.
|
||||
@@ -123,7 +123,7 @@ func Dashboard(c *context.Context) {
|
||||
// FIXME: update periodically
|
||||
updateSystemStatus()
|
||||
c.Data["SysStatus"] = sysStatus
|
||||
c.Success(DASHBOARD)
|
||||
c.Success(tmplDashboard)
|
||||
}
|
||||
|
||||
// Operation types.
|
||||
@@ -209,6 +209,7 @@ func Config(c *context.Context) {
|
||||
c.Data["Mirror"] = conf.Mirror
|
||||
c.Data["Webhook"] = conf.Webhook
|
||||
c.Data["Git"] = conf.Git
|
||||
c.Data["LFS"] = conf.LFS
|
||||
|
||||
c.Data["LogRootPath"] = conf.Log.RootPath
|
||||
type logger struct {
|
||||
@@ -225,7 +226,7 @@ func Config(c *context.Context) {
|
||||
}
|
||||
c.Data["Loggers"] = loggers
|
||||
|
||||
c.Success(CONFIG)
|
||||
c.Success(tmplConfig)
|
||||
}
|
||||
|
||||
func Monitor(c *context.Context) {
|
||||
@@ -234,5 +235,5 @@ func Monitor(c *context.Context) {
|
||||
c.Data["PageIsAdminMonitor"] = true
|
||||
c.Data["Processes"] = process.Processes
|
||||
c.Data["Entries"] = cron.ListTasks()
|
||||
c.Success(MONITOR)
|
||||
c.Success(tmplMonitor)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user