Skip to content

Commit

Permalink
Feature/cldn 1676 (#210)
Browse files Browse the repository at this point in the history
* [CLDN-1676] Added ability to search for the IPv4 rendered value of an IP address instead of the raw value

* [CLDN-1676] Temp update to img for deploying to UDev

* [CLDN-1676] Undo temp update to img for deploying to UDev
  • Loading branch information
cccs-Dustin committed Sep 22, 2022
1 parent 9e99e8c commit 5788b73
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,20 @@ export default function transformProps(chartProps: CccsGridChartProps) {
JSON: 'jsonValueRenderer',
};

const formatIpV4 = (v: any) => {
const converted = `${(v >> 24) & 0xff}.${(v >> 16) & 0xff}.${
(v >> 8) & 0xff
}.${v & 0xff}`;
return converted;
};

const advancedTypeValueFormatter = (params: any) => {
if (params.colDef.cellRenderer === 'ipv4ValueRenderer') {
return formatIpV4(params.value.toString());
}
return params.value.toString();
};

const percentMetricValueFormatter = function (params: ValueFormatterParams) {
return getNumberFormatter(NumberFormats.PERCENT_3_POINT).format(
params.value,
Expand Down Expand Up @@ -221,6 +235,7 @@ export default function transformProps(chartProps: CccsGridChartProps) {
sort: sortDirection,
sortIndex,
enableRowGroup,
getQuickFilterText: (params: any) => advancedTypeValueFormatter(params),
headerTooltip: columnDescription,
};
});
Expand All @@ -247,6 +262,8 @@ export default function transformProps(chartProps: CccsGridChartProps) {
cellRenderer,
sortable: isSortable,
enableRowGroup,
getQuickFilterText: (params: any) =>
advancedTypeValueFormatter(params),
headerTooltip: columnDescription,
};
});
Expand Down

0 comments on commit 5788b73

Please sign in to comment.