feat: content rendering improvements + save fix
This commit is contained in:
		| @@ -37,6 +37,15 @@ module.exports = { | ||||
|       case 'mariadb': | ||||
|       case 'mysql': | ||||
|         dbClient = 'mysql2' | ||||
|  | ||||
|         // Fix mysql boolean handling... | ||||
|         dbConfig.typeCast = (field, next) => { | ||||
|           if (field.type === 'TINY' && field.length === 1) { | ||||
|             let value = field.string() | ||||
|             return value ? (value === '1') : null | ||||
|           } | ||||
|           return next() | ||||
|         } | ||||
|         break | ||||
|       case 'mssql': | ||||
|         dbClient = 'mssql' | ||||
|   | ||||
| @@ -4,6 +4,7 @@ const getos = Promise.promisify(require('getos')) | ||||
| const os = require('os') | ||||
| const filesize = require('filesize') | ||||
| const path = require('path') | ||||
| const fs = require('fs-extra') | ||||
|  | ||||
| /* global WIKI */ | ||||
|  | ||||
| @@ -76,6 +77,10 @@ module.exports = { | ||||
|         const osInfo = await getos() | ||||
|         osLabel = `${os.type()} - ${osInfo.dist} (${osInfo.codename || os.platform()}) ${osInfo.release || os.release()} ${os.arch()}` | ||||
|       } | ||||
|       const isDockerized = await fs.pathExists('/.dockerenv') | ||||
|       if (isDockerized) { | ||||
|         osLabel = `${osLabel} (Docker Container)` | ||||
|       } | ||||
|       return osLabel | ||||
|     }, | ||||
|     hostname() { | ||||
|   | ||||
| @@ -23,6 +23,7 @@ module.exports = class PageHistory extends Model { | ||||
|         publishStartDate: {type: 'string'}, | ||||
|         publishEndDate: {type: 'string'}, | ||||
|         content: {type: 'string'}, | ||||
|         contentType: {type: 'string'}, | ||||
|  | ||||
|         createdAt: {type: 'string'} | ||||
|       } | ||||
| @@ -87,6 +88,7 @@ module.exports = class PageHistory extends Model { | ||||
|       pageId: opts.id, | ||||
|       authorId: opts.authorId, | ||||
|       content: opts.content, | ||||
|       contentType: opts.contentType, | ||||
|       description: opts.description, | ||||
|       editorKey: opts.editorKey, | ||||
|       hash: opts.hash, | ||||
|   | ||||
| @@ -4,6 +4,7 @@ block body | ||||
|   #root | ||||
|     v-app | ||||
|       editor( | ||||
|         :page-id=page.id | ||||
|         locale=page.localeCode | ||||
|         path=page.path | ||||
|         title=page.title | ||||
|   | ||||
| @@ -14,6 +14,6 @@ block body | ||||
|       updated-at=page.updatedAt | ||||
|       author-name=page.authorName | ||||
|       :author-id=page.authorId | ||||
|       is-published=page.isPublished | ||||
|       :is-published=page.isPublished | ||||
|       ) | ||||
|       template(slot='contents')!= page.render | ||||
|   | ||||
		Reference in New Issue
	
	Block a user