2017-09-13 08:47:34 +02:00
@inject SignInManager<ApplicationUser> SignInManager
@inject UserManager<ApplicationUser> UserManager
2017-09-15 12:08:31 +02:00
@inject RoleManager<IdentityRole> RoleManager
2017-10-27 05:08:18 +02:00
@inject BTCPayServer.Services.BTCPayServerEnvironment env
2018-01-07 20:14:35 +01:00
@inject BTCPayServer.HostedServices.NBXplorerDashboard dashboard
2018-04-13 23:15:03 +02:00
@inject BTCPayServer.HostedServices.CssThemeManager themeManager
2018-04-29 13:48:17 +02:00
2017-09-13 08:47:34 +02:00
<!DOCTYPE html>
<html lang="en">
<head>
2019-11-06 04:19:06 +01:00
<partial name="Header" />
2018-08-22 11:10:46 +02:00
@RenderSection("HeadScripts", required: false)
2018-11-19 05:20:48 +01:00
@RenderSection("HeaderContent", false)
2017-09-13 08:47:34 +02:00
</head>
<body id="page-top">
2017-10-27 10:53:04 +02:00
@{
2018-09-22 08:08:27 +02:00
if (ViewBag.AlwaysShrinkNavBar == null)
2017-10-27 10:53:04 +02:00
{
ViewBag.AlwaysShrinkNavBar = true;
}
var additionalStyle = ViewBag.AlwaysShrinkNavBar ? "navbar-shrink always-shrinked" : "";
}
<!-- Navigation -->
2019-02-26 06:08:03 +01:00
<nav class='navbar navbar-expand-lg navbar-dark fixed-top @additionalStyle' id="mainNav">
2017-10-27 10:53:04 +02:00
<div class="container">
2018-01-17 08:34:01 +01:00
<a class="navbar-brand js-scroll-trigger" href="~/">
2019-11-06 15:25:56 +01:00
<img src="~/img/btcpay-logo-white-txt.svg" height="45">
2018-09-22 08:08:27 +02:00
@if (env.NetworkType != NBitcoin.NetworkType.Mainnet)
2018-01-17 08:34:01 +01:00
{
2018-04-19 10:06:08 +02:00
<span class="badge badge-warning" style="font-size:10px;">@env.NetworkType.ToString()</span>
2018-01-17 08:34:01 +01:00
}
</a>
2019-03-18 09:07:39 +01:00
@if (env.OnionUrl != null)
{
<span>
<a href="@env.OnionUrl" target="_blank">
<img src="~/img/icons/onion.svg" width="26" height="32" />
</a>
</span>
}
2017-10-27 10:53:04 +02:00
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav ml-auto">
2018-09-22 08:08:27 +02:00
@if (SignInManager.IsSignedIn(User))
2018-04-13 23:15:03 +02:00
{
2019-03-09 16:29:04 +01:00
if (User.IsInRole(Roles.ServerAdmin))
2018-04-13 23:15:03 +02:00
{
2019-05-13 10:59:15 +02:00
<li class="nav-item"><a asp-area="" asp-controller="Server" asp-action="ListUsers" class="nav-link js-scroll-trigger" id="ServerSettings">Server settings</a></li>
2018-04-13 23:15:03 +02:00
}
2019-05-12 10:13:26 +02:00
<li class="nav-item"><a asp-area="" asp-controller="UserStores" asp-action="ListStores" class="nav-link js-scroll-trigger" id="Stores">Stores</a></li>
<li class="nav-item"><a asp-area="" asp-controller="Apps" asp-action="ListApps" class="nav-link js-scroll-trigger" id="Apps">Apps</a></li>
<li class="nav-item"><a asp-area="" asp-controller="Wallets" asp-action="ListWallets" class="nav-link js-scroll-trigger" id="Wallets">Wallets</a></li>
<li class="nav-item"><a asp-area="" asp-controller="Invoice" asp-action="ListInvoices" class="nav-link js-scroll-trigger" id="Invoices">Invoices</a></li>
<li class="nav-item"><a asp-area="" asp-controller="PaymentRequest" asp-action="GetPaymentRequests" class="nav-link js-scroll-trigger" id="PaymentRequests">Payment Requests</a></li>
2018-04-13 23:15:03 +02:00
<li class="nav-item">
2019-05-12 10:13:26 +02:00
<a asp-area="" asp-controller="Manage" asp-action="Index" title="My settings" class="nav-link js-scroll-trigger" id="MySettings"><i class="fa fa-user"></i></a>
2018-04-13 23:15:03 +02:00
</li>
<li class="nav-item">
2019-05-12 10:13:26 +02:00
<a asp-area="" asp-controller="Account" asp- asp-action="Logout" title="Logout" class="nav-link js-scroll-trigger" id="Logout"><i class="fa fa-sign-out"></i></a>
2018-04-13 23:15:03 +02:00
</li>}
2019-04-04 07:28:11 +02:00
else if (env.IsSecure)
2018-04-13 23:15:03 +02:00
{
2019-03-09 16:29:04 +01:00
if (themeManager.ShowRegister)
2018-05-10 09:02:49 +02:00
{
2019-05-12 10:13:26 +02:00
<li class="nav-item"><a asp-area="" asp-controller="Account" asp-action="Register" class="nav-link js-scroll-trigger" id="Register">Register</a></li>
2018-05-10 09:02:49 +02:00
}
2019-05-12 10:13:26 +02:00
<li class="nav-item"><a asp-area="" asp-controller="Account" asp-action="Login" class="nav-link js-scroll-trigger" id="Login">Log in</a></li>
2019-04-04 07:28:11 +02:00
}
2017-10-27 10:53:04 +02:00
</ul>
</div>
2018-07-11 15:40:10 +02:00
<div id="badUrl" class="alert alert-danger alert-dismissible" style="display:none; position:absolute; top:75px;" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
2019-03-04 09:25:01 +01:00
<span>BTCPay is expecting you to access this website from <b>@(env.ExpectedProtocol)://@(env.ExpectedHost)/</b>. If you use a reverse proxy, please set the <b>X-Forwarded-Proto</b> header to <b id="browserScheme">@(env.ExpectedProtocol)</b> (<a href="https://docs.btcpayserver.org/faq-and-common-issues/faq-deployment#btcpay-is-expecting-you-to-access-this-website-from" target="_blank">More information</a>)</span>
2018-07-11 15:40:10 +02:00
</div>
2019-04-04 07:28:11 +02:00
@if (!env.IsSecure)
{
<div class="alert alert-danger alert-dismissible" style="position:absolute; top:75px;" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
2019-10-26 21:20:39 +02:00
<span>Your access to BTCPay Server is over an unsecured network. If you are using the docker deployment method with NGINX and HTTPS is not available, you probably did not configure your DNS settings correctly. <br />
2019-04-04 07:28:11 +02:00
We disabled the register and login link so you don't leak your credentials.</span>
</div>
}
2017-10-27 10:53:04 +02:00
</div>
</nav>
2018-07-11 15:40:10 +02:00
2017-10-27 10:53:04 +02:00
@RenderBody()
2017-12-16 17:04:20 +01:00
2018-09-22 08:08:27 +02:00
@if (User.Identity.IsAuthenticated)
{
<footer class="siteFooter bg-dark text-white">
<div class="container text-right">@env.ToString()</div>
</footer>
}
2017-10-27 10:53:04 +02:00
2018-09-22 08:08:27 +02:00
@if (!dashboard.IsFullySynched())
2017-12-16 18:07:11 +01:00
{
2018-05-08 10:57:53 +02:00
<partial name="SyncModal" />
2017-12-16 18:07:11 +01:00
}
2017-10-27 10:53:04 +02:00
@RenderSection("Scripts", required: false)
2018-07-11 15:40:10 +02:00
2019-08-10 07:05:11 +02:00
<script type="text/javascript">
var expectedDomain = @Safe.Json(env.ExpectedHost);
var expectedProtocol = @Safe.Json(env.ExpectedProtocol);
2018-07-11 15:40:10 +02:00
if (window.location.host != expectedDomain || window.location.protocol != expectedProtocol + ":") {
document.getElementById("badUrl").style.display = "block";
2019-03-04 09:25:01 +01:00
document.getElementById("browserScheme").innerText = window.location.protocol.substr(0, window.location.protocol.length -1);
2018-07-11 15:40:10 +02:00
}
2019-08-10 07:05:11 +02:00
</script>
2017-09-13 08:47:34 +02:00
</body>
</html>