diff --git a/karby-server.rb b/karby-server.rb index 69d73ad..61d340d 100644 --- a/karby-server.rb +++ b/karby-server.rb @@ -1,4 +1,5 @@ require 'date' +require 'erb' require 'json' require 'securerandom' require 'sinatra' @@ -24,22 +25,7 @@ def tablify dated_files parts = Dir["#{PRE_AGGREGATION_DIR}/*.log"].map{|path| DatedFile.new(path.split("/")[-1], File::Stat.new(path).ctime)}.sort_by(&:creation_date).reverse headers "Content-Type" => "text/html" - body %{ - -
- #{tablify(aggregated)} -
-
- -
- #{tablify(parts)} -
}.delete("\n").squeeze(" ") + erb :index, :locals => {:aggregated => tablify(aggregated), :parts => tablify(parts)} end get '/raw/*.log' do |file| diff --git a/views/index.erb b/views/index.erb new file mode 100644 index 0000000..76361cd --- /dev/null +++ b/views/index.erb @@ -0,0 +1,35 @@ + + + + + Karby + + + + + +
+ + + +