diff --git a/app.rb b/app.rb index 96d992b52..c42c3b599 100644 --- a/app.rb +++ b/app.rb @@ -560,7 +560,7 @@ def render_template(name) # hand-coded list, but ... it will do, for now. COLLECTIONS = [:brokers, :repos, :tags, :policies, [:nodes, {'start' => {"type" => "number"}, 'limit' => {"type" => "number"}}], - :tasks, :commands, + :tasks, [:commands, {'start' => {'type' => 'number'}, 'limit' => {'type' => 'number'}}], [:events, {'start' => {"type" => "number"}, 'limit' => {"type" => "number"}}], :hooks] # @@ -703,6 +703,8 @@ def paginate(start, limit) end get '/api/collections/commands' do + start, limit = paginate(params[:start], params[:limit]) + collection_view Razor::Data::Command.order(:submitted_at).order(:id), 'commands', limit: limit, start: start, facts: true end