Skip to content
This repository was archived by the owner on Nov 17, 2020. It is now read-only.

Pagination for connections, channels, exchanges, queues#76

Merged
michaelklishin merged 36 commits intomasterfrom
rabbitmq-management-50
Nov 20, 2015
Merged

Pagination for connections, channels, exchanges, queues#76
michaelklishin merged 36 commits intomasterfrom
rabbitmq-management-50

Conversation

@Gsantomaggio
Copy link
Copy Markdown
Member

Fixes #50.

Back-end

Requests
Server side requests are:

http://localhost:15672/api/queues?page=1
http://localhost:15672/api/queues?page=1&page_size=50
http://localhost:15672/api/queues/%2f?page=1
http://localhost:15672/api/queues/%2f?page=1&page_size=50
http://localhost:15672/api/queues?page=1&page_size=10&name=myqueuename
http://localhost:15672/api/queues?page=1&page_size=10&name=^%28?=^myq%29&use_regex=true

The APIs are valid for:

  • queues
  • exchanges
  • connections
  • channels

Params

  • page is the page number
  • page_size is the number of elements for page you want to see ( if is not defined the default value is 100).
  • name is case insensitive.
  • use_regex when is true enables regular expression for the param name

The output is always the same:

{
total_count: 28758, //number elements the user can see, for example queues
item_count: 50, //number elements present on the current page
filtered_count:28757, //number elements filtered based on field `name` 
page: 1,//page number
page_size: 50,//number of element for page
page_count: 576,// total pages 
items: [ // list of items, for example queues
{ ...

_Note: the old API(s) still working with the old output._

Errors

The pagination API handle the following errors case:

  • page or page_size are not integer values.
    Example: http://localhost:15672/api/queues?page=no_int_val
    gets:

    "error": "bad_request", "reason": "…"

    test

  • page or page_size are out of the limit.
    Example:http://localhost:15672/api/queues?page=1&page_size=1000000
    gets:
    "error": "…","reason": "…"

    test

  • The limit are valid, but the API trying to access to a not-exist page.
    Example: http://localhost:15672/api/queues?page=2&page_size=11
    gets:
    "error": "bad_request", "reason": "Page out of range…"

    ( for example the user is looking a page that does not exist anymore )

    test

UI

We have changed the calls from the UI side, using the pagination.

Auto-refresh
We had a problem with the autorefresh, we solved skipping the autorefresh function when one pagination component is selected.

Redirect
We had to implement the auto-redirect page in case the page you are looking does not exist anymore.
We wanted to implement an time control based to avoid to flood the server, in case too much redirect are called. This is a precaution.

Dispatcher
We modified the behavior from static to dynamic.

Store preferences
In order to handle the navigation, we had to store all the pagination info using store pref

Comment thread priv/www/js/formatters.js Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add spaces around ==, <= and other operators.

@michaelklishin michaelklishin changed the title Pagination for queues - WIP - DO NOT MERGE Pagination for queues Oct 26, 2015
@michaelklishin michaelklishin self-assigned this Oct 26, 2015
@michaelklishin
Copy link
Copy Markdown
Contributor

This is far from being complete: while pagination works OK for queues, it lacks server-side filtering and there's no pagination for exchanges, channels, and connections.

I'm afraid this won't make it for 3.6.0.

@michaelklishin michaelklishin changed the title Pagination for queues Pagination for connections, channels, exchanges, queues Nov 20, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants