2018-12-05 23:21:45 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-09-10 17:25:29 +05:30
|
|
|
class Admin::HookLogsController < Admin::ApplicationController
|
2021-12-11 22:18:48 +05:30
|
|
|
include ::Integrations::HooksExecution
|
2017-09-10 17:25:29 +05:30
|
|
|
|
|
|
|
before_action :hook, only: [:show, :retry]
|
|
|
|
before_action :hook_log, only: [:show, :retry]
|
|
|
|
|
|
|
|
respond_to :html
|
|
|
|
|
2021-01-03 14:25:43 +05:30
|
|
|
feature_category :integrations
|
2021-12-11 22:18:48 +05:30
|
|
|
urgency :low, [:retry]
|
2021-01-03 14:25:43 +05:30
|
|
|
|
2017-09-10 17:25:29 +05:30
|
|
|
def show
|
|
|
|
end
|
|
|
|
|
|
|
|
def retry
|
|
|
|
result = hook.execute(hook_log.request_data, hook_log.trigger)
|
|
|
|
|
|
|
|
set_hook_execution_notice(result)
|
|
|
|
|
|
|
|
redirect_to edit_admin_hook_path(@hook)
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def hook
|
|
|
|
@hook ||= SystemHook.find(params[:hook_id])
|
|
|
|
end
|
|
|
|
|
|
|
|
def hook_log
|
|
|
|
@hook_log ||= hook.web_hook_logs.find(params[:id])
|
|
|
|
end
|
|
|
|
end
|