Skip to content
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

nsqadmin: clean up client-host display #632

Merged
merged 1 commit into from
Aug 14, 2015

Conversation

jehiah
Copy link
Member

@jehiah jehiah commented Aug 14, 2015

Prior to #323 the "Client Host" column in nsqadmin displayed the hostname appended by the port as taken from the remote-address. That PR switched to always show client_id and remote_address. It was unclear though the ideal relationship between Hostname, Name, Short_id and Client ID (see #298).

This clarifies the display to always show hostname + port (from remote_address), along with a hover state that shows the remote_address. Client ID will also be displayed when it's not equal to the hostname or a short version of the hostname.

RFR @mreiferson @rolyatmax


var port = remote_address.split(":").pop()
v['hostname_port'] = hostname + ":" + port;
})

Choose a reason for hiding this comment

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

I don't know enough about when the clients attribute would change and what values we might expect client_id, hostname, and remote_address to be to review the logic of this code. I might tweak the naming a bit to make what this method is doing a little more explicit. For example, maybe something like setHostnamePort is better?

Besides that, it's mostly just being consistent with style (e.g. indentation, single quotes, missing semicolons, spaces between function() and {).

@jehiah jehiah self-assigned this Aug 14, 2015
@jehiah
Copy link
Member Author

jehiah commented Aug 14, 2015

Hmm i realized i probably have some work i should also add in here to cleanup the display of the same fields on the nodes page as well.

@jehiah
Copy link
Member Author

jehiah commented Aug 14, 2015

nodes page updated. Any feedback @mreiferson?

initialize: function() {
this.on('change:clients', this.calculateHostnamePort);
},
calculateHostnamePort: function() {
Copy link
Member

Choose a reason for hiding this comment

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

vertical whitespace 👮 (and between functions)

@mreiferson
Copy link
Member

got a screenshot with how this ends up looking by any chance?

@jehiah jehiah force-pushed the nsqadmin_client_id_632 branch from a2ec788 to 6efd1f2 Compare August 14, 2015 19:51
@mreiferson mreiferson added this to the nsqadmin refactoring milestone Aug 14, 2015
@mreiferson
Copy link
Member

👍

mreiferson added a commit that referenced this pull request Aug 14, 2015
nsqadmin: clean up client-host display
@mreiferson mreiferson merged commit 9c3f466 into nsqio:master Aug 14, 2015
@mreiferson mreiferson deleted the nsqadmin_client_id_632 branch August 14, 2015 19:54
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