feat(ui): add quota overview (#6602)
Some checks are pending
/ release (push) Waiting to run
testing / backend-checks (push) Has been skipped
testing / frontend-checks (push) Has been skipped
testing / test-unit (push) Has been skipped
testing / test-e2e (push) Has been skipped
testing / test-mysql (push) Has been skipped
testing / test-pgsql (push) Has been skipped
testing / test-sqlite (push) Has been skipped
testing / test-remote-cacher (redis) (push) Has been skipped
testing / test-remote-cacher (valkey) (push) Has been skipped
testing / test-remote-cacher (garnet) (push) Has been skipped
testing / test-remote-cacher (redict) (push) Has been skipped
testing / security-check (push) Has been skipped

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:
![](https://codeberg.org/attachments/9f7480f2-4c31-4d70-8aec-61db79282a1e)
![](https://codeberg.org/attachments/0bd45bf3-28c5-47bf-8fff-c4ae9f38cb28)

With inspiration from concept by 0ko:
![](https://codeberg.org/attachments/b8154a52-6fba-42fc-a4a8-b3ab1527fb33)

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>
This commit is contained in:
Gusted 2025-02-26 14:36:53 +00:00 committed by 0ko
parent 6dad457552
commit 77a1af5ab8
24 changed files with 348 additions and 33 deletions

View file

@ -37,6 +37,7 @@ func TestMain(m *testing.M) {
defer cancel()
tests.InitTest(true)
setting.Quota.Enabled = true
initChangedFiles()
testE2eWebRoutes = routers.NormalRoutes()

View file

@ -0,0 +1,12 @@
-
id: 1001
uuid: 5792c349-8a26-46b8-b4cd-2c290f118285
repo_id: 1
issue_id: 1
release_id: 0
uploader_id: 3
comment_id: 1
name: forgejo-secrets.txt
download_count: 0
size: 536870911
created_unix: 1730000000

View file

@ -0,0 +1 @@
- name: trusted-user

View file

@ -0,0 +1,5 @@
-
id: 1001
kind: 0
mapped_id: 2
group_name: trusted-user

View file

@ -0,0 +1,14 @@
-
id: 1001
group_name: trusted-user
rule_name: git-lfs
-
id: 1002
group_name: trusted-user
rule_name: "all:assets"
-
id: 1003
group_name: trusted-user
rule_name: "Multi subjects"

View file

@ -0,0 +1,13 @@
-
name: git-lfs
limit: 512
subjects: [6]
-
name: "all:assets"
limit: -1
subjects: [7]
- name: "Multi subjects"
limit: 5000000000
subjects: [8,6]

View file

@ -0,0 +1,12 @@
-
id: 1001
owner_id: 2
owner_name: user2
lower_name: large-lfs
name: large-lfs
default_branch: main
is_empty: false
is_archived: false
is_private: true
status: 0
lfs_size: 8192

View file

@ -63,3 +63,12 @@ test('User: Profile settings', async ({browser}, workerInfo) => {
await page.goto('/user2?tab=activity');
await expect(page.getByText('Your activity is visible to everyone')).toBeVisible();
});
test('User: Storage overview', async ({browser}, workerInfo) => {
const page = await login({browser}, workerInfo);
await page.goto('/user/settings/storage_overview');
await page.waitForLoadState();
await page.getByLabel('Git LFS 8 KiB').nth(1).hover({position: {x: 250, y: 2}});
await expect(page.getByText('Git LFS')).toBeVisible();
await save_visual(page);
});