mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-20 13:34:37 +01:00
Do not activate Blazor in Wizard screens (#5435)
This commit is contained in:
parent
b702621a04
commit
609ec0989f
6 changed files with 31 additions and 18 deletions
|
@ -20,6 +20,15 @@ namespace BTCPayServer.Abstractions.Extensions
|
|||
Relative
|
||||
}
|
||||
|
||||
public static void SetBlazorAllowed(this ViewDataDictionary viewData, bool allowed)
|
||||
{
|
||||
viewData["BlazorAllowed"] = allowed;
|
||||
}
|
||||
public static bool IsBlazorAllowed(this ViewDataDictionary viewData)
|
||||
{
|
||||
return viewData["BlazorAllowed"] is not false;
|
||||
}
|
||||
|
||||
public static void SetActivePage<T>(this ViewDataDictionary viewData, T activePage, string title = null, string activeId = null)
|
||||
where T : IConvertible
|
||||
{
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<script src="~/vendor/flatpickr/flatpickr.js" asp-append-version="true"></script>
|
||||
<script src="~/js/copy-to-clipboard.js" asp-append-version="true"></script>
|
||||
<script src="~/main/utils.js" asp-append-version="true"></script>
|
||||
@if (User.Identity.IsAuthenticated)
|
||||
@if (User.Identity.IsAuthenticated && ViewData.IsBlazorAllowed())
|
||||
{
|
||||
<script src="~/_blazorfiles/_framework/blazor.server.js" autostart="false" asp-append-version="true"></script>
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
@{
|
||||
Layout = "_LayoutSimple";
|
||||
@{
|
||||
Layout = "_LayoutSimple";
|
||||
ViewData.SetBlazorAllowed(false);
|
||||
}
|
||||
|
||||
@section PageHeadContent {
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
return status.ToString().ToLowerInvariant();
|
||||
}
|
||||
}
|
||||
ViewData.SetBlazorAllowed(false);
|
||||
}
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
|
|
@ -7,22 +7,23 @@
|
|||
@inject DisplayFormatter DisplayFormatter
|
||||
@model BTCPayServer.Models.ViewPullPaymentModel
|
||||
@{
|
||||
ViewData["Title"] = Model.Title;
|
||||
ViewData["Title"] = Model.Title;
|
||||
Csp.UnsafeEval();
|
||||
Layout = null;
|
||||
string StatusTextClass(string status)
|
||||
{
|
||||
switch (status)
|
||||
{
|
||||
case "Completed":
|
||||
case "In Progress":
|
||||
return "bg-success";
|
||||
case "Cancelled":
|
||||
return "bg-danger";
|
||||
default:
|
||||
return "bg-warning";
|
||||
}
|
||||
}
|
||||
Layout = null;
|
||||
string StatusTextClass(string status)
|
||||
{
|
||||
switch (status)
|
||||
{
|
||||
case "Completed":
|
||||
case "In Progress":
|
||||
return "bg-success";
|
||||
case "Cancelled":
|
||||
return "bg-danger";
|
||||
default:
|
||||
return "bg-warning";
|
||||
}
|
||||
}
|
||||
ViewData.SetBlazorAllowed(false);
|
||||
}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" @(Env.IsDeveloping ? " data-devenv" : "")>
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
@using BTCPayServer.Models.StoreViewModels
|
||||
@using BTCPayServer.Data
|
||||
@using Microsoft.AspNetCore.Routing;
|
||||
@using BTCPayServer.Abstractions.Extensions;
|
||||
@inject Safe Safe
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@addTagHelper *, BTCPayServer
|
||||
|
|
Loading…
Add table
Reference in a new issue