fix: setup editors add + page view responsive
This commit is contained in:
@@ -44,9 +44,8 @@ exports.up = knex => {
|
||||
.createTable('editors', table => {
|
||||
table.increments('id').primary()
|
||||
table.string('key').notNullable().unique()
|
||||
table.string('title').notNullable()
|
||||
table.boolean('isEnabled').notNullable().defaultTo(false)
|
||||
table.jsonb('config')
|
||||
table.jsonb('config').notNullable()
|
||||
})
|
||||
// GROUPS ------------------------------
|
||||
.createTable('groups', table => {
|
||||
|
@@ -36,10 +36,10 @@ module.exports = class Editor extends Model {
|
||||
const dbEditors = await WIKI.models.editors.query()
|
||||
|
||||
// -> Fetch definitions from disk
|
||||
const editorDirs = await fs.readdir(path.join(WIKI.SERVERPATH, 'modules/editors'))
|
||||
const editorDirs = await fs.readdir(path.join(WIKI.SERVERPATH, 'modules/editor'))
|
||||
let diskEditors = []
|
||||
for (let dir of editorDirs) {
|
||||
const def = await fs.readFile(path.join(WIKI.SERVERPATH, 'modules/editors', dir, 'definition.yml'), 'utf8')
|
||||
const def = await fs.readFile(path.join(WIKI.SERVERPATH, 'modules/editor', dir, 'definition.yml'), 'utf8')
|
||||
diskEditors.push(yaml.safeLoad(def))
|
||||
}
|
||||
WIKI.data.editors = diskEditors.map(editor => ({
|
||||
@@ -72,7 +72,7 @@ module.exports = class Editor extends Model {
|
||||
}
|
||||
}
|
||||
if (newEditors.length > 0) {
|
||||
await WIKI.models.storage.query().insert(newEditors)
|
||||
await WIKI.models.editors.query().insert(newEditors)
|
||||
WIKI.logger.info(`Loaded ${newEditors.length} new editors: [ OK ]`)
|
||||
} else {
|
||||
WIKI.logger.info(`No new editors found: [ SKIPPED ]`)
|
||||
|
Reference in New Issue
Block a user