mirror of https://github.com/halo-dev/halo
Show absolute post/sheet path in create page.
parent
4713436d03
commit
6328530fcd
|
@ -38,7 +38,7 @@
|
||||||
<a-form layout="vertical">
|
<a-form layout="vertical">
|
||||||
<a-form-item
|
<a-form-item
|
||||||
label="文章路径:"
|
label="文章路径:"
|
||||||
:help="'/archives/' + (postToStage.url ? postToStage.url : '{auto_generate}')"
|
:help="options.blog_url+'/archives/' + (postToStage.url ? postToStage.url : '{auto_generate}')"
|
||||||
>
|
>
|
||||||
<a-input v-model="postToStage.url" />
|
<a-input v-model="postToStage.url" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
@ -202,6 +202,7 @@ import 'mavon-editor/dist/css/index.css'
|
||||||
import tagApi from '@/api/tag'
|
import tagApi from '@/api/tag'
|
||||||
import categoryApi from '@/api/category'
|
import categoryApi from '@/api/category'
|
||||||
import postApi from '@/api/post'
|
import postApi from '@/api/post'
|
||||||
|
import optionApi from '@/api/option'
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
TagSelect,
|
TagSelect,
|
||||||
|
@ -231,12 +232,15 @@ export default {
|
||||||
selectedTagIds: [],
|
selectedTagIds: [],
|
||||||
postToStage: {},
|
postToStage: {},
|
||||||
categoryToCreate: {},
|
categoryToCreate: {},
|
||||||
timer: null
|
timer: null,
|
||||||
|
options: [],
|
||||||
|
keys: ['blog_url']
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.loadTags()
|
this.loadTags()
|
||||||
this.loadCategories()
|
this.loadCategories()
|
||||||
|
this.loadOptions()
|
||||||
clearInterval(this.timer)
|
clearInterval(this.timer)
|
||||||
this.timer = null
|
this.timer = null
|
||||||
this.autoSaveTimer()
|
this.autoSaveTimer()
|
||||||
|
@ -279,6 +283,11 @@ export default {
|
||||||
this.categories = response.data.data
|
this.categories = response.data.data
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
loadOptions() {
|
||||||
|
optionApi.listAll(this.keys).then(response => {
|
||||||
|
this.options = response.data.data
|
||||||
|
})
|
||||||
|
},
|
||||||
createOrUpdatePost(createSuccess, updateSuccess) {
|
createOrUpdatePost(createSuccess, updateSuccess) {
|
||||||
// Set category ids
|
// Set category ids
|
||||||
this.postToStage.categoryIds = this.selectedCategoryIds
|
this.postToStage.categoryIds = this.selectedCategoryIds
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
<a-form layout="vertical">
|
<a-form layout="vertical">
|
||||||
<a-form-item
|
<a-form-item
|
||||||
label="页面路径:"
|
label="页面路径:"
|
||||||
:help="'https://localhost:8090/s/'+ (sheetToStage.url ? sheetToStage.url : '{auto_generate}')"
|
:help="options.blog_url+'/s/'+ (sheetToStage.url ? sheetToStage.url : '{auto_generate}')"
|
||||||
>
|
>
|
||||||
<a-input v-model="sheetToStage.url" />
|
<a-input v-model="sheetToStage.url" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
@ -135,6 +135,7 @@ import { toolbars } from '@/core/const'
|
||||||
import 'mavon-editor/dist/css/index.css'
|
import 'mavon-editor/dist/css/index.css'
|
||||||
import sheetApi from '@/api/sheet'
|
import sheetApi from '@/api/sheet'
|
||||||
import themeApi from '@/api/theme'
|
import themeApi from '@/api/theme'
|
||||||
|
import optionApi from '@/api/option'
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
mavonEditor,
|
mavonEditor,
|
||||||
|
@ -156,11 +157,14 @@ export default {
|
||||||
sheetSettingVisible: false,
|
sheetSettingVisible: false,
|
||||||
customTpls: [],
|
customTpls: [],
|
||||||
sheetToStage: {},
|
sheetToStage: {},
|
||||||
timer: null
|
timer: null,
|
||||||
|
options: [],
|
||||||
|
keys: ['blog_url']
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.loadCustomTpls()
|
this.loadCustomTpls()
|
||||||
|
this.loadOptions()
|
||||||
clearInterval(this.timer)
|
clearInterval(this.timer)
|
||||||
this.timer = null
|
this.timer = null
|
||||||
this.autoSaveTimer()
|
this.autoSaveTimer()
|
||||||
|
@ -196,6 +200,11 @@ export default {
|
||||||
this.customTpls = response.data.data
|
this.customTpls = response.data.data
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
loadOptions() {
|
||||||
|
optionApi.listAll(this.keys).then(response => {
|
||||||
|
this.options = response.data.data
|
||||||
|
})
|
||||||
|
},
|
||||||
handlePublishClick() {
|
handlePublishClick() {
|
||||||
this.sheetToStage.status = 'PUBLISHED'
|
this.sheetToStage.status = 'PUBLISHED'
|
||||||
this.saveSheet()
|
this.saveSheet()
|
||||||
|
|
Loading…
Reference in New Issue