-
Notifications
You must be signed in to change notification settings - Fork 712
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for multicolumn tables from the probes #1980
Comments
Motivated by #1981 |
The current table definition we use looks like this (taken from // Table is the type for a table in the UI.
type Table struct {
ID string `json:"id"`
Label string `json:"label"`
Rows []MetadataRow `json:"rows"`
TruncationCount int `json:"truncationCount,omitempty"`
} where I see two ways we could add support for proper multi-column tables: 1. Extending current
|
@fbarl Thanks for this! Your analysis doesn't cover Also, for the connections usecase, @tomwilkie mentioned we should model connections as children but never elaborated. |
From the UI perspective we should offer 2 display variants: a table for key-value pairs (aka Labels or Property Lists) as well as generic table. It's the UI's concern to render these, and even render them differently (as they are well-established UI patterns). The generic table has a special case where each row is a representative of another Scope entity (e.g. child rows in container details are processes, same for connections tables which are are either children or peers of the current node). The data structures sent to the frontend need to carry that additional information, to choose a renderer. If it helps, these can all be tables, if only they are tagged with a |
To clarify, this is a backend decision on how to model this data. |
@fons The way I see table templates being used in the code, I think their definition could "naturally" follow the corresponding models that are sent to the UI. So, in the case of extended type TableTemplate struct {
ID string `json:"id"`
Label string `json:"label"`
Prefix string `json:"prefix"`
Columns []Column `json:"columns"`
FixedRows map[string]string `json:"fixedRows"`
} and with a separate type PropertyListTemplate struct {
ID string `json:"id"`
Label string `json:"label"`
Prefix string `json:"prefix"`
FixedRows map[string]string `json:"fixedRows"`
}
type TableTemplate struct {
ID string `json:"id"`
Prefix string `json:"prefix"`
Columns []Column `json:"columns"`
} Does that make sense or I'm still missing something? I'm not so sure anymore which approach I prefer, but (unless @fons has a preference) I think I will go with extending the current |
@fbarl Thanks. From your analysis it's unclear how
And |
@2opremio I'm actually having trouble seeing how @davkal's comment about having 2 display variants (property lists and generic tables) fits in the idea of supporting a multi-column table (possibly with headings) with fixed rows (assuming fixed still means labeled) on the UI. Maybe it would be helpful for me to be given a concrete use-case of data that we would want to display multi-column with fixed rows, just so that I know what the exact scope of the new generic table should be. |
@2opremio could you please explain or ASCII-draw both a prefix-table and a fixed-table so we can see the difference? From a UI point of view I would require a generic table:
as well as a property list aka key-value list (currently used to display labels, env vars etc, but is misnamed a "table" in the backend):
Notice how the property list has not table headers. A special case of the generic table is the node table where every row corresponds to another entity in Scope. |
Right now we only support two-column tables.
As a workaround you can merge columns but it results in an ugly layout.
We should support multiple columns for both prefix-tables and fixed-tables.
We should also support setting headings, alignment and datatype metadata (for ordering and alignment).
The text was updated successfully, but these errors were encountered: