Skip to content

IP address aggregations return a long #11

@black2d

Description

@black2d

IP address aggregations return a long instead of the IP address. I found a way to fix this by updating the rendering /public/vis/components/elements/text.js

replacing

var textAccessor = function (d) { return d.text; };

with

var textAccessor = function textAccessor(d) {
if (!isNaN(d.text)) {
var part1 = d.text & 255;
var part2 = ((d.text >> 8) & 255);
var part3 = ((d.text >> 16) & 255);
var part4 = ((d.text >> 24) & 255);

      var ip = part4 + "." + part3 + "." + part2 + "." + part1;
      if (ip.startsWith("0.")) {
          return d.text;
      }
      else {
          return ip;

      }
  }
  return d.text;

};

However it may not be the best place to do it (and I am not too familiar with github).

Thoughts?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions