Small UI improvements in the payout processors

This commit is contained in:
nicolas.dorier
2024-10-09 17:44:19 +09:00
parent e4f79f046a
commit ae76cc1ca2
6 changed files with 8 additions and 12 deletions

View File

@@ -14,14 +14,6 @@ namespace BTCPayServer.Abstractions.Models
public string SeverityCSS => ToString(Severity); public string SeverityCSS => ToString(Severity);
private void ParseNonJsonStatus(string s)
{
Message = s;
Severity = s.StartsWith("Error", StringComparison.InvariantCultureIgnoreCase)
? StatusSeverity.Error
: StatusSeverity.Success;
}
public static string ToString(StatusSeverity severity) public static string ToString(StatusSeverity severity)
{ {
switch (severity) switch (severity)

View File

@@ -127,7 +127,7 @@ public class UILightningAutomatedPayoutProcessorsController : Controller
IntervalMinutes = blob.Interval.TotalMinutes; IntervalMinutes = blob.Interval.TotalMinutes;
ProcessNewPayoutsInstantly = blob.ProcessNewPayoutsInstantly; ProcessNewPayoutsInstantly = blob.ProcessNewPayoutsInstantly;
} }
[Display(Name = "Process approved payouts instantly")]
public bool ProcessNewPayoutsInstantly { get; set; } public bool ProcessNewPayoutsInstantly { get; set; }
[Range(AutomatedPayoutConstants.MinIntervalMinutes, AutomatedPayoutConstants.MaxIntervalMinutes)] [Range(AutomatedPayoutConstants.MinIntervalMinutes, AutomatedPayoutConstants.MaxIntervalMinutes)]

View File

@@ -140,6 +140,7 @@ public class UIOnChainAutomatedPayoutProcessorsController : Controller
Threshold = blob.Threshold; Threshold = blob.Threshold;
} }
[Display(Name = "Process approved payouts instantly")]
public bool ProcessNewPayoutsInstantly { get; set; } public bool ProcessNewPayoutsInstantly { get; set; }
[Range(1, 1000)] [Range(1, 1000)]

View File

@@ -30,7 +30,7 @@
} }
<div class="d-flex my-3"> <div class="d-flex my-3">
<input asp-for="ProcessNewPayoutsInstantly" type="checkbox" class="btcpay-toggle me-3" /> <input asp-for="ProcessNewPayoutsInstantly" type="checkbox" class="btcpay-toggle me-3" />
<label asp-for="ProcessNewPayoutsInstantly" class="form-check-label">Process approved payouts instantly</label> <label asp-for="ProcessNewPayoutsInstantly" class="form-check-label"></label>
<span asp-validation-for="ProcessNewPayoutsInstantly" class="text-danger"></span> <span asp-validation-for="ProcessNewPayoutsInstantly" class="text-danger"></span>
</div> </div>
<div class="form-group"> <div class="form-group">

View File

@@ -24,14 +24,14 @@
<partial name="_StatusMessage" /> <partial name="_StatusMessage" />
<div class="row"> <div class="row">
<div class="col-xl-8 col-xxl-constrain"> <div class="col-xl-8 col-xxl-constrain">
<p>Set a schedule for automated On-Chain Bitcoin Payouts. </p> <p>Set a schedule for automated On-Chain Bitcoin Payouts.</p>
@if (!ViewContext.ModelState.IsValid) @if (!ViewContext.ModelState.IsValid)
{ {
<div asp-validation-summary="All"></div> <div asp-validation-summary="All"></div>
} }
<div class="d-flex my-3"> <div class="d-flex my-3">
<input asp-for="ProcessNewPayoutsInstantly" type="checkbox" class="btcpay-toggle me-3" /> <input asp-for="ProcessNewPayoutsInstantly" type="checkbox" class="btcpay-toggle me-3" />
<label asp-for="ProcessNewPayoutsInstantly" class="form-check-label">Process approved payouts instantly</label> <label asp-for="ProcessNewPayoutsInstantly" class="form-check-label"></label>
<span asp-validation-for="ProcessNewPayoutsInstantly" class="text-danger"></span> <span asp-validation-for="ProcessNewPayoutsInstantly" class="text-danger"></span>
</div> </div>
<div class="form-group"> <div class="form-group">

View File

@@ -10,6 +10,9 @@
<div class="sticky-header"> <div class="sticky-header">
<h2 class="my-1" text-translate="true">@ViewData["Title"]</h2> <h2 class="my-1" text-translate="true">@ViewData["Title"]</h2>
</div> </div>
<partial name="_StatusMessage" />
<p>Payout Processors allow BTCPay Server to handle payouts in an automated way.</p> <p>Payout Processors allow BTCPay Server to handle payouts in an automated way.</p>
<div class="row"> <div class="row">