Add ip field formatter

This commit is contained in:
Rashid Khan 2014-06-19 14:51:57 -07:00
parent 7f8afe6ab7
commit 2cd01ca31f

View file

@ -68,6 +68,16 @@ define(function (require) {
return moment(val).format(config.get('dateFormat'));
}
},
{
types: [
'ip'
],
name: 'ip',
convert: function (ip) {
if (!isFinite(ip)) return ip;
return [ip >>> 24, ip >>> 16 & 0xFF, ip >>> 8 & 0xFF, ip & 0xFF].join('.');
}
},
{
types: [
'number'
@ -92,7 +102,7 @@ define(function (require) {
number: formats.byName.string,
date: formats.byName.date,
boolean: formats.byName.string,
ip: formats.byName.string,
ip: formats.byName.ip,
attachment: formats.byName.string,
geo_point: formats.byName.string,
geo_shape: formats.byName.string,