add logs and bump breez

This commit is contained in:
Kukks
2024-06-18 11:00:28 +02:00
parent 218c694190
commit 0caeaac5b4
6 changed files with 94 additions and 7 deletions

View File

@@ -0,0 +1,46 @@
@using BTCPayServer
@model System.Collections.Concurrent.ConcurrentQueue<(DateTimeOffset timestamp, string log)>
@{
var storeId = Context.GetCurrentStoreId();
ViewData.SetActivePage("Breez", "Logs", "Logs");
}
<div class="row mb-4">
<div class="col-12">
@if (!Model.Any())
{
<p class="text-secondary mt-3 mb-0">
There are no recent logs.
</p>
}
else
{
<div class="table-responsive">
<table class="table table-hover w-100">
<thead>
<tr>
<th >Timestamp</th>
<th >Log</th>
</tr>
</thead>
<tbody>
@foreach (var log in Model)
{
<tr>
<td>
<span >@log.timestamp.ToTimeAgo()</span>
</td>
<td>
<span class="text-break">@log.log</span>
</td>
</tr>
}
</tbody>
</table>
</div>
}
</div>
</div>

View File

@@ -1,14 +1,18 @@
@using BTCPayServer.Abstractions.Extensions
@using BTCPayServer
@using BTCPayServer.Abstractions.Extensions
@using BTCPayServer.Plugins.Breez
@using BTCPayServer.Security
@using Microsoft.AspNetCore.Mvc.TagHelpers
@using Microsoft.AspNetCore.Routing
@model string
@inject BreezService BreezService
@inject BTCPayNetworkProvider BtcPayNetworkProvider
@{
var storeId = Context.GetImplicitStoreId();
var address = Context.GetRouteValue("address").ToString();
ViewData.SetActivePage("Breez", "Create Swapin Refund", "SwapIn");
var deriv = Context.GetStoreData().GetDerivationSchemeSettings(BtcPayNetworkProvider, "BTC");
var sdk = BreezService.GetClient(storeId)?.Sdk;
var f = sdk.RecommendedFees();
}
@@ -20,7 +24,12 @@
<option value="@f.economyFee">Economic fee (@f.economyFee sat/vB)</option>
<option value="@f.minimumFee">Minimum fee (@f.minimumFee sat/vB)</option>
</datalist>
<datalist list="addresses">
@if (deriv is not null)
{
<option value="store"> Store wallet</option>
}
</datalist>
<form method="post" asp-action="SwapInRefund" asp-route-storeId="@storeId" asp-route-address="@address">
<div class="row mb-4">
@@ -40,7 +49,7 @@
<div asp-validation-summary="All" class="text-danger"></div>
<div class="form-group">
<label for="refundAddress" class="form-label" data-required>Refund address</label>
<input type="text" id="refundAddress" name="refundAddress" class="form-control" required/>
<input type="text" id="refundAddress" name="refundAddress" class="form-control" list="addresses" required/>
</div>
<div class="form-group">
<label for="satPerByte" class="form-label" data-required>Fees</label>

View File

@@ -13,7 +13,8 @@
StoreDashboardViewModel dashboardModel => dashboardModel.StoreId,
_ => Context.GetImplicitStoreId()
};
var sdk = BreezService.GetClient(storeId)?.Sdk;
var client = BreezService.GetClient(storeId);
var sdk = client?.Sdk;
}
<div class="sticky-header-setup"></div>
@@ -30,7 +31,11 @@
<a permission="@Policies.CanModifyStoreSettings" asp-action="SwapOut" asp-route-storeId="@storeId" class="nav-link @ViewData.IsActivePage("Breez", null, "SwapOut")">Swap Out</a>
<a permission="@Policies.CanModifyStoreSettings" asp-action="Configure" asp-route-storeId="@storeId" class="nav-link @ViewData.IsActivePage("Breez", null, "Configure")">Configuration</a>
</div>
@if (client.Events.Any())
{
<a permission="@Policies.CanViewStoreSettings" asp-action="Logs" asp-route-storeId="@storeId" class="nav-link @ViewData.IsActivePage("Breez", null, "Logs")">Logs</a>
}
</div>
</nav>
}
</div>