btcpayserver/BTCPayServer/Views/Wallets/WalletPSBT.cshtml
Dennis Reimann 8420c74b31
Improve static asset caching
Cache static assets for one year and set the correct cache control header. Adds the cache busting version based on file content to asset references to invalidate the cache on change. ([further details on the approach](https://andrewlock.net/adding-cache-control-headers-to-static-files-in-asp-net-core/) and [why one year](https://ashton.codes/set-cache-control-max-age-1-year/))

Most of the changes are the additions of the `asp-append-version="true"` attribute, the main configuration change is in `Startup.cs`.
2020-04-18 17:56:05 +02:00

87 lines
4.7 KiB
Text

@model WalletPSBTViewModel
@{
Layout = "../Shared/_NavLayout.cshtml";
ViewData["Title"] = "PSBT";
ViewData.SetActivePageAndTitle(WalletsNavPages.PSBT);
}
@if (TempData.HasStatusMessage())
{
<div class="row">
<div class="col-md-10 text-center">
<partial name="_StatusMessage" />
</div>
</div>
}
<div class="row">
<div class="col-md-10">
@if (Model.Errors != null && Model.Errors.Count != 0)
{
<div class="alert alert-danger alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
@foreach (var error in Model.Errors)
{
<span>@error</span><br />
}
</div>
}
@if (!string.IsNullOrEmpty(Model.Decoded))
{
<h3>Decoded PSBT</h3>
<div class="form-group">
<form method="post" asp-action="WalletPSBT" asp-route-walletId="@this.Context.GetRouteValue("walletId")">
<input type="hidden" asp-for="CryptoCode" />
<input type="hidden" asp-for="PayJoinEndpointUrl" />
<input type="hidden" asp-for="NBXSeedAvailable" />
<input type="hidden" asp-for="PSBT" />
<input type="hidden" asp-for="FileName" />
<div class="dropdown d-inline-block" style="margin-top:16px;">
<button class="btn btn-primary dropdown-toggle" type="button" id="SendMenu" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Sign with...
</button>
<div class="dropdown-menu" aria-labelledby="SendMenu">
<button name="command" type="submit" class="dropdown-item" value="ledger">... your Ledger Wallet device</button>
<button name="command" type="submit" class="dropdown-item" value="seed">... an HD private key or mnemonic seed</button>
<button name="command" type="submit" class="dropdown-item" value="save-psbt">... a wallet supporting PSBT (save as file)</button>
@if (Model.CryptoCode == "BTC") {
<button name="command" type="submit" class="dropdown-item" value="vault">... the vault (preview)</button>
}
@if (Model.NBXSeedAvailable)
{
<button name="command" type="submit" class="dropdown-item" value="nbx-seed">... the seed saved in NBXplorer</button>
}
</div>
</div>
<div class="dropdown d-inline-block">
<button class="btn btn-secondary dropdown-toggle" type="button" id="OtherActions" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Other actions...
</button>
<div class="dropdown-menu" aria-labelledby="OtherActions">
<button name="command" type="submit" class="dropdown-item" value="broadcast">Review</button>
<button name="command" type="submit" class="dropdown-item" value="update">Update</button>
<button name="command" type="submit" class="dropdown-item" value="combine">Combine</button>
</div>
</div>
</form>
</div>
<pre><code class="json">@Model.Decoded</code></pre>
}
<h3>PSBT to decode</h3>
<form class="form-group" method="post" asp-action="WalletPSBT" asp-route-walletId="@this.Context.GetRouteValue("walletId")" enctype="multipart/form-data">
<div class="form-group">
<textarea class="form-control" rows="5" asp-for="PSBT"></textarea>
<span asp-validation-for="PSBT" class="text-danger"></span>
</div>
<div class="form-group">
<label asp-for="UploadedPSBTFile"></label>
<input type="file" class="form-control-file" asp-for="UploadedPSBTFile">
</div>
<button type="submit" name="command" value="decode" class="btn btn-primary">Decode</button>
</form>
</div>
</div>
@section Scripts {
<link rel="stylesheet" href="~/vendor/highlightjs/default.min.css" asp-append-version="true">
<script src="~/vendor/highlightjs/highlight.min.js" asp-append-version="true"></script>
<script>hljs.initHighlightingOnLoad();</script>
}