diff --git a/src/api/theme.js b/src/api/theme.js
index b9e6b6558..cf3e36c0e 100644
--- a/src/api/theme.js
+++ b/src/api/theme.js
@@ -4,7 +4,7 @@ const baseUrl = '/api/admin/themes'
const themeApi = {}
-themeApi.listAll = () => {
+themeApi.list = () => {
return service({
url: `${baseUrl}`,
method: 'get'
@@ -133,63 +133,6 @@ themeApi.fetching = url => {
})
}
-themeApi.fetchingBranches = url => {
- return service({
- url: `${baseUrl}/fetchingBranches`,
- timeout: 60000,
- params: {
- uri: url
- },
- method: 'post'
- })
-}
-
-themeApi.fetchingReleases = url => {
- return service({
- url: `${baseUrl}/fetchingReleases`,
- timeout: 60000,
- params: {
- uri: url
- },
- method: 'post'
- })
-}
-
-themeApi.fetchingBranch = (url, branchName) => {
- return service({
- url: `${baseUrl}/fetchBranch`,
- timeout: 60000,
- params: {
- uri: url,
- branch: branchName
- },
- method: 'get'
- })
-}
-
-themeApi.fetchingLatestRelease = url => {
- return service({
- url: `${baseUrl}/fetchLatestRelease`,
- timeout: 60000,
- params: {
- uri: url
- },
- method: 'get'
- })
-}
-
-themeApi.fetchingRelease = (url, tagName) => {
- return service({
- url: `${baseUrl}/fetchingRelease`,
- timeout: 60000,
- params: {
- uri: url,
- tag: tagName
- },
- method: 'get'
- })
-}
-
themeApi.getContent = path => {
return service({
url: `${baseUrl}/files/content`,
diff --git a/src/styles/global.less b/src/styles/global.less
index 5856f59d9..c8fac75f7 100644
--- a/src/styles/global.less
+++ b/src/styles/global.less
@@ -859,7 +859,11 @@ body {
}
.ant-affix {
- z-index: 2000!important;
+ z-index: 1000!important;
+}
+
+.v-note-wrapper {
+ z-index: 999!important;
}
#nprogress {
diff --git a/src/views/interface/ThemeEdit.vue b/src/views/interface/ThemeEdit.vue
index 11aeed90f..dcaef350f 100644
--- a/src/views/interface/ThemeEdit.vue
+++ b/src/views/interface/ThemeEdit.vue
@@ -132,7 +132,7 @@ export default {
handleListThemes() {
this.themesLoading = true
themeApi
- .listAll()
+ .list()
.then((response) => {
this.themes = response.data.data
})
diff --git a/src/views/interface/ThemeList.vue b/src/views/interface/ThemeList.vue
index ac481e822..09bff1b2a 100644
--- a/src/views/interface/ThemeList.vue
+++ b/src/views/interface/ThemeList.vue
@@ -162,13 +162,13 @@
更多主题请访问:
https://halo.run/p/themes
-
-
-
-
- 发行版
- 开发版
-
-
-
-
- {{ item.branch }}
-
-
-
-
- {{ item.branch }}
-
+
-
+
-
-
-
- 远程地址即主题仓库地址,建议使用发行版本。更多主题请访问:
+ 目前仅支持远程 Git 仓库和 ZIP 下载链接。更多主题请访问:
{
this.list.data = response.data.data
})
@@ -463,72 +397,26 @@ export default {
this.localUpdateModel.visible = false
this.handleListThemes()
},
- handleFetching() {
- const _this = this
- _this.$refs.remoteInstallForm.validate((valid) => {
+ handleRemoteFetching() {
+ this.$refs.remoteInstallForm.validate((valid) => {
if (valid) {
- _this.installModal.remote.repoFetching = true
- themeApi.fetchingBranches(_this.installModal.remote.url).then((response) => {
- const branches = response.data.data
- _this.installModal.remote.branches = branches
- if (branches && branches.length > 0) {
- _this.installModal.remote.selectedBranch = branches[0].branch
- }
- })
+ this.installModal.remote.fetching = true
themeApi
- .fetchingReleases(_this.installModal.remote.url)
- .then((response) => {
- const releases = response.data.data
- _this.installModal.remote.releases = releases
- if (releases && releases.length > 0) {
- _this.installModal.remote.selectedRelease = releases[0].branch
- }
+ .fetching(this.installModal.remote.url)
+ .catch(() => {
+ this.installModal.remote.fetchErrored = true
})
.finally(() => {
setTimeout(() => {
- _this.installModal.remote.repoFetching = false
+ this.installModal.remote.fetching = false
}, 400)
})
}
})
},
- handleBranchPulling() {
- this.installModal.remote.branchPulling = true
- themeApi
- .fetchingBranch(this.installModal.remote.url, this.installModal.remote.selectedBranch)
- .catch(() => {
- this.installModal.remote.branchPullErrored = true
- })
- .finally(() => {
- setTimeout(() => {
- this.installModal.remote.branchPulling = false
- }, 400)
- })
- },
- handleBranchPulledCallback() {
- if (this.installModal.remote.branchPullErrored) {
- this.installModal.remote.branchPullErrored = false
- } else {
- this.installModal.visible = false
- this.handleListThemes()
- }
- },
- handleReleaseDownloading() {
- this.installModal.remote.releaseDownloading = true
- themeApi
- .fetchingRelease(this.installModal.remote.url, this.installModal.remote.selectedRelease)
- .catch(() => {
- this.installModal.remote.branchPullErrored = true
- })
- .finally(() => {
- setTimeout(() => {
- this.installModal.remote.releaseDownloading = false
- }, 400)
- })
- },
- handleReleaseDownloadedCallback() {
- if (this.installModal.remote.releaseDownloadErrored) {
- this.installModal.remote.releaseDownloadErrored = false
+ handleRemoteFetchCallback() {
+ if (this.installModal.remote.fetchErrored) {
+ this.installModal.remote.fetchErrored = false
} else {
this.installModal.visible = false
this.handleListThemes()
@@ -574,12 +462,7 @@ export default {
if (this.$refs.updateByupload) {
this.$refs.updateByupload.handleClearFileList()
}
- this.installModal.remote.branches = []
- this.installModal.remote.selectedBranch = null
- this.installModal.remote.releases = []
- this.installModal.remote.selectedRelease = null
this.installModal.remote.url = null
- this.installModal.remote.byBranchOrRelease = 'release'
this.handleListThemes()
},
onThemeSettingsDrawerClose() {