diff options
Diffstat (limited to 'modules/luci-mod-status')
-rw-r--r-- | modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/10_system.js | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/10_system.js b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/10_system.js index 8ac7e7cdae..4a35175290 100644 --- a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/10_system.js +++ b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/10_system.js @@ -34,13 +34,28 @@ return L.Class.extend({ return l.replace(/^\s*\w+\s*=\s*['"]([^'"]+)['"].*$/, '$1'); }).join(' '); + var datestr = null; + + if (systeminfo.localtime) { + var date = new Date(systeminfo.localtime * 1000); + + datestr = '%04d-%02d-%02d %02d:%02d:%02d'.format( + date.getUTCFullYear(), + date.getUTCMonth() + 1, + date.getUTCDate(), + date.getUTCHours(), + date.getUTCMinutes(), + date.getUTCSeconds() + ); + } + var fields = [ _('Hostname'), boardinfo.hostname, _('Model'), boardinfo.model, _('Architecture'), boardinfo.system, _('Firmware Version'), (L.isObject(boardinfo.release) ? boardinfo.release.description + ' / ' : '') + (luciversion || ''), _('Kernel Version'), boardinfo.kernel, - _('Local Time'), systeminfo.localtime ? (new Date(systeminfo.localtime * 1000)).toLocaleString() : null, + _('Local Time'), datestr, _('Uptime'), systeminfo.uptime ? '%t'.format(systeminfo.uptime) : null, _('Load Average'), Array.isArray(systeminfo.load) ? '%.2f, %.2f, %.2f'.format( systeminfo.load[0] / 65535.0, |