Merge branch 'sys_hooks' of dev.gitlabhq.com:gitlabhq
This commit is contained in:
commit
3c6daec4b1
33 changed files with 425 additions and 133 deletions
45
app/views/admin/hooks/_data_ex.html.erb
Normal file
45
app/views/admin/hooks/_data_ex.html.erb
Normal file
|
@ -0,0 +1,45 @@
|
|||
<% data_ex_str = <<eos
|
||||
{
|
||||
:before => "95790bf891e76fee5e1747ab589903a6a1f80f22",
|
||||
:after => "da1560886d4f094c3e6c9ef40349f7d38b5d27d7",
|
||||
:ref => "refs/heads/master",
|
||||
:user_id => 4,
|
||||
:user_name => "John Smith",
|
||||
:repository => {
|
||||
:name => "Diaspora",
|
||||
:url => "localhost/diaspora",
|
||||
:description => "",
|
||||
:homepage => "localhost/diaspora",
|
||||
:private => true
|
||||
},
|
||||
:commits => [
|
||||
[0] {
|
||||
:id => "450d0de7532f8b663b9c5cce183b...",
|
||||
:message => "Update Catalan translation to e38cb41.",
|
||||
:timestamp => "2011-12-12T14:27:31+02:00",
|
||||
:url => "http://localhost/diaspora/commits/450d0de7532f...",
|
||||
:author => {
|
||||
:name => "Jordi Mallach",
|
||||
:email => "jordi@softcatala.org"
|
||||
}
|
||||
},
|
||||
|
||||
....
|
||||
|
||||
[3] {
|
||||
:id => "da1560886d4f094c3e6c9ef40349...",
|
||||
:message => "fixed readme",
|
||||
:timestamp => "2012-01-03T23:36:29+02:00",
|
||||
:url => "http://localhost/diaspora/commits/da1560886d...",
|
||||
:author => {
|
||||
:name => "gitlab dev user",
|
||||
:email => "gitlabdev@dv6700.(none)"
|
||||
}
|
||||
}
|
||||
],
|
||||
total_commits_count => 3
|
||||
}
|
||||
eos
|
||||
%>
|
||||
<% js_lexer = Pygments::Lexer[:js] %>
|
||||
<%= raw js_lexer.highlight(data_ex_str) %>
|
39
app/views/admin/hooks/index.html.haml
Normal file
39
app/views/admin/hooks/index.html.haml
Normal file
|
@ -0,0 +1,39 @@
|
|||
.alert.alert-info
|
||||
%span
|
||||
Post receive hooks for binding events.
|
||||
%br
|
||||
Read more about system hooks
|
||||
%strong #{link_to "here", help_system_hooks_path, :class => "vlink"}
|
||||
|
||||
= form_for @hook, :as => :hook, :url => admin_hooks_path do |f|
|
||||
-if @hook.errors.any?
|
||||
.alert-message.block-message.error
|
||||
- @hook.errors.full_messages.each do |msg|
|
||||
%p= msg
|
||||
.clearfix
|
||||
= f.label :url, "URL:"
|
||||
.input
|
||||
= f.text_field :url, :class => "text_field xxlarge"
|
||||
|
||||
= f.submit "Add System Hook", :class => "btn primary"
|
||||
%hr
|
||||
|
||||
-if @hooks.any?
|
||||
%h3
|
||||
Hooks
|
||||
%small (#{@hooks.count})
|
||||
%br
|
||||
%table.admin-table
|
||||
%tr
|
||||
%th URL
|
||||
%th Method
|
||||
%th
|
||||
- @hooks.each do |hook|
|
||||
%tr
|
||||
%td
|
||||
= link_to admin_hook_path(hook) do
|
||||
%strong= hook.url
|
||||
= link_to 'Test Hook', admin_hook_test_path(hook), :class => "btn small right"
|
||||
%td POST
|
||||
%td
|
||||
= link_to 'Remove', admin_hook_path(hook), :confirm => 'Are you sure?', :method => :delete, :class => "danger btn small right"
|
|
@ -1,28 +0,0 @@
|
|||
%p This is page with preview for all system emails that are sent to user
|
||||
%p Email previews built based on existing Project/Commit/Issue base - so some preview maybe unavailable unless object appear in system
|
||||
|
||||
#accordion
|
||||
%h3
|
||||
%a New user
|
||||
%div
|
||||
%iframe{ :src=> admin_mailer_preview_user_new_path, :width=>"100%", :height=>"350"}
|
||||
%h3
|
||||
%a New issue
|
||||
%div
|
||||
%iframe{ :src=> admin_mailer_preview_issue_new_path, :width=>"100%", :height=>"350"}
|
||||
%h3
|
||||
%a Commit note
|
||||
%div
|
||||
%iframe{ :src=> admin_mailer_preview_note_path(:type => "Commit"), :width=>"100%", :height=>"350"}
|
||||
%h3
|
||||
%a Issue note
|
||||
%div
|
||||
%iframe{ :src=> admin_mailer_preview_note_path(:type => "Issue"), :width=>"100%", :height=>"350"}
|
||||
%h3
|
||||
%a Wall note
|
||||
%div
|
||||
%iframe{ :src=> admin_mailer_preview_note_path(:type => "Wall"), :width=>"100%", :height=>"350"}
|
||||
|
||||
:javascript
|
||||
$(function() {
|
||||
$("#accordion").accordion(); });
|
13
app/views/help/system_hooks.html.haml
Normal file
13
app/views/help/system_hooks.html.haml
Normal file
|
@ -0,0 +1,13 @@
|
|||
%h3 System hooks
|
||||
.back_link
|
||||
= link_to :back do
|
||||
← back
|
||||
%hr
|
||||
|
||||
%p.slead
|
||||
Your Gitlab instance can perform HTTP POST request on next event: create_project, delete_project, create_user, delete_user, change_team_member.
|
||||
%br
|
||||
System Hooks can be used for logging or change information in LDAP server.
|
||||
%br
|
||||
%h5 Hooks request example:
|
||||
= render "admin/hooks/data_ex"
|
|
@ -15,7 +15,7 @@
|
|||
%li{:class => tab_class(:admin_logs)}
|
||||
= link_to "Logs", admin_logs_path
|
||||
%li{:class => tab_class(:admin_emails)}
|
||||
= link_to "Emails", admin_emails_path
|
||||
= link_to "Hooks", admin_hooks_path
|
||||
%li{:class => tab_class(:admin_resque)}
|
||||
= link_to "Resque", admin_resque_path
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue