Commit ff9a2e2a authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Improve admin logs

parent eb1004f7
...@@ -10,3 +10,8 @@ $ -> ...@@ -10,3 +10,8 @@ $ ->
$('.log-tabs a').click (e) -> $('.log-tabs a').click (e) ->
e.preventDefault() e.preventDefault()
$(this).tab('show') $(this).tab('show')
$('.log-bottom').click (e) ->
e.preventDefault()
visible_log = $(".file_content:visible")
visible_log.animate({ scrollTop: visible_log.find('ol').height() }, "fast")
...@@ -7,13 +7,6 @@ ...@@ -7,13 +7,6 @@
Group name is Group name is
.input .input
= f.text_field :name, placeholder: "Example Group", class: "xxlarge" = 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 .form-actions
= f.submit 'Save group', class: "btn save-btn" = f.submit 'Save group', class: "btn save-btn"
...@@ -3,12 +3,18 @@ ...@@ -3,12 +3,18 @@
= link_to "githost.log", "#githost", 'data-toggle' => 'tab' = link_to "githost.log", "#githost", 'data-toggle' => 'tab'
%li %li
= link_to "application.log", "#application", 'data-toggle' => 'tab' = link_to "application.log", "#application", 'data-toggle' => 'tab'
%p.light To prevent perfomance issues admin logs output the last 2000 lines
.tab-content .tab-content
.tab-pane.active#githost .tab-pane.active#githost
.file_holder#README .file_holder#README
.file_title .file_title
%i.icon-file %i.icon-file
githost.log githost.log
.right
= link_to '#', class: 'log-bottom' do
%i.icon-arrow-down
Scroll down
.file_content.logs .file_content.logs
%ol %ol
- Gitlab::GitLogger.read_latest.each do |line| - Gitlab::GitLogger.read_latest.each do |line|
...@@ -19,6 +25,10 @@ ...@@ -19,6 +25,10 @@
.file_title .file_title
%i.icon-file %i.icon-file
application.log application.log
.right
= link_to '#', class: 'log-bottom' do
%i.icon-arrow-down
Scroll down
.file_content.logs .file_content.logs
%ol %ol
- Gitlab::AppLogger.read_latest.each do |line| - Gitlab::AppLogger.read_latest.each do |line|
......
...@@ -11,7 +11,7 @@ module Gitlab ...@@ -11,7 +11,7 @@ module Gitlab
def self.read_latest def self.read_latest
path = Rails.root.join("log", file_name) path = Rails.root.join("log", file_name)
self.build unless File.exist?(path) self.build unless File.exist?(path)
logs = File.read(path).split("\n") logs = `tail -n 2000 #{path}`.split("\n")
end end
def self.build def self.build
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment