luci2: move most RPC proxy function declarations into the views using them to reduce...
[project/luci2/ui.git] / luci2 / htdocs / luci2 / view / status.dmesg.js
1 L.ui.view.extend({
2 title: L.tr('Kernel Log'),
3 refresh: 5000,
4
5 getKernelLog: L.rpc.declare({
6 object: 'luci2.system',
7 method: 'dmesg',
8 expect: { log: '' }
9 }),
10
11 execute: function() {
12 return this.getKernelLog().then(function(log) {
13 var ta = document.getElementById('syslog');
14 var lines = log.replace(/\n+$/, '').split(/\n/);
15
16 ta.rows = lines.length;
17 ta.value = lines.reverse().join("\n");
18 });
19 }
20 });