2022-06-09 18:25:05 +02:00
@using BTCPayServer.Components.StoreSelector
@using BTCPayServer.Components.MainNav
2022-11-22 03:32:19 +09:00
@inject Microsoft.AspNetCore.Http.IHttpContextAccessor _context;
2021-12-11 04:32:23 +01:00
@inject BTCPayServer.Services.BTCPayServerEnvironment _env
2022-01-18 02:20:59 +01:00
@inject SignInManager<ApplicationUser> _signInManager
2021-12-11 04:32:23 +01:00
@inject UserManager<ApplicationUser> _userManager
2021-09-09 23:53:26 +09:00
2021-09-03 09:16:36 +02:00
@{
2024-02-21 14:43:44 +01:00
var user = await _userManager.GetUserAsync(User);
var notificationDisabled = user?.DisabledNotifications == "all";
2022-11-22 03:32:19 +09:00
var expectedScheme = _context.HttpContext.Request.Scheme;
2023-07-02 19:58:11 +02:00
var expectedHost = _context.HttpContext.Request.Host.ToString().ToLower();
2021-09-14 09:44:43 +02:00
}
2017-09-13 15:47:34 +09:00
<!DOCTYPE html>
2021-12-11 04:32:23 +01:00
<html lang="en"@(_env.IsDeveloping ? " data-devenv" : "")>
2017-09-13 15:47:34 +09:00
<head>
2021-05-19 04:39:27 +02:00
<partial name="LayoutHead" />
@await RenderSectionAsync("PageHeadContent", false)
2017-09-13 15:47:34 +09:00
</head>
2021-12-11 04:32:23 +01:00
<body class="d-flex flex-column flex-lg-row min-vh-100">
2023-03-26 13:44:05 +02:00
<header id="mainMenu" class="btcpay-header d-flex flex-column d-print-none" v-pre>
2022-01-24 18:07:52 -08:00
<div id="mainMenuHead">
2022-06-07 13:45:23 +02:00
<button id="mainMenuToggle" class="mainMenuButton" type="button" data-bs-toggle="offcanvas" data-bs-target="#mainNav" aria-controls="mainNav" aria-expanded="false" aria-label="Toggle navigation">
<span>Menu</span>
</button>
2021-12-11 04:32:23 +01:00
<vc:store-selector />
2022-01-18 02:20:59 +01:00
@if (_signInManager.IsSignedIn(User))
{
2023-09-18 10:55:05 +09:00
<component type="typeof(BTCPayServer.Blazor.NotificationsDropDown)" render-mode="ServerPrerendered" />
2022-01-18 02:20:59 +01:00
}
2021-12-11 04:32:23 +01:00
</div>
<vc:main-nav />
</header>
2022-11-22 03:32:19 +09:00
<template id="badUrl">
<div class="alert alert-danger alert-dismissible m-3" role="alert">
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close">
<vc:icon symbol="close"/>
</button>
<span>
BTCPay is expecting you to access this website from <strong>@(expectedScheme)://@(expectedHost)/</strong>.
If you use a reverse proxy, please set the <strong>X-Forwarded-Proto</strong> header to <strong id="browserScheme">@(expectedScheme)</strong>
(<a href="https://docs.btcpayserver.org/FAQ/Deployment/#cause-3-btcpay-is-expecting-you-to-access-this-website-from" target="_blank" class="alert-link" rel="noreferrer noopener">More information</a>)
</span>
</div>
</template>
2021-12-11 04:32:23 +01:00
<main id="mainContent">
2022-11-22 03:32:19 +09:00
@if (!_env.IsSecure(_context.HttpContext))
2021-12-11 04:32:23 +01:00
{
<div id="insecureEnv" class="alert alert-danger alert-dismissible" style="position:absolute; top:75px;" role="alert">
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close">
<vc:icon symbol="close"/>
</button>
<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/>
We disabled the register and login link so you don't leak your credentials.
</span>
</div>
}
<section>
2022-01-24 18:07:52 -08:00
@RenderBody()
2021-12-11 04:32:23 +01:00
</section>
2022-01-11 18:56:30 +01:00
<partial name="_Footer"/>
2021-12-11 04:32:23 +01:00
<partial name="LayoutFoot"/>
2021-09-09 23:53:26 +09:00
2021-05-19 04:39:27 +02:00
@await RenderSectionAsync("PageFootContent", false)
2021-12-11 04:32:23 +01:00
<partial name="LayoutPartials/SyncModal"/>
2021-09-09 23:53:26 +09:00
@if (!notificationDisabled)
{
2021-12-11 04:32:23 +01:00
<script>
2022-11-22 03:32:19 +09:00
var mainContent = document.getElementById("mainContent");
2023-07-02 19:58:11 +02:00
if (window.location.protocol != "@(expectedScheme):" || window.location.host.toLowerCase() != "@expectedHost")
2022-11-22 03:32:19 +09:00
{
var tmpl = document.getElementById("badUrl");
mainContent.prepend(tmpl.content.cloneNode(true));
}
2021-12-11 04:32:23 +01:00
</script>
2021-09-09 23:53:26 +09:00
}
2021-12-11 04:32:23 +01:00
</main>
2017-09-13 15:47:34 +09:00
</body>
</html>