From 035aeda7b42cd79a41471b4940fd40d4c394a7e3 Mon Sep 17 00:00:00 2001
From: ruibaby
Date: Thu, 26 Dec 2019 00:12:57 +0800
Subject: [PATCH 01/21] feat: add static pages manage in tool list.
---
src/views/system/ToolList.vue | 28 +++++++++++++++++++++++++---
1 file changed, 25 insertions(+), 3 deletions(-)
diff --git a/src/views/system/ToolList.vue b/src/views/system/ToolList.vue
index 8d3e22a2..96c6c35d 100644
--- a/src/views/system/ToolList.vue
+++ b/src/views/system/ToolList.vue
@@ -18,7 +18,7 @@
-
点击进入开发者选项页面
+ 点击进入开发者选项页面
进入
+
+
+
+ 生成静态页面并部署到 Github Pages 之类的托管平台
+ 管理
+
+
博客备份
- 支持备份全站数据
+ 备份全站数据,支持下载到本地
Markdown 文章导入
- 支持 Hexo/Jekyll 文章导入并解析元数据
+ 支持 Hexo/Jekyll 文章导入并解析元数据
Date: Thu, 26 Dec 2019 00:26:02 +0800
Subject: [PATCH 02/21] feat: add static pages manage in tool list.
---
babel.config.js | 2 +-
src/config/router.config.js | 7 ++++
src/views/system/ToolList.vue | 4 +++
.../system/staticpages/StaticPagesManage.vue | 32 +++++++++++++++++++
4 files changed, 44 insertions(+), 1 deletion(-)
create mode 100644 src/views/system/staticpages/StaticPagesManage.vue
diff --git a/babel.config.js b/babel.config.js
index d8e93c42..a35822f3 100644
--- a/babel.config.js
+++ b/babel.config.js
@@ -16,4 +16,4 @@ module.exports = {
]
],
plugins
-}
\ No newline at end of file
+}
diff --git a/src/config/router.config.js b/src/config/router.config.js
index 2c32156c..c4fed704 100644
--- a/src/config/router.config.js
+++ b/src/config/router.config.js
@@ -185,6 +185,13 @@ export const asyncRouterMap = [
component: () => import('@/views/system/ToolList'),
meta: { title: '小工具', hiddenHeaderContent: false }
},
+ {
+ path: '/system/tools/staticpages',
+ name: 'StaticPagesManage',
+ hidden: true,
+ component: () => import('@/views/system/staticpages/StaticPagesManage'),
+ meta: { title: '静态部署', hiddenHeaderContent: false }
+ },
{
path: '/system/about',
name: 'About',
diff --git a/src/views/system/ToolList.vue b/src/views/system/ToolList.vue
index 96c6c35d..669284a3 100644
--- a/src/views/system/ToolList.vue
+++ b/src/views/system/ToolList.vue
@@ -45,6 +45,7 @@
管理
@@ -150,6 +151,9 @@ export default {
handleToDeveloperOptions() {
this.$router.push({ name: 'DeveloperOptions' })
},
+ handleToStaticPagesManage() {
+ this.$router.push({ name: 'StaticPagesManage' })
+ },
onUploadClose() {
this.$refs.upload.handleClearFileList()
}
diff --git a/src/views/system/staticpages/StaticPagesManage.vue b/src/views/system/staticpages/StaticPagesManage.vue
new file mode 100644
index 00000000..939c7408
--- /dev/null
+++ b/src/views/system/staticpages/StaticPagesManage.vue
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+
+ 文件列表
+
+
+
+
+ 部署平台
+
+
+
+
+ 配置
+
+
+
+
+
+
+
+
+
From 7a0334a4693093229168212859a0e640b2fcffe9 Mon Sep 17 00:00:00 2001
From: ruibaby
Date: Thu, 26 Dec 2019 14:19:36 +0800
Subject: [PATCH 03/21] feat: add static pages manage in tool list.
---
src/api/staticPage.js | 39 +++++++
.../system/developer/tabs/SettingsForm.vue | 13 ++-
.../system/staticpages/StaticPagesManage.vue | 13 ++-
.../staticpages/tabs/DeploySettingsForm.vue | 100 +++++++++++++++++
.../system/staticpages/tabs/SettingsForm.vue | 10 ++
.../staticpages/tabs/StaticPagesList.vue | 105 ++++++++++++++++++
6 files changed, 277 insertions(+), 3 deletions(-)
create mode 100644 src/api/staticPage.js
create mode 100644 src/views/system/staticpages/tabs/DeploySettingsForm.vue
create mode 100644 src/views/system/staticpages/tabs/SettingsForm.vue
create mode 100644 src/views/system/staticpages/tabs/StaticPagesList.vue
diff --git a/src/api/staticPage.js b/src/api/staticPage.js
new file mode 100644
index 00000000..10f5150f
--- /dev/null
+++ b/src/api/staticPage.js
@@ -0,0 +1,39 @@
+import service from '@/utils/service'
+
+const baseUrl = '/api/admin/static_page'
+
+const staticPageApi = {}
+
+staticPageApi.list = () => {
+ return service({
+ url: baseUrl,
+ method: 'get'
+ })
+}
+
+staticPageApi.generate = () => {
+ return service({
+ url: `${baseUrl}/generate`,
+ method: 'get'
+ })
+}
+
+staticPageApi.deploy = () => {
+ return service({
+ url: `${baseUrl}/deploy`,
+ method: 'get'
+ })
+}
+
+staticPageApi.deployType = {
+ GIT: {
+ type: 'GIT',
+ text: 'Git'
+ },
+ NETLIFY: {
+ type: 'NETLIFY',
+ text: 'Netlify'
+ }
+}
+
+export default staticPageApi
diff --git a/src/views/system/developer/tabs/SettingsForm.vue b/src/views/system/developer/tabs/SettingsForm.vue
index 646e26d0..f1fe7b86 100644
--- a/src/views/system/developer/tabs/SettingsForm.vue
+++ b/src/views/system/developer/tabs/SettingsForm.vue
@@ -1,5 +1,8 @@
-
+
@@ -18,7 +21,13 @@ export default {
name: 'SettingsForm',
data() {
return {
- options: []
+ options: [],
+ wrapperCol: {
+ xl: { span: 8 },
+ lg: { span: 8 },
+ sm: { span: 12 },
+ xs: { span: 24 }
+ }
}
},
created() {
diff --git a/src/views/system/staticpages/StaticPagesManage.vue b/src/views/system/staticpages/StaticPagesManage.vue
index 939c7408..b273740b 100644
--- a/src/views/system/staticpages/StaticPagesManage.vue
+++ b/src/views/system/staticpages/StaticPagesManage.vue
@@ -8,16 +8,19 @@
文件列表
+
部署平台
+
配置
+
@@ -26,7 +29,15 @@
diff --git a/src/views/system/staticpages/tabs/DeploySettingsForm.vue b/src/views/system/staticpages/tabs/DeploySettingsForm.vue
new file mode 100644
index 00000000..c9a1a4fb
--- /dev/null
+++ b/src/views/system/staticpages/tabs/DeploySettingsForm.vue
@@ -0,0 +1,100 @@
+
+
+
+
+ {{ deployType[item].text }}
+
+
+
+
+
+ 保存
+
+
+
+
diff --git a/src/views/system/staticpages/tabs/SettingsForm.vue b/src/views/system/staticpages/tabs/SettingsForm.vue
new file mode 100644
index 00000000..2202e09b
--- /dev/null
+++ b/src/views/system/staticpages/tabs/SettingsForm.vue
@@ -0,0 +1,10 @@
+
+
+ SettingsForm
+
+
+
diff --git a/src/views/system/staticpages/tabs/StaticPagesList.vue b/src/views/system/staticpages/tabs/StaticPagesList.vue
new file mode 100644
index 00000000..9b77cdf3
--- /dev/null
+++ b/src/views/system/staticpages/tabs/StaticPagesList.vue
@@ -0,0 +1,105 @@
+
+
+
+
+
+
+
+
+ {{ name }}
+
+
+
+
+
+
+
+
From 4b47e2519ab758977b9c05547ef29011ccdc0c47 Mon Sep 17 00:00:00 2001
From: ruibaby
Date: Thu, 26 Dec 2019 20:17:29 +0800
Subject: [PATCH 04/21] fix: table row key error.
---
src/views/system/developer/tabs/StaticStorage.vue | 2 +-
src/views/system/staticpages/tabs/StaticPagesList.vue | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/views/system/developer/tabs/StaticStorage.vue b/src/views/system/developer/tabs/StaticStorage.vue
index 767dbd08..fadfbfac 100644
--- a/src/views/system/developer/tabs/StaticStorage.vue
+++ b/src/views/system/developer/tabs/StaticStorage.vue
@@ -27,7 +27,7 @@
Date: Thu, 26 Dec 2019 20:38:50 +0800
Subject: [PATCH 05/21] refactor: static pages generate and deploy method.
---
.../staticpages/tabs/StaticPagesList.vue | 28 ++++++++++++-------
1 file changed, 18 insertions(+), 10 deletions(-)
diff --git a/src/views/system/staticpages/tabs/StaticPagesList.vue b/src/views/system/staticpages/tabs/StaticPagesList.vue
index 826e323f..56fc626e 100644
--- a/src/views/system/staticpages/tabs/StaticPagesList.vue
+++ b/src/views/system/staticpages/tabs/StaticPagesList.vue
@@ -85,20 +85,28 @@ export default {
handleGenerate() {
this.loading = true
const hide = this.$message.loading('生成中...', 0)
- staticPageApi.generate().then(response => {
- hide()
- this.$message.success('生成成功!')
- this.loadStaticPageList()
- })
+ staticPageApi
+ .generate()
+ .then(response => {
+ this.$message.success('生成成功!')
+ })
+ .finally(response => {
+ this.loadStaticPageList()
+ hide()
+ })
},
handleDeploy() {
this.deployLoading = true
const hide = this.$message.loading('部署中...', 0)
- staticPageApi.deploy().then(response => {
- hide()
- this.deployLoading = false
- this.$message.success('部署成功!')
- })
+ staticPageApi
+ .deploy()
+ .then(response => {
+ this.$message.success('部署成功!')
+ })
+ .finally(response => {
+ this.deployLoading = false
+ hide()
+ })
}
}
}
From 12970716c00b68f80defa0dbd67dec0775055e83 Mon Sep 17 00:00:00 2001
From: ruibaby
Date: Mon, 6 Jan 2020 20:32:33 +0800
Subject: [PATCH 06/21] style: replace console.log() to this.$log.
---
src/components/Menu/menu.render.js | 2 +-
src/components/Upload/FilePondUpload.vue | 2 +-
src/utils/permissions.js | 4 ++--
.../attachment/components/AttachmentDetailDrawer.vue | 8 ++++----
src/views/system/About.vue | 4 ++--
src/views/system/Installation.vue | 4 ++--
src/views/system/ToolList.vue | 2 +-
7 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/src/components/Menu/menu.render.js b/src/components/Menu/menu.render.js
index fa0733ef..ccf8631c 100644
--- a/src/components/Menu/menu.render.js
+++ b/src/components/Menu/menu.render.js
@@ -79,7 +79,7 @@ export default {
const subItem = [h('span', { slot: 'title' }, [this.renderIcon(h, menu.meta.icon), h('span', [menu.meta.title])])]
const itemArr = []
const pIndex_ = pIndex + '_' + index
- console.log('menu', menu)
+ this.$log.debug('menu', menu)
if (!menu.hideChildrenInMenu) {
menu.children.forEach(function(item, i) {
itemArr.push(this2_.renderItem(h, item, pIndex_, i))
diff --git a/src/components/Upload/FilePondUpload.vue b/src/components/Upload/FilePondUpload.vue
index 8072cae4..8c739ae6 100644
--- a/src/components/Upload/FilePondUpload.vue
+++ b/src/components/Upload/FilePondUpload.vue
@@ -120,7 +120,7 @@ export default {
},
methods: {
handleFilePondInit() {
- console.log('FilePond has initialized')
+ this.$log.debug('FilePond has initialized')
},
handleClearFileList() {
this.$refs.pond.removeFiles()
diff --git a/src/utils/permissions.js b/src/utils/permissions.js
index 642c2348..78a91310 100644
--- a/src/utils/permissions.js
+++ b/src/utils/permissions.js
@@ -2,7 +2,7 @@ export function actionToObject(json) {
try {
return JSON.parse(json)
} catch (e) {
- console.log('err', e.message)
+ this.$log.debug('err', e.message)
}
return []
-}
+}
\ No newline at end of file
diff --git a/src/views/attachment/components/AttachmentDetailDrawer.vue b/src/views/attachment/components/AttachmentDetailDrawer.vue
index 30a6ca18..555ca85e 100644
--- a/src/views/attachment/components/AttachmentDetailDrawer.vue
+++ b/src/views/attachment/components/AttachmentDetailDrawer.vue
@@ -269,11 +269,11 @@ export default {
const text = `${encodeURI(this.attachment.path)}`
this.$copyText(text)
.then(message => {
- console.log('copy', message)
+ this.$log.debug('copy', message)
this.$message.success('复制成功!')
})
.catch(err => {
- console.log('copy.err', err)
+ this.$log.debug('copy.err', err)
this.$message.error('复制失败!')
})
},
@@ -281,11 +281,11 @@ export default {
const text = `})`
this.$copyText(text)
.then(message => {
- console.log('copy', message)
+ this.$log.debug('copy', message)
this.$message.success('复制成功!')
})
.catch(err => {
- console.log('copy.err', err)
+ this.$log.debug('copy.err', err)
this.$message.error('复制失败!')
})
},
diff --git a/src/views/system/About.vue b/src/views/system/About.vue
index fab53f61..e3602e4c 100644
--- a/src/views/system/About.vue
+++ b/src/views/system/About.vue
@@ -249,11 +249,11 @@ Admin 版本:${this.adminVersion}
UA 信息:${navigator.userAgent}`
this.$copyText(text)
.then(message => {
- console.log('copy', message)
+ this.$log.debug('copy', message)
this.$message.success('复制成功!')
})
.catch(err => {
- console.log('copy.err', err)
+ this.$log.debug('copy.err', err)
this.$message.error('复制失败!')
})
},
diff --git a/src/views/system/Installation.vue b/src/views/system/Installation.vue
index 4bc70c2c..019910c2 100644
--- a/src/views/system/Installation.vue
+++ b/src/views/system/Installation.vue
@@ -247,8 +247,8 @@ export default {
handleNextStep(e) {
e.preventDefault()
this.bloggerForm.validateFields((error, values) => {
- console.log('error', error)
- console.log('Received values of form: ', values)
+ this.$log.debug('error', error)
+ this.$log.debug('Received values of form: ', values)
if (error != null) {
} else {
this.stepCurrent++
diff --git a/src/views/system/ToolList.vue b/src/views/system/ToolList.vue
index 8d3e22a2..3911c563 100644
--- a/src/views/system/ToolList.vue
+++ b/src/views/system/ToolList.vue
@@ -117,7 +117,7 @@ export default {
handleChange(info) {
const status = info.file.status
if (status !== 'uploading') {
- console.log(info.file, info.fileList)
+ this.$log.debug(info.file, info.fileList)
}
if (status === 'done') {
this.$message.success(`${info.file.name} 导入成功!`)
From d79368b0e1325e0cc5adb35baa2651d9a3f066be Mon Sep 17 00:00:00 2001
From: ruibaby
Date: Tue, 7 Jan 2020 18:46:36 +0800
Subject: [PATCH 07/21] feat: custom permalink.
---
src/api/post.js | 19 +++++++++++
src/utils/permissions.js | 2 +-
src/views/system/OptionForm.vue | 59 ++++++++++++++++++++++++++++++++-
3 files changed, 78 insertions(+), 2 deletions(-)
diff --git a/src/api/post.js b/src/api/post.js
index 9653e35d..338e6f01 100644
--- a/src/api/post.js
+++ b/src/api/post.js
@@ -124,4 +124,23 @@ postApi.postStatus = {
text: '私密'
}
}
+
+postApi.permalinkType = {
+ DEFAULT: {
+ type: 'DEFAULT',
+ text: '默认'
+ },
+ DATE: {
+ type: 'DATE',
+ text: '年月日型'
+ },
+ DAY: {
+ type: 'DAY',
+ text: '年月型'
+ },
+ ID: {
+ type: 'ID',
+ text: 'ID 型'
+ }
+}
export default postApi
diff --git a/src/utils/permissions.js b/src/utils/permissions.js
index 78a91310..40f99961 100644
--- a/src/utils/permissions.js
+++ b/src/utils/permissions.js
@@ -5,4 +5,4 @@ export function actionToObject(json) {
this.$log.debug('err', e.message)
}
return []
-}
\ No newline at end of file
+}
diff --git a/src/views/system/OptionForm.vue b/src/views/system/OptionForm.vue
index 7825dbd1..e6e18539 100644
--- a/src/views/system/OptionForm.vue
+++ b/src/views/system/OptionForm.vue
@@ -70,7 +70,7 @@
-
+
+
+
+ 固定链接
+
+
+
+
+ {{ options.blog_url }}/archives/${url}
+ {{ options.blog_url }}/1970/01/${url}
+ {{ options.blog_url }}/1970/01/01/${url}
+ {{ options.blog_url }}/?p=${id}
+
+
+ {{ permalinkType[item].text }}
+
+
+
+
+ {{ options.blog_url }}/{{ options.sheet_prefix }}/${url}
+
+
+
+
+
+ {{ options.blog_url }}/{{ options.archives_prefix }}
+
+
+
+
+
+ {{ options.blog_url }}/{{ options.categories_prefix }}/${slugName}
+
+
+
+
+
+ {{ options.blog_url }}/{{ options.tags_prefix }}/${slugName}
+
+
+
+
+ 保存
+
+
+
API 设置
@@ -675,6 +730,7 @@ import { mapActions } from 'vuex'
import optionApi from '@/api/option'
import mailApi from '@/api/mail'
import attachmentApi from '@/api/attachment'
+import postApi from '@/api/post'
export default {
components: {
@@ -683,6 +739,7 @@ export default {
data() {
return {
attachmentType: attachmentApi.type,
+ permalinkType: postApi.permalinkType,
wrapperCol: {
xl: { span: 8 },
lg: { span: 8 },
From 9d4a3cc2fbfd409b1ae55d6d0cd5c2edff2ca14d Mon Sep 17 00:00:00 2001
From: ruibaby
Date: Tue, 7 Jan 2020 20:13:17 +0800
Subject: [PATCH 08/21] feat: support set path suffix.
---
src/views/system/OptionForm.vue | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/src/views/system/OptionForm.vue b/src/views/system/OptionForm.vue
index e6e18539..9f065ac6 100644
--- a/src/views/system/OptionForm.vue
+++ b/src/views/system/OptionForm.vue
@@ -589,9 +589,9 @@
>
- {{ options.blog_url }}/archives/${url}
- {{ options.blog_url }}/1970/01/${url}
- {{ options.blog_url }}/1970/01/01/${url}
+ {{ options.blog_url }}/{{ options.archives_prefix }}/${url}{{ options.path_suffix }}
+ {{ options.blog_url }}/1970/01/${url}{{ options.path_suffix }}
+ {{ options.blog_url }}/1970/01/01/${url}{{ options.path_suffix }}
{{ options.blog_url }}/?p=${id}
@@ -604,28 +604,34 @@
- {{ options.blog_url }}/{{ options.sheet_prefix }}/${url}
+ {{ options.blog_url }}/{{ options.sheet_prefix }}/${url}{{ options.path_suffix }}
- {{ options.blog_url }}/{{ options.archives_prefix }}
+ {{ options.blog_url }}/{{ options.archives_prefix }}{{ options.path_suffix }}
- {{ options.blog_url }}/{{ options.categories_prefix }}/${slugName}
+ {{ options.blog_url }}/{{ options.categories_prefix }}/${slugName}{{ options.path_suffix }}
- {{ options.blog_url }}/{{ options.tags_prefix }}/${slugName}
+ {{ options.blog_url }}/{{ options.tags_prefix }}/${slugName}{{ options.path_suffix }}
+
+
+ 仅对部分路径有效
+
+
+
Date: Sat, 11 Jan 2020 13:06:01 +0800
Subject: [PATCH 09/21] feat: support for configuring static resource paths.
---
.env | 2 ++
.env.development | 2 ++
src/api/post.js | 4 ++--
vue.config.js | 14 +++++++-------
4 files changed, 13 insertions(+), 9 deletions(-)
create mode 100644 .env
create mode 100644 .env.development
diff --git a/.env b/.env
new file mode 100644
index 00000000..612664a4
--- /dev/null
+++ b/.env
@@ -0,0 +1,2 @@
+NODE_ENV=production
+PUBLIC_PATH=https://cdn.jsdelivr.net/npm/halo-admin@1.2.0/dist/
\ No newline at end of file
diff --git a/.env.development b/.env.development
new file mode 100644
index 00000000..6a9d8879
--- /dev/null
+++ b/.env.development
@@ -0,0 +1,2 @@
+NODE_ENV=development
+PUBLIC_PATH=/
\ No newline at end of file
diff --git a/src/api/post.js b/src/api/post.js
index 338e6f01..9e3f02fb 100644
--- a/src/api/post.js
+++ b/src/api/post.js
@@ -132,11 +132,11 @@ postApi.permalinkType = {
},
DATE: {
type: 'DATE',
- text: '年月日型'
+ text: '年月型'
},
DAY: {
type: 'DAY',
- text: '年月型'
+ text: '年月日型'
},
ID: {
type: 'ID',
diff --git a/vue.config.js b/vue.config.js
index e6729142..dd84ae54 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -15,19 +15,19 @@ const assetsCDN = {
axios: 'axios',
marked: 'marked'
},
- css: [
- ],
+ css: [],
js: [
- '//cdn.jsdelivr.net/npm/vue@2.6.11/dist/vue.min.js',
- '//cdn.jsdelivr.net/npm/vue-router@3.1.3/dist/vue-router.min.js',
- '//cdn.jsdelivr.net/npm/vuex@3.1.1/dist/vuex.min.js',
- '//cdn.jsdelivr.net/npm/axios@0.19.0/dist/axios.min.js',
- '//cdn.jsdelivr.net/npm/marked@0.8.0/marked.min.js'
+ 'https://cdn.jsdelivr.net/npm/vue@2.6.11/dist/vue.min.js',
+ 'https://cdn.jsdelivr.net/npm/vue-router@3.1.3/dist/vue-router.min.js',
+ 'https://cdn.jsdelivr.net/npm/vuex@3.1.1/dist/vuex.min.js',
+ 'https://cdn.jsdelivr.net/npm/axios@0.19.0/dist/axios.min.js',
+ 'https://cdn.jsdelivr.net/npm/marked@0.8.0/marked.min.js'
]
}
// vue.config.js
module.exports = {
+ publicPath: process.env.PUBLIC_PATH,
configureWebpack: {
plugins: [
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/)
From 05dc1baa59168a9a7c749bec6bedea1dad898ff1 Mon Sep 17 00:00:00 2001
From: ruibaby
Date: Thu, 16 Jan 2020 19:29:58 +0800
Subject: [PATCH 10/21] fix: prevent browsers from auto-filling some password
input.
---
src/views/system/OptionForm.vue | 52 +++++++++++++++----
.../staticpages/tabs/DeploySettingsForm.vue | 10 +++-
src/views/user/Profile.vue | 15 ++++--
3 files changed, 62 insertions(+), 15 deletions(-)
diff --git a/src/views/system/OptionForm.vue b/src/views/system/OptionForm.vue
index 9f065ac6..8d16781f 100644
--- a/src/views/system/OptionForm.vue
+++ b/src/views/system/OptionForm.vue
@@ -247,6 +247,7 @@
@@ -273,7 +274,10 @@
-
+
@@ -315,10 +319,16 @@
/>
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -652,7 +681,10 @@
-
+
-
+
@@ -49,7 +52,10 @@
-
+
diff --git a/src/views/user/Profile.vue b/src/views/user/Profile.vue
index 33116b8f..3730353b 100644
--- a/src/views/user/Profile.vue
+++ b/src/views/user/Profile.vue
@@ -107,13 +107,22 @@
-
+
-
+
-
+
Date: Thu, 16 Jan 2020 21:12:08 +0800
Subject: [PATCH 11/21] fix: sheet url in mobile device.
---
src/views/sheet/SheetList.vue | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/views/sheet/SheetList.vue b/src/views/sheet/SheetList.vue
index 686375d3..b15d068b 100644
--- a/src/views/sheet/SheetList.vue
+++ b/src/views/sheet/SheetList.vue
@@ -247,7 +247,7 @@
>
From 7564997aba5f1378ab3b37489a18ca7bb60d2574 Mon Sep 17 00:00:00 2001
From: ruibaby
Date: Thu, 30 Jan 2020 12:41:06 +0800
Subject: [PATCH 12/21] feat: add the load animation to the login button.
---
src/views/user/Login.vue | 20 ++++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)
diff --git a/src/views/user/Login.vue b/src/views/user/Login.vue
index 4e1f7d98..1caddda7 100644
--- a/src/views/user/Login.vue
+++ b/src/views/user/Login.vue
@@ -47,6 +47,7 @@
:style="{'animation-delay': '0.3s'}"
>
{
- // Go to dashboard
- this.loginSuccess()
- })
+ this.landing = true
+ this.login({ username: this.username, password: this.password })
+ .then(response => {
+ // Go to dashboard
+ this.loginSuccess()
+ })
+ .finally(() => {
+ setTimeout(() => {
+ this.landing = false
+ }, 500)
+ })
},
loginSuccess() {
// Cache the user info
From a7b60c3c493315282334706bdb1997527c0041dc Mon Sep 17 00:00:00 2001
From: ruibaby
Date: Fri, 31 Jan 2020 16:10:27 +0800
Subject: [PATCH 13/21] feat: fetch github contributors in about page.
---
src/views/system/About.vue | 150 +++++++++++--------------------------
1 file changed, 45 insertions(+), 105 deletions(-)
diff --git a/src/views/system/About.vue b/src/views/system/About.vue
index e3602e4c..1bc16051 100644
--- a/src/views/system/About.vue
+++ b/src/views/system/About.vue
@@ -55,10 +55,10 @@
href="https://github.com/halo-dev"
target="_blank"
style="margin-right: 10px;"
- >开源地址
+ >开源组织
用户文档
@@ -75,39 +75,26 @@
title="开发者"
:bordered="false"
:bodyStyle="{ padding: '16px' }"
+ :loading="contributorsLoading"
>
-
-
-
- ...
- {{ item.date }} {{ item.content }}
-
-
@@ -122,97 +109,36 @@ export default {
return {
adminVersion: this.VERSION,
environments: {},
- developers: [
+ contributors: [
{
- name: 'Ryan Wang',
- avatar: '//cn.gravatar.com/avatar/7cc7f29278071bd4dce995612d428834?s=256&d=mm',
- website: 'https://ryanc.cc',
- github: 'https://github.com/ruibaby'
- },
- {
- name: 'John Niang',
- avatar: '//cn.gravatar.com/avatar/1dcf60ef27363dae539385d5bae9b2bd?s=256&d=mm',
- website: 'https://johnniang.me',
- github: 'https://github.com/johnniang'
- },
- {
- name: 'Aquan',
- avatar: '//cn.gravatar.com/avatar/3958035fa354403fa9ca3fca36b08068?s=256&d=mm',
- website: 'https://blog.eunji.cn',
- github: 'https://github.com/aquanlerou'
- },
- {
- name: 'appdev',
- avatar: '//cn.gravatar.com/avatar/08cf681fb7c6ad1b4fe70a8269c2103c?s=256&d=mm',
- website: 'https://www.apkdv.com',
- github: 'https://github.com/appdev'
- },
- {
- name: 'guqing',
- avatar: '//cn.gravatar.com/avatar/ad062ba572c8b006bfd2cbfc43fdee5e?s=256&d=mm',
- website: 'http://www.guqing.xyz',
- github: 'https://github.com/guqing'
- }
- ],
- steps: [
- {
- date: '2019-09-11',
- content: 'Halo v1.1.0 发布'
- },
- {
- date: '2019-07-09',
- content: 'Halo v1.0.3 发布'
- },
- {
- date: '2019-07-08',
- content: 'Star 数达到 6500'
- },
- {
- date: '2019-06-01',
- content: '1.0 正式版发布'
- },
- {
- date: '2019-05-03',
- content: 'Star 数达到 3300'
- },
- {
- date: '2019-01-30',
- content: 'John Niang 加入开发'
- },
- {
- date: '2018-10-18',
- content: '构建镜像到 Docker hub'
- },
- {
- date: '2018-09-22',
- content: 'Star 数达到 800'
- },
- {
- date: '2018-05-02',
- content: '第一条 Issue'
- },
- {
- date: '2018-05-01',
- content: 'Star 数达到 100'
- },
- {
- date: '2018-04-29',
- content: '第一个 Pull request'
- },
- {
- date: '2018-04-28',
- content: '正式开源'
- },
- {
- date: '2018-03-21',
- content: '确定命名为 Halo,并上传到 Github'
+ login: '',
+ id: 0,
+ node_id: '',
+ avatar_url: '',
+ gravatar_id: '',
+ url: '',
+ html_url: '',
+ followers_url: '',
+ following_url: '',
+ gists_url: '',
+ starred_url: '',
+ subscriptions_url: '',
+ organizations_url: '',
+ repos_url: '',
+ events_url: '',
+ received_events_url: '',
+ type: '',
+ site_admin: false,
+ contributions: 0
}
],
+ contributorsLoading: true,
updating: false
}
},
created() {
this.getEnvironments()
+ this.fetchContributors()
this.checkServerUpdate()
this.checkAdminUpdate()
},
@@ -246,7 +172,7 @@ export default {
Admin 版本:${this.adminVersion}
数据库:${this.environments.database}
运行模式:${this.environments.mode}
-UA 信息:${navigator.userAgent}`
+User Agent:${navigator.userAgent}`
this.$copyText(text)
.then(message => {
this.$log.debug('copy', message)
@@ -257,6 +183,20 @@ UA 信息:${navigator.userAgent}`
this.$message.error('复制失败!')
})
},
+ async fetchContributors() {
+ this.contributorsLoading = true
+ const _this = this
+ axios
+ .get('https://api.github.com/repos/halo-dev/halo/contributors')
+ .then(response => {
+ console.log(response.data)
+ _this.contributors = response.data
+ this.contributorsLoading = false
+ })
+ .catch(function(error) {
+ console.error('Fetch contributors error', error)
+ })
+ },
async checkServerUpdate() {
const _this = this
From 79325ac1826587fe5773a907b133b90764d30360 Mon Sep 17 00:00:00 2001
From: ruibaby
Date: Tue, 11 Feb 2020 12:15:48 +0800
Subject: [PATCH 14/21] feat: change post and sheet access url.
---
src/views/comment/components/CommentDetail.vue | 8 ++------
src/views/comment/components/CommentTab.vue | 11 +++++------
src/views/dashboard/Dashboard.vue | 5 ++---
src/views/dashboard/components/RecentCommentTab.vue | 7 +++----
src/views/post/PostList.vue | 7 +++----
src/views/sheet/SheetList.vue | 4 ++--
6 files changed, 17 insertions(+), 25 deletions(-)
diff --git a/src/views/comment/components/CommentDetail.vue b/src/views/comment/components/CommentDetail.vue
index 6cdb7e25..de586d12 100644
--- a/src/views/comment/components/CommentDetail.vue
+++ b/src/views/comment/components/CommentDetail.vue
@@ -56,13 +56,13 @@
{{ comment.post.title }}
{{ comment.sheet.title }}
《{{ item.post.title }}》
《{{ item.sheet.title }}》
@@ -282,14 +282,14 @@
v-if="type==='posts'"
slot="post"
slot-scope="post"
- :href="options.blog_url+'/archives/'+post.url"
+ :href="post.fullPath"
target="_blank"
>{{ post.title }}
{{ sheet.title }}
{{ item.title }}
{{ item.author }} 发表在 《{{ item.post.title }}{{ item.author }} 发表在 《{{ item.sheet.title }}
@@ -318,7 +318,7 @@
/>
@@ -620,8 +620,7 @@ export default {
post.statusProperty = this.postStatus[post.status]
return post
})
- },
- ...mapGetters(['options'])
+ }
},
created() {
this.loadPosts()
diff --git a/src/views/sheet/SheetList.vue b/src/views/sheet/SheetList.vue
index b15d068b..5b159abf 100644
--- a/src/views/sheet/SheetList.vue
+++ b/src/views/sheet/SheetList.vue
@@ -247,7 +247,7 @@
>
@@ -298,7 +298,7 @@
>
From 64a3b6c40789fbaef7c88cf70b2288d6944e23e6 Mon Sep 17 00:00:00 2001
From: ruibaby
Date: Tue, 11 Feb 2020 14:45:36 +0800
Subject: [PATCH 15/21] feat: support set internal sheet's title.
---
.../comment/components/CommentDetail.vue | 1 -
src/views/comment/components/CommentTab.vue | 1 -
src/views/dashboard/Dashboard.vue | 1 -
.../dashboard/components/RecentCommentTab.vue | 1 -
src/views/post/CategoryList.vue | 2 +-
src/views/post/PostList.vue | 1 -
src/views/sheet/SheetList.vue | 10 +--
src/views/sheet/internal/JournalList.vue | 64 ++++++++++++++++-
src/views/sheet/internal/LinkList.vue | 51 +++++++++++++-
src/views/sheet/internal/PhotoList.vue | 69 +++++++++++++++++--
src/views/system/OptionForm.vue | 18 +++++
11 files changed, 200 insertions(+), 19 deletions(-)
diff --git a/src/views/comment/components/CommentDetail.vue b/src/views/comment/components/CommentDetail.vue
index de586d12..2fc44e3e 100644
--- a/src/views/comment/components/CommentDetail.vue
+++ b/src/views/comment/components/CommentDetail.vue
@@ -125,7 +125,6 @@