diff --git a/common/config.js b/common/config.js index de3ac116d6cc15759e98dc5f1274a91daaa91b87..6583fa42b18ba7ad0b8f5092676d62e22c7a450e 100644 --- a/common/config.js +++ b/common/config.js @@ -15,6 +15,7 @@ __dir.close(err => { }); var config = { + file: __configFile, content: null, reload() { var fd = fs.openSync(__configFile, 'a'); diff --git a/instance/log.ejs b/instance/log.ejs new file mode 100644 index 0000000000000000000000000000000000000000..2e4d734f27b984702ccf24c110d421acc742f80f --- /dev/null +++ b/instance/log.ejs @@ -0,0 +1,23 @@ +<%# vim: ts=4 syntax=html + The template for the main page %> +<!DOCTYPE html> +<html> + <head> + <meta charset="UTF-8" /> + <title><%= app %>'s Logs</title> + <script> + window.$ = window.jQuery = require('../style/jquery/jquery-3.5.1.js'); + </script> + <script src="../style/bootstrap-4.5.2-dist/js/bootstrap.min.js"></script> + <link rel="stylesheet" href="../style/bootstrap-4.5.2-dist/css/bootstrap.min.css" /> + <link rel="stylesheet" href="../style/css/instance.css" /> + <link rel="stylesheet" href="../style/fontawesome-free-5.15.1-web/css/all.min.css" /> + <script src="./main.js"></script> + <script></script> + </head> + <body> + <div id="mainFrame" class="container-fluid"> + </div> + </body> +</html> + diff --git a/instance/log.js b/instance/log.js new file mode 100644 index 0000000000000000000000000000000000000000..cdfe2799c74cf9a2e0ae06fd9fbd4956e5a50ae8 --- /dev/null +++ b/instance/log.js @@ -0,0 +1,17 @@ +/* The log window */ + +const { ipcRenderer } = require('electron'), + logger = require('../common/logger.js'), + ejs = require('ejs'), + e = require('express'), + fs = require('fs'), + readline = require('readline'); + +const file = readline.createInterface({ + input: fs.createReadStream(config.file), + terminal: false, +}); + +file.on('line', line => { + console.log(line); +});