luci-app: updated log.

This commit is contained in:
gSpot
2023-11-26 16:49:59 +03:00
parent 6cfbf6b8ec
commit 25e681055e
8 changed files with 340 additions and 116 deletions
@@ -1,4 +1,5 @@
'require fs';
'require rpc';
'require ui';
'require view.ruantiblock.log-widget as abc';
'require view.ruantiblock.tools as tools';
@@ -14,6 +15,24 @@ return abc.view.extend({
entriesHandler : null,
lastBytes : 0,
callLogSize: rpc.declare({
object: 'luci.ruantiblock',
method: 'getLogSize',
expect: { '': {} }
}),
getLogSize() {
return this.callLogSize().then((data) => {
if(data.bytes) {
return Number(data.bytes);
} else {
throw new Error(_('An error occurred while trying to get the log size!'));
};
});
},
// logd
logdHandler(strArray, lineNum) {
let logLevel = strArray[5].split('.');