Overall Done for Global Repo Size Limit Option

This commit is contained in:
truecode112
2023-05-15 17:07:21 +00:00
committed by DmitryFrolovTri
parent 66c476e5de
commit d843a6736b
6 changed files with 30 additions and 13 deletions
-3
View File
@@ -66,9 +66,6 @@ func UpdateRepoPost(ctx *context.Context) {
}
setting.SaveGlobalRepositorySetting(form.EnableSizeLimit, repo_size_limit)
ctx.Flash.Success(ctx.Tr("admin.config.repository_setting_success"))
ctx.Data["RepoSizeLimit"] = base.FileSize(setting.RepoSizeLimit)
ctx.Flash.Success(ctx.Tr("admin.config.repository_setting_success"))
ctx.Redirect(setting.AppSubURL + "/admin/repos")
+3 -1
View File
@@ -67,7 +67,9 @@ func SettingsCtxData(ctx *context.Context) {
ctx.Data["DisableNewPushMirrors"] = setting.Mirror.DisableNewPush
ctx.Data["DefaultMirrorInterval"] = setting.Mirror.DefaultInterval
ctx.Data["MinimumMirrorInterval"] = setting.Mirror.MinInterval
ctx.Data["Err_RepoSize"] = ctx.Repo.Repository.RepoSizeIsOversized(ctx.Repo.Repository.SizeLimit / 10) // less than 10% left
ctx.Data["Err_RepoSize"] = ctx.Repo.Repository.RepoSizeIsOversized(ctx.Repo.Repository.GetActualSizeLimit() / 10) // less than 10% left
ctx.Data["ActualSizeLimit"] = ctx.Repo.Repository.GetActualSizeLimit()
ctx.Data["EnableSizeLimit"] = setting.EnableSizeLimit
signing, _ := asymkey_service.SigningKey(ctx, ctx.Repo.Repository.RepoPath())
ctx.Data["SigningKeyAvailable"] = len(signing) > 0