2020-11-06 20:42:26 +09:00
|
|
|
@model WebhooksViewModel
|
|
|
|
@{
|
|
|
|
Layout = "../Shared/_NavLayout.cshtml";
|
2021-12-31 08:36:38 +01:00
|
|
|
ViewData.SetActivePage(StoreNavPages.Webhooks, "Webhooks", Context.GetStoreData().Id);
|
2020-11-06 20:42:26 +09:00
|
|
|
}
|
2022-01-17 17:19:27 -08:00
|
|
|
<div class="row">
|
2022-01-27 03:56:46 +01:00
|
|
|
<div class="col-xl-8 col-xxl-constrain">
|
2022-01-17 17:19:27 -08:00
|
|
|
<div class="d-flex align-items-center justify-content-between mb-3">
|
|
|
|
<h3 class="mb-0">@ViewData["Title"]</h3>
|
|
|
|
<a id="CreateWebhook" asp-action="NewWebhook" class="btn btn-primary" role="button" asp-route-storeId="@Context.GetRouteValue("storeId")">
|
|
|
|
<span class="fa fa-plus"></span>
|
|
|
|
Create Webhook
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
<p>Webhooks allow BTCPay Server to send HTTP events related to your store to another server.</p>
|
2020-11-06 20:42:26 +09:00
|
|
|
|
2022-01-17 17:19:27 -08:00
|
|
|
@if (Model.Webhooks.Any())
|
2021-04-08 15:32:42 +02:00
|
|
|
{
|
2022-01-17 17:19:27 -08:00
|
|
|
<table class="table table-hover table-responsive-md">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>Status</th>
|
|
|
|
<th>Url</th>
|
|
|
|
<th class="text-end">Actions</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
@foreach (var wh in Model.Webhooks)
|
2021-07-12 05:58:11 -07:00
|
|
|
{
|
2022-01-17 17:19:27 -08:00
|
|
|
<tr>
|
|
|
|
<td class="align-baseline">
|
|
|
|
@if (wh.LastDeliverySuccessful)
|
|
|
|
{
|
|
|
|
<span class="fa fa-check text-success"
|
|
|
|
id="delivery-status-icon"
|
|
|
|
data-bs-toggle="tooltip"
|
|
|
|
title="@(wh.LastDeliveryTimeStamp == null ? "No deliveries for this webhook yet" : "Last delivery " + @wh.LastDeliveryTimeStamp?.ToTimeAgo())"></span>
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
<span class="fa fa-times text-danger"
|
|
|
|
id="delivery-status-icon"
|
|
|
|
data-bs-toggle="tooltip"
|
|
|
|
data-bs-html="true"
|
|
|
|
title="Error: @wh.LastDeliveryErrorMessage. <br/> Delivery last attempted <span id='last-delivery-time'>@wh.LastDeliveryTimeStamp?.ToTimeAgo()</span>"></span>
|
|
|
|
}
|
|
|
|
</td>
|
|
|
|
<td class="d-block text-break">@wh.Url</td>
|
|
|
|
<td class="text-end text-md-nowrap">
|
|
|
|
<a asp-action="TestWebhook" asp-route-storeId="@Context.GetRouteValue("storeId")" asp-route-webhookId="@wh.Id">Test</a> -
|
|
|
|
<a asp-action="ModifyWebhook" asp-route-storeId="@Context.GetRouteValue("storeId")" asp-route-webhookId="@wh.Id">Modify</a> -
|
|
|
|
<a asp-action="DeleteWebhook" asp-route-storeId="@Context.GetRouteValue("storeId")" asp-route-webhookId="@wh.Id" data-bs-toggle="modal" data-bs-target="#ConfirmModal" data-confirm-input="DELETE">Delete</a>
|
|
|
|
</td>
|
|
|
|
</tr>
|
2021-07-12 05:58:11 -07:00
|
|
|
}
|
2022-01-17 17:19:27 -08:00
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<partial name="_Confirm" model="@(new ConfirmModel("Delete Webhook", "This webhook will be removed from this store.", "Delete"))" />
|
2021-04-08 15:32:42 +02:00
|
|
|
}
|
2022-01-17 17:19:27 -08:00
|
|
|
else
|
|
|
|
{
|
|
|
|
<p class="text-secondary mt-3">
|
|
|
|
There are no webhooks yet.
|
|
|
|
</p>
|
|
|
|
}
|
|
|
|
</div>
|
|
|
|
</div>
|
2020-11-06 20:42:26 +09:00
|
|
|
|
2021-05-19 04:39:27 +02:00
|
|
|
@section PageFootContent {
|
2021-07-12 05:58:11 -07:00
|
|
|
<partial name="_ValidationScriptsPartial" />
|
2020-11-06 20:42:26 +09:00
|
|
|
}
|