Files
BTCPayServerPlugins/Plugins/BTCPayServer.Plugins.MicroNode/Views/Shared/MicroNode/MicroNodeNav.cshtml
2024-01-17 09:07:18 +01:00

32 lines
1.1 KiB
Plaintext

@using BTCPayServer.Abstractions.Contracts
@using BTCPayServer.Abstractions.Extensions
@using BTCPayServer.Client
@using BTCPayServer.Plugins.MicroNode
@using Microsoft.AspNetCore.Mvc.TagHelpers
@inject IScopeProvider ScopeProvider
@inject MicroNodeService MicroNodeService
@{
var storeId = ScopeProvider.GetCurrentStoreId();
}
@if (!string.IsNullOrEmpty(storeId))
{
var masters = (await MicroNodeService.GetMasterSettings()).Select(m => new SelectListItem(m.Value.Name, m.Key)).ToArray();
@if (masters.Any())
{
<li class="nav-item">
<a permission="@Policies.CanModifyStoreSettings" asp-controller="MicroNode" asp-action="Configure" asp-route-storeId="@storeId" class="nav-link @ViewData.IsActivePage("MicroNode")" id="Nav-MicroNode">
<span>MicroNode</span>
</a>
</li>
}
<li class="nav-item">
<a permission="@Policies.CanModifyStoreSettings" asp-controller="MicroNode" asp-action="ConfigureMaster" asp-route-storeId="@storeId" class="nav-link @ViewData.IsActivePage("MicroNodeMaster")" id="Nav-MicroNodeMaster">
<span>MicroNode Master</span>
</a>
</li>
}