refactor: global namespace + admin pages UI

This commit is contained in:
NGPixel
2018-03-05 15:49:36 -05:00
parent f203173c6c
commit 7acc4e9fed
61 changed files with 751 additions and 508 deletions

View File

@@ -3,7 +3,7 @@ const cluster = require('cluster')
const fs = require('fs-extra')
const path = require('path')
/* global wiki */
/* global WIKI */
module.exports = {
loggers: {},
@@ -11,7 +11,7 @@ module.exports = {
let winston = require('winston')
let logger = new (winston.Logger)({
level: wiki.config.logLevel,
level: WIKI.config.logLevel,
transports: []
})
@@ -20,10 +20,10 @@ module.exports = {
return '[' + processName + '] ' + msg
})
_.forOwn(_.omitBy(wiki.config.logging.loggers, s => s.enabled === false), (loggerConfig, loggerKey) => {
_.forOwn(_.omitBy(WIKI.config.logging.loggers, s => s.enabled === false), (loggerConfig, loggerKey) => {
let loggerModule = require(`../modules/logging/${loggerKey}`)
loggerModule.init(logger, loggerConfig)
fs.readFile(path.join(wiki.ROOTPATH, `assets/svg/auth-icon-${loggerKey}.svg`), 'utf8').then(iconData => {
fs.readFile(path.join(WIKI.ROOTPATH, `assets/svg/auth-icon-${loggerKey}.svg`), 'utf8').then(iconData => {
logger.icon = iconData
}).catch(err => {
if (err.code === 'ENOENT') {