multinode/console: held amount summary use satellite address
Change-Id: I7816a263579831eaaeb808e3cdd49b3b7b0a07b8
This commit is contained in:
parent
d674bc9c52
commit
b23a782c6b
@ -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
|
||||
}
|
||||
}
|
||||
|
@ -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.
|
||||
|
@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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,
|
||||
|
@ -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>
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user