Consolidate the source and destination columns in the Tap and Top tables#1620
Consolidate the source and destination columns in the Tap and Top tables#1620
Conversation
siggy
left a comment
There was a problem hiding this comment.
looks great! a couple tioli comments...
| onFilter: (value, row) => row.base.destination.pod === value || row.base.destination.str === value, | ||
| render: d => srcDstColumn(_.get(d, "destination"), _.get(d, "destinationMeta.labels", {}), ResourceLink) | ||
| title: "Source/Destination", | ||
| key: "src-dst", |
There was a problem hiding this comment.
since the direction column already conveys src/dst info, what do you think about just calling this column name, or, resource? in the CLI we just call it NAME.
| key: "source", | ||
| sorter: srcDstSorter("source"), | ||
| render: d => srcDstColumn(d.source, d.sourceLabels, ResourceLink) | ||
| title: " ", |
There was a problem hiding this comment.
curious: why no title in the Top table, but Direction title in the Tap table. i kind of like how it looks without title in the Top table. perhaps if we removed the ID column from Tap, we could render more similarly?
There was a problem hiding this comment.
Mostly because of the ID column, yeah :) I think we can totally remove the ID column and have this be the first column!
There was a problem hiding this comment.
Oh yeah, another reason I wanted to leave the word direction in there is because, unlike the Top tables, I wanted to keep the client side filtering for tap (so leaving the column filters in there). But the filter icon next to a blank column title looked weird....
3491727 to
48255eb
Compare
klingerf
left a comment
There was a problem hiding this comment.
This is a huge improvement! I had a medium-size refactor suggestion for the code in TapUtils.jsx, but would also be ok if it makes more sense to do that in a separate branch.
| <div className="src-dst-name"> | ||
| { !_.isEmpty(display.pod) ? podLink : display.str } | ||
| { !_.isEmpty(labels.deployment) ? deployLink(labels, ResourceLink) : | ||
| !_.isEmpty(display.pod) ? podLink(labels, ResourceLink) : display.str |
There was a problem hiding this comment.
Rather than defaulting the display to show deployments, I think we should have this method take a resourceType parameter, and use the specified resourceType if a corresponding label exists. Otherwise, this setup won't work very well for other resource types, such as replication controllers.
Additionally, if I'm viewing a pod detail page, I'd prefer to see pods displayed in the top table, rather than deployments, replications controllers, etc. If we update this method to accept a resourceType string, then that should fix this issue too.
| <ResourceLink | ||
| resource={{ type: "deployment", name: labels.deployment, namespace: labels.namespace}} | ||
| linkText={"deploy/" + labels.deployment} /> | ||
| ); |
There was a problem hiding this comment.
Related to my other comment below -- I'd prefer to generalize these methods to work for all resource types, not just deployments and pods. I think something like this would work:
const resourceLink = (resourceType, labels, ResourceLink) => (
<ResourceLink
resource={{ type: resourceType, name: labels[resourceType], namespace: labels.namespace}}
linkText={toShortResourceName(resourceType) + "/" + labels[resourceType]} />
);
| return ( | ||
| <React.Fragment> | ||
| <div>{ !labels.deployment ? null : deployLink(labels, ResourceLink) }</div> | ||
| <div>{ !labels.pod ? null : podLink(labels, ResourceLink) }</div> |
There was a problem hiding this comment.
And similarly here, I think we should take into account resource type when generating the list of links in the popover. Or it might be cool to render a link for every label that exists, minus the namespace label. That way if we're viewing a pod, we see all of it's linkable owners in the popover.
There was a problem hiding this comment.
yeah! I like the idea of trying all of these!
| title: "Direction", | ||
| key: "direction", | ||
| dataIndex: "base.proxyDirection", | ||
| width: "60px", |
There was a problem hiding this comment.
I'll increase the width. I also suspect #1629 will help with this.
| width: "60px", | ||
| filters: [ | ||
| { text: "Inbound", value: "INBOUND" }, | ||
| { text: "Outbound", value: "OUTBOUND" } |
Consolidate the source and destination columns
9de063b to
158cc8e
Compare
klingerf
left a comment
There was a problem hiding this comment.
⭐️ Thanks for making the resource type update -- looks great. Just had the 2 other nits we discussed, but otherwise looks good to me.
| <React.Fragment> | ||
| { | ||
| _.map(labels, (labelVal, labelName) => { | ||
| if (_.has(shortNameLookup, labelName) && labelName !== "namespace") { |
There was a problem hiding this comment.
Let's also filter "service" here, since we don't handle services on the resource detail page.
| title: "Direction", | ||
| key: "direction", | ||
| dataIndex: "base.proxyDirection", | ||
| width: "80px", |
* master: Update CHANGES.md for v18.9.1 release (linkerd#1631) Cleanly shutdown tap stream to data plane proxies (linkerd#1624) Change breadcrumb header to default font in styles.css (linkerd#1633) Improve top table to better cope with high RPS traffic (linkerd#1634) Add small success rate chart to table, misc web tweaks (linkerd#1628) Consolidate the source and destination columns in the Tap and Top tables (linkerd#1620) remove extraneous calc function in sidebar.css (linkerd#1632) Display more helpful websocket errors (linkerd#1626) Add breadcrumb navigation at the top of linkerd dashboard (linkerd#1613) Introduce inject check for known sidecars (linkerd#1619) Bump Prometheus to v2.4.0, Grafana to 5.2.4 (linkerd#1625) Improve performance of tap table by throttling updates (linkerd#1623) Add with-source flag to top (linkerd#1614) Conflicts: web/app/css/styles.css web/app/js/components/ResourceDetail.jsx web/app/js/index.js



Consolidate the source and destination columns into one column, and add a direction column (To/From) so the user knows if the displayed resource is src/dst.
Fixes #1588 (and alleviates #1554)