Unverified Commit 38ba3ef1 authored by 悟空's avatar 悟空 Committed by GitHub
Browse files

feature: add field projectTotal in the table-report response (#2919)

* feature: add field projectTotal in the table-report response

* feature: format
parent a4ec147e
Showing with 3 additions and 0 deletions
+3 -0
......@@ -31,6 +31,7 @@ type ResourceOverviewReportDataItem struct {
ProjectName string `json:"projectName,omitempty"`
ProjectDisplayName string `json:"projectDisplayName,omitempty"`
ProjectDesc string `json:"projectDesc,omitempty"`
ProjectTotal uint64 `json:"projectTotal"`
OwnerUserID int64 `json:"ownerUserID"`
OwnerUserName string `json:"ownerUserName"`
OwnerUserNickName string `json:"ownerUserNickname"`
......@@ -54,11 +55,13 @@ func (data *ResourceOverviewReportData) GroupByOwner() {
owner, ok := m[item.OwnerUserName]
if !ok {
owner = &ResourceOverviewReportDataItem{
ProjectTotal: 0,
OwnerUserID: item.OwnerUserID,
OwnerUserName: item.OwnerUserName,
OwnerUserNickName: item.OwnerUserNickName,
}
}
owner.ProjectTotal += 1
owner.CPUQuota += item.CPUQuota
owner.CPURequest += item.CPURequest
owner.MemQuota += item.MemQuota
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment