feat: edit drawio site url

pull/5873/head
dzruyk 2 years ago
parent ca2f7aaf73
commit 12e6c6bfc2

@ -2,14 +2,13 @@
v-card.editor-modal-drawio.animated.fadeIn(flat, tile)
iframe(
ref='drawio'
src='https://embed.diagrams.net/?embed=1&proto=json&spin=1&saveAndExit=1&noSaveBtn=1&noExitBtn=0'
:src='drawioBaseUrl'
frameborder='0'
)
</template>
<script>
import { sync, get } from 'vuex-pathify'
// const xmlTest = `<?xml version="1.0" encoding="UTF-8"?>
// <mxfile version="13.4.2">
// <diagram id="SgbkCjxR32CZT1FvBvkp" name="Page-1">
@ -34,7 +33,10 @@ export default {
},
computed: {
editorKey: get('editor/editorKey'),
activeModal: sync('editor/activeModal')
activeModal: sync('editor/activeModal'),
drawioBaseUrl() {
return `${siteConfig.drawioBaseUrl}?embed=1&proto=json&spin=1&saveAndExit=1&noSaveBtn=1&noExitBtn=0`
}
},
methods: {
close () {

@ -45,6 +45,7 @@ defaults:
company: ''
contentLicense: ''
logoUrl: https://static.requarks.io/logo/wikijs-butterfly.svg
drawioBaseUrl: https://embed.diagrams.net/
pageExtensions:
- md
- html

@ -113,6 +113,9 @@ router.get(['/e', '/e/*'], async (req, res, next) => {
_.set(res, 'locals.siteConfig.lang', pageArgs.locale)
_.set(res, 'locals.siteConfig.rtl', req.i18n.dir() === 'rtl')
// -> Set Draw.IO url for editor-modal-drawio.vue
_.set(res, 'locals.siteConfig.drawioBaseUrl', WIKI.config.drawioBaseUrl)
// -> Check for reserved path
if (pageHelper.isReservedPath(pageArgs.path)) {
return next(new Error('Cannot create this page because it starts with a system reserved path.'))

Loading…
Cancel
Save