Commit 6041b169 authored by Nick's avatar Nick

fix: session knex connector + editor UI improvements

parent 4552c6d2
...@@ -6,25 +6,25 @@ ...@@ -6,25 +6,25 @@
.subheading.grey--text {{currentPageTitle}} .subheading.grey--text {{currentPageTitle}}
v-spacer v-spacer
template(slot='actions') template(slot='actions')
v-btn( v-btn.animated.fadeInDown(
outline flat
color='green' color='green'
@click.native.stop='save' @click.native.stop='save'
:class='{ "is-icon": $vuetify.breakpoint.mdAndDown }' :class='{ "is-icon": $vuetify.breakpoint.mdAndDown }'
) )
v-icon(color='green', :left='$vuetify.breakpoint.lgAndUp') check v-icon(color='green', :left='$vuetify.breakpoint.lgAndUp') check
span.white--text(v-if='$vuetify.breakpoint.lgAndUp') {{ mode === 'create' ? $t('common:actions.create') : $t('common:actions.save') }} span.white--text(v-if='$vuetify.breakpoint.lgAndUp') {{ mode === 'create' ? $t('common:actions.create') : $t('common:actions.save') }}
v-btn( v-btn.animated.fadeInDown.wait-p1s(
outline flat
color='blue' color='blue'
@click.native.stop='openPropsModal' @click.native.stop='openPropsModal'
:class='{ "is-icon": $vuetify.breakpoint.mdAndDown, "mx-0": !welcomeMode, "ml-0": welcomeMode }' :class='{ "is-icon": $vuetify.breakpoint.mdAndDown, "mx-0": !welcomeMode, "ml-0": welcomeMode }'
) )
v-icon(color='blue', :left='$vuetify.breakpoint.lgAndUp') sort_by_alpha v-icon(color='blue', :left='$vuetify.breakpoint.lgAndUp') sort_by_alpha
span.white--text(v-if='$vuetify.breakpoint.lgAndUp') {{ $t('editor:page') }} span.white--text(v-if='$vuetify.breakpoint.lgAndUp') {{ $t('editor:page') }}
v-btn( v-btn.animated.fadeInDown.wait-p2s(
v-if='!welcomeMode' v-if='!welcomeMode'
outline flat
color='red' color='red'
:class='{ "is-icon": $vuetify.breakpoint.mdAndDown }' :class='{ "is-icon": $vuetify.breakpoint.mdAndDown }'
@click.native.stop='exit' @click.native.stop='exit'
......
...@@ -5,7 +5,7 @@ $use-bounce: true; ...@@ -5,7 +5,7 @@ $use-bounce: true;
@import "~animate-sass/animate"; @import "~animate-sass/animate";
@for $i from 1 to 9 { @for $i from 1 to 12 {
.wait-p#{$i}s { .wait-p#{$i}s {
animation-delay: $i * .1s !important; animation-delay: $i * .1s !important;
} }
......
...@@ -274,6 +274,10 @@ ...@@ -274,6 +274,10 @@
padding: 1rem 1rem 1rem 3rem; padding: 1rem 1rem 1rem 3rem;
margin: 1rem 24px; margin: 1rem 24px;
@at-root .theme--dark & {
background-color: darken(mc('grey', '900'), 5%);
}
> code { > code {
background-color: transparent; background-color: transparent;
padding: 0; padding: 0;
......
...@@ -57,6 +57,7 @@ ...@@ -57,6 +57,7 @@
"chokidar": "2.1.5", "chokidar": "2.1.5",
"clean-css": "4.2.1", "clean-css": "4.2.1",
"compression": "1.7.4", "compression": "1.7.4",
"connect-session-knex": "1.4.0",
"cookie-parser": "1.4.4", "cookie-parser": "1.4.4",
"cors": "2.8.5", "cors": "2.8.5",
"custom-error-instance": "2.1.1", "custom-error-instance": "2.1.1",
......
...@@ -5,6 +5,7 @@ const cookieParser = require('cookie-parser') ...@@ -5,6 +5,7 @@ const cookieParser = require('cookie-parser')
const cors = require('cors') const cors = require('cors')
const express = require('express') const express = require('express')
const session = require('express-session') const session = require('express-session')
const KnexSessionStore = require('connect-session-knex')(session)
const favicon = require('serve-favicon') const favicon = require('serve-favicon')
const fs = require('fs-extra') const fs = require('fs-extra')
const http = require('http') const http = require('http')
...@@ -69,7 +70,10 @@ module.exports = async () => { ...@@ -69,7 +70,10 @@ module.exports = async () => {
app.use(session({ app.use(session({
secret: WIKI.config.sessionSecret, secret: WIKI.config.sessionSecret,
resave: false, resave: false,
saveUninitialized: false saveUninitialized: false,
store: new KnexSessionStore({
knex: WIKI.models.knex
})
})) }))
app.use(WIKI.auth.passport.initialize()) app.use(WIKI.auth.passport.initialize())
app.use(WIKI.auth.authenticate) app.use(WIKI.auth.authenticate)
......
...@@ -88,6 +88,9 @@ module.exports = class Editor extends Model { ...@@ -88,6 +88,9 @@ module.exports = class Editor extends Model {
} catch (err) { } catch (err) {
WIKI.logger.error(`Failed to scan or load new editors: [ FAILED ]`) WIKI.logger.error(`Failed to scan or load new editors: [ FAILED ]`)
WIKI.logger.error(err) WIKI.logger.error(err)
if (trx) {
trx.rollback()
}
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment