style fixes & fixes for wipe data

This commit is contained in:
Kukks 2024-03-11 09:42:03 +01:00
parent 1d4d5127b1
commit 1d6eee0de7
No known key found for this signature in database
GPG key ID: 8E5530D9D1C93097
2 changed files with 28 additions and 20 deletions

View file

@ -98,13 +98,13 @@ namespace BTCPayServer.Plugins.BoltcardBalance.Controllers
BoltcardKeysResetLink = $"boltcard://reset?url={GetBoltcardDeeplinkUrl(pp.Id, OnExistingBehavior.KeepVersion)}", BoltcardKeysResetLink = $"boltcard://reset?url={GetBoltcardDeeplinkUrl(pp.Id, OnExistingBehavior.KeepVersion)}",
WipeData = JObject.FromObject(new WipeData = JObject.FromObject(new
{ {
version = registration.Version, version = 1,
action = "wipe", action = "wipe",
K0 = Encoders.Hex.EncodeData(boltCardKeys.AppMasterKey.ToBytes()).ToUpperInvariant(), k0 = Encoders.Hex.EncodeData(boltCardKeys.AppMasterKey.ToBytes()).ToUpperInvariant(),
K1 = Encoders.Hex.EncodeData(boltCardKeys.EncryptionKey.ToBytes()).ToUpperInvariant(), k1 = Encoders.Hex.EncodeData(boltCardKeys.EncryptionKey.ToBytes()).ToUpperInvariant(),
K2 = Encoders.Hex.EncodeData(boltCardKeys.AuthenticationKey.ToBytes()).ToUpperInvariant(), k2 = Encoders.Hex.EncodeData(boltCardKeys.AuthenticationKey.ToBytes()).ToUpperInvariant(),
K3 = Encoders.Hex.EncodeData(boltCardKeys.K3.ToBytes()).ToUpperInvariant(), k3 = Encoders.Hex.EncodeData(boltCardKeys.K3.ToBytes()).ToUpperInvariant(),
K4 = Encoders.Hex.EncodeData(boltCardKeys.K4.ToBytes()).ToUpperInvariant(), k4 = Encoders.Hex.EncodeData(boltCardKeys.K4.ToBytes()).ToUpperInvariant(),
}).ToString(Newtonsoft.Json.Formatting.None), }).ToString(Newtonsoft.Json.Formatting.None),
PullPaymentLink = Url.Action(nameof(UIPullPaymentController.ViewPullPayment), "UIPullPayment", new { pullPaymentId = pp.Id }, Request.Scheme, Request.Host.ToString()) PullPaymentLink = Url.Action(nameof(UIPullPaymentController.ViewPullPayment), "UIPullPayment", new { pullPaymentId = pp.Id }, Request.Scheme, Request.Host.ToString())

View file

@ -36,25 +36,33 @@
} }
<div class="d-flex justify-content-center nfc-supported"> <div class="d-flex justify-content-center nfc-supported">
<div class="boltcard-reset boltcard-details mt-3 mt-sm-0 w-100 text-center"> <div class="boltcard-reset boltcard-details mt-3 mt-sm-0 w-100 text-center">
<div class="input-group">
<a class="btn btn-outline-danger form-contrrol" href="@Model.BoltcardKeysResetLink">Reset Boltcard</a>
<button type="button" class="btn btn-link" id="show-wipe-qr">
<span class="fa fa-qrcode fa-2x" title="Show wipe QR"></span>
</button>
</div>
<div id="wipe-qr" class="d-none d-flex cursor-pointer">
<vc:qr-code data="@Model.WipeData" data-clipboard-target="#qr-wipe-code-data-input" /> <div class="d-flex justify-content-center">
<div class="input-group input-group-sm mt-3"> <div class="input-group">
<input type="text" class="form-control" readonly value="@Model.WipeData" id="qr-wipe-code-data-input">
<button type="button" class="btn btn-outline-secondary px-3" data-clipboard-target="#qr-wipe-code-data-input"> <a class="btn btn-outline-danger form-control " href="@Model.BoltcardKeysResetLink">Reset Boltcard</a>
<vc:icon symbol="copy" /> <button type="button" class="btn btn-outline-danger input-group-btn" id="show-wipe-qr">
<span class="fa fa-qrcode fa-2x" title="Show wipe QR"></span>
</button> </button>
</div> </div>
</div> </div>
<div id="wipe-qr" class="d-none mt-2 cursor-pointer" data-clipboard-target="#qr-wipe-code-data-input">
<div class="d-flex">
<vc:qr-code data="@Model.WipeData" />
</div>
<div class="d-flex">
<div class="input-group input-group-sm mt-3">
<input type="text" class="form-control" readonly value="@Model.WipeData" id="qr-wipe-code-data-input">
<button type="button" class="btn btn-outline-secondary px-3" data-clipboard-target="#qr-wipe-code-data-input">
<vc:icon symbol="copy" />
</button>
</div>
</div>
</div>
<p class="text-secondary mt-2">Requires installing the <a href="https://play.google.com/store/apps/details?id=com.lightningnfcapp&hl=en&gl=US">Bolt Card Creator app</a></p> <p class="text-secondary mt-2">Requires installing the <a href="https://play.google.com/store/apps/details?id=com.lightningnfcapp&hl=en&gl=US">Bolt Card Creator app</a></p>
</div> </div>
</div> </div>