diff --git a/MMM-SystemStats.js b/MMM-SystemStats.js index 1c5d029..8aaff67 100644 --- a/MMM-SystemStats.js +++ b/MMM-SystemStats.js @@ -52,6 +52,7 @@ Module.register('MMM-SystemStats', { this.stats.freeMem = this.translate('LOADING').toLowerCase(); this.stats.upTime = this.translate('LOADING').toLowerCase(); this.stats.freeSpace = this.translate('LOADING').toLowerCase(); + this.stats.ipAddress = this.translate('LOADING').toLowerCase(); this.sendSocketNotification('CONFIG', this.config); }, @@ -74,6 +75,7 @@ Module.register('MMM-SystemStats', { upTime = parseInt(payload.upTime[0]); this.stats.upTime = moment.duration(upTime, "seconds").humanize(); this.stats.freeSpace = payload.freeSpace; + this.stats.ipAddress = payload.ipAddress; this.updateDom(this.config.animationSpeed); } }, @@ -104,6 +106,10 @@ Module.register('MMM-SystemStats', { text: 'DISK_FREE', icon: 'fa-hdd-o', }, + ipAddress: { + text: 'IP_ADDRESS', + icon: 'fa-sitemap', + } }; Object.keys(sysData).forEach(function (item){ diff --git a/README.md b/README.md index d2dbaff..0de2196 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Module: MMM-SystemStats This [MagicMirror](https://github.com/MichMich/MagicMirror) modules, shows the processor temperature, system load, available RAM, uptime and free disk space. -![Magic-Mirror Module MMM-SystemStats screenshot](https://raw.githubusercontent.com/BenRoe/MMM-SystemStats/master/screenshot.png) +![Magic-Mirror Module MMM-SystemStats screenshot](screenshot.png) Tested with: - Raspberry Pi diff --git a/node_helper.js b/node_helper.js index 943db08..c691d95 100644 --- a/node_helper.js +++ b/node_helper.js @@ -69,6 +69,8 @@ module.exports = NodeHelper.create({ async.apply(exec, 'cat /proc/uptime'), // get root free-space async.apply(exec, "df -h|grep /dev/root|awk '{print $4}'"), + // get ip local ip address + async.apply(exec, "hostname -I"), ], function (err, res) { @@ -77,7 +79,8 @@ module.exports = NodeHelper.create({ stats.sysLoad = res[1][0].split(' '); stats.freeMem = res[2][0]; stats.upTime = res[3][0].split(' '); - stats.freeSpace = res[4][0]; + stats.freeSpace = res[4][0]; + stats.ipAddress = res[5][0]; // console.log(stats); self.sendSocketNotification('STATS', stats); }); diff --git a/screenshot.png b/screenshot.png index 6b48a32..15338d3 100644 Binary files a/screenshot.png and b/screenshot.png differ diff --git a/translations/de.json b/translations/de.json index f38fae7..258eed4 100644 --- a/translations/de.json +++ b/translations/de.json @@ -4,5 +4,6 @@ "RAM_FREE": "Freier RAM", "UPTIME": "Laufzeit", "DISK_FREE": "Freier Speicherplatz", + "IP_ADDRESS": "IP Adresse", "TEMP_THRESHOLD_WARNING": "CPU zu heiß!" } diff --git a/translations/en.json b/translations/en.json index 956c323..b376945 100644 --- a/translations/en.json +++ b/translations/en.json @@ -4,5 +4,6 @@ "RAM_FREE": "Free RAM", "UPTIME": "Uptime", "DISK_FREE": "Avail Space", + "IP_ADDRESS": "IP Address", "TEMP_THRESHOLD_WARNING": "CPU Temp is exceeded threshold" } diff --git a/translations/fr.json b/translations/fr.json index 8d5cef9..83c7f54 100644 --- a/translations/fr.json +++ b/translations/fr.json @@ -4,5 +4,6 @@ "RAM_FREE": "RAM Libre", "UPTIME": "En fonctionnement depuis", "DISK_FREE": "Espace disponible", + "IP_ADDRESS": "adresse IP", "TEMP_THRESHOLD_WARNING": "Temp. CPU a dépassé le seuil" } diff --git a/translations/id.json b/translations/id.json index f045eb3..4fe30bd 100644 --- a/translations/id.json +++ b/translations/id.json @@ -4,5 +4,6 @@ "RAM_FREE": "RAM Sisa", "UPTIME": "Nyala", "DISK_FREE": "Ruang Sisa", + "IP_ADDRESS": "Alamat IP", "TEMP_THRESHOLD_WARNING": "Suhu CPU melebihi batas normal" } diff --git a/translations/sv.json b/translations/sv.json index c6c01b0..fdc397d 100644 --- a/translations/sv.json +++ b/translations/sv.json @@ -4,5 +4,6 @@ "RAM_FREE": "Fri RAM", "UPTIME": "tid sedan start", "DISK_FREE": "lagrings plats", + "IP_ADDRESS": "IP adres", "TEMP_THRESHOLD_WARNING": "CPU Temperaturen går ovanför gränsen" }