1.增加爱发电地址配置

2.修改版本号为1.0.4-ce
This commit is contained in:
UPToZ 2025-05-25 16:32:12 +08:00
parent 5be073fea1
commit 70f94ede36
4 changed files with 9 additions and 4 deletions

View File

@ -753,6 +753,10 @@ spec:
url: /apis/api.plugin.halo.run/v1alpha1/plugins/plugin-afdian/afdian/getSponsorList url: /apis/api.plugin.halo.run/v1alpha1/plugins/plugin-afdian/afdian/getSponsorList
showNum: 3 showNum: 3
children: children:
- $formkit: url
name: powerAddress
label: 爱发电地址
help: https://ifdian.net
- $formkit: url - $formkit: url
name: powerLink name: powerLink
label: 赞助地址 label: 赞助地址

View File

@ -374,11 +374,11 @@ let halo = {
}, },
getTopSponsors() { getTopSponsors() {
var address = GLOBAL_CONFIG.source.power.powerAddress;
var show_num = GLOBAL_CONFIG.source.power.showNum; var show_num = GLOBAL_CONFIG.source.power.showNum;
var url = GLOBAL_CONFIG.source.power.url; var url = GLOBAL_CONFIG.source.power.url;
function getPower() { function getPower() {
const url = GLOBAL_CONFIG.source.power.url;
let powerStar = document.getElementById("power-star") let powerStar = document.getElementById("power-star")
powerStar.href = GLOBAL_CONFIG.source.power.powerLink powerStar.href = GLOBAL_CONFIG.source.power.powerLink
fetch(url) fetch(url)
@ -429,7 +429,7 @@ let halo = {
</div>`; </div>`;
} else { } else {
if (powerStar) { if (powerStar) {
powerStar.href = "https://ifdian.net/u/" + data[0]["user"].user_id powerStar.href = address + "/u/" + data[0]["user"].user_id
powerStar.innerHTML = ` powerStar.innerHTML = `
<div id="power-star-image" style="background-image: url(${data[0]["user"].avatar})"> <div id="power-star-image" style="background-image: url(${data[0]["user"].avatar})">
</div> </div>
@ -447,7 +447,7 @@ let halo = {
break; break;
} }
htmlText += htmlText +=
` <a href="${"https://ifdian.net/u/" + value["user"]["user_id"]}" rel="external nofollow" target="_blank" th:title="${value["user"]["name"]}">${value["user"]["name"]}</a>`; ` <a href="${address+"/u/" + value["user"]["user_id"]}" rel="external nofollow" target="_blank" th:title="${value["user"]["name"]}">${value["user"]["name"]}</a>`;
i = i + 1; i = i + 1;
} }
if (document.getElementById("power-item-link")) { if (document.getElementById("power-item-link")) {

View File

@ -56,6 +56,7 @@
}, },
source: { source: {
power: { power: {
powerAddress: [[${theme.config.sidebar.power.powerAddress}]],
powerLink: [[${theme.config.sidebar.power.powerLink}]], powerLink: [[${theme.config.sidebar.power.powerLink}]],
url: [[${theme.config.sidebar.power.url}]], url: [[${theme.config.sidebar.power.url}]],
showNum: [[${theme.config.sidebar.power.showNum}]] showNum: [[${theme.config.sidebar.power.showNum}]]

View File

@ -52,7 +52,7 @@ spec:
issues: https://gitee.com/uptoz/halo-theme-hao/issues issues: https://gitee.com/uptoz/halo-theme-hao/issues
settingName: "theme-hao-setting" settingName: "theme-hao-setting"
configMapName: "theme-hao-configMap" configMapName: "theme-hao-configMap"
version: "1.0.3-ce" version: "1.0.4-ce"
require: ">=2.20.0" require: ">=2.20.0"
license: license:
- name: "CC BY-SA 4.0" - name: "CC BY-SA 4.0"