From dd8967fff3cf6515088cc82a0c325307413ac44d Mon Sep 17 00:00:00 2001 From: CosmoX Date: Sat, 6 Jun 2020 13:51:03 -0700 Subject: [PATCH] enhance: display file paths of .leptonrc and log in the about page --- app/containers/aboutPage/index.js | 10 ++++++++++ app/containers/aboutPage/index.scss | 14 ++++++++++++-- main.js | 11 +++++++---- 3 files changed, 29 insertions(+), 6 deletions(-) diff --git a/app/containers/aboutPage/index.js b/app/containers/aboutPage/index.js index 7a587e76..ad9de6e4 100644 --- a/app/containers/aboutPage/index.js +++ b/app/containers/aboutPage/index.js @@ -12,6 +12,8 @@ import React, { Component } from 'react' import './index.scss' const conf = remote.getGlobal('conf') +const logFilePath = remote.getGlobal('logFilePath') +const configFilePath = remote.getGlobal('configFilePath') class AboutPage extends Component { renderAboutSection () { @@ -48,6 +50,14 @@ class AboutPage extends Component { Feedback License +
Configs(.leptonrc)
+
+ { configFilePath } +
+
Logs
+
+ { logFilePath } +
Contributors
hackjutsu
diff --git a/app/containers/aboutPage/index.scss b/app/containers/aboutPage/index.scss index 85f5e2b9..248382d1 100644 --- a/app/containers/aboutPage/index.scss +++ b/app/containers/aboutPage/index.scss @@ -7,7 +7,7 @@ } .section-base { - height: 75vh; + height: 80vh; } .general-section { @@ -34,7 +34,7 @@ .contributor-section { overflow: auto; - min-height: 200px; + min-height: 150px; border-radius: 5px; padding: 0 20px; border: solid 1px var(--border-color); @@ -51,6 +51,16 @@ color: var(--text-secondary); } + .one-line-section { + overflow: auto; + min-height: 28px; + border-radius: 5px; + padding: 0 20px; + white-space: nowrap; + border: solid 1px var(--border-color); + color: var(--text-secondary); + } + .license-item { margin: 10px 0px; } diff --git a/main.js b/main.js index 4eba603b..129286ed 100755 --- a/main.js +++ b/main.js @@ -300,23 +300,26 @@ function initGlobalConfigs () { } nconf.defaults(defaultConfig) global.conf = nconf + global.configFilePath = configFilePath } function initGlobalLogger () { logger.level = nconf.get('logger:level') - let appFolder = app.getPath('userData') + const appFolder = app.getPath('userData') if (!fs.existsSync(appFolder)) { fs.mkdirSync(appFolder) } - let logFolder = path.join(app.getPath('userData'), 'logs') + const logFolder = path.join(app.getPath('userData'), 'logs') if (!fs.existsSync(logFolder)) { fs.mkdirSync(logFolder) } - let logFile = new Date().toISOString().replace(/:/g, '.') + '.log' + const logFile = new Date().toISOString().replace(/:/g, '.') + '.log' + const logFilePath = path.join(logFolder, logFile) logger.add(logger.transports.File, { json: false, exitOnError: false, - filename: path.join(logFolder, logFile), + filename: logFilePath, timestamp: true }) global.logger = logger + global.logFilePath = logFilePath }