refactor: cleanup
This commit is contained in:
parent
8d74c48b7b
commit
30ce9c8670
@ -81,12 +81,11 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
/* global CONSTANTS, graphQL, siteConfig */
|
/* global siteConfig */
|
||||||
|
|
||||||
import { mapState } from 'vuex'
|
import { mapState } from 'vuex'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'navigator',
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
sdShown: false,
|
sdShown: false,
|
||||||
@ -151,8 +150,6 @@ export default {
|
|||||||
logout() {
|
logout() {
|
||||||
window.location.assign(this.$helpers.resolvePath('logout'))
|
window.location.assign(this.$helpers.resolvePath('logout'))
|
||||||
}
|
}
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -9,14 +9,20 @@ const DuplicatePackageCheckerPlugin = require('duplicate-package-checker-webpack
|
|||||||
|
|
||||||
const common = require('./webpack.common.js')
|
const common = require('./webpack.common.js')
|
||||||
|
|
||||||
console.info(process.cwd())
|
|
||||||
|
|
||||||
module.exports = merge(common, {
|
module.exports = merge(common, {
|
||||||
module: {
|
module: {
|
||||||
rules: []
|
rules: []
|
||||||
},
|
},
|
||||||
plugins: [
|
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 UglifyJSPlugin(),
|
||||||
new webpack.DefinePlugin({
|
new webpack.DefinePlugin({
|
||||||
'process.env.NODE_ENV': JSON.stringify('production')
|
'process.env.NODE_ENV': JSON.stringify('production')
|
||||||
|
@ -34,7 +34,7 @@ const bruteforce = new ExpressBrute(EBstore, {
|
|||||||
* Login form
|
* Login form
|
||||||
*/
|
*/
|
||||||
router.get('/login', function (req, res, next) {
|
router.get('/login', function (req, res, next) {
|
||||||
res.render('auth/login')
|
res.render('pages/login')
|
||||||
})
|
})
|
||||||
|
|
||||||
router.post('/login', bruteforce.prevent, function (req, res, next) {
|
router.post('/login', bruteforce.prevent, function (req, res, next) {
|
||||||
|
@ -77,7 +77,7 @@ module.exports = () => {
|
|||||||
|
|
||||||
app.get('*', async (req, res) => {
|
app.get('*', async (req, res) => {
|
||||||
let packageObj = await fs.readJson(path.join(wiki.ROOTPATH, 'package.json'))
|
let packageObj = await fs.readJson(path.join(wiki.ROOTPATH, 'package.json'))
|
||||||
res.render('setup', {
|
res.render('pages/setup', {
|
||||||
packageObj,
|
packageObj,
|
||||||
telemetryClientID: wiki.telemetry.cid
|
telemetryClientID: wiki.telemetry.cid
|
||||||
})
|
})
|
||||||
@ -375,12 +375,12 @@ module.exports = () => {
|
|||||||
wiki.logger.info(`HTTP Server on port: ${wiki.config.port}`)
|
wiki.logger.info(`HTTP Server on port: ${wiki.config.port}`)
|
||||||
|
|
||||||
app.set('port', wiki.config.port)
|
app.set('port', wiki.config.port)
|
||||||
server = http.createServer(app)
|
wiki.server = http.createServer(app)
|
||||||
server.listen(wiki.config.port)
|
wiki.server.listen(wiki.config.port)
|
||||||
|
|
||||||
var openConnections = []
|
var openConnections = []
|
||||||
|
|
||||||
server.on('connection', (conn) => {
|
wiki.server.on('connection', (conn) => {
|
||||||
let key = conn.remoteAddress + ':' + conn.remotePort
|
let key = conn.remoteAddress + ':' + conn.remotePort
|
||||||
openConnections[key] = conn
|
openConnections[key] = conn
|
||||||
conn.on('close', () => {
|
conn.on('close', () => {
|
||||||
@ -388,14 +388,14 @@ module.exports = () => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
server.destroy = (cb) => {
|
wiki.server.destroy = (cb) => {
|
||||||
server.close(cb)
|
wiki.server.close(cb)
|
||||||
for (let key in openConnections) {
|
for (let key in openConnections) {
|
||||||
openConnections[key].destroy()
|
openConnections[key].destroy()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
server.on('error', (error) => {
|
wiki.server.on('error', (error) => {
|
||||||
if (error.syscall !== 'listen') {
|
if (error.syscall !== 'listen') {
|
||||||
throw error
|
throw error
|
||||||
}
|
}
|
||||||
@ -412,7 +412,7 @@ module.exports = () => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
server.on('listening', () => {
|
wiki.server.on('listening', () => {
|
||||||
wiki.logger.info('HTTP Server: RUNNING')
|
wiki.logger.info('HTTP Server: RUNNING')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
extends master.pug
|
extends ../master.pug
|
||||||
|
|
||||||
block body
|
block body
|
||||||
body
|
body
|
Loading…
Reference in New Issue
Block a user