summaryrefslogtreecommitdiff
path: root/app/views/admin
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzegorz.bizon@ntsn.pl>2015-12-14 11:46:02 +0100
committerGrzegorz Bizon <grzegorz.bizon@ntsn.pl>2015-12-14 12:26:40 +0100
commit2ec93abed7a1a3aa49b3267342824e0743de0f54 (patch)
tree7d3381dd4bd1f4d73ba234a56742edf491baa515 /app/views/admin
parentbc1cfd384f4f972ad887b0501280b9f94d4c94ac (diff)
parentc81023435795766411c5954a4676ebb215af40a6 (diff)
downloadgitlab-ce-2ec93abed7a1a3aa49b3267342824e0743de0f54.tar.gz
Merge branch 'master' into ci/persist-registration-token
* master: (66 commits) Fix runners admin view Fix migrations Rename mention of gitlab-git-http-server to gitlab-workhorse Bump Redis requirement to 2.8 for Sidekiq 4 requirements Fix wording on runner setup page add details on how to change saml button label Fix tests Move awards back to gray panel and few improvements to sidebar Few UI improvements to new sidebar implementation Fix tests for new issuable sidebar Update changelog Implement new sidebar for merge request page Make edit link on issuable sidebar works Redesign issue page for new sidebar Move awards css to separate file Implement issuable sidebar partial Update CHANGELOG Clarify cache behavior Run builds from projects with enabled CI Use Gitlab::Git instead of Ci::Git ... Conflicts: db/schema.rb
Diffstat (limited to 'app/views/admin')
-rw-r--r--app/views/admin/builds/_build.html.haml73
-rw-r--r--app/views/admin/builds/index.html.haml50
-rw-r--r--app/views/admin/runners/_runner.html.haml48
-rw-r--r--app/views/admin/runners/index.html.haml67
-rw-r--r--app/views/admin/runners/show.html.haml125
-rw-r--r--app/views/admin/runners/update.js.haml2
6 files changed, 365 insertions, 0 deletions
diff --git a/app/views/admin/builds/_build.html.haml b/app/views/admin/builds/_build.html.haml
new file mode 100644
index 00000000000..6936e614346
--- /dev/null
+++ b/app/views/admin/builds/_build.html.haml
@@ -0,0 +1,73 @@
+- project = build.project
+%tr.build
+ %td.status
+ = ci_status_with_icon(build.status)
+
+ %td.build-link
+ - if build.target_url
+ = link_to build.target_url do
+ %strong Build ##{build.id}
+ - else
+ %strong Build ##{build.id}
+
+ - if build.show_warning?
+ %i.fa.fa-warning.text-warning
+
+ %td
+ - if project
+ = link_to project.name_with_namespace, admin_namespace_project_path(project.namespace, project), class: "monospace"
+
+ %td
+ = link_to build.short_sha, namespace_project_commit_path(project.namespace, project, build.sha), class: "monospace"
+
+ %td
+ - if build.ref
+ = link_to build.ref, namespace_project_commits_path(project.namespace, project, build.ref)
+ - else
+ .light none
+
+ %td
+ - if build.try(:runner)
+ = runner_link(build.runner)
+ - else
+ .light none
+
+ %td
+ #{build.stage} / #{build.name}
+
+ .pull-right
+ - if build.tags.any?
+ - build.tags.each do |tag|
+ %span.label.label-primary
+ = tag
+ - if build.try(:trigger_request)
+ %span.label.label-info triggered
+ - if build.try(:allow_failure)
+ %span.label.label-danger allowed to fail
+
+ %td.duration
+ - if build.duration
+ #{duration_in_words(build.finished_at, build.started_at)}
+
+ %td.timestamp
+ - if build.finished_at
+ %span #{time_ago_with_tooltip(build.finished_at)}
+
+ - if defined?(coverage) && coverage
+ %td.coverage
+ - if build.try(:coverage)
+ #{build.coverage}%
+
+ %td
+ .pull-right
+ - if current_user && can?(current_user, :download_build_artifacts, project) && build.download_url
+ = link_to build.download_url, title: 'Download artifacts' do
+ %i.fa.fa-download
+ - if current_user && can?(current_user, :manage_builds, build.project)
+ - if build.active?
+ - if build.cancel_url
+ = link_to build.cancel_url, method: :post, title: 'Cancel' do
+ %i.fa.fa-remove.cred
+ - elsif defined?(allow_retry) && allow_retry && build.retry_url
+ = link_to build.retry_url, method: :post, title: 'Retry' do
+ %i.fa.fa-repeat
diff --git a/app/views/admin/builds/index.html.haml b/app/views/admin/builds/index.html.haml
new file mode 100644
index 00000000000..55da06a7fe9
--- /dev/null
+++ b/app/views/admin/builds/index.html.haml
@@ -0,0 +1,50 @@
+.project-issuable-filter
+ .controls
+ .pull-left.hidden-xs
+ - if @all_builds.running_or_pending.any?
+ = link_to 'Cancel all', cancel_all_admin_builds_path, data: { confirm: 'Are you sure?' }, class: 'btn btn-danger', method: :post
+
+ %ul.center-top-menu
+ %li{class: ('active' if @scope.nil?)}
+ = link_to admin_builds_path do
+ Running
+ %span.badge.js-running-count= @all_builds.running_or_pending.count(:id)
+
+ %li{class: ('active' if @scope == 'finished')}
+ = link_to admin_builds_path(scope: :finished) do
+ Finished
+ %span.badge.js-running-count= @all_builds.finished.count(:id)
+
+ %li{class: ('active' if @scope == 'all')}
+ = link_to admin_builds_path(scope: :all) do
+ All
+ %span.badge.js-totalbuilds-count= @all_builds.count(:id)
+
+.gray-content-block
+ #{(@scope || 'running').capitalize} builds
+
+%ul.content-list
+ - if @builds.blank?
+ %li
+ .nothing-here-block No builds to show
+ - else
+ .table-holder
+ %table.table.builds
+ %thead
+ %tr
+ %th Status
+ %th Build ID
+ %th Project
+ %th Commit
+ %th Ref
+ %th Runner
+ %th Name
+ %th Duration
+ %th Finished at
+ %th
+
+ - @builds.each do |build|
+ = render "admin/builds/build", build: build
+
+ = paginate @builds, theme: 'gitlab'
+
diff --git a/app/views/admin/runners/_runner.html.haml b/app/views/admin/runners/_runner.html.haml
new file mode 100644
index 00000000000..6745e58deca
--- /dev/null
+++ b/app/views/admin/runners/_runner.html.haml
@@ -0,0 +1,48 @@
+%tr{id: dom_id(runner)}
+ %td
+ - if runner.shared?
+ %span.label.label-success shared
+ - else
+ %span.label.label-info specific
+ - unless runner.active?
+ %span.label.label-danger paused
+
+ %td
+ = link_to admin_runner_path(runner) do
+ = runner.short_sha
+ %td
+ .runner-description
+ = runner.description
+ %span (#{link_to 'edit', '#', class: 'edit-runner-link'})
+ .runner-description-form.hide
+ = form_for [:admin, runner], remote: true, html: { class: 'form-inline' } do |f|
+ .form-group
+ = f.text_field :description, class: 'form-control'
+ = f.submit 'Save', class: 'btn'
+ %span (#{link_to 'cancel', '#', class: 'cancel'})
+ %td
+ - if runner.shared?
+ \-
+ - else
+ = runner.projects.count(:all)
+ %td
+ #{runner.builds.count(:all)}
+ %td
+ - runner.tag_list.each do |tag|
+ %span.label.label-primary
+ = tag
+ %td
+ - if runner.contacted_at
+ #{time_ago_in_words(runner.contacted_at)} ago
+ - else
+ Never
+ %td
+ .pull-right
+ = link_to 'Edit', admin_runner_path(runner), class: 'btn btn-sm'
+ &nbsp;
+ - if runner.active?
+ = link_to 'Pause', [:pause, :admin, runner], data: { confirm: "Are you sure?" }, method: :get, class: 'btn btn-danger btn-sm'
+ - else
+ = link_to 'Resume', [:resume, :admin, runner], method: :get, class: 'btn btn-success btn-sm'
+ = link_to 'Remove', [:admin, runner], data: { confirm: "Are you sure?" }, method: :delete, class: 'btn btn-danger btn-sm'
+
diff --git a/app/views/admin/runners/index.html.haml b/app/views/admin/runners/index.html.haml
new file mode 100644
index 00000000000..c5fb3c95506
--- /dev/null
+++ b/app/views/admin/runners/index.html.haml
@@ -0,0 +1,67 @@
+%p.lead
+ %span
+ To register a new runner you should enter the following registration token.
+ With this token the runner will request a unique runner token and use that for future communication.
+ Registration token is
+ %code{ id: 'runners-token' } #{current_application_settings.ensure_runners_registration_token}
+
+.bs-callout.clearfix
+ .pull-left
+ %p
+ You can reset runners registration token by pressing a button below.
+ %p
+ = button_to reset_runners_token_admin_application_settings_path,
+ method: :put, class: 'btn btn-default',
+ data: { confirm: 'Are you sure you want to reset registration token?' } do
+ = icon('refresh')
+ Reset runners registration token
+
+.bs-callout
+ %p
+ A 'runner' is a process which runs a build.
+ You can setup as many runners as you need.
+ %br
+ Runners can be placed on separate users, servers, and even on your local machine.
+ %br
+
+ %div
+ %span Each runner can be in one of the following states:
+ %ul
+ %li
+ %span.label.label-success shared
+ \- run builds from all unassigned projects
+ %li
+ %span.label.label-info specific
+ \- run builds from assigned projects
+ %li
+ %span.label.label-danger paused
+ \- runner will not receive any new builds
+
+.append-bottom-20.clearfix
+ .pull-left
+ = form_tag admin_runners_path, id: 'runners-search', class: 'form-inline', method: :get do
+ .form-group
+ = search_field_tag :search, params[:search], class: 'form-control', placeholder: 'Runner description or token', spellcheck: false
+ = submit_tag 'Search', class: 'btn'
+
+ .pull-right.light
+ Runners with last contact less than a minute ago: #{@active_runners_cnt}
+
+%br
+
+.table-holder
+ %table.table
+ %thead
+ %tr
+ %th Type
+ %th Runner token
+ %th Description
+ %th Projects
+ %th Builds
+ %th Tags
+ %th Last contact
+ %th
+
+ - @runners.each do |runner|
+ = render "admin/runners/runner", runner: runner
+= paginate @runners
diff --git a/app/views/admin/runners/show.html.haml b/app/views/admin/runners/show.html.haml
new file mode 100644
index 00000000000..32051852dc0
--- /dev/null
+++ b/app/views/admin/runners/show.html.haml
@@ -0,0 +1,125 @@
+= content_for :title do
+ %h3.project-title
+ Runner ##{@runner.id}
+ .pull-right
+ - if @runner.shared?
+ %span.runner-state.runner-state-shared
+ Shared
+ - else
+ %span.runner-state.runner-state-specific
+ Specific
+
+
+
+- if @runner.shared?
+ .bs-callout.bs-callout-success
+ %h4 This runner will process builds 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.
+- else
+ .bs-callout.bs-callout-info
+ %h4 This runner will process builds only from ASSIGNED projects
+ %p You can't make this a shared runner.
+%hr
+= form_for @runner, url: admin_runner_path(@runner), html: { class: 'form-horizontal' } do |f|
+ .form-group
+ = label_tag :token, class: 'control-label' do
+ Token
+ .col-sm-10
+ = f.text_field :token, class: 'form-control', readonly: true
+ .form-group
+ = label_tag :description, class: 'control-label' do
+ Description
+ .col-sm-10
+ = f.text_field :description, class: 'form-control'
+ .form-group
+ = label_tag :tag_list, class: 'control-label' do
+ Tags
+ .col-sm-10
+ = f.text_field :tag_list, value: @runner.tag_list.to_s, class: 'form-control'
+ .help-block You can setup builds to only use runners with specific tags
+ .form-actions
+ = f.submit 'Save', class: 'btn btn-save'
+
+.row
+ .col-md-6
+ %h4 Restrict projects for this runner
+ - if @runner.projects.any?
+ %table.table
+ %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.name_with_namespace
+ %td
+ .pull-right
+ = link_to 'Disable', [:admin, project.namespace, project, runner_project], method: :delete, class: 'btn btn-danger btn-xs'
+
+ %table.table
+ %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.name_with_namespace
+ %td
+ .pull-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-xs'
+ = paginate @projects
+
+ .col-md-6
+ %h4 Recent builds served by this runner
+ %table.table.builds.runner-builds
+ %thead
+ %tr
+ %th Build
+ %th Status
+ %th Project
+ %th Commit
+ %th Finished at
+
+ - @builds.each do |build|
+ - project = build.project
+ %tr.build
+ %td.id
+ - if project
+ = link_to namespace_project_build_path(project.namespace, project, build) do
+ %strong ##{build.id}
+ - else
+ %strong ##{build.id}
+
+ %td.status
+ = ci_status_with_icon(build.status)
+
+ %td.status
+ - if project
+ = project.name_with_namespace
+
+ %td.build-link
+ - if project
+ = link_to ci_status_path(build.commit) do
+ %strong #{build.commit.short_sha}
+
+ %td.timestamp
+ - if build.finished_at
+ %span #{time_ago_in_words build.finished_at} ago
diff --git a/app/views/admin/runners/update.js.haml b/app/views/admin/runners/update.js.haml
new file mode 100644
index 00000000000..2b7d3067e20
--- /dev/null
+++ b/app/views/admin/runners/update.js.haml
@@ -0,0 +1,2 @@
+:plain
+ $("#runner_#{@runner.id}").replaceWith("#{escape_javascript(render(@runner))}")