Age | Commit message (Collapse) | Author | Files | Lines |
|
Move scrolling logic to the ui.c module, it requires to have
some data iteration provided in flowtop.c and delegated to ui.c part.
So approach is that now flowtop provides 2 additional callbacks for:
1) Iterate over flows/procs list
2) Draw flow/proc on each iteration which is controlled from ui.c
it allows to unify scrolling logic and delegate it to the ui.c, in the
future it should allow to easy handle press event on selected row and
drow some additional information, or draw a cursor line per selected
row.
Also fixed case when down scrolling was bigger that printed rows, not
it is handled by ui part.
Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
|
|
Add ui_tab API to create ui tab control to switch between
different ui tables which may contain different aggregated
info per unique pid/port/proto/dst/src.
Meanwhile there is only 1 ui tab entry for flows table.
Added some missing cds_list_{next,prev,last}_entry functions
into urcu-list-compat.h header.
Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
|
|
Use the cds_list_* types and macros directly instead of redefining them.
This makes it clear that we're not using the Linux kernel implementation
of list_head but the one from urcu.
Also make sure _LGPL_SOURCE is defined everywhere the urcu
functionality is used, such that we get the statically linkable version
with reduced overhead.
Reference: https://lwn.net/Articles/573424/#qq2answer
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
|
|
Really ui_table_row_print(x) no more prints anything, it
just sets column value in a row.
Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
|
|
Add left/right scrolling for flows list table to make
possible see all the columns with a smaller display size.
Handle 'Left' & 'Right' keypress to scroll left or right.
Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
|
|
Render each column to the ncurses raw buffer first, this buffer
contains ncurses {char:attr} elements which will be printed
to the screen after ui_table_row_show() will
be called (at the end of columns rendering by flowtop).
The reason of this change is to have easy way to
make horizontal scrolling over this buffer.
Approach is used from the 'htop' tool.
Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
|
|
Fill table with empty rows while clearing.
It will allow to get rid of clear() & refresh() each time
before print the flows list.
Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
|
|
Add new module ui.c which is responsible to render
different kinds of UI widgets - tables, etc.
Implemented generic API for print table-like list of elements.
This table API might be used for print flows in curses or text mode.
Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
[tk: change bug_on(true) to bug(), whitespace fix]
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
|