mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-02 19:39:49 +02:00
Config parameter REPO_SIZE_LIMIT = XXXX (should accept bytes human readable) part1, sensible defaults, app.ini saving
This commit is contained in:
1 parent
414c90263a
commit
31600a0159
4 files changed
+40
-8
No files matched your search
@@ -55,7 +55,7 @@ func UpdateRepoPost(ctx *context.Context) {
|
||||
ctx.Data["RepoSizeLimit"] = form.RepoSizeLimit
|
||||
|
||||
if err != nil {
|
||||
ctx.Data["Err_Repo_Size_Limit"] = true
|
||||
ctx.Data["Err_Repo_Size_Limit"] = err.Error()
|
||||
explore.RenderRepoSearch(ctx, &explore.RepoSearchOptions{
|
||||
Private: true,
|
||||
PageSize: setting.UI.Admin.RepoPagingNum,
|
||||
@@ -65,7 +65,18 @@ func UpdateRepoPost(ctx *context.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
setting.SaveGlobalRepositorySetting(form.EnableSizeLimit, repo_size_limit)
|
||||
err = setting.SaveGlobalRepositorySetting(form.EnableSizeLimit, repo_size_limit)
|
||||
|
||||
if err != nil {
|
||||
ctx.Data["Err_Repo_Size_Save"] = err.Error()
|
||||
explore.RenderRepoSearch(ctx, &explore.RepoSearchOptions{
|
||||
Private: true,
|
||||
PageSize: setting.UI.Admin.RepoPagingNum,
|
||||
TplName: tplRepos,
|
||||
OnlyShowRelevant: false,
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
ctx.Flash.Success(ctx.Tr("admin.config.repository_setting_success"))
|
||||
ctx.Redirect(setting.AppSubURL + "/admin/repos")
|
||||
|
||||
@@ -142,7 +142,14 @@ func RenderRepoSearch(ctx *context.Context, opts *RepoSearchOptions) {
|
||||
ctx.Data["Page"] = pager
|
||||
|
||||
if ctx.Data["Err_Repo_Size_Limit"] != nil {
|
||||
ctx.RenderWithErr(ctx.Tr("admin.config.invalid_repo_size"), opts.TplName, nil)
|
||||
ctx.RenderWithErr(ctx.Tr("admin.config.invalid_repo_size")+" "+ctx.Data["Err_Repo_Size_Limit"].(string),
|
||||
opts.TplName, nil)
|
||||
return
|
||||
}
|
||||
|
||||
if ctx.Data["Err_Repo_Size_Save"] != nil {
|
||||
ctx.RenderWithErr(ctx.Tr("admin.config.save_repo_size_setting_failed")+" "+ctx.Data["Err_Repo_Size_Save"].(string),
|
||||
opts.TplName, nil)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user