Quota UI rework#13449
Conversation
|
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #13449 +/- ##
============================================
- Coverage 18.94% 18.93% -0.01%
- Complexity 18363 18481 +118
============================================
Files 6192 6227 +35
Lines 556361 560407 +4046
Branches 67908 68311 +403
============================================
+ Hits 105397 106110 +713
- Misses 439393 442673 +3280
- Partials 11571 11624 +53
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@winterhazel |
@weizhouapache it is ready. |
|
@blueorangutan package |
|
@winterhazel a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 18419 |
|
@winterhazel a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress. |
|
UI build: ✔️ |
|
@weizhouapache can we run the CI here? |
|
@blueorangutan test |
|
@weizhouapache a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
There was a problem hiding this comment.
Pull request overview
This PR reworks the Quota UI to surface recent Quota API enhancements (multi-period visualization, resource-level breakdown, balance and credits history) and extends backend quota responses to include consumption history and improved credits handling (including projects).
Changes:
- Replaced the legacy Quota Summary/Usage/Balance UI views with new tabbed views supporting period filtering, charts, and CSV export.
- Extended quota statement/statement-item responses with
historyto enable line charts for consumption over time. - Refactored quota credits add/list flows (UI + API) to better support projects and enforcement/min-balance behavior.
Reviewed changes
Copilot reviewed 44 out of 45 changed files in this pull request and generated 18 comments.
Show a summary per file
| File | Description |
|---|---|
| ui/src/views/plugins/quota/QuotaUsageTab.vue | New usage tab with charts, resource drill-down, and export |
| ui/src/views/plugins/quota/QuotaUsage.vue | Removed legacy quota usage view |
| ui/src/views/plugins/quota/QuotaSummaryResource.vue | Removed legacy summary resource wrapper |
| ui/src/views/plugins/quota/QuotaSummary.vue | Removed legacy summary page wrapper |
| ui/src/views/plugins/quota/QuotaCreditTab.vue | New credits history tab with chart and export |
| ui/src/views/plugins/quota/QuotaBalanceTab.vue | New balance history tab with chart and export |
| ui/src/views/plugins/quota/QuotaBalance.vue | Removed legacy quota balance view |
| ui/src/views/plugins/quota/FilterQuotaDataByPeriodView.vue | New shared period selector (preset + custom range) |
| ui/src/views/plugins/quota/EditTariffValueWizard.vue | Removed legacy tariff edit wizard |
| ui/src/views/plugins/quota/EditQuotaTariff.vue | Minor UI cleanup (class removals) |
| ui/src/views/plugins/quota/CreateQuotaTariff.vue | Minor UI cleanup (class removals) |
| ui/src/views/plugins/quota/AddQuotaCredit.vue | New quota credits add popup using ownership selection |
| ui/src/views/AutogenView.vue | QuotaSummary param handling + quota tariff column adjustment |
| ui/src/utils/units.js | Added shared time-unit constants |
| ui/src/utils/quota.js | Added chart colors + quota type lookup helper |
| ui/src/utils/export.js | Added CSV export helper |
| ui/src/utils/date.js | Extracted timezone-offset helper |
| ui/src/utils/chart.js | Added chart helpers (time axis unit selection + colors) |
| ui/src/style/common/common.scss | Added common utility classes used by new UI |
| ui/src/config/section/plugin/quota.js | Rewired quota sections/tabs/actions to new components |
| ui/src/components/view/stats/ResourceStatsLineChart.vue | Allow per-dataset fill override |
| ui/src/components/view/ListView.vue | Adjusted quota summary account linking and email template linking |
| ui/src/components/view/InfoCard.vue | Show quota currency/balance fields; adjust project display |
| ui/src/components/view/DetailsTab.vue | Syntax highlighting for activationRule |
| ui/src/components/view/charts/BarChart.vue | New reusable BarChart wrapper |
| ui/src/components/view/buttons/ExportToCsvButton.vue | New reusable export button |
| ui/src/api/index.js | Allow quotaEmailTemplateList via GET API list |
| ui/public/locales/pt_BR.json | Added/updated quota UI strings |
| ui/public/locales/en.json | Added/updated quota UI strings |
| ui/package.json | Added vue-code-highlight dependency |
| ui/jest.config.js | Allow prism transform for tests |
| server/src/main/java/com/cloud/user/AccountManagerImpl.java | Minor message cleanup in finalizeAccountId |
| plugins/database/quota/src/test/java/org/apache/cloudstack/api/response/QuotaResponseBuilderImplTest.java | Updated/expanded quota response builder tests |
| plugins/database/quota/src/test/java/org/apache/cloudstack/api/command/QuotaCreditsCmdTest.java | Updated credits command test for new builder signature |
| plugins/database/quota/src/main/java/org/apache/cloudstack/api/response/QuotaStatementItemResponse.java | Added history field to statement item |
| plugins/database/quota/src/main/java/org/apache/cloudstack/api/response/QuotaStatementItemResourceResponse.java | Added history field to resource statement item |
| plugins/database/quota/src/main/java/org/apache/cloudstack/api/response/QuotaStatementItemHistoryResponse.java | New response type for consumption history |
| plugins/database/quota/src/main/java/org/apache/cloudstack/api/response/QuotaResponseBuilderImpl.java | Credits refactor + history generation |
| plugins/database/quota/src/main/java/org/apache/cloudstack/api/response/QuotaResponseBuilder.java | Updated credits API to accept command object |
| plugins/database/quota/src/main/java/org/apache/cloudstack/api/command/QuotaCreditsListCmd.java | Added projectid, recursion handling, owner resolution |
| plugins/database/quota/src/main/java/org/apache/cloudstack/api/command/QuotaCreditsCmd.java | Added accountid/projectid support; refactored execute path |
| framework/quota/src/main/java/org/apache/cloudstack/quota/dao/QuotaCreditsDaoImpl.java | Credits query signature refactor (domainIds list) |
| framework/quota/src/main/java/org/apache/cloudstack/quota/dao/QuotaCreditsDao.java | Updated DAO method signature |
| api/src/main/java/org/apache/cloudstack/api/ApiConstants.java | Added HISTORY constant |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Description
This PR is a rework of the Quota UI intended to expose the new functionality added in #9590, #10505, #10506, #12961, and #13236, as well as provide a better visualization of the Quota-related statistics.
With these changes, it is now possible to:
Additionally, some changes were made in
quotaCreditsandquotaCreditsListto allow adding credits to and obtaining the credits addition history for Projects, which has also been exposed in the UI. A new field was also added to the response ofquotaStatementto allow seeing the consumption history as a line chart.Closes #11805.
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Screenshots (if appropriate):
2026-06-18.10-02-25.mp4
How Has This Been Tested?
I manually tested these changes by accessing the summary (consumption, balance, and credits), tariff, and email template pages for admin, domain admin, users, and projects (when applicable) and validating that the expected contents were shown. The credits addition and listing was also tested.