mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-03-15 08:01:44 -05:00
Add UI to the quota feature to see what quotas applies to you and if you're exceeding any quota, it's designed to be a general size overview although it's exclusively filled with quota features for now. There's also no UI to see what item is actually taking in the most size. Purely an quota overview. Screenshots:   With inspiration from concept by 0ko:  Co-authored-by: Otto Richter <git@otto.splvs.net> Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6602 Reviewed-by: Otto <otto@codeberg.org> Co-authored-by: Gusted <postmaster@gusted.xyz> Co-committed-by: Gusted <postmaster@gusted.xyz>
25 lines
522 B
Go
25 lines
522 B
Go
// Copyright 2024 The Forgejo Authors. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package quota
|
|
|
|
import (
|
|
"code.gitea.io/gitea/modules/setting"
|
|
)
|
|
|
|
func EvaluateDefault(used Used, forSubject LimitSubject) (bool, int64) {
|
|
groups := GroupList{
|
|
&Group{
|
|
Name: "builtin-default-group",
|
|
Rules: []Rule{
|
|
{
|
|
Name: "builtin-default-rule",
|
|
Limit: setting.Quota.Default.Total,
|
|
Subjects: LimitSubjects{LimitSubjectSizeAll},
|
|
},
|
|
},
|
|
},
|
|
}
|
|
|
|
return groups.Evaluate(used, forSubject)
|
|
}
|