From c912f72157b0e27dccd921729210930c5b00fbc6 Mon Sep 17 00:00:00 2001 From: Yuval Adam Date: Sat, 12 Dec 2015 13:05:53 +0200 Subject: Cleanup details --- index.js | 30 ++++++------------------------ 1 file changed, 6 insertions(+), 24 deletions(-) diff --git a/index.js b/index.js index 2b4cbe1..3540cf3 100644 --- a/index.js +++ b/index.js @@ -39,27 +39,9 @@ class IPAddress extends React.Component { return this.state.octets.join('.') + '/' + this.state.cidr } - getNetmask = () => { - var block = new Netmask(this.getPretty()) - return block.mask - } - - getFirst = () => { - var block = new Netmask(this.getPretty()) - return block.first - } - - getLast = () => { - var block = new Netmask(this.getPretty()) - return block.last - } - - getCount = () => { - var block = new Netmask(this.getPretty()) - return block.size - } - render() { + var details = new Netmask(this.getPretty()) + return
{[...Array(4)].map((x, octet) => @@ -87,19 +69,19 @@ class IPAddress extends React.Component {
- {this.getNetmask()} + {details.mask} Netmask - {this.getFirst()} + {details.first} First IP - {this.getLast()} + {details.last} Last IP - {this.getCount().toLocaleString()} + {details.size.toLocaleString()} Count
-- cgit v1.3.1