btcpayserver/BTCPayServer/Views/Shared/Ethereum/ETHSyncSummary.cshtml

28 lines
1,012 B
Text
Raw Normal View History

@using BTCPayServer.Services.Altcoins.Ethereum.Services
@inject BTCPayNetworkProvider BTCPayNetworkProvider
@inject EthereumService EthereumService;
@inject SignInManager<ApplicationUser> SignInManager;
@{
var networks = BTCPayNetworkProvider.GetAll().OfType<EthereumBTCPayNetwork>().OrderBy(network => network.ChainId).Where(network => network.ShowSyncSummary);
}
@foreach (var network in networks)
{
<h4>@network.CryptoCode (Chain ID: @network.ChainId) @(network is ERC20BTCPayNetwork is true ? "(ERC20)" : "")</h4>
<ul>
@if (!EthereumService.IsAvailable(network.CryptoCode, out var error))
{
<li>
@(error??"Web3 has not yet been configured")
@if (SignInManager.IsSignedIn(User) && User.IsInRole(Roles.ServerAdmin))
{
<a asp-action="UpdateChainConfig" asp-controller="EthereumConfig" asp-route-chainId="@network.ChainId">Configure Web3</a>
}
</li>
}
</ul>
}