refactor: cleanup

This commit is contained in:
NGPixel 2018-01-29 22:58:05 -05:00
parent 8d74c48b7b
commit 30ce9c8670
6 changed files with 20 additions and 17 deletions

View File

@ -81,12 +81,11 @@
</template>
<script>
/* global CONSTANTS, graphQL, siteConfig */
/* global siteConfig */
import { mapState } from 'vuex'
export default {
name: 'navigator',
data() {
return {
sdShown: false,
@ -151,8 +150,6 @@ export default {
logout() {
window.location.assign(this.$helpers.resolvePath('logout'))
}
},
mounted() {
}
}
</script>

View File

@ -9,14 +9,20 @@ const DuplicatePackageCheckerPlugin = require('duplicate-package-checker-webpack
const common = require('./webpack.common.js')
console.info(process.cwd())
module.exports = merge(common, {
module: {
rules: []
},
plugins: [
new CleanWebpackPlugin(['assets'], { root: process.cwd() }),
new CleanWebpackPlugin([
'assets/js/*.*',
'assets/css/*.*',
'assets/*.js',
'assets/*.json'
], {
root: process.cwd(),
verbose: false
}),
new UglifyJSPlugin(),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('production')

View File

@ -34,7 +34,7 @@ const bruteforce = new ExpressBrute(EBstore, {
* Login form
*/
router.get('/login', function (req, res, next) {
res.render('auth/login')
res.render('pages/login')
})
router.post('/login', bruteforce.prevent, function (req, res, next) {

View File

@ -77,7 +77,7 @@ module.exports = () => {
app.get('*', async (req, res) => {
let packageObj = await fs.readJson(path.join(wiki.ROOTPATH, 'package.json'))
res.render('setup', {
res.render('pages/setup', {
packageObj,
telemetryClientID: wiki.telemetry.cid
})
@ -375,12 +375,12 @@ module.exports = () => {
wiki.logger.info(`HTTP Server on port: ${wiki.config.port}`)
app.set('port', wiki.config.port)
server = http.createServer(app)
server.listen(wiki.config.port)
wiki.server = http.createServer(app)
wiki.server.listen(wiki.config.port)
var openConnections = []
server.on('connection', (conn) => {
wiki.server.on('connection', (conn) => {
let key = conn.remoteAddress + ':' + conn.remotePort
openConnections[key] = conn
conn.on('close', () => {
@ -388,14 +388,14 @@ module.exports = () => {
})
})
server.destroy = (cb) => {
server.close(cb)
wiki.server.destroy = (cb) => {
wiki.server.close(cb)
for (let key in openConnections) {
openConnections[key].destroy()
}
}
server.on('error', (error) => {
wiki.server.on('error', (error) => {
if (error.syscall !== 'listen') {
throw error
}
@ -412,7 +412,7 @@ module.exports = () => {
}
})
server.on('listening', () => {
wiki.server.on('listening', () => {
wiki.logger.info('HTTP Server: RUNNING')
})
}

View File

@ -1,4 +1,4 @@
extends master.pug
extends ../master.pug
block body
body