btcpayserver/BTCPayServer/Views/UIServer/LightningWalletServices.cshtml
2024-07-25 22:46:02 +09:00

88 lines
2.8 KiB
Text

@model LightningWalletServices
@{
ViewData.SetActivePage(ServerNavPages.Services, Model.WalletName);
}
<div class="sticky-header">
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a asp-action="Services">Services</a>
</li>
<li class="breadcrumb-item active" aria-current="page">@ViewData["Title"]</li>
</ol>
<h2 text-translate="true">@ViewData["Title"]</h2>
</nav>
</div>
<partial name="_StatusMessage" />
@if (Model.ShowQR)
{
<div class="alert alert-warning alert-dismissible" role="alert">
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close">
<vc:icon symbol="close" />
</button>
<div>
<span><b>CONFIDENTIAL:</b> This QR Code is confidential, close this window as soon as you don't need it anymore.<br /></span>
<span>A malicious actor with access to this QR Code could steal the funds on your lightning wallet.</span>
</div>
</div>
}
<div class="row">
<div class="col-md-8">
@if (!ViewContext.ModelState.IsValid)
{
<div asp-validation-summary="All"></div>
}
<div class="form-group">
<h5>Browser connection</h5>
<p>
<span>You can go to @Model.WalletName from your browser by <a href="@Model.ServiceLink" rel="noreferrer noopener">clicking here</a><br/></span>
</p>
</div>
<div class="form-group">
<h5>QR Code connection</h5>
<p>
<span>You can use QR Code to connect to your @Model.WalletName from your mobile.<br/></span>
</p>
</div>
<div class="form-group">
@if (!Model.ShowQR)
{
<div class="form-group">
<form method="get">
<input type="hidden" asp-for="ShowQR" value="true"/>
<button type="submit" class="btn btn-primary">Show Confidential QR Code</button>
</form>
</div>
}
else
{
<div class="form-group">
<div id="qrCode"></div>
<div id="qrCodeData" data-url="@Model.ServiceLink"></div>
</div>
}
</div>
</div>
</div>
@section PageFootContent {
<partial name="_ValidationScriptsPartial" />
@if (Model.ShowQR)
{
<script src="~/js/qrcode.js" asp-append-version="true"></script>
<script>
new QRCode(document.getElementById("qrCode"), {
text: @Safe.Json(Model.ServiceLink),
width: 200,
height: 200,
useSVG: true,
correctLevel : QRCode.CorrectLevel.M
});
</script>
}
}