diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2012-11-29 07:49:11 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2012-11-29 07:49:11 +0300 |
commit | ff9a2e2a9399bf1d190de7fab2d1d26b70433b19 (patch) | |
tree | 615b63e88e2d8a0b4db45f28f09d5d33c21397ac | |
parent | eb1004f7890d25a86beb0ca0a7eca802d9fce665 (diff) | |
download | gitlab-ce-ff9a2e2a9399bf1d190de7fab2d1d26b70433b19.tar.gz |
Improve admin logs
-rw-r--r-- | app/assets/javascripts/admin.js.coffee | 5 | ||||
-rw-r--r-- | app/views/admin/groups/_form.html.haml | 7 | ||||
-rw-r--r-- | app/views/admin/logs/show.html.haml | 10 | ||||
-rw-r--r-- | lib/gitlab/logger.rb | 2 |
4 files changed, 16 insertions, 8 deletions
diff --git a/app/assets/javascripts/admin.js.coffee b/app/assets/javascripts/admin.js.coffee index 76454c29269..1dafdf4bd8b 100644 --- a/app/assets/javascripts/admin.js.coffee +++ b/app/assets/javascripts/admin.js.coffee @@ -10,3 +10,8 @@ $ -> $('.log-tabs a').click (e) -> e.preventDefault() $(this).tab('show') + + $('.log-bottom').click (e) -> + e.preventDefault() + visible_log = $(".file_content:visible") + visible_log.animate({ scrollTop: visible_log.find('ol').height() }, "fast") diff --git a/app/views/admin/groups/_form.html.haml b/app/views/admin/groups/_form.html.haml index 40d361b0402..67516eb26e3 100644 --- a/app/views/admin/groups/_form.html.haml +++ b/app/views/admin/groups/_form.html.haml @@ -7,13 +7,6 @@ Group name is .input = f.text_field :name, placeholder: "Example Group", class: "xxlarge" - .clearfix - = f.label :path do - URL - .input - .input-prepend - %span.add-on= web_app_url + 'groups/' - = f.text_field :path, placeholder: "example" .form-actions = f.submit 'Save group', class: "btn save-btn" diff --git a/app/views/admin/logs/show.html.haml b/app/views/admin/logs/show.html.haml index 0efe6db7483..e33c5468555 100644 --- a/app/views/admin/logs/show.html.haml +++ b/app/views/admin/logs/show.html.haml @@ -3,12 +3,18 @@ = link_to "githost.log", "#githost", 'data-toggle' => 'tab' %li = link_to "application.log", "#application", 'data-toggle' => 'tab' + +%p.light To prevent perfomance issues admin logs output the last 2000 lines .tab-content .tab-pane.active#githost .file_holder#README .file_title %i.icon-file githost.log + .right + = link_to '#', class: 'log-bottom' do + %i.icon-arrow-down + Scroll down .file_content.logs %ol - Gitlab::GitLogger.read_latest.each do |line| @@ -19,6 +25,10 @@ .file_title %i.icon-file application.log + .right + = link_to '#', class: 'log-bottom' do + %i.icon-arrow-down + Scroll down .file_content.logs %ol - Gitlab::AppLogger.read_latest.each do |line| diff --git a/lib/gitlab/logger.rb b/lib/gitlab/logger.rb index cf9a4c4afa2..8b4eee5da06 100644 --- a/lib/gitlab/logger.rb +++ b/lib/gitlab/logger.rb @@ -11,7 +11,7 @@ module Gitlab def self.read_latest path = Rails.root.join("log", file_name) self.build unless File.exist?(path) - logs = File.read(path).split("\n") + logs = `tail -n 2000 #{path}`.split("\n") end def self.build |