Files
btcpayserver/BTCPayServer/Views/UIStores/ImportWallet/Hardware.cshtml
Nicolas Dorier 2f26979ed7 Refactor vault (#6678)
* Use Blazor for the Vault code

* Put elements in different file

* Controller abstraction

* Break into VaultElement
2025-04-21 17:09:46 +09:00

52 lines
1.9 KiB
Plaintext

@using BTCPayServer.Abstractions.TagHelpers
@using BTCPayServer.Blazor
@using BTCPayServer.Blazor.VaultBridge
@using BTCPayServer.TagHelpers
@using Microsoft.AspNetCore.Mvc.TagHelpers
@model WalletSetupViewModel
@{
Layout = "_LayoutWalletSetup";
ViewData.SetActivePage(StoreNavPages.OnchainSettings, StringLocalizer["Connect your hardware wallet"], $"{Context.GetStoreData().Id}-{Model.CryptoCode}");
this.ViewData.SetBlazorAllowed(true);
}
@section Navbar {
<a asp-controller="UIStores" asp-action="ImportWallet" asp-route-storeId="@Model.StoreId" asp-route-cryptoCode="@Model.CryptoCode" asp-route-method="">
<vc:icon symbol="back" />
</a>
}
<header class="text-center">
<h1>@ViewData["Title"]</h1>
<p class="lead text-secondary mt-3" text-translate="true">In order to securely connect to your hardware wallet you must first download, install, and run the BTCPay Server Vault.</p>
</header>
<div class="row mt-5 mb-4">
<div class="col-md-8 mx-auto">
<component type="typeof(VaultBridgeUI)"
param-Controller=@(new GetXPubController()
{
CryptoCode = Context.GetRouteValue("cryptoCode")?.ToString(),
})
render-mode="Server"/>
</div>
</div>
<form id="walletInfo" method="post" asp-controller="UIStores" asp-action="UpdateWallet" asp-route-storeId="@Model.StoreId" asp-route-cryptoCode="@Model.CryptoCode">
<input asp-for="Config" type="hidden" />
<input asp-for="Confirmation" type="hidden" value="true" />
</form>
@section PageFootContent {
<script src="~/js/vaultbridge.js" asp-append-version="true"></script>
<script>
vault.setXPub = function (xpub)
{
$("#Config").val(xpub.config);
$("#walletInfo").submit();
}
</script>
}