Sha256: 93a2fa88e7cd5bcefdcec1292263fcdd2ae807000faa895ab08e664f370ae9af

Contents?: true

Size: 793 Bytes

Versions: 34

Compression:

Stored size: 793 Bytes

Contents

module Rack::Insight
  class PanelsContent < PanelApp
    def initialize(insight_app)
      @insight_app = insight_app
      @request_table = Database::RequestTable.new
    end

    def dispatch
      return not_found("not get") unless @request.get?
      return not_found("id nil") if params['request_id'].nil?
      request = @request_table.select("*", "id = #{params['request_id']}").first
      return not_found("id not found") if request.nil?
      requests = @request_table.to_a.map do |row|
        { :id => row[0], :method => row[1], :path => row[2] }
      end
      render_template("request_fragment",
                      :request_id => params['request_id'].to_i,
                      :requests => requests,
                      :panels => @insight_app.panels)
    end
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
rack-insight-0.6.4 lib/rack/insight/panels-content.rb
rack-insight-0.6.3 lib/rack/insight/panels-content.rb
rack-insight-0.6.2 lib/rack/insight/panels-content.rb
rack-insight-0.5.30 lib/rack/insight/panels-content.rb
rack-insight-0.5.29 lib/rack/insight/panels-content.rb
rack-insight-0.5.28 lib/rack/insight/panels-content.rb
rack-insight-0.5.27 lib/rack/insight/panels-content.rb
rack-insight-0.5.26 lib/rack/insight/panels-content.rb
rack-insight-0.5.25 lib/rack/insight/panels-content.rb
rack-insight-0.5.24 lib/rack/insight/panels-content.rb
rack-insight-0.5.23 lib/rack/insight/panels-content.rb
rack-insight-0.5.22 lib/rack/insight/panels-content.rb
rack-insight-0.5.21 lib/rack/insight/panels-content.rb
rack-insight-0.5.20 lib/rack/insight/panels-content.rb
rack-insight-0.5.19 lib/rack/insight/panels-content.rb
rack-insight-0.5.18 lib/rack/insight/panels-content.rb
rack-insight-0.5.17 lib/rack/insight/panels-content.rb
rack-insight-0.5.16 lib/rack/insight/panels-content.rb
rack-insight-0.5.15 lib/rack/insight/panels-content.rb
rack-insight-0.5.14 lib/rack/insight/panels-content.rb