From b23a782c6bb9b9b81fb09c7ec7a6819a5197a53c Mon Sep 17 00:00:00 2001 From: Yaroslav Vorobiov Date: Wed, 2 Jun 2021 22:18:22 +0300 Subject: [PATCH] multinode/console: held amount summary use satellite address Change-Id: I7816a263579831eaaeb808e3cdd49b3b7b0a07b8 --- multinode/console/controllers/payouts.go | 4 ++-- multinode/payouts/payouts.go | 12 ++++++------ multinode/payouts/service.go | 5 +---- web/multinode/src/api/payouts.ts | 2 +- .../payouts/tables/heldHistory/HeldHistory.vue | 2 +- web/multinode/src/payouts/index.ts | 2 +- 6 files changed, 12 insertions(+), 15 deletions(-) diff --git a/multinode/console/controllers/payouts.go b/multinode/console/controllers/payouts.go index f6635e036..a024235a5 100644 --- a/multinode/console/controllers/payouts.go +++ b/multinode/console/controllers/payouts.go @@ -420,13 +420,13 @@ func (controller *Payouts) HeldAmountSummary(w http.ResponseWriter, r *http.Requ return } - controller.log.Error("held amount history internal error", zap.Error(err)) + controller.log.Error("held amount history internal error", zap.Error(ErrPayouts.Wrap(err))) controller.serveError(w, http.StatusInternalServerError, ErrPayouts.Wrap(err)) return } if err = json.NewEncoder(w).Encode(heldSummary); err != nil { - controller.log.Error("failed to write json response", zap.Error(err)) + controller.log.Error("failed to write json response", zap.Error(ErrPayouts.Wrap(err))) return } } diff --git a/multinode/payouts/payouts.go b/multinode/payouts/payouts.go index d7824877e..aaf0ef6c4 100644 --- a/multinode/payouts/payouts.go +++ b/multinode/payouts/payouts.go @@ -27,12 +27,12 @@ type HeldAmount struct { // HeldAmountSummary contains held amount summary for first 3 quarters. type HeldAmountSummary struct { - SatelliteID storj.NodeID `json:"satelliteId"` - SatelliteURL storj.NodeURL `json:"satelliteUrl"` - FirstQuarter int64 `json:"firstQuarter"` - SecondQuarter int64 `json:"secondQuarter"` - ThirdQuarter int64 `json:"thirdQuarter"` - PeriodCount int `json:"periodCount"` + SatelliteID storj.NodeID `json:"satelliteId"` + SatelliteAddress string `json:"satelliteAddress"` + FirstQuarter int64 `json:"firstQuarter"` + SecondQuarter int64 `json:"secondQuarter"` + ThirdQuarter int64 `json:"thirdQuarter"` + PeriodCount int `json:"periodCount"` } // NodeSummary contains node's payout information. diff --git a/multinode/payouts/service.go b/multinode/payouts/service.go index b5b10e432..651fd2014 100644 --- a/multinode/payouts/service.go +++ b/multinode/payouts/service.go @@ -399,10 +399,7 @@ func (service *Service) HeldAmountSummary(ctx context.Context, nodeID storj.Node for _, trustedSatellite := range trustedSatellites { if satelliteSummary.SatelliteID.Compare(trustedSatellite.NodeId) == 0 { - satelliteSummary.SatelliteURL = storj.NodeURL{ - ID: trustedSatellite.NodeId, - Address: trustedSatellite.GetAddress(), - } + satelliteSummary.SatelliteAddress = trustedSatellite.GetAddress() } } diff --git a/web/multinode/src/api/payouts.ts b/web/multinode/src/api/payouts.ts index 7c5b66c4b..dedde95fe 100644 --- a/web/multinode/src/api/payouts.ts +++ b/web/multinode/src/api/payouts.ts @@ -174,7 +174,7 @@ export class PayoutsClient extends APIClient { const result = await response.json(); return result.map(heldHistoryItem => new HeldAmountSummary( - heldHistoryItem.satelliteUrl.Address, + heldHistoryItem.satelliteAddress, heldHistoryItem.firstQuarter, heldHistoryItem.secondQuarter, heldHistoryItem.thirdQuarter, diff --git a/web/multinode/src/app/components/payouts/tables/heldHistory/HeldHistory.vue b/web/multinode/src/app/components/payouts/tables/heldHistory/HeldHistory.vue index 18e446c0c..09d461509 100644 --- a/web/multinode/src/app/components/payouts/tables/heldHistory/HeldHistory.vue +++ b/web/multinode/src/app/components/payouts/tables/heldHistory/HeldHistory.vue @@ -14,7 +14,7 @@ -

{{ heldHistoryItem.satelliteName }}

+

{{ heldHistoryItem.satelliteAddress }}

{{ heldHistoryItem.monthsCount }}

{{ heldHistoryItem.firstQuarter | centsToDollars }} diff --git a/web/multinode/src/payouts/index.ts b/web/multinode/src/payouts/index.ts index 6f07fb51e..1387e6586 100644 --- a/web/multinode/src/payouts/index.ts +++ b/web/multinode/src/payouts/index.ts @@ -94,7 +94,7 @@ export class NodePayouts { */ export class HeldAmountSummary { public constructor( - public satelliteName: string = '', + public satelliteAddress: string = '', public firstQuarter: number = 0, public secondQuarter: number = 0, public thirdQuarter: number = 0,