mirror of https://github.com/halo-dev/halo
refactor: system options page layout. (halo-dev/console#251)
* refactor: system options page layout. * refactor: system options page layout.pull/3445/head
parent
ab0617251f
commit
c9f4b5694c
|
@ -6,7 +6,7 @@
|
||||||
:boxShadow="false"
|
:boxShadow="false"
|
||||||
:toolbars="toolbars"
|
:toolbars="toolbars"
|
||||||
:ishljs="true"
|
:ishljs="true"
|
||||||
:autofocus="false"
|
autofocus
|
||||||
@imgAdd="handleAttachmentUpload"
|
@imgAdd="handleAttachmentUpload"
|
||||||
@save="handleSaveDraft"
|
@save="handleSaveDraft"
|
||||||
/>
|
/>
|
||||||
|
@ -20,19 +20,19 @@ import attachmentApi from '@/api/attachment'
|
||||||
export default {
|
export default {
|
||||||
name: 'MarkdownEditor',
|
name: 'MarkdownEditor',
|
||||||
components: {
|
components: {
|
||||||
haloEditor
|
haloEditor,
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
originalContent: {
|
originalContent: {
|
||||||
type: String,
|
type: String,
|
||||||
required: false,
|
required: false,
|
||||||
default: ''
|
default: '',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
toolbars,
|
toolbars,
|
||||||
originalContentData: ''
|
originalContentData: '',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
@ -41,7 +41,7 @@ export default {
|
||||||
},
|
},
|
||||||
originalContentData(val) {
|
originalContentData(val) {
|
||||||
this.$emit('onContentChange', val)
|
this.$emit('onContentChange', val)
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleAttachmentUpload(pos, $file) {
|
handleAttachmentUpload(pos, $file) {
|
||||||
|
@ -55,7 +55,7 @@ export default {
|
||||||
},
|
},
|
||||||
handleSaveDraft() {
|
handleSaveDraft() {
|
||||||
this.$emit('onSaveDraft')
|
this.$emit('onSaveDraft')
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -162,7 +162,7 @@ export const asyncRouterMap = [
|
||||||
{
|
{
|
||||||
path: '/system',
|
path: '/system',
|
||||||
name: 'System',
|
name: 'System',
|
||||||
component: PageView,
|
component: BlankLayout,
|
||||||
redirect: '/system/options',
|
redirect: '/system/options',
|
||||||
meta: { title: '系统', icon: 'setting' },
|
meta: { title: '系统', icon: 'setting' },
|
||||||
children: [
|
children: [
|
||||||
|
|
|
@ -15,6 +15,11 @@
|
||||||
slot="extra"
|
slot="extra"
|
||||||
>
|
>
|
||||||
</slot>
|
</slot>
|
||||||
|
<slot
|
||||||
|
name="footer"
|
||||||
|
slot="footer"
|
||||||
|
>
|
||||||
|
</slot>
|
||||||
</a-page-header>
|
</a-page-header>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -44,6 +44,7 @@
|
||||||
v-if="editable"
|
v-if="editable"
|
||||||
>
|
>
|
||||||
<a-input
|
<a-input
|
||||||
|
ref="nameInput"
|
||||||
v-model="attachment.name"
|
v-model="attachment.name"
|
||||||
@blur="doUpdateAttachment"
|
@blur="doUpdateAttachment"
|
||||||
/>
|
/>
|
||||||
|
@ -57,7 +58,7 @@
|
||||||
<a href="javascript:void(0);">
|
<a href="javascript:void(0);">
|
||||||
<a-icon
|
<a-icon
|
||||||
type="edit"
|
type="edit"
|
||||||
@click="editable = !editable"
|
@click="handleEditName"
|
||||||
/>
|
/>
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
|
@ -134,9 +135,7 @@
|
||||||
cancelText="取消"
|
cancelText="取消"
|
||||||
v-if="addToPhoto"
|
v-if="addToPhoto"
|
||||||
>
|
>
|
||||||
<a-button
|
<a-button type="dashed">添加到图库</a-button>
|
||||||
type="dashed"
|
|
||||||
>添加到图库</a-button>
|
|
||||||
</a-popconfirm>
|
</a-popconfirm>
|
||||||
<a-popconfirm
|
<a-popconfirm
|
||||||
title="你确定要删除该附件?"
|
title="你确定要删除该附件?"
|
||||||
|
@ -172,7 +171,7 @@ export default {
|
||||||
name: 'AttachmentDetailDrawer',
|
name: 'AttachmentDetailDrawer',
|
||||||
mixins: [mixin, mixinDevice],
|
mixins: [mixin, mixinDevice],
|
||||||
components: {
|
components: {
|
||||||
'd-player': VueDPlayer
|
'd-player': VueDPlayer,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -188,30 +187,30 @@ export default {
|
||||||
lang: 'zh-cn',
|
lang: 'zh-cn',
|
||||||
video: {
|
video: {
|
||||||
url: '',
|
url: '',
|
||||||
type: 'auto'
|
type: 'auto',
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
model: {
|
model: {
|
||||||
prop: 'visible',
|
prop: 'visible',
|
||||||
event: 'close'
|
event: 'close',
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
attachment: {
|
attachment: {
|
||||||
type: Object,
|
type: Object,
|
||||||
required: true
|
required: true,
|
||||||
},
|
},
|
||||||
addToPhoto: {
|
addToPhoto: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
required: false,
|
required: false,
|
||||||
default: false
|
default: false,
|
||||||
},
|
},
|
||||||
visible: {
|
visible: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
required: false,
|
required: false,
|
||||||
default: true
|
default: true,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.player = this.$refs.player
|
this.player = this.$refs.player
|
||||||
|
@ -221,7 +220,7 @@ export default {
|
||||||
if (newValue) {
|
if (newValue) {
|
||||||
this.handleJudgeMediaType(newValue)
|
this.handleJudgeMediaType(newValue)
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleDeleteAttachment() {
|
handleDeleteAttachment() {
|
||||||
|
@ -242,28 +241,35 @@ export default {
|
||||||
this.deleteErrored = false
|
this.deleteErrored = false
|
||||||
this.onClose()
|
this.onClose()
|
||||||
},
|
},
|
||||||
|
handleEditName() {
|
||||||
|
this.editable = !this.editable
|
||||||
|
if (this.editable) {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.nameInput.focus()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
doUpdateAttachment() {
|
doUpdateAttachment() {
|
||||||
if (!this.attachment.name) {
|
if (!this.attachment.name) {
|
||||||
this.$notification['error']({
|
this.$notification['error']({
|
||||||
message: '提示',
|
message: '提示',
|
||||||
description: '附件名称不能为空!'
|
description: '附件名称不能为空!',
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
attachmentApi.update(this.attachment.id, this.attachment).then(response => {
|
attachmentApi.update(this.attachment.id, this.attachment).then((response) => {
|
||||||
this.$log.debug('Updated attachment', response.data.data)
|
this.$log.debug('Updated attachment', response.data.data)
|
||||||
this.$message.success('附件修改成功!')
|
|
||||||
})
|
})
|
||||||
this.editable = false
|
this.editable = false
|
||||||
},
|
},
|
||||||
handleCopyNormalLink() {
|
handleCopyNormalLink() {
|
||||||
const text = `${encodeURI(this.attachment.path)}`
|
const text = `${encodeURI(this.attachment.path)}`
|
||||||
this.$copyText(text)
|
this.$copyText(text)
|
||||||
.then(message => {
|
.then((message) => {
|
||||||
this.$log.debug('copy', message)
|
this.$log.debug('copy', message)
|
||||||
this.$message.success('复制成功!')
|
this.$message.success('复制成功!')
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch((err) => {
|
||||||
this.$log.debug('copy.err', err)
|
this.$log.debug('copy.err', err)
|
||||||
this.$message.error('复制失败!')
|
this.$message.error('复制失败!')
|
||||||
})
|
})
|
||||||
|
@ -271,11 +277,11 @@ export default {
|
||||||
handleCopyMarkdownLink() {
|
handleCopyMarkdownLink() {
|
||||||
const text = `})`
|
const text = `})`
|
||||||
this.$copyText(text)
|
this.$copyText(text)
|
||||||
.then(message => {
|
.then((message) => {
|
||||||
this.$log.debug('copy', message)
|
this.$log.debug('copy', message)
|
||||||
this.$message.success('复制成功!')
|
this.$message.success('复制成功!')
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch((err) => {
|
||||||
this.$log.debug('copy.err', err)
|
this.$log.debug('copy.err', err)
|
||||||
this.$message.error('复制失败!')
|
this.$message.error('复制失败!')
|
||||||
})
|
})
|
||||||
|
@ -285,7 +291,7 @@ export default {
|
||||||
this.photo['thumbnail'] = encodeURI(this.attachment.thumbPath)
|
this.photo['thumbnail'] = encodeURI(this.attachment.thumbPath)
|
||||||
this.photo['url'] = encodeURI(this.attachment.path)
|
this.photo['url'] = encodeURI(this.attachment.path)
|
||||||
this.photo['takeTime'] = new Date().getTime()
|
this.photo['takeTime'] = new Date().getTime()
|
||||||
photoApi.create(this.photo).then(response => {
|
photoApi.create(this.photo).then((response) => {
|
||||||
this.$message.success('添加成功!')
|
this.$message.success('添加成功!')
|
||||||
this.photo = {}
|
this.photo = {}
|
||||||
})
|
})
|
||||||
|
@ -322,7 +328,7 @@ export default {
|
||||||
this.$set(this, 'photoPreviewVisible', photo)
|
this.$set(this, 'photoPreviewVisible', photo)
|
||||||
this.$set(this, 'videoPreviewVisible', video)
|
this.$set(this, 'videoPreviewVisible', video)
|
||||||
this.$set(this, 'nonsupportPreviewVisible', nonsupport)
|
this.$set(this, 'nonsupportPreviewVisible', nonsupport)
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -422,6 +422,7 @@
|
||||||
>
|
>
|
||||||
<a-form-model-item prop="content">
|
<a-form-model-item prop="content">
|
||||||
<a-input
|
<a-input
|
||||||
|
ref="contentInput"
|
||||||
type="textarea"
|
type="textarea"
|
||||||
:autoSize="{ minRows: 8 }"
|
:autoSize="{ minRows: 8 }"
|
||||||
v-model.trim="replyComment.content"
|
v-model.trim="replyComment.content"
|
||||||
|
@ -450,39 +451,39 @@ const postColumns = [
|
||||||
dataIndex: 'author',
|
dataIndex: 'author',
|
||||||
width: '150px',
|
width: '150px',
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
scopedSlots: { customRender: 'author' }
|
scopedSlots: { customRender: 'author' },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '内容',
|
title: '内容',
|
||||||
dataIndex: 'content',
|
dataIndex: 'content',
|
||||||
scopedSlots: { customRender: 'content' }
|
scopedSlots: { customRender: 'content' },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '状态',
|
title: '状态',
|
||||||
className: 'status',
|
className: 'status',
|
||||||
dataIndex: 'statusProperty',
|
dataIndex: 'statusProperty',
|
||||||
width: '100px',
|
width: '100px',
|
||||||
scopedSlots: { customRender: 'status' }
|
scopedSlots: { customRender: 'status' },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '评论文章',
|
title: '评论文章',
|
||||||
dataIndex: 'post',
|
dataIndex: 'post',
|
||||||
width: '200px',
|
width: '200px',
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
scopedSlots: { customRender: 'post' }
|
scopedSlots: { customRender: 'post' },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '日期',
|
title: '日期',
|
||||||
dataIndex: 'createTime',
|
dataIndex: 'createTime',
|
||||||
width: '170px',
|
width: '170px',
|
||||||
scopedSlots: { customRender: 'createTime' }
|
scopedSlots: { customRender: 'createTime' },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '操作',
|
title: '操作',
|
||||||
dataIndex: 'action',
|
dataIndex: 'action',
|
||||||
width: '180px',
|
width: '180px',
|
||||||
scopedSlots: { customRender: 'action' }
|
scopedSlots: { customRender: 'action' },
|
||||||
}
|
},
|
||||||
]
|
]
|
||||||
const sheetColumns = [
|
const sheetColumns = [
|
||||||
{
|
{
|
||||||
|
@ -490,45 +491,45 @@ const sheetColumns = [
|
||||||
dataIndex: 'author',
|
dataIndex: 'author',
|
||||||
width: '150px',
|
width: '150px',
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
scopedSlots: { customRender: 'author' }
|
scopedSlots: { customRender: 'author' },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '内容',
|
title: '内容',
|
||||||
dataIndex: 'content',
|
dataIndex: 'content',
|
||||||
scopedSlots: { customRender: 'content' }
|
scopedSlots: { customRender: 'content' },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '状态',
|
title: '状态',
|
||||||
className: 'status',
|
className: 'status',
|
||||||
dataIndex: 'statusProperty',
|
dataIndex: 'statusProperty',
|
||||||
width: '100px',
|
width: '100px',
|
||||||
scopedSlots: { customRender: 'status' }
|
scopedSlots: { customRender: 'status' },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '评论页面',
|
title: '评论页面',
|
||||||
dataIndex: 'sheet',
|
dataIndex: 'sheet',
|
||||||
width: '200px',
|
width: '200px',
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
scopedSlots: { customRender: 'sheet' }
|
scopedSlots: { customRender: 'sheet' },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '日期',
|
title: '日期',
|
||||||
dataIndex: 'createTime',
|
dataIndex: 'createTime',
|
||||||
width: '170px',
|
width: '170px',
|
||||||
scopedSlots: { customRender: 'createTime' }
|
scopedSlots: { customRender: 'createTime' },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '操作',
|
title: '操作',
|
||||||
dataIndex: 'action',
|
dataIndex: 'action',
|
||||||
width: '180px',
|
width: '180px',
|
||||||
scopedSlots: { customRender: 'action' }
|
scopedSlots: { customRender: 'action' },
|
||||||
}
|
},
|
||||||
]
|
]
|
||||||
export default {
|
export default {
|
||||||
name: 'CommentTab',
|
name: 'CommentTab',
|
||||||
mixins: [mixin, mixinDevice],
|
mixins: [mixin, mixinDevice],
|
||||||
components: {
|
components: {
|
||||||
CommentDetail
|
CommentDetail,
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
type: {
|
type: {
|
||||||
|
@ -537,8 +538,8 @@ export default {
|
||||||
default: 'posts',
|
default: 'posts',
|
||||||
validator: function(value) {
|
validator: function(value) {
|
||||||
return ['posts', 'sheets', 'journals'].indexOf(value) !== -1
|
return ['posts', 'sheets', 'journals'].indexOf(value) !== -1
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -548,14 +549,14 @@ export default {
|
||||||
page: 1,
|
page: 1,
|
||||||
size: 10,
|
size: 10,
|
||||||
sort: null,
|
sort: null,
|
||||||
total: 1
|
total: 1,
|
||||||
},
|
},
|
||||||
queryParam: {
|
queryParam: {
|
||||||
page: 0,
|
page: 0,
|
||||||
size: 10,
|
size: 10,
|
||||||
sort: null,
|
sort: null,
|
||||||
keyword: null,
|
keyword: null,
|
||||||
status: null
|
status: null,
|
||||||
},
|
},
|
||||||
selectedRowKeys: [],
|
selectedRowKeys: [],
|
||||||
selectedRows: [],
|
selectedRows: [],
|
||||||
|
@ -563,13 +564,13 @@ export default {
|
||||||
selectedComment: {},
|
selectedComment: {},
|
||||||
replyComment: {},
|
replyComment: {},
|
||||||
replyCommentRules: {
|
replyCommentRules: {
|
||||||
content: [{ required: true, message: '* 内容不能为空', trigger: ['change'] }]
|
content: [{ required: true, message: '* 内容不能为空', trigger: ['change'] }],
|
||||||
},
|
},
|
||||||
loading: false,
|
loading: false,
|
||||||
commentStatus: commentApi.commentStatus,
|
commentStatus: commentApi.commentStatus,
|
||||||
commentDetailVisible: false,
|
commentDetailVisible: false,
|
||||||
replying: false,
|
replying: false,
|
||||||
replyErrored: false
|
replyErrored: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
@ -577,12 +578,12 @@ export default {
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
formattedComments() {
|
formattedComments() {
|
||||||
return this.comments.map(comment => {
|
return this.comments.map((comment) => {
|
||||||
comment.statusProperty = this.commentStatus[comment.status]
|
comment.statusProperty = this.commentStatus[comment.status]
|
||||||
comment.content = marked(decodeHTML(comment.content))
|
comment.content = marked(decodeHTML(comment.content))
|
||||||
return comment
|
return comment
|
||||||
})
|
})
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleListComments() {
|
handleListComments() {
|
||||||
|
@ -592,7 +593,7 @@ export default {
|
||||||
this.queryParam.sort = this.pagination.sort
|
this.queryParam.sort = this.pagination.sort
|
||||||
commentApi
|
commentApi
|
||||||
.queryComment(this.type, this.queryParam)
|
.queryComment(this.type, this.queryParam)
|
||||||
.then(response => {
|
.then((response) => {
|
||||||
this.comments = response.data.data.content
|
this.comments = response.data.data.content
|
||||||
this.pagination.total = response.data.data.total
|
this.pagination.total = response.data.data.total
|
||||||
})
|
})
|
||||||
|
@ -609,7 +610,7 @@ export default {
|
||||||
handleEditStatusClick(commentId, status) {
|
handleEditStatusClick(commentId, status) {
|
||||||
commentApi
|
commentApi
|
||||||
.updateStatus(this.type, commentId, status)
|
.updateStatus(this.type, commentId, status)
|
||||||
.then(response => {
|
.then((response) => {
|
||||||
this.$message.success('操作成功!')
|
this.$message.success('操作成功!')
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
|
@ -619,7 +620,7 @@ export default {
|
||||||
handleDeleteClick(commentId) {
|
handleDeleteClick(commentId) {
|
||||||
commentApi
|
commentApi
|
||||||
.delete(this.type, commentId)
|
.delete(this.type, commentId)
|
||||||
.then(response => {
|
.then((response) => {
|
||||||
this.$message.success('删除成功!')
|
this.$message.success('删除成功!')
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
|
@ -639,10 +640,13 @@ export default {
|
||||||
} else {
|
} else {
|
||||||
this.replyComment.postId = comment.sheet.id
|
this.replyComment.postId = comment.sheet.id
|
||||||
}
|
}
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.contentInput.focus()
|
||||||
|
})
|
||||||
},
|
},
|
||||||
handleCreateClick() {
|
handleCreateClick() {
|
||||||
const _this = this
|
const _this = this
|
||||||
_this.$refs.replyCommentForm.validate(valid => {
|
_this.$refs.replyCommentForm.validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
_this.replying = true
|
_this.replying = true
|
||||||
commentApi
|
commentApi
|
||||||
|
@ -687,7 +691,7 @@ export default {
|
||||||
}
|
}
|
||||||
commentApi
|
commentApi
|
||||||
.updateStatusInBatch(this.type, this.selectedRowKeys, status)
|
.updateStatusInBatch(this.type, this.selectedRowKeys, status)
|
||||||
.then(response => {
|
.then((response) => {
|
||||||
this.$log.debug(`commentIds: ${this.selectedRowKeys}, status: ${status}`)
|
this.$log.debug(`commentIds: ${this.selectedRowKeys}, status: ${status}`)
|
||||||
this.selectedRowKeys = []
|
this.selectedRowKeys = []
|
||||||
})
|
})
|
||||||
|
@ -702,7 +706,7 @@ export default {
|
||||||
}
|
}
|
||||||
commentApi
|
commentApi
|
||||||
.deleteInBatch(this.type, this.selectedRowKeys)
|
.deleteInBatch(this.type, this.selectedRowKeys)
|
||||||
.then(response => {
|
.then((response) => {
|
||||||
this.$log.debug(`delete: ${this.selectedRowKeys}`)
|
this.$log.debug(`delete: ${this.selectedRowKeys}`)
|
||||||
this.selectedRowKeys = []
|
this.selectedRowKeys = []
|
||||||
})
|
})
|
||||||
|
@ -726,14 +730,14 @@ export default {
|
||||||
return {
|
return {
|
||||||
props: {
|
props: {
|
||||||
disabled: this.queryParam.status == null || this.queryParam.status === '',
|
disabled: this.queryParam.status == null || this.queryParam.status === '',
|
||||||
name: comment.author
|
name: comment.author,
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleShowDetailDrawer(comment) {
|
handleShowDetailDrawer(comment) {
|
||||||
this.selectedComment = comment
|
this.selectedComment = comment
|
||||||
this.commentDetailVisible = true
|
this.commentDetailVisible = true
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -29,11 +29,11 @@
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-divider />
|
<a-divider />
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<a-spin :spinning="loading">
|
<a-spin :spinning="list.loading">
|
||||||
<a-empty v-if="comments.length == 0" />
|
<a-empty v-if="list.data.length == 0" />
|
||||||
<TargetCommentTree
|
<TargetCommentTree
|
||||||
v-else
|
v-else
|
||||||
v-for="(comment, index) in comments"
|
v-for="(comment, index) in list.data"
|
||||||
:key="index"
|
:key="index"
|
||||||
:comment="comment"
|
:comment="comment"
|
||||||
@reply="handleCommentReply"
|
@reply="handleCommentReply"
|
||||||
|
@ -46,9 +46,9 @@
|
||||||
<a-divider />
|
<a-divider />
|
||||||
<div class="page-wrapper">
|
<div class="page-wrapper">
|
||||||
<a-pagination
|
<a-pagination
|
||||||
:current="pagination.page"
|
:current="list.pagination.page"
|
||||||
:total="pagination.total"
|
:total="list.pagination.total"
|
||||||
:defaultPageSize="pagination.size"
|
:defaultPageSize="list.pagination.size"
|
||||||
@change="handlePaginationChange"
|
@change="handlePaginationChange"
|
||||||
showLessItems
|
showLessItems
|
||||||
></a-pagination>
|
></a-pagination>
|
||||||
|
@ -57,59 +57,42 @@
|
||||||
<div class="bottom-control">
|
<div class="bottom-control">
|
||||||
<a-button
|
<a-button
|
||||||
type="primary"
|
type="primary"
|
||||||
@click="handleComment"
|
@click="handleCommentReply({})"
|
||||||
>评论</a-button>
|
>评论</a-button>
|
||||||
</div>
|
</div>
|
||||||
<a-modal
|
<a-modal
|
||||||
v-if="selectedComment"
|
:title="replyModalTitle"
|
||||||
:title="'回复给:' + selectedComment.author"
|
v-model="replyModal.visible"
|
||||||
v-model="replyCommentVisible"
|
@close="onReplyModalClose"
|
||||||
@close="onReplyClose"
|
|
||||||
destroyOnClose
|
destroyOnClose
|
||||||
>
|
>
|
||||||
<template slot="footer">
|
<template slot="footer">
|
||||||
<a-button
|
<ReactiveButton
|
||||||
key="submit"
|
|
||||||
type="primary"
|
type="primary"
|
||||||
@click="handleCreateClick"
|
@click="handleReplyClick"
|
||||||
>
|
@callback="handleReplyCallback"
|
||||||
回复
|
:loading="replyModal.saving"
|
||||||
</a-button>
|
:errored="replyModal.saveErrored"
|
||||||
|
text="回复"
|
||||||
|
loadedText="回复成功"
|
||||||
|
erroredText="回复失败"
|
||||||
|
></ReactiveButton>
|
||||||
</template>
|
</template>
|
||||||
<a-form layout="vertical">
|
<a-form-model
|
||||||
<a-form-item>
|
ref="replyCommentForm"
|
||||||
|
:model="replyModal.model"
|
||||||
|
:rules="replyModal.rules"
|
||||||
|
layout="vertical"
|
||||||
|
>
|
||||||
|
<a-form-model-item prop="content">
|
||||||
<a-input
|
<a-input
|
||||||
|
ref="contentInput"
|
||||||
type="textarea"
|
type="textarea"
|
||||||
:autoSize="{ minRows: 8 }"
|
:autoSize="{ minRows: 8 }"
|
||||||
v-model="replyComment.content"
|
v-model="replyModal.model.content"
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-model-item>
|
||||||
</a-form>
|
</a-form-model>
|
||||||
</a-modal>
|
|
||||||
<a-modal
|
|
||||||
title="评论"
|
|
||||||
v-model="commentVisible"
|
|
||||||
@close="onCommentClose"
|
|
||||||
destroyOnClose
|
|
||||||
>
|
|
||||||
<template slot="footer">
|
|
||||||
<a-button
|
|
||||||
key="submit"
|
|
||||||
type="primary"
|
|
||||||
@click="handleCreateClick"
|
|
||||||
>
|
|
||||||
回复
|
|
||||||
</a-button>
|
|
||||||
</template>
|
|
||||||
<a-form layout="vertical">
|
|
||||||
<a-form-item>
|
|
||||||
<a-input
|
|
||||||
type="textarea"
|
|
||||||
:autoSize="{ minRows: 8 }"
|
|
||||||
v-model="replyComment.content"
|
|
||||||
/>
|
|
||||||
</a-form-item>
|
|
||||||
</a-form>
|
|
||||||
</a-modal>
|
</a-modal>
|
||||||
</a-drawer>
|
</a-drawer>
|
||||||
</template>
|
</template>
|
||||||
|
@ -123,111 +106,130 @@ export default {
|
||||||
components: { TargetCommentTree },
|
components: { TargetCommentTree },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
comments: [],
|
list: {
|
||||||
loading: false,
|
data: [],
|
||||||
selectedComment: {},
|
loading: false,
|
||||||
replyComment: {},
|
selected: {},
|
||||||
replyCommentVisible: false,
|
pagination: {
|
||||||
commentVisible: false,
|
page: 1,
|
||||||
pagination: {
|
size: 10,
|
||||||
page: 1,
|
sort: null,
|
||||||
size: 10,
|
total: 1,
|
||||||
sort: null,
|
},
|
||||||
total: 1
|
queryParam: {
|
||||||
|
page: 0,
|
||||||
|
size: 10,
|
||||||
|
sort: null,
|
||||||
|
keyword: null,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
replyModal: {
|
||||||
|
model: {},
|
||||||
|
visible: false,
|
||||||
|
saving: false,
|
||||||
|
saveErrored: false,
|
||||||
|
rules: {
|
||||||
|
content: [{ required: true, message: '* 内容不能为空', trigger: ['change'] }],
|
||||||
|
},
|
||||||
},
|
},
|
||||||
queryParam: {
|
|
||||||
page: 0,
|
|
||||||
size: 10,
|
|
||||||
sort: null,
|
|
||||||
keyword: null
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
visible: {
|
visible: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
required: false,
|
required: false,
|
||||||
default: false
|
default: false,
|
||||||
},
|
},
|
||||||
title: {
|
title: {
|
||||||
type: String,
|
type: String,
|
||||||
required: false,
|
required: false,
|
||||||
default: ''
|
default: '',
|
||||||
},
|
},
|
||||||
description: {
|
description: {
|
||||||
type: String,
|
type: String,
|
||||||
required: false,
|
required: false,
|
||||||
default: ''
|
default: '',
|
||||||
},
|
},
|
||||||
target: {
|
target: {
|
||||||
type: String,
|
type: String,
|
||||||
required: false,
|
required: false,
|
||||||
default: ''
|
default: '',
|
||||||
},
|
},
|
||||||
id: {
|
id: {
|
||||||
type: Number,
|
type: Number,
|
||||||
required: false,
|
required: false,
|
||||||
default: 0
|
default: 0,
|
||||||
}
|
},
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
replyModalTitle() {
|
||||||
|
return this.list.selected.id ? `回复给:${this.list.selected.author}` : '评论'
|
||||||
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleListComments() {
|
handleListComments() {
|
||||||
this.loading = true
|
this.list.loading = true
|
||||||
this.queryParam.page = this.pagination.page - 1
|
this.list.queryParam.page = this.list.pagination.page - 1
|
||||||
this.queryParam.size = this.pagination.size
|
this.list.queryParam.size = this.list.pagination.size
|
||||||
this.queryParam.sort = this.pagination.sort
|
this.list.queryParam.sort = this.list.pagination.sort
|
||||||
commentApi
|
commentApi
|
||||||
.commentTree(this.target, this.id, this.queryParam)
|
.commentTree(this.target, this.id, this.list.queryParam)
|
||||||
.then(response => {
|
.then((response) => {
|
||||||
this.comments = response.data.data.content
|
this.list.data = response.data.data.content
|
||||||
this.pagination.total = response.data.data.total
|
this.list.pagination.total = response.data.data.total
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.loading = false
|
this.list.loading = false
|
||||||
}, 200)
|
}, 200)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
handlePaginationChange(page, pageSize) {
|
handlePaginationChange(page, pageSize) {
|
||||||
this.pagination.page = page
|
this.list.pagination.page = page
|
||||||
this.pagination.size = pageSize
|
this.list.pagination.size = pageSize
|
||||||
this.handleListComments()
|
this.handleListComments()
|
||||||
},
|
},
|
||||||
handleCommentReply(comment) {
|
handleCommentReply(comment) {
|
||||||
this.selectedComment = comment
|
this.list.selected = comment
|
||||||
this.replyCommentVisible = true
|
this.replyModal.visible = true
|
||||||
this.replyComment.parentId = comment.id
|
this.replyModal.model.parentId = comment.id
|
||||||
this.replyComment.postId = this.id
|
this.replyModal.model.postId = this.id
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.contentInput.focus()
|
||||||
|
})
|
||||||
},
|
},
|
||||||
handleComment() {
|
handleReplyClick() {
|
||||||
this.replyComment.postId = this.id
|
const _this = this
|
||||||
this.commentVisible = true
|
_this.$refs.replyCommentForm.validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
_this.replyModal.saving = true
|
||||||
|
commentApi
|
||||||
|
.create(_this.target, _this.replyModal.model)
|
||||||
|
.catch(() => {
|
||||||
|
_this.replyModal.saveErrored = true
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
setTimeout(() => {
|
||||||
|
_this.replyModal.saving = false
|
||||||
|
}, 400)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
handleCreateClick() {
|
handleReplyCallback() {
|
||||||
if (!this.replyComment.content) {
|
if (this.replyModal.saveErrored) {
|
||||||
this.$notification['error']({
|
this.replyModal.saveErrored = false
|
||||||
message: '提示',
|
} else {
|
||||||
description: '评论内容不能为空!'
|
this.replyModal.model = {}
|
||||||
})
|
this.list.selected = {}
|
||||||
return
|
this.replyModal.visible = false
|
||||||
|
this.handleListComments()
|
||||||
}
|
}
|
||||||
commentApi
|
|
||||||
.create(this.target, this.replyComment)
|
|
||||||
.then(response => {
|
|
||||||
this.$message.success('回复成功!')
|
|
||||||
this.replyComment = {}
|
|
||||||
this.selectedComment = {}
|
|
||||||
this.replyCommentVisible = false
|
|
||||||
this.commentVisible = false
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
this.handleListComments()
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
handleEditStatusClick(comment, status) {
|
handleEditStatusClick(comment, status) {
|
||||||
commentApi
|
commentApi
|
||||||
.updateStatus(this.target, comment.id, status)
|
.updateStatus(this.target, comment.id, status)
|
||||||
.then(response => {
|
.then((response) => {
|
||||||
this.$message.success('操作成功!')
|
this.$message.success('操作成功!')
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
|
@ -237,28 +239,24 @@ export default {
|
||||||
handleCommentDelete(comment) {
|
handleCommentDelete(comment) {
|
||||||
commentApi
|
commentApi
|
||||||
.delete(this.target, comment.id)
|
.delete(this.target, comment.id)
|
||||||
.then(response => {
|
.then((response) => {
|
||||||
this.$message.success('删除成功!')
|
this.$message.success('删除成功!')
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
this.handleListComments()
|
this.handleListComments()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
onReplyClose() {
|
onReplyModalClose() {
|
||||||
this.replyComment = {}
|
this.replyModal.model = {}
|
||||||
this.selectedComment = {}
|
this.list.selected = {}
|
||||||
this.replyCommentVisible = false
|
this.replyModal.visible = false
|
||||||
},
|
|
||||||
onCommentClose() {
|
|
||||||
this.replyComment = {}
|
|
||||||
this.commentVisible = false
|
|
||||||
},
|
},
|
||||||
onClose() {
|
onClose() {
|
||||||
this.comments = []
|
this.list.data = []
|
||||||
this.pagination = {
|
this.list.pagination = {
|
||||||
page: 1,
|
page: 1,
|
||||||
size: 10,
|
size: 10,
|
||||||
sort: ''
|
sort: '',
|
||||||
}
|
}
|
||||||
this.$emit('close', false)
|
this.$emit('close', false)
|
||||||
},
|
},
|
||||||
|
@ -266,7 +264,7 @@ export default {
|
||||||
if (visible) {
|
if (visible) {
|
||||||
this.handleListComments()
|
this.handleListComments()
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
>
|
>
|
||||||
<template slot="extra">
|
<template slot="extra">
|
||||||
<a-button
|
<a-button
|
||||||
key="2"
|
|
||||||
icon="reload"
|
icon="reload"
|
||||||
:loading="list.loading"
|
:loading="list.loading"
|
||||||
@click="handleRefreshThemesCache"
|
@click="handleRefreshThemesCache"
|
||||||
|
@ -13,7 +12,6 @@
|
||||||
刷新
|
刷新
|
||||||
</a-button>
|
</a-button>
|
||||||
<a-button
|
<a-button
|
||||||
key="1"
|
|
||||||
type="primary"
|
type="primary"
|
||||||
icon="plus"
|
icon="plus"
|
||||||
@click="installModal.visible = true"
|
@click="installModal.visible = true"
|
||||||
|
|
|
@ -229,6 +229,7 @@
|
||||||
>
|
>
|
||||||
<a-form-model-item prop="sourceContent">
|
<a-form-model-item prop="sourceContent">
|
||||||
<a-input
|
<a-input
|
||||||
|
ref="sourceContentInput"
|
||||||
type="textarea"
|
type="textarea"
|
||||||
:autoSize="{ minRows: 8 }"
|
:autoSize="{ minRows: 8 }"
|
||||||
v-model="form.model.sourceContent"
|
v-model="form.model.sourceContent"
|
||||||
|
@ -357,11 +358,17 @@ export default {
|
||||||
handleOpenPublishModal() {
|
handleOpenPublishModal() {
|
||||||
this.form.visible = true
|
this.form.visible = true
|
||||||
this.form.model = {}
|
this.form.model = {}
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.sourceContentInput.focus()
|
||||||
|
})
|
||||||
},
|
},
|
||||||
handleOpenEditModal(item) {
|
handleOpenEditModal(item) {
|
||||||
this.form.model = item
|
this.form.model = item
|
||||||
this.form.isPublic = item.type !== 'INTIMATE'
|
this.form.isPublic = item.type !== 'INTIMATE'
|
||||||
this.form.visible = true
|
this.form.visible = true
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.sourceContentInput.focus()
|
||||||
|
})
|
||||||
},
|
},
|
||||||
handleDelete(id) {
|
handleDelete(id) {
|
||||||
journalApi.delete(id).finally(() => {
|
journalApi.delete(id).finally(() => {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<page-view>
|
||||||
<a-row>
|
<a-row>
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<a-card
|
<a-card
|
||||||
|
@ -52,19 +52,22 @@
|
||||||
target="_blank"
|
target="_blank"
|
||||||
class="mr-3"
|
class="mr-3"
|
||||||
>开源组织
|
>开源组织
|
||||||
<a-icon type="link" /></a>
|
<a-icon type="link" />
|
||||||
|
</a>
|
||||||
<a
|
<a
|
||||||
href="https://halo.run"
|
href="https://halo.run"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
class="mr-3"
|
class="mr-3"
|
||||||
>用户文档
|
>用户文档
|
||||||
<a-icon type="link" /></a>
|
<a-icon type="link" />
|
||||||
|
</a>
|
||||||
<a
|
<a
|
||||||
href="https://bbs.halo.run"
|
href="https://bbs.halo.run"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
class="mr-3"
|
class="mr-3"
|
||||||
>在线社区
|
>在线社区
|
||||||
<a-icon type="link" /></a>
|
<a-icon type="link" />
|
||||||
|
</a>
|
||||||
</a-card>
|
</a-card>
|
||||||
|
|
||||||
<a-card
|
<a-card
|
||||||
|
@ -108,14 +111,18 @@
|
||||||
>
|
>
|
||||||
<div v-html="versionContent"></div>
|
<div v-html="versionContent"></div>
|
||||||
</a-modal>
|
</a-modal>
|
||||||
</div>
|
</page-view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import adminApi from '@/api/admin'
|
import adminApi from '@/api/admin'
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import marked from 'marked'
|
import marked from 'marked'
|
||||||
|
import { PageView } from '@/layouts'
|
||||||
export default {
|
export default {
|
||||||
|
components: {
|
||||||
|
PageView,
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
environments: {},
|
environments: {},
|
||||||
|
@ -139,14 +146,14 @@ export default {
|
||||||
received_events_url: '',
|
received_events_url: '',
|
||||||
type: '',
|
type: '',
|
||||||
site_admin: false,
|
site_admin: false,
|
||||||
contributions: 0
|
contributions: 0,
|
||||||
}
|
},
|
||||||
],
|
],
|
||||||
contributorsLoading: true,
|
contributorsLoading: true,
|
||||||
checking: false,
|
checking: false,
|
||||||
isLatest: false,
|
isLatest: false,
|
||||||
latestData: {},
|
latestData: {},
|
||||||
versionContentVisible: false
|
versionContentVisible: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
@ -164,7 +171,7 @@ export default {
|
||||||
},
|
},
|
||||||
versionContentModalTitle() {
|
versionContentModalTitle() {
|
||||||
return `${this.latestData.name} 更新内容`
|
return `${this.latestData.name} 更新内容`
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getEnvironments()
|
this.getEnvironments()
|
||||||
|
@ -172,7 +179,7 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async getEnvironments() {
|
async getEnvironments() {
|
||||||
await adminApi.environments().then(response => {
|
await adminApi.environments().then((response) => {
|
||||||
this.environments = response.data.data
|
this.environments = response.data.data
|
||||||
})
|
})
|
||||||
this.checkServerUpdate()
|
this.checkServerUpdate()
|
||||||
|
@ -183,11 +190,11 @@ export default {
|
||||||
运行模式:${this.environments.mode}
|
运行模式:${this.environments.mode}
|
||||||
User Agent:${navigator.userAgent}`
|
User Agent:${navigator.userAgent}`
|
||||||
this.$copyText(text)
|
this.$copyText(text)
|
||||||
.then(message => {
|
.then((message) => {
|
||||||
this.$log.debug('copy', message)
|
this.$log.debug('copy', message)
|
||||||
this.$message.success('复制成功!')
|
this.$message.success('复制成功!')
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch((err) => {
|
||||||
this.$log.debug('copy.err', err)
|
this.$log.debug('copy.err', err)
|
||||||
this.$message.error('复制失败!')
|
this.$message.error('复制失败!')
|
||||||
})
|
})
|
||||||
|
@ -197,7 +204,7 @@ User Agent:${navigator.userAgent}`
|
||||||
_this.contributorsLoading = true
|
_this.contributorsLoading = true
|
||||||
axios
|
axios
|
||||||
.get('https://api.github.com/repos/halo-dev/halo/contributors')
|
.get('https://api.github.com/repos/halo-dev/halo/contributors')
|
||||||
.then(response => {
|
.then((response) => {
|
||||||
_this.contributors = response.data
|
_this.contributors = response.data
|
||||||
})
|
})
|
||||||
.catch(function(error) {
|
.catch(function(error) {
|
||||||
|
@ -214,7 +221,7 @@ User Agent:${navigator.userAgent}`
|
||||||
_this.checking = true
|
_this.checking = true
|
||||||
axios
|
axios
|
||||||
.get('https://api.github.com/repos/halo-dev/halo/releases/latest')
|
.get('https://api.github.com/repos/halo-dev/halo/releases/latest')
|
||||||
.then(response => {
|
.then((response) => {
|
||||||
const data = response.data
|
const data = response.data
|
||||||
_this.latestData = data
|
_this.latestData = data
|
||||||
if (data.draft || data.prerelease) {
|
if (data.draft || data.prerelease) {
|
||||||
|
@ -232,21 +239,21 @@ User Agent:${navigator.userAgent}`
|
||||||
message: title,
|
message: title,
|
||||||
description: content,
|
description: content,
|
||||||
icon: <a-icon type="smile" style="color: #108ee9" />,
|
icon: <a-icon type="smile" style="color: #108ee9" />,
|
||||||
btn: h => {
|
btn: (h) => {
|
||||||
return h(
|
return h(
|
||||||
'a-button',
|
'a-button',
|
||||||
{
|
{
|
||||||
props: {
|
props: {
|
||||||
type: 'primary',
|
type: 'primary',
|
||||||
size: 'small'
|
size: 'small',
|
||||||
},
|
},
|
||||||
on: {
|
on: {
|
||||||
click: () => this.handleShowVersionContent()
|
click: () => this.handleShowVersionContent(),
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
'去看看'
|
'去看看'
|
||||||
)
|
)
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
.catch(function(error) {
|
.catch(function(error) {
|
||||||
|
@ -277,7 +284,7 @@ User Agent:${navigator.userAgent}`
|
||||||
return -1
|
return -1
|
||||||
}
|
}
|
||||||
return major * 1000000 + minor * 1000 + micro
|
return major * 1000000 + minor * 1000 + micro
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -1,5 +1,13 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<page-view :title="advancedOptions?'高级选项':'基础选项'">
|
||||||
|
<template slot="extra">
|
||||||
|
<a-button
|
||||||
|
type="link"
|
||||||
|
@click="advancedOptions = !advancedOptions"
|
||||||
|
>
|
||||||
|
切换到{{ advancedOptions?'基础选项':'高级选项' }}
|
||||||
|
</a-button>
|
||||||
|
</template>
|
||||||
<a-row>
|
<a-row>
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<div class="card-container">
|
<div class="card-container">
|
||||||
|
@ -149,24 +157,10 @@
|
||||||
</div>
|
</div>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
|
</page-view>
|
||||||
<div style="position: fixed;bottom: 30px;right: 30px;">
|
|
||||||
<a-tooltip placement="top">
|
|
||||||
<template slot="title">
|
|
||||||
<span>{{ advancedOptions?'基础选项':'高级选项' }}</span>
|
|
||||||
</template>
|
|
||||||
<a-button
|
|
||||||
type="primary"
|
|
||||||
shape="circle"
|
|
||||||
:icon="`${advancedOptions?'setting':'thunderbolt'}`"
|
|
||||||
size="large"
|
|
||||||
@click="advancedOptions = !advancedOptions"
|
|
||||||
></a-button>
|
|
||||||
</a-tooltip>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
import { PageView } from '@/layouts'
|
||||||
import GeneralTab from './optiontabs/GeneralTab'
|
import GeneralTab from './optiontabs/GeneralTab'
|
||||||
import SeoTab from './optiontabs/SeoTab'
|
import SeoTab from './optiontabs/SeoTab'
|
||||||
import PostTab from './optiontabs/PostTab'
|
import PostTab from './optiontabs/PostTab'
|
||||||
|
@ -182,6 +176,7 @@ import optionApi from '@/api/option'
|
||||||
import { mapActions } from 'vuex'
|
import { mapActions } from 'vuex'
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
|
PageView,
|
||||||
GeneralTab,
|
GeneralTab,
|
||||||
SeoTab,
|
SeoTab,
|
||||||
PostTab,
|
PostTab,
|
||||||
|
@ -191,14 +186,14 @@ export default {
|
||||||
OtherTab,
|
OtherTab,
|
||||||
PermalinkTab,
|
PermalinkTab,
|
||||||
ApiTab,
|
ApiTab,
|
||||||
AdvancedOtherTab
|
AdvancedOtherTab,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
options: {},
|
options: {},
|
||||||
advancedOptions: false,
|
advancedOptions: false,
|
||||||
saving: false,
|
saving: false,
|
||||||
errored: false
|
errored: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
@ -207,7 +202,7 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
...mapActions(['refreshUserCache', 'refreshOptionsCache']),
|
...mapActions(['refreshUserCache', 'refreshOptionsCache']),
|
||||||
hanldeListOptions() {
|
hanldeListOptions() {
|
||||||
optionApi.listAll().then(response => {
|
optionApi.listAll().then((response) => {
|
||||||
this.options = response.data.data
|
this.options = response.data.data
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
@ -229,7 +224,7 @@ export default {
|
||||||
this.refreshOptionsCache()
|
this.refreshOptionsCache()
|
||||||
this.refreshUserCache()
|
this.refreshUserCache()
|
||||||
})
|
})
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -1,32 +1,31 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<page-view>
|
||||||
<div class="card-content">
|
<a-row :gutter="12">
|
||||||
<a-row :gutter="12">
|
<a-col
|
||||||
<a-col
|
v-if="options.developer_mode"
|
||||||
v-if="options.developer_mode"
|
:xl="6"
|
||||||
:xl="6"
|
:lg="6"
|
||||||
:lg="6"
|
:md="12"
|
||||||
:md="12"
|
:sm="24"
|
||||||
:sm="24"
|
:xs="24"
|
||||||
:xs="24"
|
class="pb-3"
|
||||||
class="pb-3"
|
>
|
||||||
|
<a-card
|
||||||
|
:bordered="false"
|
||||||
|
:bodyStyle="{ padding: '16px' }"
|
||||||
>
|
>
|
||||||
<a-card
|
<div slot="title">
|
||||||
:bordered="false"
|
<a-icon type="experiment" /> 开发者选项
|
||||||
:bodyStyle="{ padding: '16px' }"
|
</div>
|
||||||
>
|
<p style="min-height: 50px;">点击进入开发者选项页面</p>
|
||||||
<div slot="title">
|
<a-button
|
||||||
<a-icon type="experiment" /> 开发者选项
|
type="primary"
|
||||||
</div>
|
class="float-right"
|
||||||
<p style="min-height: 50px;">点击进入开发者选项页面</p>
|
@click="handleToDeveloperOptions()"
|
||||||
<a-button
|
>进入</a-button>
|
||||||
type="primary"
|
</a-card>
|
||||||
class="float-right"
|
</a-col>
|
||||||
@click="handleToDeveloperOptions()"
|
<!-- <a-col
|
||||||
>进入</a-button>
|
|
||||||
</a-card>
|
|
||||||
</a-col>
|
|
||||||
<!-- <a-col
|
|
||||||
:xl="6"
|
:xl="6"
|
||||||
:lg="6"
|
:lg="6"
|
||||||
:md="12"
|
:md="12"
|
||||||
|
@ -49,107 +48,107 @@
|
||||||
>管理</a-button>
|
>管理</a-button>
|
||||||
</a-card>
|
</a-card>
|
||||||
</a-col> -->
|
</a-col> -->
|
||||||
<a-col
|
<a-col
|
||||||
:xl="6"
|
:xl="6"
|
||||||
:lg="6"
|
:lg="6"
|
||||||
:md="12"
|
:md="12"
|
||||||
:sm="24"
|
:sm="24"
|
||||||
:xs="24"
|
:xs="24"
|
||||||
class="mb-3"
|
class="mb-3"
|
||||||
>
|
|
||||||
<a-card
|
|
||||||
:bordered="false"
|
|
||||||
:bodyStyle="{ padding: '16px' }"
|
|
||||||
>
|
|
||||||
<div slot="title">
|
|
||||||
<a-icon type="hdd" /> 博客备份
|
|
||||||
</div>
|
|
||||||
<p style="min-height: 50px;">支持备份全站数据和数据导出,支持下载到本地</p>
|
|
||||||
|
|
||||||
<a-dropdown class="float-right">
|
|
||||||
<a-menu slot="overlay">
|
|
||||||
<a-menu-item
|
|
||||||
key="1"
|
|
||||||
@click="backupWorkDirDrawerVisible = true"
|
|
||||||
>
|
|
||||||
整站备份
|
|
||||||
</a-menu-item>
|
|
||||||
<a-menu-item
|
|
||||||
key="2"
|
|
||||||
@click="exportDataDrawerVisible = true"
|
|
||||||
>
|
|
||||||
数据导出
|
|
||||||
</a-menu-item>
|
|
||||||
</a-menu>
|
|
||||||
<a-button class="ml-2"> 备份
|
|
||||||
<a-icon type="down" />
|
|
||||||
</a-button>
|
|
||||||
</a-dropdown>
|
|
||||||
</a-card>
|
|
||||||
</a-col>
|
|
||||||
<a-col
|
|
||||||
:xl="6"
|
|
||||||
:lg="6"
|
|
||||||
:md="12"
|
|
||||||
:sm="24"
|
|
||||||
:xs="24"
|
|
||||||
class="pb-3"
|
|
||||||
>
|
|
||||||
<a-card
|
|
||||||
:bordered="false"
|
|
||||||
:bodyStyle="{ padding: '16px' }"
|
|
||||||
>
|
|
||||||
<div slot="title">
|
|
||||||
<a-icon type="file-markdown" /> Markdown 文章导入
|
|
||||||
</div>
|
|
||||||
<p style="min-height: 50px;">支持 Hexo/Jekyll 文章导入并解析元数据</p>
|
|
||||||
<a-button
|
|
||||||
type="primary"
|
|
||||||
class="float-right"
|
|
||||||
@click="markdownUpload = true"
|
|
||||||
>导入</a-button>
|
|
||||||
</a-card>
|
|
||||||
</a-col>
|
|
||||||
</a-row>
|
|
||||||
<a-modal
|
|
||||||
title="Markdown 文章导入"
|
|
||||||
v-model="markdownUpload"
|
|
||||||
:footer="null"
|
|
||||||
destroyOnClose
|
|
||||||
:afterClose="onUploadClose"
|
|
||||||
>
|
>
|
||||||
<FilePondUpload
|
<a-card
|
||||||
ref="upload"
|
:bordered="false"
|
||||||
name="file"
|
:bodyStyle="{ padding: '16px' }"
|
||||||
accept="text/markdown"
|
>
|
||||||
label="拖拽或点击选择 Markdown 文件到此处"
|
<div slot="title">
|
||||||
:uploadHandler="uploadHandler"
|
<a-icon type="hdd" /> 博客备份
|
||||||
></FilePondUpload>
|
</div>
|
||||||
</a-modal>
|
<p style="min-height: 50px;">支持备份全站数据和数据导出,支持下载到本地</p>
|
||||||
<BackupWorkDirDrawer v-model="backupWorkDirDrawerVisible"></BackupWorkDirDrawer>
|
|
||||||
<ExportDataDrawer v-model="exportDataDrawerVisible"></ExportDataDrawer>
|
<a-dropdown class="float-right">
|
||||||
</div>
|
<a-menu slot="overlay">
|
||||||
</div>
|
<a-menu-item
|
||||||
|
key="1"
|
||||||
|
@click="backupWorkDirDrawerVisible = true"
|
||||||
|
>
|
||||||
|
整站备份
|
||||||
|
</a-menu-item>
|
||||||
|
<a-menu-item
|
||||||
|
key="2"
|
||||||
|
@click="exportDataDrawerVisible = true"
|
||||||
|
>
|
||||||
|
数据导出
|
||||||
|
</a-menu-item>
|
||||||
|
</a-menu>
|
||||||
|
<a-button class="ml-2"> 备份
|
||||||
|
<a-icon type="down" />
|
||||||
|
</a-button>
|
||||||
|
</a-dropdown>
|
||||||
|
</a-card>
|
||||||
|
</a-col>
|
||||||
|
<a-col
|
||||||
|
:xl="6"
|
||||||
|
:lg="6"
|
||||||
|
:md="12"
|
||||||
|
:sm="24"
|
||||||
|
:xs="24"
|
||||||
|
class="pb-3"
|
||||||
|
>
|
||||||
|
<a-card
|
||||||
|
:bordered="false"
|
||||||
|
:bodyStyle="{ padding: '16px' }"
|
||||||
|
>
|
||||||
|
<div slot="title">
|
||||||
|
<a-icon type="file-markdown" /> Markdown 文章导入
|
||||||
|
</div>
|
||||||
|
<p style="min-height: 50px;">支持 Hexo/Jekyll 文章导入并解析元数据</p>
|
||||||
|
<a-button
|
||||||
|
type="primary"
|
||||||
|
class="float-right"
|
||||||
|
@click="markdownUpload = true"
|
||||||
|
>导入</a-button>
|
||||||
|
</a-card>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
<a-modal
|
||||||
|
title="Markdown 文章导入"
|
||||||
|
v-model="markdownUpload"
|
||||||
|
:footer="null"
|
||||||
|
destroyOnClose
|
||||||
|
:afterClose="onUploadClose"
|
||||||
|
>
|
||||||
|
<FilePondUpload
|
||||||
|
ref="upload"
|
||||||
|
name="file"
|
||||||
|
accept="text/markdown"
|
||||||
|
label="拖拽或点击选择 Markdown 文件到此处"
|
||||||
|
:uploadHandler="uploadHandler"
|
||||||
|
></FilePondUpload>
|
||||||
|
</a-modal>
|
||||||
|
<BackupWorkDirDrawer v-model="backupWorkDirDrawerVisible"></BackupWorkDirDrawer>
|
||||||
|
<ExportDataDrawer v-model="exportDataDrawerVisible"></ExportDataDrawer>
|
||||||
|
</page-view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { mapGetters } from 'vuex'
|
import { mapGetters } from 'vuex'
|
||||||
import backupApi from '@/api/backup'
|
import backupApi from '@/api/backup'
|
||||||
|
import { PageView } from '@/layouts'
|
||||||
import BackupWorkDirDrawer from './components/BackupWorkDirDrawer'
|
import BackupWorkDirDrawer from './components/BackupWorkDirDrawer'
|
||||||
import ExportDataDrawer from './components/ExportDataDrawer'
|
import ExportDataDrawer from './components/ExportDataDrawer'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: { BackupWorkDirDrawer, ExportDataDrawer },
|
components: { PageView, BackupWorkDirDrawer, ExportDataDrawer },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
backupWorkDirDrawerVisible: false,
|
backupWorkDirDrawerVisible: false,
|
||||||
exportDataDrawerVisible: false,
|
exportDataDrawerVisible: false,
|
||||||
markdownUpload: false,
|
markdownUpload: false,
|
||||||
uploadHandler: backupApi.importMarkdown
|
uploadHandler: backupApi.importMarkdown,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters(['options'])
|
...mapGetters(['options']),
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleChange(info) {
|
handleChange(info) {
|
||||||
|
@ -171,7 +170,7 @@ export default {
|
||||||
// },
|
// },
|
||||||
onUploadClose() {
|
onUploadClose() {
|
||||||
this.$refs.upload.handleClearFileList()
|
this.$refs.upload.handleClearFileList()
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<page-view>
|
||||||
<a-row>
|
<a-row>
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<div
|
<div
|
||||||
|
@ -48,10 +48,11 @@
|
||||||
/>
|
/>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
</div>
|
</page-view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { mapGetters } from 'vuex'
|
import { mapGetters } from 'vuex'
|
||||||
|
import { PageView } from '@/layouts'
|
||||||
import Environment from './tabs/Environment'
|
import Environment from './tabs/Environment'
|
||||||
import RuntimeLogs from './tabs/RuntimeLogs'
|
import RuntimeLogs from './tabs/RuntimeLogs'
|
||||||
import SettingsForm from './tabs/SettingsForm'
|
import SettingsForm from './tabs/SettingsForm'
|
||||||
|
@ -59,14 +60,15 @@ import OptionsList from './tabs/OptionsList'
|
||||||
import StaticStorage from './tabs/StaticStorage'
|
import StaticStorage from './tabs/StaticStorage'
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
|
PageView,
|
||||||
Environment,
|
Environment,
|
||||||
RuntimeLogs,
|
RuntimeLogs,
|
||||||
SettingsForm,
|
SettingsForm,
|
||||||
OptionsList,
|
OptionsList,
|
||||||
StaticStorage
|
StaticStorage,
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters(['options'])
|
...mapGetters(['options']),
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -59,7 +59,7 @@
|
||||||
<a-button
|
<a-button
|
||||||
type="primary"
|
type="primary"
|
||||||
icon="plus"
|
icon="plus"
|
||||||
@click="form.visible=true"
|
@click="handleOpenFormModal"
|
||||||
>新增</a-button>
|
>新增</a-button>
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-4">
|
<div class="mt-4">
|
||||||
|
@ -105,7 +105,7 @@
|
||||||
>
|
>
|
||||||
<a
|
<a
|
||||||
href="javascript:void(0);"
|
href="javascript:void(0);"
|
||||||
@click="handleEditOption(record)"
|
@click="handleOpenEditFormModal(record)"
|
||||||
>编辑</a>
|
>编辑</a>
|
||||||
<a-divider type="vertical" />
|
<a-divider type="vertical" />
|
||||||
<a-popconfirm
|
<a-popconfirm
|
||||||
|
@ -165,7 +165,10 @@
|
||||||
prop="key"
|
prop="key"
|
||||||
label="Key:"
|
label="Key:"
|
||||||
>
|
>
|
||||||
<a-input v-model="form.model.key" />
|
<a-input
|
||||||
|
ref="keyInput"
|
||||||
|
v-model="form.model.key"
|
||||||
|
/>
|
||||||
</a-form-model-item>
|
</a-form-model-item>
|
||||||
<a-form-model-item
|
<a-form-model-item
|
||||||
prop="value"
|
prop="value"
|
||||||
|
@ -303,9 +306,18 @@ export default {
|
||||||
this.refreshOptionsCache()
|
this.refreshOptionsCache()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleEditOption(option) {
|
handleOpenFormModal() {
|
||||||
|
this.form.visible = true
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.keyInput.focus()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleOpenEditFormModal(option) {
|
||||||
this.form.model = option
|
this.form.model = option
|
||||||
this.form.visible = true
|
this.form.visible = true
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.keyInput.focus()
|
||||||
|
})
|
||||||
},
|
},
|
||||||
handlePaginationChange(page, pageSize) {
|
handlePaginationChange(page, pageSize) {
|
||||||
this.$log.debug(`Current: ${page}, PageSize: ${pageSize}`)
|
this.$log.debug(`Current: ${page}, PageSize: ${pageSize}`)
|
||||||
|
|
Loading…
Reference in New Issue