discourse/app/assets/javascripts/admin/addon/components/webhook-event.hbs
Guhyoun Nam 784c04ea81
FEATURE: Add Mechanism to redeliver all failed webhook events (#27609)
Background:
In order to redrive failed webhook events, an operator has to go through and click on each. This PR is adding a mechanism to retry all failed events to help resolve issues quickly once the underlying failure has been resolved.

What is the change?:
Previously, we had to redeliver each webhook event. This merge is adding a 'Redeliver Failed' button next to the webhook event filter to redeliver all failed events. If there is no failed webhook events to redeliver, 'Redeliver Failed' gets disabled. If you click it, a window pops up to confirm the operator. Failed webhook events will be added to the queue and webhook event list will show the redelivering progress. Every minute, a job will be ran to go through 20 events to redeliver. Every hour, a job will cleanup the redelivering events which have been stored more than 8 hours.
2024-07-08 15:43:16 -05:00

43 lines
1.0 KiB
Handlebars

<li>
<div class="col first status">
{{#if @event.redelivering}}
{{d-icon "sync"}}
{{else}}
<span class={{this.statusColorClasses}}>{{@event.status}}</span>
{{/if}}
</div>
<div class="col event-id">{{@event.id}}</div>
<div class="col timestamp">{{this.createdAt}}</div>
<div class="col completion">{{this.completion}}</div>
<div class="col actions">
<DButton
@icon={{this.expandRequestIcon}}
@action={{this.toggleRequest}}
@label="admin.web_hooks.events.request"
/>
<DButton
@icon={{this.expandResponseIcon}}
@action={{this.toggleResponse}}
@label="admin.web_hooks.events.response"
/>
<DButton
@icon="sync"
@action={{this.redeliver}}
@label="admin.web_hooks.events.redeliver"
/>
</div>
{{#if this.expandDetails}}
<div class="details">
<h3>{{i18n "admin.web_hooks.events.headers"}}</h3>
<pre><code>{{this.headers}}</code></pre>
<h3>{{this.bodyLabel}}</h3>
<pre><code>{{this.body}}</code></pre>
</div>
{{/if}}
</li>