summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorJacob Vosmaer <contact@jacobvosmaer.nl>2016-04-12 17:32:58 +0200
committerJacob Vosmaer <contact@jacobvosmaer.nl>2016-04-12 17:32:58 +0200
commitea787165b3a9604aa86304e29778066bb014824e (patch)
treeacaf9cf04c004b43bb87001ddda17a1542fc68bf /app
parent97f4ffff1e7b5da94e18edc20c009ffb46784187 (diff)
downloadgitlab-ce-ea787165b3a9604aa86304e29778066bb014824e.tar.gz
Move 'clear checks' button to applicatoin settings
Diffstat (limited to 'app')
-rw-r--r--app/controllers/admin/application_settings_controller.rb14
-rw-r--r--app/controllers/admin/projects_controller.rb12
-rw-r--r--app/views/admin/application_settings/_form.html.haml6
-rw-r--r--app/views/admin/projects/index.html.haml5
4 files changed, 20 insertions, 17 deletions
diff --git a/app/controllers/admin/application_settings_controller.rb b/app/controllers/admin/application_settings_controller.rb
index f010436bd36..993a70e63bc 100644
--- a/app/controllers/admin/application_settings_controller.rb
+++ b/app/controllers/admin/application_settings_controller.rb
@@ -19,6 +19,19 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController
redirect_to admin_runners_path
end
+ def clear_repository_check_states
+ Project.update_all(
+ last_repository_check_failed: false,
+ last_repository_check_at: nil
+ )
+
+ redirect_to(
+ admin_application_settings_path,
+ notice: 'All repository check states were cleared'
+ )
+ end
+
+
private
def set_application_setting
@@ -82,6 +95,7 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController
:akismet_enabled,
:akismet_api_key,
:email_author_in_body,
+ :repository_checks_enabled,
restricted_visibility_levels: [],
import_sources: []
)
diff --git a/app/controllers/admin/projects_controller.rb b/app/controllers/admin/projects_controller.rb
index 01257a68616..d7cd9520cc6 100644
--- a/app/controllers/admin/projects_controller.rb
+++ b/app/controllers/admin/projects_controller.rb
@@ -40,18 +40,6 @@ class Admin::ProjectsController < Admin::ApplicationController
)
end
- def clear_repository_check_states
- Project.update_all(
- last_repository_check_failed: false,
- last_repository_check_at: nil
- )
-
- redirect_to(
- admin_namespaces_projects_path,
- notice: 'All project states were cleared'
- )
- end
-
protected
def project
diff --git a/app/views/admin/application_settings/_form.html.haml b/app/views/admin/application_settings/_form.html.haml
index afd88465a78..c7c82da72c7 100644
--- a/app/views/admin/application_settings/_form.html.haml
+++ b/app/views/admin/application_settings/_form.html.haml
@@ -287,6 +287,12 @@
GitLab will periodically run
%a{ href: 'https://www.kernel.org/pub/software/scm/git/docs/git-fsck.html', target: 'blank' } 'git fsck'
in all project and wiki repositories to look for silent disk corruption issues.
+ .form-group
+ .col-sm-offset-2.col-sm-10
+ = link_to 'Clear all repository checks', clear_repository_check_states_admin_application_settings_path, data: { confirm: 'This will clear repository check states for ALL projects in the database. This cannot be undone. Are you sure?' }, method: :put, class: "btn btn-sm btn-remove"
+ .help-block
+ If you got a lot of false alarms from repository checks (maybe your fileserver was temporarily unavailable) you can choose to clear all repository check information from the database.
+
.form-actions
= f.submit 'Save', class: 'btn btn-save'
diff --git a/app/views/admin/projects/index.html.haml b/app/views/admin/projects/index.html.haml
index c2bf0659841..aa07afa0d62 100644
--- a/app/views/admin/projects/index.html.haml
+++ b/app/views/admin/projects/index.html.haml
@@ -49,11 +49,6 @@
= button_tag "Search", class: "btn submit btn-primary"
= link_to "Reset", admin_namespaces_projects_path, class: "btn btn-cancel"
- .panel.panel-default.repository-check-states
- .panel-heading
- Repository check states
- .panel-body
- = link_to 'Clear all', clear_repository_check_states_admin_namespace_projects_path(0), data: { confirm: 'This will clear repository check states for ALL projects in the database. This cannot be undone. Are you sure?' }, method: :put, class: "btn btn-sm btn-remove"
%section.col-md-9
.panel.panel-default
.panel-heading