From f169f9ce592aa26139a8f955b67241244c9ab28c Mon Sep 17 00:00:00 2001 From: mariyachanniwala Date: Mon, 11 Jun 2018 20:33:40 +0000 Subject: [PATCH] Download webui logs functionality added! --- br-webui/_includes/header.liquid | 22 +++++----------------- br-webui/index.js | 8 +------- br-webui/views/camera.liquid | 1 - br-webui/views/network.liquid | 4 ---- br-webui/views/routing.liquid | 3 +-- br-webui/views/system.liquid | 6 ------ 6 files changed, 7 insertions(+), 37 deletions(-) diff --git a/br-webui/_includes/header.liquid b/br-webui/_includes/header.liquid index 7bfd9a71..e9de9699 100644 --- a/br-webui/_includes/header.liquid +++ b/br-webui/_includes/header.liquid @@ -14,19 +14,6 @@ function shutdown() { socket.emit('shutdown'); } - - function send() { - console.log('got into the function send'); - socket.emit('sendlog'); - - } - - socket.on('getlogs', function(data) { - console.log("In get logs
"); - console.log(data); - }); - - @@ -55,10 +42,11 @@ diff --git a/br-webui/index.js b/br-webui/index.js index 096fc01a..2ffdaee6 100644 --- a/br-webui/index.js +++ b/br-webui/index.js @@ -9,6 +9,7 @@ var env = process.env logger.log('ENVIRONMENT', process.env) logger.log('COMPANION_DIR', process.env.COMPANION_DIR) app.use(express.static('public')); +app.use('/webui.log', express.static('/home/pi/.webui.log')); app.use('/js', express.static(__dirname + '/node_modules/bootstrap/dist/js')); // redirect bootstrap JS app.use('/js', express.static(__dirname + '/node_modules/jquery/dist')); // redirect JS jQuery app.use('/font-awesome', express.static(__dirname + '/node_modules/font-awesome')); // redirect JS jQuery @@ -1593,13 +1594,6 @@ io.on('connection', function(socket) { }); }); - socket.on('sendlog', function(data) { - logger.log('sendlog'); - var cmd = child_process.exec('ls', function (error, stdout, stderr) { - socket.emit('getlogs',"hi"); - logger.log('entered function sendlog'); - }); - }); var uploader = new SocketIOFile(socket, { // uploadDir: { // multiple directories // music: 'data/music', diff --git a/br-webui/views/camera.liquid b/br-webui/views/camera.liquid index d447eded..1e3c6498 100644 --- a/br-webui/views/camera.liquid +++ b/br-webui/views/camera.liquid @@ -7,7 +7,6 @@