summaryrefslogtreecommitdiff
path: root/app/views/ci/admin/runner_projects/index.html.haml
blob: f049b4f4c4e483a9937dfc414a7494d7ceaaa81c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
%p.lead
  To register new runner visit #{link_to 'this page ', ci_runners_path}

.row
  .col-md-8
    %h5 Activated:
    %table.table
      %tr
        %th Runner ID
        %th Runner Description
        %th Last build
        %th Builds Stats
        %th Registered
        %th

      - @runner_projects.each do |runner_project|
        - runner = runner_project.runner
        - builds = runner.builds.where(project_id: @project.id)
        %tr
          %td
            %span.badge.badge-info= runner.id
          %td
            = runner.display_name
          %td
            - last_build = builds.last
            - if last_build
              = link_to last_build.short_sha, [last_build.project, last_build]
            - else
              unknown
          %td
            %span.badge.badge-success
              #{builds.success.count}
            %span /
            %span.badge.badge-important
              #{builds.failed.count}
          %td
            #{time_ago_in_words(runner_project.created_at)} ago
          %td
            = link_to 'Disable', [:ci, @project, runner_project], data: { confirm: "Are you sure?" }, method: :delete, class: 'btn btn-danger btn-sm right'
  .col-md-4
    %h5 Available
    %table.table
      %tr
        %th ID
        %th Token
        %th

      - (Ci::Runner.all - @project.runners).each do |runner|
        %tr
          %td
            = runner.id
          %td
            = runner.token
          %td
            = form_for [:ci, @project, @runner_project] do |f|
              = f.hidden_field :runner_id, value: runner.id
              = f.submit 'Add', class: 'btn btn-sm'