diff --git a/src/api/theme.js b/src/api/theme.js
index e6a10e029..aad62d1fd 100644
--- a/src/api/theme.js
+++ b/src/api/theme.js
@@ -39,6 +39,14 @@ themeApi.getActivatedTheme = () => {
})
}
+themeApi.update = themeId => {
+ return service({
+ url: `${baseUrl}/${themeId}`,
+ timeout: 60000,
+ method: 'put'
+ })
+}
+
themeApi.delete = key => {
return service({
url: `${baseUrl}/${key}`,
diff --git a/src/views/interface/ThemeList.vue b/src/views/interface/ThemeList.vue
index 93e22444d..20618d6cf 100644
--- a/src/views/interface/ThemeList.vue
+++ b/src/views/interface/ThemeList.vue
@@ -35,23 +35,23 @@
已启用
+ /> 已启用
- 更多
+ 更多
- 删除
+ 删除
- 删除
+ 删除
+
+
+ 更新
+
+
@@ -259,8 +269,34 @@
+
+
+
+
+
+ 下载
+
+
+
+
+ 远程地址即主题仓库地址,如:https://github.com/halo-dev/halo-theme-quick-starter。
+ 更多主题请访问:https://halo.run/theme
+
+
+
+
支持单个或批量上传,仅支持 ZIP 格式的文件
-
-
-
-
-
-
- 确定
-
-
-
@@ -316,6 +336,7 @@ export default {
themeLoading: false,
optionLoading: true,
uploadVisible: false,
+ fetchButtonLoading: false,
wrapperCol: {
xl: { span: 12 },
lg: { span: 12 },
@@ -382,6 +403,12 @@ export default {
this.loadThemes()
})
},
+ handleUpdateTheme(themeId) {
+ themeApi.update(themeId).then(response => {
+ this.$message.success('更新成功!')
+ this.loadThemes()
+ })
+ },
handleDeleteTheme(key) {
themeApi.delete(key).then(response => {
this.$message.success('删除成功!')
@@ -421,9 +448,11 @@ export default {
this.activeTheme(theme.id)
},
handleFetching() {
+ this.fetchButtonLoading = true
themeApi.fetching(this.fetchingUrl).then(response => {
- this.$message.success('上传成功')
+ this.$message.success('拉取成功')
this.uploadVisible = false
+ this.fetchButtonLoading = false
this.loadThemes()
})
},