diff --git a/MMM-SystemStats.js b/MMM-SystemStats.js
index 1c5d029..06f73f1 100644
--- a/MMM-SystemStats.js
+++ b/MMM-SystemStats.js
@@ -18,7 +18,8 @@ Module.register('MMM-SystemStats', {
useSyslog: false,
thresholdCPUTemp: 75, // in configured units
baseURLSyslog: 'http://127.0.0.1:8080/syslog',
- label: 'textAndIcon'
+ label: 'textAndIcon',
+ singleRow: false,
},
// Define required styles.
getStyles: function() {
@@ -52,6 +53,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.ipaddr = this.translate('LOADING').toLowerCase();
this.sendSocketNotification('CONFIG', this.config);
},
@@ -74,6 +76,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.ipaddr = payload.ipaddr;
this.updateDom(this.config.animationSpeed);
}
},
@@ -104,10 +107,23 @@ Module.register('MMM-SystemStats', {
text: 'DISK_FREE',
icon: 'fa-hdd-o',
},
+ ipaddr: {
+ text: 'IP_ADDRESS',
+ icon: 'fa-info-circle',
+ },
+
};
+
+ var row;
+
+ if (self.config.singleRow) {
+ row = document.createElement('tr');
+ }
Object.keys(sysData).forEach(function (item){
- var row = document.createElement('tr');
+ if (!self.config.singleRow) {
+ row = document.createElement('tr');
+ }
if (self.config.label.match(/^(text|textAndIcon)$/)) {
var c1 = document.createElement('td');
@@ -129,9 +145,15 @@ Module.register('MMM-SystemStats', {
c3.innerText = self.stats[item];
row.appendChild(c3);
- wrapper.appendChild(row);
+ if (!self.config.singleRow) {
+ wrapper.appendChild(row);
+ }
});
+ if (self.config.singleRow) {
+ wrapper.appendChild(row);
+ }
+
return wrapper;
},
});
diff --git a/README.md b/README.md
index d2dbaff..dcea047 100644
--- a/README.md
+++ b/README.md
@@ -1,8 +1,14 @@
# Module: MMM-SystemStats
This [MagicMirror](https://github.com/MichMich/MagicMirror) modules, shows the processor temperature, system load, available RAM, uptime and free disk space.
+display as block
+

+display a single line
+
+
+
Tested with:
- Raspberry Pi
@@ -52,6 +58,7 @@ modules: [
//header: 'System Stats', // This is optional
units: 'metric', // default, metric, imperial
view: 'textAndIcon',
+ singleRow: false,
},
},
]
@@ -128,6 +135,12 @@ The following properties can be configured:
Default value: http://127.0.0.1:8080/syslog
+
singleRowfalse
+