Closed animegasan closed 6 months ago
load: function () {
poll.add(function() {
return fs.exec('/sbin/logread', ['-e', 'tailscale'])
.then(function (res) {
if (res.code === 0) {
var statusMappings = {
'daemon.err': { status: 'Error', startIndex: 9 },
'daemon.notice': { status: 'Info', startIndex: 10 }
};
var logs = res.stdout.split('\n').map(function(log) {
var logParts = log.split(' ');
if (logParts.length >= 6) {
var formattedTime = logParts[1] + ' ' + logParts[2] + ' - ' + logParts[3];
var status = logParts[5];
var mapping = statusMappings[status] || { status: status, startIndex: 9 };
status = mapping.status;
var startIndex = mapping.startIndex;
var message = logParts.slice(startIndex).join(' ');
return formattedTime + ' [ ' + status + ' ] - ' + message;
} else {
return '';
}
}).filter(Boolean).join('\n');
var view = document.getElementById('syslog');
view.innerHTML = logs;
return view;
} else {
throw new Error(res.stdout + ' ' + res.stderr);
}
})
});
},
Hello, I am very impressed with this project, because it can add another option to remote OpenWRT with local network like ZeroTier!
There is input from me, why not just add a logs page to read all processes from tailscale?
References can be seen on the following page https://github.com/openwrt/luci/blob/master/applications/luci-app-cloudflared/htdocs/luci-static/resources/view/cloudflared/log.js
And try making a pull request to Luci OpenWRT to make it an official package. Thank You!
it is a good idea
Hello, I am very impressed with this project, because it can add another option to remote OpenWRT with local network like ZeroTier!
There is input from me, why not just add a logs page to read all processes from tailscale?
References can be seen on the following page https://github.com/openwrt/luci/blob/master/applications/luci-app-cloudflared/htdocs/luci-static/resources/view/cloudflared/log.js
And try making a pull request to Luci OpenWRT to make it an official package. Thank You!