Skip to content
This repository was archived by the owner on Sep 5, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions MMM-SystemStats.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
},

Expand All @@ -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);
}
},
Expand Down Expand Up @@ -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){
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 4 additions & 1 deletion node_helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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);
});
Expand Down
Binary file modified screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions translations/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
"RAM_FREE": "Freier RAM",
"UPTIME": "Laufzeit",
"DISK_FREE": "Freier Speicherplatz",
"IP_ADDRESS": "IP Adresse",
"TEMP_THRESHOLD_WARNING": "CPU zu heiß!"
}
1 change: 1 addition & 0 deletions translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
1 change: 1 addition & 0 deletions translations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
1 change: 1 addition & 0 deletions translations/id.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
1 change: 1 addition & 0 deletions translations/sv.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}