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

display record ip, not record viewer ip #34

Merged
merged 2 commits into from
Jul 25, 2024
Merged

display record ip, not record viewer ip #34

merged 2 commits into from
Jul 25, 2024

Conversation

neonphog
Copy link
Collaborator

No description provided.

@@ -57,6 +57,7 @@ export default {
let opened = 0;
let active = 0;
let activeBytesReceived = 0;
let recIp = 'no-ip';
Copy link
Contributor

Choose a reason for hiding this comment

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

As a general suggestion, you could use the ternary operator for these conditional assignments:

Suggested change
let recIp = 'no-ip';
const recIp = 'ip' in item.metadata && typeof item.metadata.ip === 'string'
? item.metadata.ip
: 'no-ip';

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

For a brief period I used ternary operators in c, then people started saying not to use them because they were too archaic...

@neonphog neonphog merged commit dfea29a into main Jul 25, 2024
5 checks passed
@neonphog neonphog deleted the metrics-ip-fix branch July 25, 2024 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants