ui+invoice: improve webhooks section styling

This commit is contained in:
dstrukt 2022-05-05 06:23:37 -07:00 committed by Andrew Camilleri
parent fbe2096098
commit 12a5998a07

View file

@ -140,7 +140,7 @@
else
{
@Model.State
@if (Model.StatusException != InvoiceExceptionStatus.None)
@if (Model.StatusException != InvoiceExceptionStatus.None)
{
@String.Format(" ({0})", Model.StatusException.ToString());
}
@ -303,60 +303,78 @@
@if (Model.Deliveries.Count != 0)
{
<h3 class="mb-3 mt-4">Webhook deliveries</h3>
<ul class="list-group mb-5">
@foreach (var delivery in Model.Deliveries)
{
<li class="list-group-item ">
<form
asp-action="RedeliverWebhook"
asp-route-storeId="@Model.StoreId"
asp-route-invoiceId="@Model.Id"
asp-route-deliveryId="@delivery.Id"
method="post">
<div class="d-flex align-items-center">
<span class="d-flex align-items-center flex-fill me-3">
@if (delivery.Success)
{
<span class="d-flex align-items-center fa fa-check text-success" title="Success"></span>
}
else
{
<span class="d-flex align-items-center fa fa-times text-danger" title="@delivery.ErrorMessage"></span>
}
<span class="ms-3">
<a
asp-action="WebhookDelivery"
asp-route-invoiceId="@Model.Id"
asp-route-deliveryId="@delivery.Id"
class="btn btn-link delivery-content" target="_blank">
@delivery.Id
</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>
<button id="#redeliver-@delivery.Id"
type="submit"
class="btn btn-info py-1 ms-3 redeliver">
Redeliver
</button>
</span>
</div>
</form>
</li>
}
</ul>
<div class="row">
<div class="col-md-12">
<h3 class="mb-3 mt-4">Webhooks</h3>
<table class="table table-hover table-responsive-md mb-5">
<thead class="thead-inverse">
<tr>
<th>Status</th>
<th>ID</th>
<th>Type</th>
<th>Url</th>
<th>Date</th>
<th class="text-end">Action</th>
</tr>
</thead>
<tbody>
@foreach (var delivery in Model.Deliveries)
{
<tr>
<form asp-action="RedeliverWebhook"
asp-route-storeId="@Model.StoreId"
asp-route-invoiceId="@Model.Id"
asp-route-deliveryId="@delivery.Id"
method="post">
<td>
<span>
@if (delivery.Success)
{
<span class="fa fa-check text-success" title="Success"></span>
}
else
{
<span class="fa fa-times text-danger" title="@delivery.ErrorMessage"></span>
}
</span>
</td>
<td>
<span>
<a asp-action="WebhookDelivery"
asp-route-invoiceId="@Model.Id"
asp-route-deliveryId="@delivery.Id"
target="_blank">
@delivery.Id
</a>
</span>
</td>
<td>
<span>@delivery.Type</span>
</td>
<td>
<span class="text-nowrap" data-bs-toggle="tooltip" title="@delivery.PayloadUrl" style="cursor: pointer;">
<span style="max-width: 250px;">@delivery.PayloadUrl</span>
</span>
</td>
<td>
<span>
@delivery.Time.ToBrowserDate()
</span>
</td>
<td class="text-end">
<button id="#redeliver-@delivery.Id"
type="submit"
class="btn btn-link p-0">
Redeliver
</button>
</td>
</form>
</tr>
}
</tbody>
</table>
</div>
</div>
}
<div class="row mt-4">
<div class="col-md-12">