Show sync progress for monero and show amount of monero payment

This commit is contained in:
XPayServer 2020-07-11 17:44:27 +02:00
parent aeb90a3674
commit 1c7185a574
3 changed files with 29 additions and 5 deletions

View File

@ -1,6 +1,7 @@
@inject BTCPayServer.HostedServices.NBXplorerDashboard dashboard
@if (!dashboard.IsFullySynched())
@using BTCPayServer.Services.Altcoins.Monero.Services
@inject BTCPayServer.HostedServices.NBXplorerDashboard dashboard
@inject MoneroRPCProvider MoneroRpcProvider
@if (!dashboard.IsFullySynched() || !MoneroRpcProvider.Summaries.All(pair => pair.Value.WalletAvailable))
{
<!-- Modal -->
<div id="modalDialog" class="modal-dialog animated bounceInRight"
@ -76,6 +77,8 @@
}
}
}
<partial name="Monero/MoneroSyncSummary"/>
<p>
<a href="https://www.youtube.com/watch?v=OrYDehC-8TU" target="_blank">Watch this video</a> to understand the importance of blockchain synchronization.
</p>

View File

@ -0,0 +1,20 @@
@using BTCPayServer.Services.Altcoins.Monero.Services
@inject MoneroRPCProvider MoneroRpcProvider
@inject SignInManager<ApplicationUser> SignInManager;
@if (SignInManager.IsSignedIn(User) && User.IsInRole(Roles.ServerAdmin) && MoneroRpcProvider.Summaries.Any())
{
@foreach (var summary in MoneroRpcProvider.Summaries)
{
@if (summary.Value != null)
{
<h4>@summary.Key</h4>
<ul >
<li >Node available: @Model.Summary.DaemonAvailable</li>
<li >Wallet available: @Model.Summary.WalletAvailable (@(Model.WalletFileFound ? "Wallet file present" : "Wallet file not found"))</li>
<li >Last updated: @Model.Summary.UpdatedAt</li>
<li >Synced: @Model.Summary.Synced (@Model.Summary.CurrentHeight / @Model.Summary.TargetHeight)</li>
</ul>
}
}
}

View File

@ -1,5 +1,4 @@
@using System.Globalization
@using BTCPayServer.Controllers
@using BTCPayServer.Services.Altcoins.Monero.Payments
@using BTCPayServer.Services.Altcoins.Monero.UI
@model IEnumerable<BTCPayServer.Services.Invoices.PaymentEntity>
@ -11,7 +10,7 @@
var onChainPaymentData = payment.GetCryptoPaymentData() as MoneroLikePaymentData;
m.Crypto = payment.GetPaymentMethodId().CryptoCode;
m.DepositAddress = onChainPaymentData.GetDestination();
m.Amount = onChainPaymentData.GetValue().ToString(CultureInfo.InvariantCulture);
var confirmationCount = onChainPaymentData.ConfirmationCount;
var network = payment.Network as MoneroLikeSpecificBtcPayNetwork;
if (confirmationCount >= network.MaxTrackedConfirmation)
@ -40,6 +39,7 @@
<tr>
<th>Crypto</th>
<th>Deposit address</th>
<th>Amount</th>
<th>Transaction Id</th>
<th class="text-right">Confirmations</th>
</tr>
@ -50,6 +50,7 @@
<tr >
<td>@payment.Crypto</td>
<td>@payment.DepositAddress</td>
<td>@payment.Amount</td>
<td>
<div class="wraptextAuto">
<a href="@payment.TransactionLink" target="_blank">