mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 06:24:24 +01:00
Can disable method of payments
This commit is contained in:
committed by
nicolas.dorier
parent
3775317047
commit
d480be925b
@@ -123,8 +123,9 @@ namespace BTCPayServer.Controllers
|
|||||||
|
|
||||||
HashSet<CurrencyPair> currencyPairsToFetch = new HashSet<CurrencyPair>();
|
HashSet<CurrencyPair> currencyPairsToFetch = new HashSet<CurrencyPair>();
|
||||||
var rules = storeBlob.GetRateRules(_NetworkProvider);
|
var rules = storeBlob.GetRateRules(_NetworkProvider);
|
||||||
|
var excludeFilter = storeBlob.GetExcludedPaymentMethods(); // Here we can compose filters from other origin with PaymentFilter.Any()
|
||||||
foreach (var network in store.GetSupportedPaymentMethods(_NetworkProvider)
|
foreach (var network in store.GetSupportedPaymentMethods(_NetworkProvider)
|
||||||
|
.Where(s => !excludeFilter.Match(s.PaymentId))
|
||||||
.Select(c => _NetworkProvider.GetNetwork(c.PaymentId.CryptoCode))
|
.Select(c => _NetworkProvider.GetNetwork(c.PaymentId.CryptoCode))
|
||||||
.Where(c => c != null))
|
.Where(c => c != null))
|
||||||
{
|
{
|
||||||
@@ -140,6 +141,7 @@ namespace BTCPayServer.Controllers
|
|||||||
|
|
||||||
var fetchingAll = WhenAllFetched(logs, fetchingByCurrencyPair);
|
var fetchingAll = WhenAllFetched(logs, fetchingByCurrencyPair);
|
||||||
var supportedPaymentMethods = store.GetSupportedPaymentMethods(_NetworkProvider)
|
var supportedPaymentMethods = store.GetSupportedPaymentMethods(_NetworkProvider)
|
||||||
|
.Where(s => !excludeFilter.Match(s.PaymentId))
|
||||||
.Select(c =>
|
.Select(c =>
|
||||||
(Handler: (IPaymentMethodHandler)_ServiceProvider.GetService(typeof(IPaymentMethodHandler<>).MakeGenericType(c.GetType())),
|
(Handler: (IPaymentMethodHandler)_ServiceProvider.GetService(typeof(IPaymentMethodHandler<>).MakeGenericType(c.GetType())),
|
||||||
SupportedPaymentMethod: c,
|
SupportedPaymentMethod: c,
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ namespace BTCPayServer.Controllers
|
|||||||
private void SetExistingValues(StoreData store, DerivationSchemeViewModel vm)
|
private void SetExistingValues(StoreData store, DerivationSchemeViewModel vm)
|
||||||
{
|
{
|
||||||
vm.DerivationScheme = GetExistingDerivationStrategy(vm.CryptoCode, store)?.DerivationStrategyBase.ToString();
|
vm.DerivationScheme = GetExistingDerivationStrategy(vm.CryptoCode, store)?.DerivationStrategyBase.ToString();
|
||||||
|
vm.Enabled = !store.GetStoreBlob().IsExcluded(new PaymentMethodId(vm.CryptoCode, PaymentTypes.BTCLike));
|
||||||
}
|
}
|
||||||
|
|
||||||
private DerivationStrategy GetExistingDerivationStrategy(string cryptoCode, StoreData store)
|
private DerivationStrategy GetExistingDerivationStrategy(string cryptoCode, StoreData store)
|
||||||
@@ -93,10 +94,8 @@ namespace BTCPayServer.Controllers
|
|||||||
vm.Confirmation = false;
|
vm.Confirmation = false;
|
||||||
return View(vm);
|
return View(vm);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!vm.Confirmation && strategy != null)
|
if (!vm.Confirmation && strategy != null)
|
||||||
return ShowAddresses(vm, strategy);
|
return ShowAddresses(vm, strategy);
|
||||||
|
|
||||||
if (vm.Confirmation && !string.IsNullOrWhiteSpace(vm.HintAddress))
|
if (vm.Confirmation && !string.IsNullOrWhiteSpace(vm.HintAddress))
|
||||||
{
|
{
|
||||||
BitcoinAddress address = null;
|
BitcoinAddress address = null;
|
||||||
@@ -132,6 +131,10 @@ namespace BTCPayServer.Controllers
|
|||||||
if (strategy != null)
|
if (strategy != null)
|
||||||
await wallet.TrackAsync(strategy.DerivationStrategyBase);
|
await wallet.TrackAsync(strategy.DerivationStrategyBase);
|
||||||
store.SetSupportedPaymentMethod(paymentMethodId, strategy);
|
store.SetSupportedPaymentMethod(paymentMethodId, strategy);
|
||||||
|
|
||||||
|
var storeBlob = store.GetStoreBlob();
|
||||||
|
storeBlob.SetExcluded(paymentMethodId, !vm.Enabled);
|
||||||
|
store.SetStoreBlob(storeBlob);
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -24,9 +24,11 @@ namespace BTCPayServer.Controllers
|
|||||||
var store = HttpContext.GetStoreData();
|
var store = HttpContext.GetStoreData();
|
||||||
if (store == null)
|
if (store == null)
|
||||||
return NotFound();
|
return NotFound();
|
||||||
LightningNodeViewModel vm = new LightningNodeViewModel();
|
LightningNodeViewModel vm = new LightningNodeViewModel
|
||||||
vm.CryptoCode = cryptoCode;
|
{
|
||||||
vm.InternalLightningNode = GetInternalLighningNode(cryptoCode)?.ToString();
|
CryptoCode = cryptoCode,
|
||||||
|
InternalLightningNode = GetInternalLighningNode(cryptoCode)?.ToString()
|
||||||
|
};
|
||||||
SetExistingValues(store, vm);
|
SetExistingValues(store, vm);
|
||||||
return View(vm);
|
return View(vm);
|
||||||
}
|
}
|
||||||
@@ -34,6 +36,7 @@ namespace BTCPayServer.Controllers
|
|||||||
private void SetExistingValues(StoreData store, LightningNodeViewModel vm)
|
private void SetExistingValues(StoreData store, LightningNodeViewModel vm)
|
||||||
{
|
{
|
||||||
vm.ConnectionString = GetExistingLightningSupportedPaymentMethod(vm.CryptoCode, store)?.GetLightningUrl()?.ToString();
|
vm.ConnectionString = GetExistingLightningSupportedPaymentMethod(vm.CryptoCode, store)?.GetLightningUrl()?.ToString();
|
||||||
|
vm.Enabled = !store.GetStoreBlob().IsExcluded(new PaymentMethodId(vm.CryptoCode, PaymentTypes.LightningLike));
|
||||||
}
|
}
|
||||||
private LightningSupportedPaymentMethod GetExistingLightningSupportedPaymentMethod(string cryptoCode, StoreData store)
|
private LightningSupportedPaymentMethod GetExistingLightningSupportedPaymentMethod(string cryptoCode, StoreData store)
|
||||||
{
|
{
|
||||||
@@ -132,22 +135,22 @@ namespace BTCPayServer.Controllers
|
|||||||
CryptoCode = paymentMethodId.CryptoCode
|
CryptoCode = paymentMethodId.CryptoCode
|
||||||
};
|
};
|
||||||
paymentMethod.SetLightningUrl(connectionString);
|
paymentMethod.SetLightningUrl(connectionString);
|
||||||
|
var storeBlob = store.GetStoreBlob();
|
||||||
|
storeBlob.SetExcluded(paymentMethod.PaymentId , vm.Enabled);
|
||||||
|
store.SetStoreBlob(storeBlob);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (command == "save")
|
switch (command)
|
||||||
{
|
{
|
||||||
|
case "save":
|
||||||
store.SetSupportedPaymentMethod(paymentMethodId, paymentMethod);
|
store.SetSupportedPaymentMethod(paymentMethodId, paymentMethod);
|
||||||
await _Repo.UpdateStore(store);
|
await _Repo.UpdateStore(store);
|
||||||
StatusMessage = $"Lightning node modified ({network.CryptoCode})";
|
StatusMessage = $"Lightning node modified ({network.CryptoCode})";
|
||||||
return RedirectToAction(nameof(UpdateStore), new { storeId = storeId });
|
return RedirectToAction(nameof(UpdateStore), new { storeId = storeId });
|
||||||
}
|
case "test" when paymentMethod == null:
|
||||||
else // if(command == "test")
|
|
||||||
{
|
|
||||||
if (paymentMethod == null)
|
|
||||||
{
|
|
||||||
ModelState.AddModelError(nameof(vm.ConnectionString), "Missing url parameter");
|
ModelState.AddModelError(nameof(vm.ConnectionString), "Missing url parameter");
|
||||||
return View(vm);
|
return View(vm);
|
||||||
}
|
case "test":
|
||||||
var handler = (LightningLikePaymentHandler)_ServiceProvider.GetRequiredService<IPaymentMethodHandler<Payments.Lightning.LightningSupportedPaymentMethod>>();
|
var handler = (LightningLikePaymentHandler)_ServiceProvider.GetRequiredService<IPaymentMethodHandler<Payments.Lightning.LightningSupportedPaymentMethod>>();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -167,6 +170,8 @@ namespace BTCPayServer.Controllers
|
|||||||
return View(vm);
|
return View(vm);
|
||||||
}
|
}
|
||||||
return View(vm);
|
return View(vm);
|
||||||
|
default:
|
||||||
|
return View(vm);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -404,7 +404,7 @@ namespace BTCPayServer.Controllers
|
|||||||
vm.NetworkFee = !storeBlob.NetworkFeeDisabled;
|
vm.NetworkFee = !storeBlob.NetworkFeeDisabled;
|
||||||
vm.SpeedPolicy = store.SpeedPolicy;
|
vm.SpeedPolicy = store.SpeedPolicy;
|
||||||
vm.CanDelete = _Repo.CanDeleteStores();
|
vm.CanDelete = _Repo.CanDeleteStores();
|
||||||
AddPaymentMethods(store, vm);
|
AddPaymentMethods(store, storeBlob, vm);
|
||||||
vm.MonitoringExpiration = storeBlob.MonitoringExpiration;
|
vm.MonitoringExpiration = storeBlob.MonitoringExpiration;
|
||||||
vm.InvoiceExpiration = storeBlob.InvoiceExpiration;
|
vm.InvoiceExpiration = storeBlob.InvoiceExpiration;
|
||||||
vm.LightningDescriptionTemplate = storeBlob.LightningDescriptionTemplate;
|
vm.LightningDescriptionTemplate = storeBlob.LightningDescriptionTemplate;
|
||||||
@@ -413,8 +413,9 @@ namespace BTCPayServer.Controllers
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void AddPaymentMethods(StoreData store, StoreViewModel vm)
|
private void AddPaymentMethods(StoreData store, StoreBlob storeBlob, StoreViewModel vm)
|
||||||
{
|
{
|
||||||
|
var excludeFilters = storeBlob.GetExcludedPaymentMethods();
|
||||||
var derivationByCryptoCode =
|
var derivationByCryptoCode =
|
||||||
store
|
store
|
||||||
.GetSupportedPaymentMethods(_NetworkProvider)
|
.GetSupportedPaymentMethods(_NetworkProvider)
|
||||||
@@ -428,6 +429,7 @@ namespace BTCPayServer.Controllers
|
|||||||
Crypto = network.CryptoCode,
|
Crypto = network.CryptoCode,
|
||||||
Value = strategy?.DerivationStrategyBase?.ToString() ?? string.Empty,
|
Value = strategy?.DerivationStrategyBase?.ToString() ?? string.Empty,
|
||||||
WalletId = new WalletId(store.Id, network.CryptoCode),
|
WalletId = new WalletId(store.Id, network.CryptoCode),
|
||||||
|
Enabled = !excludeFilters.Match(new Payments.PaymentMethodId(network.CryptoCode, Payments.PaymentTypes.BTCLike))
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -439,10 +441,12 @@ namespace BTCPayServer.Controllers
|
|||||||
foreach (var network in _NetworkProvider.GetAll())
|
foreach (var network in _NetworkProvider.GetAll())
|
||||||
{
|
{
|
||||||
var lightning = lightningByCryptoCode.TryGet(network.CryptoCode);
|
var lightning = lightningByCryptoCode.TryGet(network.CryptoCode);
|
||||||
|
var paymentId = new Payments.PaymentMethodId(network.CryptoCode, Payments.PaymentTypes.LightningLike);
|
||||||
vm.LightningNodes.Add(new StoreViewModel.LightningNode()
|
vm.LightningNodes.Add(new StoreViewModel.LightningNode()
|
||||||
{
|
{
|
||||||
CryptoCode = network.CryptoCode,
|
CryptoCode = network.CryptoCode,
|
||||||
Address = lightning?.GetLightningUrl()?.BaseUri.AbsoluteUri ?? string.Empty
|
Address = lightning?.GetLightningUrl()?.BaseUri.AbsoluteUri ?? string.Empty,
|
||||||
|
Enabled = !excludeFilters.Match(paymentId)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -373,5 +373,34 @@ namespace BTCPayServer.Data
|
|||||||
rules.GlobalMultiplier = GetRateMultiplier();
|
rules.GlobalMultiplier = GetRateMultiplier();
|
||||||
return rules;
|
return rules;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Obsolete("Use GetExcludedPaymentMethods instead")]
|
||||||
|
public string[] ExcludedPaymentMethods { get; set; }
|
||||||
|
|
||||||
|
public IPaymentFilter GetExcludedPaymentMethods()
|
||||||
|
{
|
||||||
|
#pragma warning disable CS0618 // Type or member is obsolete
|
||||||
|
if (ExcludedPaymentMethods == null || ExcludedPaymentMethods.Length == 0)
|
||||||
|
return PaymentFilter.Never();
|
||||||
|
return PaymentFilter.Any(ExcludedPaymentMethods.Select(p => PaymentFilter.WhereIs(PaymentMethodId.Parse(p))).ToArray());
|
||||||
|
#pragma warning restore CS0618 // Type or member is obsolete
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool IsExcluded(PaymentMethodId paymentMethodId)
|
||||||
|
{
|
||||||
|
return GetExcludedPaymentMethods().Match(paymentMethodId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetExcluded(PaymentMethodId paymentMethodId, bool value)
|
||||||
|
{
|
||||||
|
#pragma warning disable CS0618 // Type or member is obsolete
|
||||||
|
var methods = new HashSet<string>(ExcludedPaymentMethods ?? Array.Empty<string>());
|
||||||
|
if (value)
|
||||||
|
methods.Add(paymentMethodId.ToString());
|
||||||
|
else
|
||||||
|
methods.Remove(paymentMethodId.ToString());
|
||||||
|
ExcludedPaymentMethods = methods.ToArray();
|
||||||
|
#pragma warning restore CS0618 // Type or member is obsolete
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ namespace BTCPayServer.Models.StoreViewModels
|
|||||||
[Display(Name = "Hint address")]
|
[Display(Name = "Hint address")]
|
||||||
public string HintAddress { get; set; }
|
public string HintAddress { get; set; }
|
||||||
public bool Confirmation { get; set; }
|
public bool Confirmation { get; set; }
|
||||||
|
public bool Enabled { get; set; } = true;
|
||||||
|
|
||||||
public string ServerUrl { get; set; }
|
public string ServerUrl { get; set; }
|
||||||
public string StatusMessage { get; internal set; }
|
public string StatusMessage { get; internal set; }
|
||||||
|
|||||||
@@ -24,5 +24,6 @@ namespace BTCPayServer.Models.StoreViewModels
|
|||||||
public string StatusMessage { get; set; }
|
public string StatusMessage { get; set; }
|
||||||
public string InternalLightningNode { get; internal set; }
|
public string InternalLightningNode { get; internal set; }
|
||||||
public bool SkipPortTest { get; set; }
|
public bool SkipPortTest { get; set; }
|
||||||
|
public bool Enabled { get; set; } = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ namespace BTCPayServer.Models.StoreViewModels
|
|||||||
public string Crypto { get; set; }
|
public string Crypto { get; set; }
|
||||||
public string Value { get; set; }
|
public string Value { get; set; }
|
||||||
public WalletId WalletId { get; set; }
|
public WalletId WalletId { get; set; }
|
||||||
|
public bool Enabled { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public StoreViewModel()
|
public StoreViewModel()
|
||||||
@@ -83,6 +84,7 @@ namespace BTCPayServer.Models.StoreViewModels
|
|||||||
{
|
{
|
||||||
public string CryptoCode { get; set; }
|
public string CryptoCode { get; set; }
|
||||||
public string Address { get; set; }
|
public string Address { get; set; }
|
||||||
|
public bool Enabled { get; set; }
|
||||||
}
|
}
|
||||||
public List<LightningNode> LightningNodes
|
public List<LightningNode> LightningNodes
|
||||||
{
|
{
|
||||||
|
|||||||
74
BTCPayServer/Payments/IPaymentFilter.cs
Normal file
74
BTCPayServer/Payments/IPaymentFilter.cs
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace BTCPayServer.Payments
|
||||||
|
{
|
||||||
|
public interface IPaymentFilter
|
||||||
|
{
|
||||||
|
bool Match(PaymentMethodId paymentMethodId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public class PaymentFilter
|
||||||
|
{
|
||||||
|
class NeverPaymentFilter : IPaymentFilter
|
||||||
|
{
|
||||||
|
|
||||||
|
private static readonly NeverPaymentFilter _Instance = new NeverPaymentFilter();
|
||||||
|
public static NeverPaymentFilter Instance
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return _Instance;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public bool Match(PaymentMethodId paymentMethodId)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
class CompositePaymentFilter : IPaymentFilter
|
||||||
|
{
|
||||||
|
private readonly IPaymentFilter[] _filters;
|
||||||
|
|
||||||
|
public CompositePaymentFilter(IPaymentFilter[] filters)
|
||||||
|
{
|
||||||
|
_filters = filters;
|
||||||
|
}
|
||||||
|
public bool Match(PaymentMethodId paymentMethodId)
|
||||||
|
{
|
||||||
|
return _filters.Any(f => f.Match(paymentMethodId));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
class PaymentIdFilter : IPaymentFilter
|
||||||
|
{
|
||||||
|
private readonly PaymentMethodId _paymentMethodId;
|
||||||
|
|
||||||
|
public PaymentIdFilter(PaymentMethodId paymentMethodId)
|
||||||
|
{
|
||||||
|
_paymentMethodId = paymentMethodId;
|
||||||
|
}
|
||||||
|
public bool Match(PaymentMethodId paymentMethodId)
|
||||||
|
{
|
||||||
|
return paymentMethodId == _paymentMethodId;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public static IPaymentFilter Never()
|
||||||
|
{
|
||||||
|
return NeverPaymentFilter.Instance;
|
||||||
|
}
|
||||||
|
public static IPaymentFilter Any(IPaymentFilter[] filters)
|
||||||
|
{
|
||||||
|
if (filters == null)
|
||||||
|
throw new ArgumentNullException(nameof(filters));
|
||||||
|
return new CompositePaymentFilter(filters);
|
||||||
|
}
|
||||||
|
public static IPaymentFilter WhereIs(PaymentMethodId paymentMethodId)
|
||||||
|
{
|
||||||
|
if (paymentMethodId == null)
|
||||||
|
throw new ArgumentNullException(nameof(paymentMethodId));
|
||||||
|
return new PaymentIdFilter(paymentMethodId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
@model DerivationSchemeViewModel
|
@model DerivationSchemeViewModel
|
||||||
@{
|
@{
|
||||||
Layout = "../Shared/_NavLayout.cshtml";
|
Layout = "../Shared/_NavLayout.cshtml";
|
||||||
ViewData["Title"] = "Add derivation scheme";
|
ViewData["Title"] = $"{Model.CryptoCode} Derivation scheme";
|
||||||
ViewData.AddActivePage(BTCPayServer.Views.Stores.StoreNavPages.Index);
|
ViewData.AddActivePage(BTCPayServer.Views.Stores.StoreNavPages.Index);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -77,7 +77,12 @@
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<button name="command" type="submit" class="btn btn-primary">Continue</button>
|
<div class="form-check">
|
||||||
|
<input id="enabled" asp-for="Enabled" class="form-check-input" />
|
||||||
|
<label asp-for="Enabled" class="form-check-label"></label>
|
||||||
|
<span asp-validation-for="Enabled" class="text-danger"></span>
|
||||||
|
</div>
|
||||||
|
<button name="command" type="submit" class="btn btn-primary" value="save">Continue</button>
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -87,6 +92,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<input type="hidden" asp-for="Confirmation" />
|
<input type="hidden" asp-for="Confirmation" />
|
||||||
<input type="hidden" asp-for="DerivationScheme" />
|
<input type="hidden" asp-for="DerivationScheme" />
|
||||||
|
<input type="hidden" asp-for="Enabled" />
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<table class="table table-sm table-responsive-md">
|
<table class="table table-sm table-responsive-md">
|
||||||
<thead>
|
<thead>
|
||||||
@@ -116,7 +122,7 @@
|
|||||||
<input asp-for="HintAddress" class="form-control" />
|
<input asp-for="HintAddress" class="form-control" />
|
||||||
<span asp-validation-for="HintAddress" class="text-danger"></span>
|
<span asp-validation-for="HintAddress" class="text-danger"></span>
|
||||||
</div>
|
</div>
|
||||||
<button name="command" type="submit" class="btn btn-primary">Confirm</button>
|
<button name="command" type="submit" class="btn btn-primary" value="save">Confirm</button>
|
||||||
}
|
}
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -62,6 +62,11 @@
|
|||||||
</p>
|
</p>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-check">
|
||||||
|
<input id="enabled" asp-for="Enabled" class="form-check-input" />
|
||||||
|
<label asp-for="Enabled" class="form-check-label"></label>
|
||||||
|
<span asp-validation-for="Enabled" class="text-danger"></span>
|
||||||
|
</div>
|
||||||
<button name="command" type="submit" value="save" class="btn btn-primary">Submit</button>
|
<button name="command" type="submit" value="save" class="btn btn-primary">Submit</button>
|
||||||
<button name="command" type="submit" value="test" class="btn btn-secondary">Test connection</button>
|
<button name="command" type="submit" value="test" class="btn btn-secondary">Test connection</button>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@@ -70,6 +70,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<th>Crypto</th>
|
<th>Crypto</th>
|
||||||
<th>Derivation Scheme</th>
|
<th>Derivation Scheme</th>
|
||||||
|
<th>Status</th>
|
||||||
<th style="text-align:right">Actions</th>
|
<th style="text-align:right">Actions</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
@@ -79,6 +80,12 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td>@scheme.Crypto</td>
|
<td>@scheme.Crypto</td>
|
||||||
<td style="max-width:300px;overflow:hidden;">@scheme.Value</td>
|
<td style="max-width:300px;overflow:hidden;">@scheme.Value</td>
|
||||||
|
<td>
|
||||||
|
@if (!string.IsNullOrWhiteSpace(scheme.Value))
|
||||||
|
{
|
||||||
|
@(scheme.Enabled ? "Enabled" : "Disabled")
|
||||||
|
}
|
||||||
|
</td>
|
||||||
<td style="text-align:right">
|
<td style="text-align:right">
|
||||||
@if(!string.IsNullOrWhiteSpace(scheme.Value))
|
@if(!string.IsNullOrWhiteSpace(scheme.Value))
|
||||||
{
|
{
|
||||||
@@ -106,6 +113,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<th>Crypto</th>
|
<th>Crypto</th>
|
||||||
<th>Address</th>
|
<th>Address</th>
|
||||||
|
<th>Status</th>
|
||||||
<th style="text-align:right">Actions</th>
|
<th style="text-align:right">Actions</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
@@ -115,6 +123,9 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td>@scheme.CryptoCode</td>
|
<td>@scheme.CryptoCode</td>
|
||||||
<td>@scheme.Address</td>
|
<td>@scheme.Address</td>
|
||||||
|
<td>
|
||||||
|
@(scheme.Enabled ? "Enabled" : "Disabled")
|
||||||
|
</td>
|
||||||
<td style="text-align:right"><a asp-action="AddLightningNode" asp-route-cryptoCode="@scheme.CryptoCode">Modify</a></td>
|
<td style="text-align:right"><a asp-action="AddLightningNode" asp-route-cryptoCode="@scheme.CryptoCode">Modify</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user