btcpayserver/BTCPayServer/Views/UIStores/Webhooks.cshtml
d11n a962e60de9
More Translations (#6318)
* Store selector

* Footer

* Notifications

* Checkout Appearance

* Users list

* Forms

* Emails

* Pay Button

* Edit Dictionary

* Remove newlines, fix typos

* Forms

* Pull payments and payouts

* Various pages

* Use local docs link

* Fix

* Even more translations

* Fixes #6325

* Account pages

* Notifications

* Placeholders

* Various pages and components

* Add more
2024-10-25 22:48:53 +09:00

78 lines
4.3 KiB
Text

@using BTCPayServer.Abstractions.Models
@using BTCPayServer.Client
@using Microsoft.AspNetCore.Mvc.TagHelpers
@model WebhooksViewModel
@{
ViewData.SetActivePage(StoreNavPages.Webhooks, StringLocalizer["Webhooks"], Context.GetStoreData().Id);
}
<div class="sticky-header">
<h2 text-translate="true">@ViewData["Title"]</h2>
<a id="page-primary" asp-action="NewWebhook" class="btn btn-primary" role="button" asp-route-storeId="@Context.GetRouteValue("storeId")" permission="@Policies.CanModifyStoreSettings">
Create Webhook
</a>
</div>
<partial name="_StatusMessage" />
<p text-translate="true">Webhooks allow BTCPay Server to send HTTP events related to your store to another server.</p>
<div class="row">
<div class="col-xl-8 col-xxl-constrain">
@if (Model.Webhooks.Any())
{
<div class="table-responsive-md">
<table class="table table-hover">
<thead>
<tr>
<th text-translate="true">Status</th>
<th text-translate="true">Url</th>
<th class="actions-col" permission="@Policies.CanModifyStoreSettings" text-translate="true">Actions</th>
</tr>
</thead>
<tbody>
@foreach (var wh in Model.Webhooks)
{
<tr>
<td class="align-baseline">
@if (wh.LastDeliverySuccessful)
{
<span id="delivery-status-icon"
data-bs-toggle="tooltip"
title="@(wh.LastDeliveryTimeStamp == null ? StringLocalizer["No deliveries for this webhook yet"] : StringLocalizer["Last delivery {0}", wh.LastDeliveryTimeStamp.Value.ToTimeAgo()])">
<vc:icon symbol="checkmark" css-class="text-success" />
</span>
}
else
{
<span 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>">
<vc:icon symbol="cross" css-class="text-danger" />
</span>
}
</td>
<td class="d-block text-break">@wh.Url</td>
<td class="actions-col text-md-nowrap" permission="@Policies.CanModifyStoreSettings">
<a asp-action="TestWebhook" asp-route-storeId="@Context.GetRouteValue("storeId")" asp-route-webhookId="@wh.Id" text-translate="true">Test</a> -
<a asp-action="ModifyWebhook" asp-route-storeId="@Context.GetRouteValue("storeId")" asp-route-webhookId="@wh.Id" text-translate="true">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" text-translate="true">Delete</a>
</td>
</tr>
}
</tbody>
</table>
</div>
<partial name="_Confirm" model="@(new ConfirmModel(StringLocalizer["Delete Webhook"], StringLocalizer["This webhook will be removed from this store."], StringLocalizer["Delete"]))" permission="@Policies.CanModifyStoreSettings" />
}
else
{
<p class="text-secondary mt-3" text-translate="true">
There are no webhooks yet.
</p>
}
</div>
</div>
@section PageFootContent {
<partial name="_ValidationScriptsPartial" />
}