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

Added share feature #30

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

nikolai-katkov
Copy link

With this change users can share links and quickly paste the desired CIDRs in the URL. Now different handy tools can be integrated with cidr.xyz

image

@yuvadm
Copy link
Owner

yuvadm commented Sep 22, 2020

This is a really neat feature! I have a few followup thoughts on this:

  1. Did you consider passing the shared IP via URL anchor instead of query string?
  2. Perhaps we can also consider encoding the input in a more compact way (some URL-friendly variation on Base64?)
  3. It would be nice to have the Share link as a button

Thanks for putting in the work on this feature 👍

@nikolai-katkov
Copy link
Author

nikolai-katkov commented Sep 22, 2020

Hi @yuvadm, thanks for getting back so swiftly

  1. Did you consider passing the shared IP via URL anchor instead of query string?

Like https://cidr.xyz/#10.81.135.144/28? No strong opinion here (apart from getting rid of querystring dependency). Would you like it like this?

  1. Perhaps we can also consider encoding the input in a more compact way (some URL-friendly variation on Base64?)

TBH I'd like to keep it in a natural format for the reasons mentioned in the PR description - being able to paste CIDRs

  1. It would be nice to have the Share link as a button

What should be the behavior then, e.g. copy to clipboard (my original intention was that users can select the url and copy it)? Maybe we don't need any link/button at all, just reflecting the CIDR in the URL (qs or hash) on every change?

@nikolai-katkov
Copy link
Author

Hi @yuvadm would you please answer the questions above?

@yuvadm
Copy link
Owner

yuvadm commented Oct 1, 2020

@nikolai-katkov absolutely, sorry I dropped the ball on this one.

  1. I think the location hash makes more sense and is a more standard way for React components to maintain "sharable" state.
  2. On second thought I absolutely agree with you on this one, let's keep the IP/CIDR format for readability
  3. Agree that the URL might be enough, but a button that provides share functionality or copy to clipboard would be equally nice

@marceloboeira
Copy link

marceloboeira commented Nov 22, 2020

IMHO the raw format makes it easier for people that use this often, I could just type directly: cidr.xyz/#10.0.0.1/16 or something similar...

@unfor19
Copy link

unfor19 commented Jan 26, 2021

I also think it's a great feature, I don't mind using either option

  • location https://cidr.xyz/#10.81.135.144/28
  • querysting https://cidr.xyz/?addr=10.81.135.144/28

Regarding querystring - I'd go for addr instead of ip since it's not really an IP (just a thought)
Or maybe even ?v=10.81.135.144/28 since there's only one input variable, v is shorter

@yuvadm
Copy link
Owner

yuvadm commented Jan 26, 2021

@unfor19 agree, although the most precise option would be... cidr 😄

@falnyr
Copy link

falnyr commented Apr 25, 2022

@yuvadm was there any conclusion to this PR?

@yuvadm
Copy link
Owner

yuvadm commented Apr 25, 2022

@falnyr I'm definitely happy to merge this PR once it's rebased and cleaned up, specifically with regards to the parsing logic

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.

None yet

5 participants