index.html.haml 2.6 KB
Newer Older
D
Douwe Maan 已提交
1
- page_title "System Hooks"
2
%h3.page-title
3
  System hooks
4 5

%p.light
6
  #{link_to "System hooks ", help_page_path("system_hooks/system_hooks"), class: "vlink"} can be
7 8 9 10
  used for binding events when GitLab creates a User or Project.

%hr

V
Valeriy Sizov 已提交
11

D
Dmitriy Zaporozhets 已提交
12
= form_for @hook, as: :hook, url: admin_hooks_path, html: { class: 'form-horizontal' } do |f|
13 14
  = form_errors(@hook)

D
Dmitriy Zaporozhets 已提交
15
  .form-group
16
    = f.label :url, 'URL', class: 'control-label'
D
Dmitriy Zaporozhets 已提交
17
    .col-sm-10
18 19 20 21 22 23 24
      = f.text_field :url, class: 'form-control'
  .form-group
    = f.label :token, 'Secret Token', class: 'control-label'
    .col-sm-10
      = f.text_field :token, class: 'form-control'
      %p.help-block
        Use this token to validate received payloads
25 26 27 28 29 30 31
  .form-group
    = f.label :url, "Trigger", class: 'control-label'
    .col-sm-10.prepend-top-10
      %div
        System hook will be triggered on set of events like creating project
        or adding ssh key. But you can also enable extra triggers like Push events.

32
      .prepend-top-default
33 34 35 36 37 38 39 40 41 42 43 44 45
        = f.check_box :push_events, class: 'pull-left'
        .prepend-left-20
          = f.label :push_events, class: 'list-label' do
            %strong Push events
          %p.light
            This url will be triggered by a push to the repository
      %div
        = f.check_box :tag_push_events, class: 'pull-left'
        .prepend-left-20
          = f.label :tag_push_events, class: 'list-label' do
            %strong Tag push events
          %p.light
            This url will be triggered when a new tag is pushed to the repository
46 47 48 49 50 51 52
  .form-group
    = f.label :enable_ssl_verification, "SSL verification", class: 'control-label checkbox'
    .col-sm-10
      .checkbox
        = f.label :enable_ssl_verification do
          = f.check_box :enable_ssl_verification
          %strong Enable SSL verification
D
Dmitriy Zaporozhets 已提交
53
  .form-actions
54
    = f.submit "Add system hook", class: "btn btn-create"
V
Valeriy Sizov 已提交
55 56
%hr

57
- if @hooks.any?
58
  .panel.panel-default
59
    .panel-heading
60
      System hooks (#{@hooks.count})
61
    %ul.content-list
62 63
      - @hooks.each do |hook|
        %li
64
          .controls
65
            = link_to 'Test hook', admin_hook_test_path(hook), class: "btn btn-sm"
D
Dmitriy Zaporozhets 已提交
66
            = link_to 'Remove', admin_hook_path(hook), data: { confirm: 'Are you sure?' }, method: :delete, class: "btn btn-remove btn-sm"
67 68 69 70 71 72
          .monospace= hook.url
          %div
            - %w(push_events tag_push_events issues_events note_events merge_requests_events build_events).each do |trigger|
              - if hook.send(trigger)
                %span.label.label-gray= trigger.titleize
            %span.label.label-gray SSL Verification: #{hook.enable_ssl_verification ? "enabled" : "disabled"}