mirror of
https://github.com/aljazceru/btcpayserver-breez-nodeless-plugin.git
synced 2025-12-17 00:24:22 +01:00
38 lines
1.5 KiB
Plaintext
38 lines
1.5 KiB
Plaintext
@inject BreezService BreezService;
|
|
@using BTCPayServer.Client
|
|
@using BTCPayServer.Plugins.Breez
|
|
@using Microsoft.AspNetCore.Mvc.TagHelpers
|
|
@model BTCPayServer.Models.StoreViewModels.LightningNodeViewModel
|
|
|
|
@if (Model.CryptoCode != "BTC")
|
|
{
|
|
return;
|
|
}
|
|
|
|
@{
|
|
var breezClient = BreezService.GetClient(Model.StoreId);
|
|
}
|
|
|
|
@if (breezClient == null)
|
|
{
|
|
<a asp-action="Index" asp-controller="Breez" permission="@Policies.CanModifyStoreSettings" asp-route-storeId="@Model.StoreId" type="radio" role="tab" aria-controls="BreezSetup" aria-selected="false" name="LightningNodeType">
|
|
<label for="LightningNodeType-Breez">Configure Breez</label>
|
|
</a>
|
|
}
|
|
else
|
|
{
|
|
<input value="Custom" type="radio" id="LightningNodeType-Breez" data-bs-toggle="pill" data-bs-target="#BreezSetup" role="tab" aria-controls="BreezSetup" aria-selected="false" name="LightningNodeType">
|
|
<label for="LightningNodeType-Breez">Use Breez</label>
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', () => {
|
|
const typePrefix = '@breezClient.ToString()';
|
|
const connStringEl = document.getElementById('ConnectionString')
|
|
delegate('change', 'input[name="LightningNodeType"]', e => {
|
|
const activeEl = document.querySelector('input[name="LightningNodeType"]:checked')
|
|
if (activeEl.id === "LightningNodeType-Breez"){
|
|
connStringEl.value = typePrefix;
|
|
}
|
|
})
|
|
})
|
|
</script>
|
|
} |