9 L
.resolveDefault(fs
.stat('/sbin/logread'), null),
10 L
.resolveDefault(fs
.stat('/usr/sbin/logread'), null)
11 ]).then(function(stat
) {
12 var logger
= stat
[0] ? stat
[0].path
: stat
[1] ? stat
[1].path
: null;
14 return fs
.exec_direct(logger
, [ '-e', '^' ]).catch(function(err
) {
15 ui
.addNotification(null, E('p', {}, _('Unable to load log data: ' + err
.message
)));
21 render: function(logdata
) {
22 var loglines
= logdata
.trim().split(/\n/);
25 var scrollDownButton
= E('button', {
26 'id': 'scrollDownButton',
27 'class': 'cbi-button cbi-button-neutral'
28 }, _('Scroll to tail', 'scroll to bottom (the tail) of the log file')
30 scrollDownButton
.addEventListener('click', function() {
31 scrollUpButton
.focus();
34 var scrollUpButton
= E('button', {
35 'id' : 'scrollUpButton',
36 'class': 'cbi-button cbi-button-neutral'
37 }, _('Scroll to head', 'scroll to top (the head) of the log file')
39 scrollUpButton
.addEventListener('click', function() {
40 scrollDownButton
.focus();
44 E('h2', {}, [ _('System Log') ]),
45 E('div', { 'id': 'content_syslog' }, [
46 E('div', {'style': 'padding-bottom: 20px'}, [scrollDownButton
]),
49 'style': 'font-size:12px',
50 'readonly': 'readonly',
52 'rows': loglines
.length
+ 1
53 }, [ loglines
.join('\n') ]),
54 E('div', {'style': 'padding-bottom: 20px'}, [scrollUpButton
])
59 handleSaveApply
: null,