From 330789c23c777d8ca646eba7c25f39cb7342cdee Mon Sep 17 00:00:00 2001 From: Alexander Randa Date: Thu, 27 Apr 2017 10:08:57 +0000 Subject: Implement web hooks logging * implemented logging of project and system web hooks * implemented UI for user area (project hooks) * implemented UI for admin area (system hooks) * implemented retry of logged webhook * NOT imeplemented log remover --- app/controllers/concerns/hooks_execution.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 app/controllers/concerns/hooks_execution.rb (limited to 'app/controllers/concerns/hooks_execution.rb') diff --git a/app/controllers/concerns/hooks_execution.rb b/app/controllers/concerns/hooks_execution.rb new file mode 100644 index 00000000000..846cd60518f --- /dev/null +++ b/app/controllers/concerns/hooks_execution.rb @@ -0,0 +1,15 @@ +module HooksExecution + extend ActiveSupport::Concern + + private + + def set_hook_execution_notice(status, message) + if status && status >= 200 && status < 400 + flash[:notice] = "Hook executed successfully: HTTP #{status}" + elsif status + flash[:alert] = "Hook executed successfully but returned HTTP #{status} #{message}" + else + flash[:alert] = "Hook execution failed: #{message}" + end + end +end -- cgit v1.2.1