feat: local disk import all action + v1 import content (#1100)
This commit is contained in:
@@ -99,6 +99,8 @@ module.exports = class Editor extends Model {
|
||||
switch (contentType) {
|
||||
case 'markdown':
|
||||
return 'markdown'
|
||||
case 'html':
|
||||
return 'ckeditor'
|
||||
default:
|
||||
return 'code'
|
||||
}
|
||||
|
@@ -366,7 +366,7 @@ module.exports = class Page extends Model {
|
||||
}
|
||||
|
||||
// -> Perform move?
|
||||
if (opts.locale !== page.localeCode || opts.path !== page.path) {
|
||||
if ((opts.locale && opts.locale !== page.localeCode) || (opts.path && opts.path !== page.path)) {
|
||||
await WIKI.models.pages.movePage({
|
||||
id: page.id,
|
||||
destinationLocale: opts.locale,
|
||||
|
@@ -712,4 +712,14 @@ module.exports = class User extends Model {
|
||||
user.permissions = user.getGlobalPermissions()
|
||||
return user
|
||||
}
|
||||
|
||||
static async getRootUser () {
|
||||
let user = await WIKI.models.users.query().findById(1)
|
||||
if (!user) {
|
||||
WIKI.logger.error('CRITICAL ERROR: Root Administrator user is missing!')
|
||||
process.exit(1)
|
||||
}
|
||||
user.permissions = ['manage:system']
|
||||
return user
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user