Cloud admin: storage usage dashboard

Đang mở
#791 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
55/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
firebase, typescript
Lĩnh vực
databases, full-stack, security

Hướng nghiên cứu

Start by checking dependency #790 and locating the existing admin entry point, Firestore rules, and manifest data shape. Update firestore.indexes.json for the collection-group query, verify one-shot getDocs behavior and the non-admin rules unit test, then run the relevant tests and scoped mutation coverage. Done means all listed dashboard fields, sorting, aggregate total, and acceptance checks pass.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

enhancement

Summary

Admin-facing view of actual storage consumption across all users, so quotas can be tuned from
evidence rather than guesswork.

Scope

Per-user table showing:

  • used bytes vs quotaBytes (with a percentage / bar)
  • fileCount vs maxFiles
  • lastSeenAt, createdAt, role, disabled
  • sortable by usage so the heaviest users surface first
  • an aggregate total across all users, to compare against the Firebase project's own billing

Acceptance criteria

  • Per-user used/quota bytes and fileCount/maxFiles displayed
  • lastSeenAt displayed
  • Sortable by usage
  • Aggregate total shown
  • Reads use one-shot getDocs, not onSnapshot
  • Rules permit admins to read across users via a collectionGroup query; non-admins denied
  • Rules unit test confirms a non-admin collectionGroup('drive') query is rejected
  • Scoped mutation coverage >= 80%

Implementation notes

  • Usage lives on users/{uid}/drive/manifest, so a collectionGroup('drive') query is the
    natural read. This needs a collection-group index — add it to firestore.indexes.json.
  • Deliberately use one-shot getDocs rather than onSnapshot here. A live listener spanning
    every user's manifest re-reads documents on every change from every user, which is exactly the
    pattern that turns a negligible Firestore bill into a real one. Live listeners are appropriate
    for a single user watching their own drive (#796), not for a dashboard.
  • Paginate if the user count grows; a full scan is acceptable at classroom scale.

Depends on

  • #790

Branching

This issue is part of the Cloud Accounts & Storage
milestone, which uses feat/cloud as its integration branch.

Branch from feat/cloud, and open the PR against feat/cloud. Never against main.

Create the branch (the --base flag also sets the default PR target for this branch):

gh issue develop <number> --base feat/cloud --checkout

Open the PR:

python3 scripts/issue-review.py <number> --base feat/cloud \
  --summary "<summary>" --test-plan "<test-plan>"

feat/cloud merges to main in a single PR once the milestone is complete.

Why both flags are required: gh issue develop without --base branches from the repository
default branch (main), and scripts/issue-review.py falls back to main when --base is
omitted — both for the gh pr create target and for the changed-file list in the PR body.

Ngôn ngữ chính
TypeScript
Star
1
Fork
0
Merge trung bình
1 giờ 41 phút
Pull request đã merge (30 ngày)
1

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của jcollard/LuaInTheWeb

Tất cả issue của jcollard/LuaInTheWeb

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.