-
Notifications
You must be signed in to change notification settings - Fork 40
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
New helper nodeName to allow centralized formatting of hostnames #6
base: dev
Are you sure you want to change the base?
Conversation
…xtra-long node names. Handle empty hostnames Removed some debug output
else if (d && d.nodeinfo && d.nodeinfo.node_id) | ||
name = '[' + d.nodeinfo.node_id + ']' | ||
if (trim && name.length > 48) | ||
name = name.substring(0,48) + "..." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be the Unicode character "…" instead of three single "."?
I support the idea, both content-wise (shortening node names) and implementation-wise (introducing a single helper function that does the job). However, my knowledge of the codebase is too scarce to decide whether the implementation is done properly. |
I wouldn't call it "trim". That usually implies cutting excess whitespace from strings. "shorten" might be better suited. I'd also create two functions, e.g. |
Actually, call it |
Also make sure, that |
On the other hand, why don't we use CSS? Set this on a table cell:
|
I like the CSS based solution for truncating. |
added OS switch for the coords … (new) fix for plumpudding/meshviewer/ffnord#6 restore backwards compatibility resolve builderror fixed typo
This implements part of #6 with CSS to shorten extremely long node names with ellipsis.
This implements part of ffnord#6 with CSS to shorten extremely long node names with ellipsis.
This PR adds a new helper "nodeName" to allow a centralized handling of extra long or empty hostnames.
Long node names will be trimmed to avoid layout issues, empty node names will be replaced with the node id in square brackets.