summaryrefslogtreecommitdiff
path: root/app/views/admin/runners/show.html.haml
blob: 8a0c2bf4c5f62446a83fcbd50cd3e914c7ba4673 (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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
= content_for :title do
  %h3.project-title
    Runner ##{@runner.id}
    .float-right
      - if @runner.shared?
        %span.runner-state.runner-state-shared
          Shared
      - else
        %span.runner-state.runner-state-specific
          Specific

- add_to_breadcrumbs _("Runners"), admin_runners_path
- breadcrumb_title "##{@runner.id}"
- @no_container = true

- if @runner.shared?
  .bs-callout.bs-callout-success
    %h4 This Runner will process jobs from ALL UNASSIGNED projects
    %p
      If you want Runners to build only specific projects, enable them in the table below.
      Keep in mind that this is a one way transition.
- elsif @runner.group_type?
  .bs-callout.bs-callout-success
    %h4 This runner will process jobs from all projects in its group and subgroups
- else
  .bs-callout.bs-callout-info
    %h4 This Runner will process jobs only from ASSIGNED projects
    %p You can't make this a shared Runner.
%hr

.append-bottom-20
  = render 'shared/runners/form', runner: @runner, runner_form_url: admin_runner_path(@runner)

.row
  .col-md-6
    %h4 Restrict projects for this Runner
    - if @runner.projects.any?
      %table.table.assigned-projects
        %thead
          %tr
            %th Assigned projects
            %th
        - @runner.runner_projects.each do |runner_project|
          - project = runner_project.project
          - if project
            %tr.alert-info
              %td
                %strong
                  = project.full_name
              %td
                .float-right
                  = link_to 'Disable', [:admin, project.namespace.becomes(Namespace), project, runner_project], method: :delete, class: 'btn btn-danger btn-sm'

    %table.table.unassigned-projects
      %thead
        %tr
          %th Project
          %th

      %tr
        %td
          = form_tag admin_runner_path(@runner), id: 'runner-projects-search', class: 'form-inline', method: :get do
            .form-group
              = search_field_tag :search, params[:search], class: 'form-control', spellcheck: false
            = submit_tag 'Search', class: 'btn'

        %td
      - @projects.each do |project|
        %tr
          %td
            = project.full_name
          %td
            .float-right
              = form_for [:admin, project.namespace.becomes(Namespace), project, project.runner_projects.new] do |f|
                = f.hidden_field :runner_id, value: @runner.id
                = f.submit 'Enable', class: 'btn btn-sm'
    = paginate @projects, theme: "gitlab"

  .col-md-6
    %h4 Recent jobs served by this Runner
    %table.table.ci-table.runner-builds
      %thead
        %tr
          %th Job
          %th Status
          %th Project
          %th Commit
          %th Finished at

      - @builds.each do |build|
        - project = build.project
        %tr.build
          %td.id
            - if project
              = link_to project_job_path(project, build) do
                %strong ##{build.id}
            - else
              %strong ##{build.id}

          %td.status
            = render 'ci/status/badge', status: build.detailed_status(current_user)

          %td.status
            - if project
              = project.full_name

          %td.build-link
            - if project
              = link_to pipeline_path(build.pipeline) do
                %strong= build.pipeline.short_sha

          %td.timestamp
            - if build.finished_at
              %span= time_ago_with_tooltip build.finished_at