summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-mod-status/htdocs/luci-static/resources/view/status
diff options
context:
space:
mode:
Diffstat (limited to 'modules/luci-mod-status/htdocs/luci-static/resources/view/status')
-rw-r--r--modules/luci-mod-status/htdocs/luci-static/resources/view/status/dmesg.js35
-rw-r--r--modules/luci-mod-status/htdocs/luci-static/resources/view/status/syslog.js33
2 files changed, 68 insertions, 0 deletions
diff --git a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/dmesg.js b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/dmesg.js
new file mode 100644
index 0000000000..3b9428eaf1
--- /dev/null
+++ b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/dmesg.js
@@ -0,0 +1,35 @@
+'use strict';
+'require fs';
+'require ui';
+
+return L.view.extend({
+ load: function() {
+ return fs.exec_direct('/bin/dmesg', [ '-r' ]).catch(function(err) {
+ ui.addNotification(null, E('p', {}, _('Unable to load log data: ' + err.message)));
+ return '';
+ });
+ },
+
+ render: function(logdata) {
+ var loglines = logdata.trim().split(/\n/).map(function(line) {
+ return line.replace(/^<\d+>/, '');
+ });
+
+ return E([], [
+ E('h2', {}, [ _('Kernel Log') ]),
+ E('div', { 'id': 'content_syslog' }, [
+ E('textarea', {
+ 'id': 'syslog',
+ 'style': 'font-size:12px',
+ 'readonly': 'readonly',
+ 'wrap': 'off',
+ 'rows': loglines.length + 1
+ }, [ loglines.join('\n') ])
+ ])
+ ]);
+ },
+
+ handleSaveApply: null,
+ handleSave: null,
+ handleReset: null
+});
diff --git a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/syslog.js b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/syslog.js
new file mode 100644
index 0000000000..69694bcfb3
--- /dev/null
+++ b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/syslog.js
@@ -0,0 +1,33 @@
+'use strict';
+'require fs';
+'require ui';
+
+return L.view.extend({
+ load: function() {
+ return fs.exec_direct('/sbin/logread', [ '-e', '^' ]).catch(function(err) {
+ ui.addNotification(null, E('p', {}, _('Unable to load log data: ' + err.message)));
+ return '';
+ });
+ },
+
+ render: function(logdata) {
+ var loglines = logdata.trim().split(/\n/);
+
+ return E([], [
+ E('h2', {}, [ _('System Log') ]),
+ E('div', { 'id': 'content_syslog' }, [
+ E('textarea', {
+ 'id': 'syslog',
+ 'style': 'font-size:12px',
+ 'readonly': 'readonly',
+ 'wrap': 'off',
+ 'rows': loglines.length + 1
+ }, [ loglines.join('\n') ])
+ ])
+ ]);
+ },
+
+ handleSaveApply: null,
+ handleSave: null,
+ handleReset: null
+});