threefoldtech / tfgrid-sdk-ts

Apache License 2.0
4 stars 8 forks source link

🐞 [Bug]: represnt IP address in the dashboard in a clearer way #2724

Open sameh-farouk opened 6 months ago

sameh-farouk commented 6 months ago

Is there an existing issue for this?

which package/s did you face the problem with?

Dashboard

What happened?

image

I believe these cannot be interrupted as unique single IP addresses or valid CIDR ranges. As Hanfi explains, we aim to represent both the IP address and the subnet mask. We need to ensure that our intentions are communicated more understandably.

Steps To Reproduce

NA

which network/s did you face the problem on?

Dev

version

latest

Twin ID/s

No response

Node ID/s

No response

Farm ID/s

No response

Contract ID/s

No response

Relevant screenshots/screen records

NA

Relevant log output

NA
sameh-farouk commented 6 months ago

in the dashboard, we can show separately the IP and the subnet. consider converting the bit count to a subnet address like this

function createNetmaskAddr(bitCount) {
  var mask = [], i, n;
  for(i=0; i<4; i++) {
    n = Math.min(bitCount, 8);
    mask.push(256 - Math.pow(2, 8-n));
    bitCount -= n;
  }
  return mask.join('.');
}

console.log(createNetmaskAddr(parseInt("24")))

output

255.255.255.0
amiraabouhadid commented 2 months ago

also add better visualization for ip range to be added

image