btcpayserver/BTCPayServer/Views/UIStores/LightningSettings.cshtml
d11n a4ee1e9805
Checkout v2 finetuning (#4276)
* Indent all JSON files with two spaces

* Upgrade Vue.js

* Cheat mode improvements

* Show payment details in case of expired invoice

* Add logo size recommendation

* Show clipboard copy hint cursor

* Improve info area and wording

* Update BIP21 wording

* Invoice details adjustments

* Remove form; switch payment methods via AJAX

* UI updates

* Decrease paddings to gain space

* Tighten up padding between logo mark and the store title text

* Add drop-shadow to the containers

* Wording

* Cheating improvements

* Improve footer spacing

* Cheating improvements

* Display addresses

* More improvements

* Expire invoices

* Customize invoice expiry

* Footer improvements

* Remove theme switch

* Remove non-existing sourcemap references

* Move inline JS to checkout.js file

* Plugin compatibility

See Kukks/btcpayserver#8

* Test fix

* Upgrade vue-i18next

* Extract translations into a separate file

* Round QR code borders

* Remove "Pay with Bitcoin" title in BIP21 case

* Add copy hint to payment details

* Cheating: Reduce margins

* Adjust dt color

* Hide addresses for first iteration

* Improve View Details button

* Make info section collapsible

* Revert original en locale file

* Checkout v2 tests

* Result view link fixes

* Fix BIP21 + lazy payment methods case

* More result page link improvements

* minor visual improvements

* Update clipboard code

Remove fallback for old browsers. https://caniuse.com/?search=navigator.clipboard

* Transition copy symbol

* Update info text color

* Invert dark neutral colors

Simplifies the dark theme quite a bit.

* copy adjustments

* updates QR border-radius

* Add option to remove logo

* More checkout v2 test cases

* JS improvements

* Remove leftovers

* Update test

* Fix links

* Update tests

* Update plugins integration

* Remove obsolete url code

* Minor view update

* Update JS to not use arrow functions

* Remove FormId from Checkout Appearance settings

* Add English-only hint and feedback link

* Checkout Appearance: Make options clearer, remove Custom CSS for v2

* Clipboard copy full URL instead of just address/BOLT11

* Upgrade JS libs, add content checks

* Add test for BIP21 setting with zero amount invoice

Co-authored-by: dstrukt <gfxdsign@gmail.com>
2022-11-24 08:53:32 +09:00

142 lines
7.7 KiB
Text

@using BTCPayServer.Lightning
@model LightningSettingsViewModel
@{
Layout = "../Shared/_NavLayout.cshtml";
ViewData["NavPartialName"] = "../UILightning/_Nav";
ViewData.SetActivePage(StoreNavPages.LightningSettings, $"{Model.CryptoCode} Lightning Settings", Context.GetStoreData().Id);
}
<div class="row">
<div class="col-xl-8 col-xxl-constrain">
<div class="mb-5">
<h3 class="mb-3">@ViewData["Title"]</h3>
<div class="text-break mb-3">
<span class="me-3" id="NodeType">@Model.LightningNodeType Node</span>
@if (Model.LightningNodeType != LightningNodeType.Internal)
{
<span class="me-3" id="CustomNodeInfo">
@if (LightningConnectionString.TryParse(Model.ConnectionString, out var cs))
{
@typeof(LightningConnectionType).DisplayName(cs.ConnectionType.ToString())
<span>(@cs.BaseUri)</span>
}
else
{
@Model.ConnectionString
}
</span>
}
<a class="me-3"
asp-controller="UIPublicLightningNodeInfo"
asp-action="ShowLightningNodeInfo"
asp-route-cryptoCode="@Model.CryptoCode"
asp-route-storeId="@Model.StoreId"
target="_blank"
id="PublicNodeInfo">
Public Node Info
</a>
<a asp-controller="UIStores" asp-action="SetupLightningNode" asp-route-storeId="@Model.StoreId" asp-route-cryptoCode="@Model.CryptoCode" id="SetupLightningNodeLink">
Change connection
</a>
</div>
<form method="post"
asp-action="SetLightningNodeEnabled"
asp-route-cryptoCode="@Model.CryptoCode"
asp-route-storeId="@Model.StoreId"
class="d-flex align-items-center mt-4"
style="min-width:7rem">
<button type="submit" class="btcpay-toggle me-3 @if (Model.Enabled) { @("btcpay-toggle--active") }" name="Enabled" value="@(Model.Enabled ? "false" : "true")" id="@($"{Model.CryptoCode}LightningEnabled")">@(Model.Enabled ? "Disable" : "Enable")</button>
<span>
Enabled
</span>
</form>
<form method="post" class="mt-n2 text-center">
<div class="text-start">
<h3 class="mt-5 mb-3">Payment</h3>
<div class="form-check my-3">
<input asp-for="LightningAmountInSatoshi" type="checkbox" class="form-check-input"/>
<label asp-for="LightningAmountInSatoshi" class="form-check-label"></label>
</div>
<div class="form-check my-3">
<input asp-for="LightningPrivateRouteHints" type="checkbox" class="form-check-input"/>
<label asp-for="LightningPrivateRouteHints" class="form-check-label"></label>
</div>
<div class="form-check my-3">
<input asp-for="OnChainWithLnInvoiceFallback" type="checkbox" class="form-check-input"/>
<label asp-for="OnChainWithLnInvoiceFallback" class="form-check-label"></label>
<a href="https://bitcoinqr.dev/" target="_blank" rel="noreferrer noopener">
<span class="fa fa-question-circle-o text-secondary" title="More information..."></span>
</a>
</div>
<div class="form-group mt-3">
<label asp-for="LightningDescriptionTemplate" class="form-label"></label>
<input asp-for="LightningDescriptionTemplate" class="form-control"/>
<span asp-validation-for="LightningDescriptionTemplate" class="text-danger"></span>
<p class="form-text text-muted">
Available placeholders:
<code>{StoreName} {ItemDescription} {OrderId}</code>
</p>
</div>
<h3 class="mt-5 mb-3" id="ln-url">LNURL</h3>
<div class="form-group d-flex align-items-center">
<input asp-for="LNURLEnabled" type="checkbox" class="btcpay-toggle me-3" data-bs-toggle="collapse" data-bs-target="#LNURLSettings" aria-expanded="@Model.LNURLEnabled" aria-controls="LNURLSettings"/>
<label asp-for="LNURLEnabled" class="form-label mb-0 me-1"></label>
</div>
<div class="collapse @(Model.LNURLEnabled ? "show" : "")" id="LNURLSettings">
<div class="form-group">
<label class="form-group d-flex align-items-center">
<input type="checkbox" asp-for="LNURLBech32Mode" class="btcpay-toggle me-3" />
<div class="">
<label asp-for="LNURLBech32Mode" class="form-label mb-0 me-1"></label>
<span asp-validation-for="LNURLBech32Mode" class="text-danger"></span>
<p class="form-text text-muted mb-0">For wallet compatibility: Bech32 encoded (classic) vs. cleartext URL (upcoming)</p>
</div>
</label>
</div>
<div class="form-group">
<label class="form-group d-flex align-items-center">
<input type="checkbox" asp-for="LNURLStandardInvoiceEnabled" class="btcpay-toggle me-3" />
<div class="">
<label asp-for="LNURLStandardInvoiceEnabled" class="form-label mb-0 me-1"></label>
<p class="form-text text-muted mb-0">Required for Lightning Address, the pay button and apps.</p>
</div>
</label>
</div>
<div class="form-group">
<label class="form-group d-flex align-items-center">
<input type="checkbox" asp-for="DisableBolt11PaymentMethod" class="btcpay-toggle me-3" />
<div class="">
<label asp-for="DisableBolt11PaymentMethod" class="form-label mb-0 me-1"></label>
<p class="form-text text-muted mb-0">Performance: Turn it off if users should pay only via LNURL.</p>
</div>
</label>
</div>
<div class="form-group mb-3">
<div class="d-flex align-items-center">
<input type="checkbox" asp-for="LUD12Enabled" class="btcpay-toggle me-3" />
<label asp-for="LUD12Enabled" class="form-label mb-0 me-1"></label>
</div>
</div>
</div>
</div>
<div class="text-start mt-4">
<button id="save" name="command" type="submit" value="save" class="btn btn-primary me-2">Save</button>
</div>
</form>
</div>
</div>
</div>
@section PageFootContent {
<partial name="_ValidationScriptsPartial"/>
}