nuagenetworks / visualization-framework

Visualization Framework using ReactJS
BSD 3-Clause "New" or "Revised" License
7 stars 25 forks source link

Feature/add optional tabify #782

Closed nxanil closed 5 years ago

nxanil commented 5 years ago

@natabal @bmukheja

Add custom tabify option to remove duplicate rows in the table. now the value will be showing comma separated. Updated docs here - https://github.com/nuagenetworks/vis-graphs/pull/69. To enable tabifyOptions, we have to add the path of the object of ES response and field name in join array as an object, now it will converting the provided array indexes to comma separated values, instead of generating the multiple rows (avoiding possible duplicates). E.g -

`

"tabifyOptions": {

"join": [
    {
        "path": "nuage_metadata.src-pgmem-info",
        "field": "name"
    },
    {
        "path": "nuage_metadata.dst-pgmem-info",
        "field": "name"
    }
]

} `

natabal commented 5 years ago

@nxanil You need to add this to vsd-react-ui in the integration PR as well

nxanil commented 5 years ago

@natabal Already added in VSD and created a PR in js-bambou

bharat-mukheja commented 5 years ago

I was informed by @natabal that you need some data to work with. Here it is.

{
  "took" : 47,
  "timed_out" : false,
  "_shards" : {
    "total" : 5,
    "successful" : 5,
    "failed" : 0
  },
  "hits" : {
    "total" : 4,
    "max_score" : 1.0,
    "hits" : [
      {
        "_index" : "nuage_flow",
        "_type" : "nuage_doc_type",
        "_id" : "2",
        "_score" : 1.0,
        "_source" : {
          "destinationmac" : "00:00:01:00:00:02",
          "tcpstate" : 0,
          "type" : "ALLOW",
          "packets" : 2,
          "sourcemac" : "00:00:01:00:00:01",
          "destinationip" : "1.1.1.23",
          "sourceport" : "80",
          "destinationport" : "8080",
          "protocol" : "TCP",
          "sourceip" : "1.1.1.36",
          "bytes" : 2908,
          "nuage_metadata" : {
            "aclId" : "8091a727-ccc2-442a-b0a9-94455785bc6f",
            "subnetId" : "e95c8c0e-5120-4bd8-9962-7f449ba1e71c",
            "acl_destination_type" : "zone",
            "src-pgmem-info" : [
              {
                "name" : "testApp",
                "category" : "App"
              }
            ],
            "subnetName" : "z-1-s-1",
            "spgName" : null,
            "acl_destination_name" : "zone-1",
            "vrfId" : "1826218275",
            "acl_source_id" : "e3f39e28-1a29-49f7-951c-c0f744e23ed3",
            "dpgName" : null,
            "acl_destination_id" : "e3f39e28-1a29-49f7-951c-c0f744e23ed3",
            "zoneId" : "e3f39e28-1a29-49f7-951c-c0f744e23ed3",
            "zoneName" : "zone-1",
            "enterpriseID" : "dbd70743-43e6-4289-862a-5226a7925f3c",
            "src-zonemem" : "zone-1",
            "enterpriseName" : "vss-corp",
            "direction" : "ingress",
            "evpnId" : "1723225233",
            "aclResourceName" : "ingressaclentrytemplates",
            "domainId" : "fec26f53-fc07-44ec-9f1c-4aaf055680b7",
            "vfrID" : null,
            "acl_source_name" : "zone-1",
            "domainName" : "vcs-domain",
            "src-subnetmem" : "z-1-s-1",
            "acl_source_type" : "zone",
            "flowid" : "2027288457",
            "vportId" : "338f1625-7c94-4a85-8efd-2be48433622a",
            "actions" : [
              {
                "aclId" : "0364b745-651b-462c-a440-9de751614be1",
                "type" : "ALLOW",
                "value" : "Null"
              }
            ]
          },
          "tcpflags" : { },
          "timestamp" : 1537792405912
        }
      },
      {
        "_index" : "nuage_flow",
        "_type" : "nuage_doc_type",
        "_id" : "4",
        "_score" : 1.0,
        "_source" : {
          "destinationmac" : "00:00:01:00:00:01",
          "tcpstate" : 0,
          "type" : "ALLOW",
          "packets" : 2,
          "sourcemac" : "00:00:01:00:00:02",
          "destinationip" : "1.1.1.36",
          "sourceport" : "8080",
          "destinationport" : "80",
          "protocol" : "TCP",
          "sourceip" : "1.1.1.23",
          "bytes" : 108,
          "nuage_metadata" : {
            "aclId" : "8091a727-ccc2-442a-b0a9-94455785bc6f",
            "subnetId" : "e95c8c0e-5120-4bd8-9962-7f449ba1e71c",
            "acl_destination_type" : "zone",
            "src-pgmem-info" : [
              {
                "name" : "testLocation",
                "category" : "Location"
              }
            ],
            "subnetName" : "z-1-s-1",
            "spgName" : null,
            "acl_destination_name" : "zone-1",
            "vrfId" : "1826218275",
            "acl_source_id" : "e3f39e28-1a29-49f7-951c-c0f744e23ed3",
            "dpgName" : null,
            "acl_destination_id" : "e3f39e28-1a29-49f7-951c-c0f744e23ed3",
            "zoneId" : "e3f39e28-1a29-49f7-951c-c0f744e23ed3",
            "zoneName" : "zone-1",
            "enterpriseID" : "dbd70743-43e6-4289-862a-5226a7925f3c",
            "src-zonemem" : "zone-1",
            "enterpriseName" : "vss-corp",
            "direction" : "ingress",
            "evpnId" : "1723225233",
            "aclResourceName" : "ingressaclentrytemplates",
            "domainId" : "fec26f53-fc07-44ec-9f1c-4aaf055680b7",
            "vfrID" : null,
            "acl_source_name" : "zone-1",
            "service" : "HTTP",
            "domainName" : "vcs-domain",
            "src-subnetmem" : "z-1-s-1",
            "acl_source_type" : "zone",
            "flowid" : "89717824",
            "vportId" : "54a4d234-cb7c-4392-97a6-3ae952dad55f",
            "actions" : [
              {
                "aclId" : "0364b745-651b-462c-a440-9de751614be1",
                "type" : "ALLOW",
                "value" : "Null"
              }
            ]
          },
          "tcpflags" : { },
          "timestamp" : 1537792405912
        }
      },
      {
        "_index" : "nuage_flow",
        "_type" : "nuage_doc_type",
        "_id" : "1",
        "_score" : 1.0,
        "_source" : {
          "destinationmac" : "00:00:01:00:00:02",
          "tcpstate" : 0,
          "type" : "ALLOW",
          "packets" : 2,
          "sourcemac" : "00:00:01:00:00:01",
          "destinationip" : "1.1.1.23",
          "sourceport" : "80",
          "destinationport" : "8080",
          "protocol" : "TCP",
          "sourceip" : "1.1.1.36",
          "bytes" : 2908,
          "nuage_metadata" : {
            "aclId" : "3ac7645a-7230-491c-a0f7-372ec9d906d6",
            "subnetId" : "e95c8c0e-5120-4bd8-9962-7f449ba1e71c",
            "acl_destination_type" : "zone",
            "subnetName" : "z-1-s-1",
            "spgName" : null,
            "acl_destination_name" : "zone-1",
            "vrfId" : "1826218275",
            "acl_source_id" : "e3f39e28-1a29-49f7-951c-c0f744e23ed3",
            "dpgName" : null,
            "dst-pgmem-info" : [
              {
                "name" : "testLocation",
                "category" : "Location"
              }
            ],
            "acl_destination_id" : "e3f39e28-1a29-49f7-951c-c0f744e23ed3",
            "zoneId" : "e3f39e28-1a29-49f7-951c-c0f744e23ed3",
            "dst-subnetmem" : "z-1-s-1",
            "zoneName" : "zone-1",
            "enterpriseID" : "dbd70743-43e6-4289-862a-5226a7925f3c",
            "enterpriseName" : "vss-corp",
            "direction" : "egress",
            "evpnId" : "1723225233",
            "dst-zonemem" : "zone-1",
            "aclResourceName" : "egressaclentrytemplates",
            "domainId" : "fec26f53-fc07-44ec-9f1c-4aaf055680b7",
            "vfrID" : null,
            "acl_source_name" : "zone-1",
            "domainName" : "vcs-domain",
            "acl_source_type" : "endpoint-zone",
            "flowid" : "2027288457",
            "vportId" : "54a4d234-cb7c-4392-97a6-3ae952dad55f",
            "actions" : [
              {
                "aclId" : "5c741a68-ab94-4523-bd7a-1e20ff24b1e6",
                "type" : "ALLOW",
                "value" : "Null"
              }
            ]
          },
          "tcpflags" : { },
          "timestamp" : 1537792405912
        }
      },
      {
        "_index" : "nuage_flow",
        "_type" : "nuage_doc_type",
        "_id" : "3",
        "_score" : 1.0,
        "_source" : {
          "destinationmac" : "00:00:01:00:00:01",
          "tcpstate" : 0,
          "type" : "ALLOW",
          "packets" : 2,
          "sourcemac" : "00:00:01:00:00:02",
          "destinationip" : "1.1.1.36",
          "sourceport" : "8080",
          "destinationport" : "80",
          "protocol" : "TCP",
          "sourceip" : "1.1.1.23",
          "bytes" : 108,
          "nuage_metadata" : {
            "aclId" : "3ac7645a-7230-491c-a0f7-372ec9d906d6",
            "subnetId" : "e95c8c0e-5120-4bd8-9962-7f449ba1e71c",
            "acl_destination_type" : "zone",
            "subnetName" : "z-1-s-1",
            "spgName" : null,
            "acl_destination_name" : "zone-1",
            "vrfId" : "1826218275",
            "acl_source_id" : "e3f39e28-1a29-49f7-951c-c0f744e23ed3",
            "dpgName" : null,
            "dst-pgmem-info" : [
              {
                "name" : "testApp",
                "category" : "App"
              }
            ],
            "acl_destination_id" : "e3f39e28-1a29-49f7-951c-c0f744e23ed3",
            "zoneId" : "e3f39e28-1a29-49f7-951c-c0f744e23ed3",
            "dst-subnetmem" : "z-1-s-1",
            "zoneName" : "zone-1",
            "enterpriseID" : "dbd70743-43e6-4289-862a-5226a7925f3c",
            "enterpriseName" : "vss-corp",
            "direction" : "egress",
            "evpnId" : "1723225233",
            "dst-zonemem" : "zone-1",
            "aclResourceName" : "egressaclentrytemplates",
            "domainId" : "fec26f53-fc07-44ec-9f1c-4aaf055680b7",
            "vfrID" : null,
            "acl_source_name" : "zone-1",
            "service" : "HTTP",
            "domainName" : "vcs-domain",
            "acl_source_type" : "endpoint-zone",
            "flowid" : "89717824",
            "vportId" : "338f1625-7c94-4a85-8efd-2be48433622a",
            "actions" : [
              {
                "aclId" : "5c741a68-ab94-4523-bd7a-1e20ff24b1e6",
                "type" : "ALLOW",
                "value" : "Null"
              }
            ]
          },
          "tcpflags" : { },
          "timestamp" : 1537792405912
        }
      }
    ]
  }
}