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

Copy-to-clipboard functionality for IPs #12499

Closed
giezi opened this issue May 5, 2023 · 8 comments · Fixed by #12584
Closed

Copy-to-clipboard functionality for IPs #12499

giezi opened this issue May 5, 2023 · 8 comments · Fixed by #12584
Assignees
Labels
status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application

Comments

@giezi
Copy link

giezi commented May 5, 2023

NetBox version

v3.5.0

Feature type

New functionality

Proposed functionality

It would be great if there would be a function that when you hover over the IP addresses with the mouse a copy button appears which copies the IP without subnet mask.

Copy button like:

Screenshot 2023-05-05 at 11 27 40

Use case

I think it would be a relief for most users, at the moment you always have to tediously mark the IP and then copy it to connect to a system e.g. via SSH.

Database changes

External dependencies

@giezi giezi added the type: feature Introduction of new functionality to the application label May 5, 2023
@giezi giezi changed the title Copy Functionality for IPs Copy functionality for IPs May 5, 2023
@jeremystretch jeremystretch changed the title Copy functionality for IPs Copy-to-clipboard functionality for IPs May 5, 2023
@v0tti
Copy link
Contributor

v0tti commented May 5, 2023

Copying the IP without the subnet mask seems a bit counter intuitive because it is displayed with a mask in most places of the UI.

But I agree that copying should be improved. I always mark the IP to copy it but sometimes I accidentally select a leading tabulator which makes pasting it a pain.

@jeremystretch jeremystretch added the status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation label May 5, 2023
@jeremystretch
Copy link
Member

We have a copy-to-clipboard button in place elsewhere around the UI (the API tokens list, for instance) that should be suitable for this.

@abhi1693
Copy link
Member

abhi1693 commented May 8, 2023

I can take this up, but which places in the UI is this being intended to be applied?

@PieterL75
Copy link
Contributor

I have a plugin that creates a small hamburger to all the links, being able to copy the text out of it (and do much more)
image
image
It opens a lot of flexibility and quick navigations.
The burger is there on all 'links' and not only ip addresses. Would be great if this can become part of the core netbox

@jeremystretch
Copy link
Member

jeremystretch commented May 10, 2023

@abhi1693 I think the intent here is just to display a copy-to-clipboard button wherever an IP address is displayed within the UI, maybe excluding object tables.

@abhi1693 abhi1693 self-assigned this May 10, 2023
@abhi1693 abhi1693 added status: accepted This issue has been accepted for implementation and removed status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation labels May 10, 2023
@abhi1693
Copy link
Member

@jeremystretch The OP has requested to copy the IP without the mask. If I'm to generalize the copy button, that may complicate things because I have a feeling this code will have to be some sort of hack in the TS script to drop the mask. I would rather leave this on the user to remove the mask after they paste, but just wanted to confirm with you as well.

@jeremystretch
Copy link
Member

IMO it makes sense to copy the mask as well. I don't see any reason to exclude it.

@giezi
Copy link
Author

giezi commented May 11, 2023

I think the plugin of @PieterL75 should be included as standard in the Netbox - it solves all our problems :)
https://github.com/PieterL75/netbox_contextmenus

abhi1693 added a commit that referenced this issue May 12, 2023
abhi1693 added a commit that referenced this issue May 12, 2023
jeremystretch pushed a commit that referenced this issue May 31, 2023
jeremystretch added a commit that referenced this issue Jul 6, 2023
* adds copy content button #12499

* adds newline

* Omit hash mark from target string

* Clean up HTML element IDs

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants