List webhook URLs (#3034)

Addresses #3000.

I limited the width of the URL field and made the full URL visible with a tooltip. The UI could probably use some sprucing up.
This commit is contained in:
Samuel Adams 2021-10-30 09:40:26 -04:00 committed by GitHub
parent 6b96f9b446
commit 24b7705094
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 0 deletions

View file

@ -24,6 +24,7 @@ namespace BTCPayServer.Models.StoreViewModels
Time = s.Timestamp;
Type = blob.ReadRequestAs<WebhookEvent>().Type;
WebhookId = s.Id;
PayloadUrl = s.Webhook?.GetBlob().Url;
}
public string Id { get; set; }
public DateTimeOffset Time { get; set; }
@ -31,6 +32,7 @@ namespace BTCPayServer.Models.StoreViewModels
public string WebhookId { get; set; }
public bool Success { get; set; }
public string ErrorMessage { get; set; }
public string PayloadUrl { get; set; }
}
public class EditWebhookViewModel
{

View file

@ -102,6 +102,7 @@ namespace BTCPayServer.Services.Invoices
{
using var ctx = _applicationDbContextFactory.CreateContext();
return await ctx.InvoiceWebhookDeliveries
.Include(s => s.Delivery).ThenInclude(s => s.Webhook)
.Where(s => s.InvoiceId == invoiceId)
.Select(s => s.Delivery)
.OrderByDescending(s => s.Timestamp)

View file

@ -338,9 +338,14 @@
</a>
<span class="text-light mx-2">|</span>
<span class="small text-muted">@delivery.Type</span>
<span class="text-light mx-2">|</span>
</span>
</span>
<span class="d-flex align-items-center">
<span class="text-nowrap" data-bs-toggle="tooltip" title="@delivery.PayloadUrl" style="cursor: pointer;">
<span class="small text-truncate d-inline-block" style="max-width: 250px;">@delivery.PayloadUrl</span>
</span>
<span class="text-light mx-2">|</span>
<strong class="d-flex align-items-center text-muted small">
@delivery.Time.ToBrowserDate()
</strong>