mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2026-01-03 14:14:28 +01:00
Streamline views
This commit is contained in:
committed by
Andrew Camilleri
parent
b4c1f695a8
commit
bf5ea23bc6
@@ -1,29 +1,9 @@
|
||||
@model WalletPSBTViewModel
|
||||
@addTagHelper *, BundlerMinifier.TagHelpers
|
||||
@{
|
||||
var isReady = !Model.HasErrors;
|
||||
Layout = "_LayoutWizard";
|
||||
ViewData.SetActivePageAndTitle(WalletsNavPages.PSBT, "PSBT", Context.GetStoreData().StoreName);
|
||||
}
|
||||
|
||||
@section PageHeadContent {
|
||||
<link rel="stylesheet" href="~/vendor/highlightjs/default.min.css" asp-append-version="true">
|
||||
<link href="~/vendor/vue-qrcode-reader/vue-qrcode-reader.css" rel="stylesheet" asp-append-version="true"/>
|
||||
}
|
||||
|
||||
@section PageFootContent {
|
||||
<script src="~/vendor/highlightjs/highlight.min.js" asp-append-version="true"></script>
|
||||
<bundle name="wwwroot/bundles/camera-bundle.min.js"></bundle>
|
||||
<script>
|
||||
hljs.initHighlightingOnLoad();
|
||||
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
initQRShow("Scan PSBT", @Json.Serialize(Model.PSBTHex), "scan-qr-modal");
|
||||
initCameraScanningApp("Scan PSBT", function (data){
|
||||
$("textarea[name=PSBT]").val(data);
|
||||
$("#Decode").click();
|
||||
}, "scanModal");
|
||||
});
|
||||
</script>
|
||||
ViewData.SetActivePageAndTitle(WalletsNavPages.PSBT, isReady ? "Transaction Broadcasting" : "Transaction Details", Context.GetStoreData().StoreName);
|
||||
}
|
||||
|
||||
@section Navbar {
|
||||
@@ -35,51 +15,33 @@
|
||||
</a>
|
||||
}
|
||||
|
||||
<header class="text-center">
|
||||
<header class="text-center mb-3">
|
||||
<h1>@ViewData["PageTitle"]</h1>
|
||||
<p class="lead text-secondary mt-3">
|
||||
You can either sign the PSBT or export and update it.
|
||||
</p>
|
||||
@if (Model.CanCalculateBalance)
|
||||
{
|
||||
<p class="lead text-secondary mt-3">
|
||||
If you broadcast this transaction, your balance will change:
|
||||
<br>
|
||||
@if (Model.Positive)
|
||||
{
|
||||
<span class="text-success">@Model.BalanceChange</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span class="text-danger">@Model.BalanceChange</span>
|
||||
}
|
||||
</p>
|
||||
}
|
||||
</header>
|
||||
|
||||
<partial name="_PSBTInfo" model="Model" />
|
||||
|
||||
@if (Model.HasErrors)
|
||||
@if (!isReady)
|
||||
{
|
||||
<form method="post" asp-action="WalletPSBT" asp-route-walletId="@Context.GetRouteValue("walletId")">
|
||||
<form method="post" asp-action="WalletPSBT" asp-route-walletId="@Context.GetRouteValue("walletId")" class="mt-5">
|
||||
<input type="hidden" asp-for="CryptoCode"/>
|
||||
<input type="hidden" asp-for="NBXSeedAvailable"/>
|
||||
<input type="hidden" asp-for="PSBT"/>
|
||||
<input type="hidden" asp-for="FileName"/>
|
||||
<div class="d-flex justify-content-center">
|
||||
<div class="d-flex align-items-center justify-content-center">
|
||||
<button type="submit" id="SignTransaction" name="command" value="@(Model.NBXSeedAvailable ? "nbx-seed" : "sign")" class="btn btn-primary me-2">Sign transaction</button>
|
||||
<button type="submit" name="command" value="update" class="btn btn-secondary me-2">Update</button>
|
||||
<button type="submit" name="command" value="combine" class="btn btn-secondary">Combine</button>
|
||||
<button type="submit" name="command" value="update" class="btn btn-secondary me-2">Update PSBT</button>
|
||||
<button type="submit" name="command" value="combine" class="btn btn-secondary">Combine PSBT</button>
|
||||
</div>
|
||||
</form>
|
||||
}
|
||||
else
|
||||
{
|
||||
<form method="post" asp-action="WalletPSBTReady" asp-route-walletId="@Context.GetRouteValue("walletId")">
|
||||
<form method="post" asp-action="WalletPSBTReady" asp-route-walletId="@Context.GetRouteValue("walletId")" class="mt-5">
|
||||
<input type="hidden" asp-for="SigningKey" />
|
||||
<input type="hidden" asp-for="SigningKeyPath" />
|
||||
<partial name="SigningContext" for="SigningContext" />
|
||||
<div class="d-flex justify-content-center">
|
||||
<div class="d-flex align-items-center justify-content-center">
|
||||
@if (!string.IsNullOrEmpty(Model.SigningContext?.PayJoinBIP21))
|
||||
{
|
||||
<button type="submit" class="btn btn-primary" name="command" value="payjoin">Broadcast (Payjoin)</button>
|
||||
@@ -88,33 +50,8 @@ else
|
||||
}
|
||||
else
|
||||
{
|
||||
<button type="submit" class="btn btn-primary" name="command" value="broadcast">Broadcast it</button>
|
||||
<button type="submit" class="btn btn-primary" name="command" value="broadcast">Broadcast transaction</button>
|
||||
}
|
||||
</div>
|
||||
</form>
|
||||
}
|
||||
|
||||
<p class="my-5 text-center">
|
||||
<a href="#ExportOptions" data-bs-toggle="collapse" class="text-secondary">Show export options</a>
|
||||
</p>
|
||||
|
||||
<div id="ExportOptions" class="collapse">
|
||||
<h4 class="mb-3">Export PSBT for signing</h4>
|
||||
<div class="form-group">
|
||||
<form method="post" asp-action="WalletPSBT" asp-route-walletId="@Context.GetRouteValue("walletId")">
|
||||
<input type="hidden" asp-for="CryptoCode"/>
|
||||
<input type="hidden" asp-for="PSBT"/>
|
||||
<div class="d-flex">
|
||||
<button name="command" type="submit" class="btn btn-primary me-2" value="save-psbt">Download PSBT file</button>
|
||||
<button name="command" type="button" class="btn btn-primary only-for-js" data-bs-toggle="modal" data-bs-target="#scan-qr-modal">Show QR for wallet camera</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<h4 class="mt-5 mb-3">Raw version</h4>
|
||||
<pre><code class="json">@Model.Decoded</code></pre>
|
||||
<pre><code class="text">@Model.PSBT</code></pre>
|
||||
</div>
|
||||
|
||||
<partial name="ShowQR"/>
|
||||
<partial name="CameraScanner"/>
|
||||
|
||||
@@ -2,20 +2,24 @@
|
||||
@addTagHelper *, BundlerMinifier.TagHelpers
|
||||
@{
|
||||
Layout = "_LayoutWizard";
|
||||
ViewData.SetActivePageAndTitle(WalletsNavPages.PSBT, "PSBT Signing", Context.GetStoreData().StoreName);
|
||||
ViewData.SetActivePageAndTitle(WalletsNavPages.PSBT, "Transaction Signing", Context.GetStoreData().StoreName);
|
||||
}
|
||||
|
||||
@section PageHeadContent {
|
||||
<link rel="stylesheet" href="~/vendor/highlightjs/default.min.css" asp-append-version="true">
|
||||
<link href="~/vendor/vue-qrcode-reader/vue-qrcode-reader.css" rel="stylesheet" asp-append-version="true"/>
|
||||
}
|
||||
|
||||
@section PageFootContent {
|
||||
<script src="~/vendor/highlightjs/highlight.min.js" asp-append-version="true"></script>
|
||||
<bundle name="wwwroot/bundles/camera-bundle.min.js"></bundle>
|
||||
<script>
|
||||
hljs.initHighlightingOnLoad();
|
||||
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
initQRShow("Scan the PSBT with your wallet", @Json.Serialize(Model.PSBTHex), "scan-qr-modal");
|
||||
initCameraScanningApp("Scan the PSBT from your wallet", function (data){
|
||||
$("textarea#ImportedPSBT").val(data);
|
||||
$("textarea[name=PSBT]").val(data);
|
||||
$("#Decode").click();
|
||||
}, "scanModal");
|
||||
});
|
||||
@@ -31,24 +35,8 @@
|
||||
</a>
|
||||
}
|
||||
|
||||
<header class="text-center">
|
||||
<header class="text-center mb-3">
|
||||
<h1>@ViewData["PageTitle"]</h1>
|
||||
|
||||
@if (Model.CanCalculateBalance)
|
||||
{
|
||||
<p class="lead text-secondary mt-3">
|
||||
This transaction will change your balance:
|
||||
<br>
|
||||
@if (Model.Positive)
|
||||
{
|
||||
<span class="text-success">@Model.BalanceChange</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span class="text-danger">@Model.BalanceChange</span>
|
||||
}
|
||||
</p>
|
||||
}
|
||||
</header>
|
||||
|
||||
<partial name="_PSBTInfo" model="Model" />
|
||||
@@ -71,11 +59,17 @@
|
||||
<form method="post" asp-action="WalletPSBT" asp-route-walletId="@Context.GetRouteValue("walletId")">
|
||||
<input type="hidden" asp-for="CryptoCode"/>
|
||||
<input type="hidden" asp-for="PSBT"/>
|
||||
<div class="form-group d-flex">
|
||||
<div class="form-group d-flex align-items-center">
|
||||
<button name="command" type="submit" class="btn btn-primary" value="save-psbt">Download PSBT file</button>
|
||||
<button name="command" type="button" class="btn btn-primary only-for-js ms-2" data-bs-toggle="modal" data-bs-target="#scan-qr-modal">Show QR for wallet camera</button>
|
||||
<a href="#ExportOptions" data-bs-toggle="collapse" class="ms-3 text-secondary">Show raw versions</a>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div id="ExportOptions" class="collapse">
|
||||
<pre><code class="json">@Model.Decoded</code></pre>
|
||||
<pre><code class="text">@Model.PSBT</code></pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -97,7 +91,7 @@
|
||||
<label asp-for="UploadedPSBTFile" class="form-label"></label>
|
||||
<input asp-for="UploadedPSBTFile" type="file" class="form-control">
|
||||
</div>
|
||||
<div class="d-flex">
|
||||
<div class="d-flex align-items-center">
|
||||
<button type="submit" name="command" value="decode" class="btn btn-primary" id="Decode">Decode PSBT</button>
|
||||
<button type="button" id="scanqrcode" class="btn btn-primary only-for-js ms-2" data-bs-toggle="modal" data-bs-target="#scanModal">Scan wallet QR with camera</button>
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,21 @@
|
||||
@model WalletPSBTReadyViewModel
|
||||
|
||||
@if (Model.CanCalculateBalance)
|
||||
{
|
||||
<p class="lead text-center text-secondary">
|
||||
This transaction will change your balance:
|
||||
<br>
|
||||
@if (Model.Positive)
|
||||
{
|
||||
<span class="text-success">@Model.BalanceChange</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span class="text-danger">@Model.BalanceChange</span>
|
||||
}
|
||||
</p>
|
||||
}
|
||||
|
||||
<h4 class="mb-n3">Inputs</h4>
|
||||
<table class="table table-sm table-responsive-lg">
|
||||
<thead class="thead-inverse">
|
||||
|
||||
Reference in New Issue
Block a user