btcpayserver/BTCPayServer/Components/StoreLightningServices/Default.cshtml
d11n 479f21f4f3
Dashboard: Add Lightning balances and services (#3838)
* Update Lightning lib

* Refactoring: Move Lightning methods and props to ExternalServices

* Rename Lightning services

* Add Lightning balance to dashboard

* Split Lightning dashboard tiles

* View updates
2022-06-14 14:36:22 +09:00

36 lines
1.9 KiB
Text

@using Microsoft.AspNetCore.Mvc.TagHelpers
@model BTCPayServer.Components.StoreLightningServices.StoreLightningServicesViewModel
@if (Model.Services != null && Model.Services.Any())
{
<div id="StoreLightningServices-@Model.Store.Id" class="widget store-lightning-services">
<header class="mb-4">
<h6>Lightning Services</h6>
<a class asp-controller="UIStores" asp-action="Lightning" asp-route-storeId="@Model.Store.Id" asp-route-cryptoCode="@Model.CryptoCode">Details</a>
</header>
<div id="Services" class="services-list">
@foreach (var service in Model.Services)
{
@if (!string.IsNullOrEmpty(service.Error))
{
<div class="service" id="@($"Service-{service.ServiceName}")">
<img src="@($"~/img/{service.Type.ToLower()}.png")" asp-append-version="true" alt="@service.DisplayName" />
<small class="d-block mt-3 lh-sm fw-semibold text-danger">@service.Error</small>
</div>
}
else if (string.IsNullOrEmpty(service.Link))
{
<a asp-controller="UIServer" asp-action="Service" asp-route-serviceName="@service.ServiceName" asp-route-cryptoCode="@service.CryptoCode" class="service" id="@($"Service-{service.ServiceName}")">
<img src="@($"~/img/{service.Type.ToLower()}.png")" asp-append-version="true" alt="@service.DisplayName" />
</a>
}
else
{
<a href="@service.Link" target="_blank" rel="noreferrer noopener" class="service" id="@($"Service-{service.ServiceName}")">
<img src="@($"~/img/{service.Type.ToLower()}.png")" asp-append-version="true" alt="@service.DisplayName" />
</a>
}
}
</div>
</div>
}