multinode/console: held amount summary use satellite address

Change-Id: I7816a263579831eaaeb808e3cdd49b3b7b0a07b8
This commit is contained in:
Yaroslav Vorobiov 2021-06-02 22:18:22 +03:00 committed by NickolaiYurchenko
parent d674bc9c52
commit b23a782c6b
6 changed files with 12 additions and 15 deletions

View File

@ -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
}
}

View File

@ -28,7 +28,7 @@ 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"`
SatelliteAddress string `json:"satelliteAddress"`
FirstQuarter int64 `json:"firstQuarter"`
SecondQuarter int64 `json:"secondQuarter"`
ThirdQuarter int64 `json:"thirdQuarter"`

View File

@ -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()
}
}

View File

@ -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,

View File

@ -14,7 +14,7 @@
<tbody slot="body">
<tr class="table-item" v-for="(heldHistoryItem, index) in heldHistory" :key="index">
<th class="align-left">
<p class="table-item__name">{{ heldHistoryItem.satelliteName }}</p>
<p class="table-item__name">{{ heldHistoryItem.satelliteAddress }}</p>
<p class="table-item__months">{{ heldHistoryItem.monthsCount }}</p>
</th>
<th>{{ heldHistoryItem.firstQuarter | centsToDollars }}</th>

View File

@ -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,