Skip to content

Consolidate the source and destination columns in the Tap and Top tables#1620

Merged
rmars merged 9 commits intomasterfrom
rmars/ui-small-fixes
Sep 12, 2018
Merged

Consolidate the source and destination columns in the Tap and Top tables#1620
rmars merged 9 commits intomasterfrom
rmars/ui-small-fixes

Conversation

@rmars
Copy link

@rmars rmars commented Sep 10, 2018

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.

screen shot 2018-09-10 at 4 18 03 pm

deploys

Fixes #1588 (and alleviates #1554)

@rmars rmars added the area/web label Sep 10, 2018
@rmars rmars self-assigned this Sep 10, 2018
Copy link
Member

@siggy siggy left a comment

Choose a reason for hiding this comment

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

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",
Copy link
Member

Choose a reason for hiding this comment

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

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.

Copy link
Author

Choose a reason for hiding this comment

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

ooh, yeah, Name could be good!

key: "source",
sorter: srcDstSorter("source"),
render: d => srcDstColumn(d.source, d.sourceLabels, ResourceLink)
title: " ",
Copy link
Member

Choose a reason for hiding this comment

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

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?

Copy link
Author

Choose a reason for hiding this comment

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

Mostly because of the ID column, yeah :) I think we can totally remove the ID column and have this be the first column!

Copy link
Author

Choose a reason for hiding this comment

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

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....

@rmars rmars force-pushed the rmars/ui-small-fixes branch from 3491727 to 48255eb Compare September 11, 2018 17:50
Copy link
Contributor

@klingerf klingerf left a comment

Choose a reason for hiding this comment

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

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
Copy link
Contributor

Choose a reason for hiding this comment

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

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} />
);
Copy link
Contributor

Choose a reason for hiding this comment

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

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>
Copy link
Contributor

Choose a reason for hiding this comment

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

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.

Copy link
Author

Choose a reason for hiding this comment

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

yeah! I like the idea of trying all of these!

title: "Direction",
key: "direction",
dataIndex: "base.proxyDirection",
width: "60px",
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like 60px isn't quite wide enough for this column, causing the title text to wrap:

image

Copy link
Author

Choose a reason for hiding this comment

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

I'll increase the width. I also suspect #1629 will help with this.

width: "60px",
filters: [
{ text: "Inbound", value: "INBOUND" },
{ text: "Outbound", value: "OUTBOUND" }
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should change the filter text here as well, to match the TO/FROM language that's used in the table.

image

Something like this:

    filters: [
      { text: "FROM", value: "INBOUND" },
      { text: "TO", value: "OUTBOUND" }
    ],

@rmars rmars force-pushed the rmars/ui-small-fixes branch from 9de063b to 158cc8e Compare September 12, 2018 00:20
Copy link
Contributor

@klingerf klingerf left a comment

Choose a reason for hiding this comment

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

⭐️ 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") {
Copy link
Contributor

Choose a reason for hiding this comment

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

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",
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we need to make this column just slightly wider so that the filter icon doesn't wrap to the next line:

image

Looks like 100px would do it.

@rmars rmars merged commit 01be78e into master Sep 12, 2018
@rmars rmars deleted the rmars/ui-small-fixes branch September 12, 2018 20:32
zachalbert added a commit to zachalbert/linkerd2 that referenced this pull request Sep 13, 2018
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants