添加文章ai摘要功能,修改了关于页面的打赏样式,修复51la网站统计

This commit is contained in:
1152958806@qq.com 2023-06-30 01:28:19 +08:00
parent 1cccca40a7
commit 8995b546e4
11 changed files with 1221 additions and 750 deletions

View File

@ -635,7 +635,7 @@ spec:
- $formkit: radio
name: enable_footer_group
label: 启用页脚友链
value: true
value: false
options:
- label: 启用
value: true
@ -671,39 +671,6 @@ spec:
label: 最近发布文章
value: 4
help: "最近发布的文章数量"
- $formkit: group
name: reward
label: 打赏
value:
enable_reward:
wxPay:
alipay:
reward_md_url:
children:
- $formkit: radio
name: enable_reward
help: 启用文章打赏,请正确填写名称和二维码图片链接
value: true
options:
- label: 启用
value: true
- label: 禁用
value: false
- $formkit: attachment
name: wxPay
label: 微信
help: 微信二维码图片链接
placeholder: 请填写微信二维码图片链接
- $formkit: attachment
name: alipay
label: 支付宝
help: 支付宝二维码图片链接
placeholder: 请填写支付宝二维码图片链接
- $formkit: url
name: reward_md_url
label: 赞赏者名单地址
placeholder: "请输入赞赏者名单地址"
value: "/about"
- $formkit: group
name: post_edit
label: 运营模式与责任
@ -740,7 +707,68 @@ spec:
label: 版权声明
placeholder: '本文是原创文章,采用 <a target="_blank" href="/cc">CC BY-NC-ND 4.0</a> 协议,完整转载请注明来自 <a href="/" target="_blank" >程序员小航</a>'
help: "版权声明内容,支持填入 HTML 标签"
- group: aiDescription
label: 文章ai摘要
formSchema:
- $formkit: radio
name: enable
label: 启用ai 摘要
value: false
options:
- label: 启用
value: true
- label: 禁用
value: false
- $formkit: text
name: gptName
label: 名称
placeholder: 请输入内容
value: KunKunYu
- $formkit: radio
name: mode
label: 模式
value: local
options:
- label: 本地
value: local
- label: ai
value: tianli
- $formkit: radio
name: switchBtn
label: 显示切换按钮
value: false
options:
- label:
value: true
- label:
value: false
- $formkit: url
name: btnLink
label: 链接地址
placeholder: 输入链接地址
value: https://afdian.net/item/f18c2e08db4411eda2f25254001e7c00
- $formkit: number
name: randomNum
label: 标签数量
value: 3
help: "按钮最大的随机次数,也就是一篇文章最大随机出来几种"
- $formkit: number
name: basicWordCount
label: 标签数量
value: 1000
help: "最低获取字符数, 最小1000, 最大1999"
- $formkit: text
name: key
label: key
value: xxxx
placeholder: 请输入key
- $formkit: url
name: Referer
label: 你的博客地址
help: 注意保留最后的斜杠
value: https://xx.xx/
- group: about
label: 个人
formSchema:
@ -1000,6 +1028,7 @@ spec:
- $formkit: text
name: LingQueMonitorID
label: 51la网站统计配置
help: 统计ID
placeholder: 请输入内容
value: https://v6-widget.51.la/v6/K48u6B53QKqNs741/quote.js
- $formkit: group
@ -1057,21 +1086,36 @@ spec:
name: content
label: 内容
placeholder: 请输入内容
value: 感谢赞赏的人,因为你们,让我感受到写博客这件事情能够给你们创造了价值。这会让我在这条路上走得更远。
value: 感谢赞赏的人,因为你们,让我感受到写博客这件事情能够给你们创造了价值。这会让我在这条路上走得更远。
- $formkit: group
name: reward
label: 打赏按钮
value:
enable_reward:
name:
content:
wxPay:
alipay:
alipay:
enable_reward_wz:
reward_md_url:
children:
- $formkit: radio
name: enable_reward_wz
help: 启用文章页面打赏
value: false
options:
- label: 启用
value: true
- label: 禁用
value: false
- $formkit: url
name: reward_md_url
label: 赞赏者名单地址
placeholder: "请输入赞赏者名单地址"
value: "/about"
- $formkit: radio
name: enable_reward
help: 启用文章打赏,请正确填写名称和二维码图片链接
value: true
help: 启用关于页面打赏
value: false
options:
- label: 启用
value: true
@ -1082,11 +1126,6 @@ spec:
label: 按钮名称
placeholder: 请输入内容
value: 赞赏作者
- $formkit: text
name: content
label: 内容
placeholder: 请输入内容
value: 感谢你赐予我前进的力量
- $formkit: attachment
name: wxPay
label: 微信
@ -1189,7 +1228,7 @@ spec:
- $formkit: radio
name: switch
label: 开关
value: false
value: true
options:
- label: 打开
value: true

View File

@ -1,6 +1,6 @@
<!DOCTYPE html>
<html lang="en" th:replace="~{modules/layouts/layout :: layout(content = ~{::content}, htmlType = 'about')}"
xmlns:th="http://www.thymeleaf.org">
xmlns:th="http://www.thymeleaf.org">
<th:block th:fragment="content">
@ -18,20 +18,20 @@
<div class="author-info">
<div class="author-tag-left"
th:if="${not #lists.isEmpty(theme.config.about.authorInfoLeftTags)}"
th:with="authorTags = ${theme.config.about.authorInfoLeftTags}">
th:if="${not #lists.isEmpty(theme.config.about.authorInfoLeftTags)}"
th:with="authorTags = ${theme.config.about.authorInfoLeftTags}">
<span class="author-tag" th:each="authorTag : ${authorTags}"
th:text="${authorTag.tag}"></span>
th:text="${authorTag.tag}"></span>
</div>
<div class="author-img">
<img
th:src="@{${#strings.isEmpty(site.favicon) ? '/assets/images/hao-logo.jpg' : site.favicon}}">
th:src="@{${#strings.isEmpty(site.favicon) ? '/assets/images/hao-logo.jpg' : site.favicon}}">
</div>
<div class="author-tag-right"
th:if="${not #lists.isEmpty(theme.config.about.authorInfoRightTags)}"
th:with="authorTags = ${theme.config.about.authorInfoRightTags}">
th:if="${not #lists.isEmpty(theme.config.about.authorInfoRightTags)}"
th:with="authorTags = ${theme.config.about.authorInfoRightTags}">
<span class="author-tag" th:each="authorTag : ${authorTags}"
th:text="${authorTag.tag}"></span>
th:text="${authorTag.tag}"></span>
</div>
</div>
<div class="author-title">关于本站</div>
@ -73,51 +73,51 @@
<div class="tags-group-all">
<!-- banners 使用默认值-->
<div class="tags-group-wrapper"
th:if="${#strings.equals(theme.config.top.bannersBackground, 'default')}">
th:if="${#strings.equals(theme.config.top.bannersBackground, 'default')}">
<div class="tags-group-icon-pair">
<div class="tags-group-icon" style="background:#989bf8">
<img th:src="@{/assets/images/icons/AfterEffect.png}"
title="AfterEffect">
title="AfterEffect">
</div>
<div class="tags-group-icon" style="background:#fff">
<img th:src="@{/assets/images/icons/Sketch.png}"
title="Sketch">
title="Sketch">
</div>
</div>
<div class="tags-group-icon-pair">
<div class="tags-group-icon" style="background:#57b6e6">
<img th:src="@{/assets/images/icons/Docker.png}"
title="Docker">
title="Docker">
</div>
<div class="tags-group-icon" style="background:#4082c3">
<img th:src="@{/assets/images/icons/Photoshop.png}"
title="Photoshop">
title="Photoshop">
</div>
</div>
<div class="tags-group-icon-pair">
<div class="tags-group-icon" style="background:#fff">
<img th:src="@{/assets/images/icons/FinalCutPro.png}"
title="FinalCutPro">
title="FinalCutPro">
</div>
<div class="tags-group-icon" style="background:#fff">
<img th:src="@{/assets/images/icons/Python.png}"
title="Python">
title="Python">
</div>
</div>
<div class="tags-group-icon-pair">
<div class="tags-group-icon" style="background:#eb6840">
<img th:src="@{/assets/images/icons/Swift.png}"
title="Swift">
title="Swift">
</div>
<div class="tags-group-icon" style="background:#8f55ba">
<img th:src="@{/assets/images/icons/Principle.png}"
title="Principle">
title="Principle">
</div>
</div>
<div class="tags-group-icon-pair">
<div class="tags-group-icon" style="background:#f29e39">
<img th:src="@{/assets/images/icons/illustrator.png}"
title="illustrator">
title="illustrator">
</div>
<div class="tags-group-icon" style="background:#2c51db">
<img th:src="@{/assets/images/icons/CSS3.png}" title="CSS3">
@ -137,53 +137,53 @@
</div>
<div class="tags-group-icon" style="background:#e65164">
<img th:src="@{/assets/images/icons/Apifox.webp}"
title="Apifox">
title="Apifox">
</div>
</div>
<div class="tags-group-icon-pair">
<div class="tags-group-icon" style="background:#989bf8">
<img th:src="@{/assets/images/icons/AfterEffect.png}"
title="AfterEffect">
title="AfterEffect">
</div>
<div class="tags-group-icon" style="background:#fff">
<img th:src="@{/assets/images/icons/Sketch.png}"
title="Sketch">
title="Sketch">
</div>
</div>
<div class="tags-group-icon-pair">
<div class="tags-group-icon" style="background:#57b6e6">
<img th:src="@{/assets/images/icons/Docker.png}"
title="Docker">
title="Docker">
</div>
<div class="tags-group-icon" style="background:#4082c3">
<img th:src="@{/assets/images/icons/Photoshop.png}"
title="Photoshop">
title="Photoshop">
</div>
</div>
<div class="tags-group-icon-pair">
<div class="tags-group-icon" style="background:#fff">
<img th:src="@{/assets/images/icons/FinalCutPro.png}"
title="FinalCutPro">
title="FinalCutPro">
</div>
<div class="tags-group-icon" style="background:#fff">
<img th:src="@{/assets/images/icons/Python.png}"
title="Python">
title="Python">
</div>
</div>
<div class="tags-group-icon-pair">
<div class="tags-group-icon" style="background:#eb6840">
<img th:src="@{/assets/images/icons/Swift.png}"
title="Swift">
title="Swift">
</div>
<div class="tags-group-icon" style="background:#8f55ba">
<img th:src="@{/assets/images/icons/Principle.png}"
title="Principle">
title="Principle">
</div>
</div>
<div class="tags-group-icon-pair">
<div class="tags-group-icon" style="background:#f29e39">
<img th:src="@{/assets/images/icons/illustrator.png}"
title="illustrator">
title="illustrator">
</div>
<div class="tags-group-icon" style="background:#2c51db">
<img th:src="@{/assets/images/icons/CSS3.png}" title="CSS3">
@ -203,29 +203,29 @@
</div>
<div class="tags-group-icon" style="background:#e65164">
<img th:src="@{/assets/images/icons/Apifox.webp}"
title="Apifox">
title="Apifox">
</div>
</div>
</div>
<!-- banners 使用默认值-->
<div class="tags-group-wrapper"
th:if="${#strings.equals(theme.config.top.bannersBackground, 'techStack')}"
th:with="techs = ${theme.config.about.techStack}">
th:if="${#strings.equals(theme.config.top.bannersBackground, 'techStack')}"
th:with="techs = ${theme.config.about.techStack}">
<th:block th:each="tech,iterStat : ${techs}">
<div class="tags-group-icon-pair" th:if="${iterStat.odd}">
<div class="tags-group-icon"
th:style="'background:' + ${techOdd.background}"
th:with="techOdd = ${techs.get(iterStat.index - 1)}">
th:style="'background:' + ${techOdd.background}"
th:with="techOdd = ${techs.get(iterStat.index - 1)}">
<img th:src="@{${techOdd.url}}"
th:title="${techOdd.name}">
th:title="${techOdd.name}">
</div>
<div class="tags-group-icon"
th:style="'background:' + ${techEven.background}"
th:with="techEven = ${tech}">
th:style="'background:' + ${techEven.background}"
th:with="techEven = ${tech}">
<img th:src="@{${techEven.url}}"
th:title="${techEven.name}">
th:title="${techEven.name}">
</div>
</div>
</th:block>
@ -236,13 +236,13 @@
<!-- banners 使用默认值-->
<div class="skills-list"
th:if="${#strings.equals(theme.config.top.bannersBackground, 'default')}"
th:with="techs = ${theme.config.about.techStack}">
th:if="${#strings.equals(theme.config.top.bannersBackground, 'default')}"
th:with="techs = ${theme.config.about.techStack}">
<div class="skill-info">
<div class="skill-icon" style="background:#989bf8">
<img th:src="@{/assets/images/icons/AfterEffect.png}"
title="AfterEffect">
title="AfterEffect">
</div>
<div class="skill-name"><span>AfterEffect</span></div>
</div>
@ -271,7 +271,7 @@
<div class="skill-info">
<div class="skill-icon" style="background:#ffffff">
<img th:src="@{/assets/images/icons/FinalCutPro.png}"
title="FinalCutPro">
title="FinalCutPro">
</div>
<div class="skill-name"><span>FinalCutPro</span></div>
</div>
@ -300,7 +300,7 @@
<div class="skill-info">
<div class="skill-icon" style="background:#f29e39">
<img th:src="@{/assets/images/icons/illustrator.png}"
title="illustrator">
title="illustrator">
</div>
<div class="skill-name"><span>illustrator</span></div>
</div>
@ -343,8 +343,8 @@
<div class="etc">...</div>
</div>
<div class="skills-list"
th:if="${#strings.equals(theme.config.top.bannersBackground, 'techStack')}"
th:with="techs = ${theme.config.about.techStack}">
th:if="${#strings.equals(theme.config.top.bannersBackground, 'techStack')}"
th:with="techs = ${theme.config.about.techStack}">
<th:block th:each="tech : ${techs}">
<div class="skill-info">
<div class="skill-icon" th:style="'background:' + ${tech.background}">
@ -362,17 +362,17 @@
<div class="card-content">
<div class="author-content-item-tips">生涯</div>
<span class="author-content-item-title"
th:text="${theme.config.about.authorCareers.authorCareersTitle}">无限进步</span>
th:text="${theme.config.about.authorCareers.authorCareersTitle}">无限进步</span>
<div class="careers-group"
th:if="${not #lists.isEmpty(theme.config.about.authorCareers.authorCareersTags)}"
th:with="careersTags = ${theme.config.about.authorCareers.authorCareersTags}">
th:if="${not #lists.isEmpty(theme.config.about.authorCareers.authorCareersTags)}"
th:with="careersTags = ${theme.config.about.authorCareers.authorCareersTags}">
<div class="careers-item" th:each="tag : ${careersTags}">
<div class="circle" th:style="'background:' + ${tag.background}"></div>
<div class="name" th:text="${tag.desc}"></div>
</div>
</div>
<img alt="生涯" class="author-content-img"
th:src="@{${#strings.isEmpty(theme.config.about.authorCareers.authorCareersBackground) ? '/assets/images/hao-logo.jpg' : theme.config.about.authorCareers.authorCareersBackground}}">
th:src="@{${#strings.isEmpty(theme.config.about.authorCareers.authorCareersBackground) ? '/assets/images/hao-logo.jpg' : theme.config.about.authorCareers.authorCareersBackground}}">
</div>
</div>
</div>
@ -380,18 +380,18 @@
<!-- personalities -->
<div class="author-content">
<div class="author-content-item personalities"
th:with="personality = ${theme.config.about.personalities}">
th:with="personality = ${theme.config.about.personalities}">
<div class="author-content-item-tips">性格</div>
<th:block th:if="${personality == 'infp'}">
<span class="author-content-item-title">调停者</span>
<div class="title2" style="color: #56a178;">INFP</div>
<div class="image"><img src="/themes/theme-hao/assets/images/infp.svg"
style="transform: rotateY(180deg);"></div>
style="transform: rotateY(180deg);"></div>
<div class="post-tips"><a href="https://www.16personalities.com/"
rel="noopener nofollow" target="_blank">16personalities</a>
rel="noopener nofollow" target="_blank">16personalities</a>
了解更多关于 <a rel="noopener external nofollow" target="_blank"
th:href="@{'https://www.16personalities.com/ch/INFP-%E4%BA%BA%E6%A0%BC'}">调停者</a>
th:href="@{'https://www.16personalities.com/ch/INFP-%E4%BA%BA%E6%A0%BC'}">调停者</a>
</div>
</th:block>
@ -399,11 +399,11 @@
<span class="author-content-item-title">建筑师</span>
<div class="title2" style="color: #56a178;">INTJ</div>
<div class="image"><img src="/themes/theme-hao/assets/images/intj.svg"
style="transform: rotateY(180deg);"></div>
style="transform: rotateY(180deg);"></div>
<div class="post-tips"><a href="https://www.16personalities.com/"
rel="noopener nofollow" target="_blank">16personalities</a>
rel="noopener nofollow" target="_blank">16personalities</a>
了解更多关于 <a rel="noopener external nofollow" target="_blank"
th:href="@{'https://www.16personalities.com/ch/INTJ-%E4%BA%BA%E6%A0%BC'}">建筑师</a>
th:href="@{'https://www.16personalities.com/ch/INTJ-%E4%BA%BA%E6%A0%BC'}">建筑师</a>
</div>
</th:block>
@ -411,11 +411,11 @@
<span class="author-content-item-title">逻辑学家</span>
<div class="title2" style="color: #56a178;">INTP</div>
<div class="image"><img src="/themes/theme-hao/assets/images/intp.svg"
style="transform: rotateY(180deg);"></div>
style="transform: rotateY(180deg);"></div>
<div class="post-tips"><a href="https://www.16personalities.com/"
rel="noopener nofollow" target="_blank">16personalities</a>
rel="noopener nofollow" target="_blank">16personalities</a>
了解更多关于 <a rel="noopener external nofollow" target="_blank"
th:href="@{'https://www.16personalities.com/ch/INTP-%E4%BA%BA%E6%A0%BC'}">逻辑学家</a>
th:href="@{'https://www.16personalities.com/ch/INTP-%E4%BA%BA%E6%A0%BC'}">逻辑学家</a>
</div>
</th:block>
@ -423,11 +423,11 @@
<span class="author-content-item-title">指挥官</span>
<div class="title2" style="color: #56a178;">ENTJ</div>
<div class="image"><img src="/themes/theme-hao/assets/images/entj.svg"
style="transform: rotateY(180deg);"></div>
style="transform: rotateY(180deg);"></div>
<div class="post-tips"><a href="https://www.16personalities.com/"
rel="noopener nofollow" target="_blank">16personalities</a>
rel="noopener nofollow" target="_blank">16personalities</a>
了解更多关于 <a rel="noopener external nofollow" target="_blank"
th:href="@{'https://www.16personalities.com/ch/ENTJ-%E4%BA%BA%E6%A0%BC'}">指挥官</a>
th:href="@{'https://www.16personalities.com/ch/ENTJ-%E4%BA%BA%E6%A0%BC'}">指挥官</a>
</div>
</th:block>
@ -435,11 +435,11 @@
<span class="author-content-item-title">辩论家</span>
<div class="title2" style="color: #56a178;">ENTP</div>
<div class="image"><img src="/themes/theme-hao/assets/images/entp.svg"
style="transform: rotateY(180deg);"></div>
style="transform: rotateY(180deg);"></div>
<div class="post-tips"><a href="https://www.16personalities.com/"
rel="noopener nofollow" target="_blank">16personalities</a>
rel="noopener nofollow" target="_blank">16personalities</a>
了解更多关于 <a rel="noopener external nofollow" target="_blank"
th:href="@{'https://www.16personalities.com/ch/ENTP-%E4%BA%BA%E6%A0%BC'}">辩论家</a>
th:href="@{'https://www.16personalities.com/ch/ENTP-%E4%BA%BA%E6%A0%BC'}">辩论家</a>
</div>
</th:block>
@ -447,11 +447,11 @@
<span class="author-content-item-title">主人公</span>
<div class="title2" style="color: #56a178;">ENFJ</div>
<div class="image"><img src="/themes/theme-hao/assets/images/enfj.svg"
style="transform: rotateY(180deg);"></div>
style="transform: rotateY(180deg);"></div>
<div class="post-tips"><a href="https://www.16personalities.com/"
rel="noopener nofollow" target="_blank">16personalities</a>
rel="noopener nofollow" target="_blank">16personalities</a>
了解更多关于 <a rel="noopener external nofollow" target="_blank"
th:href="@{'https://www.16personalities.com/ch/ENFJ-%E4%BA%BA%E6%A0%BC'}">主人公</a>
th:href="@{'https://www.16personalities.com/ch/ENFJ-%E4%BA%BA%E6%A0%BC'}">主人公</a>
</div>
</th:block>
@ -459,11 +459,11 @@
<span class="author-content-item-title">竞选者</span>
<div class="title2" style="color: #56a178;">ENFP</div>
<div class="image"><img src="/themes/theme-hao/assets/images/enfp.svg"
style="transform: rotateY(180deg);"></div>
style="transform: rotateY(180deg);"></div>
<div class="post-tips"><a href="https://www.16personalities.com/"
rel="noopener nofollow" target="_blank">16personalities</a>
rel="noopener nofollow" target="_blank">16personalities</a>
了解更多关于 <a rel="noopener external nofollow" target="_blank"
th:href="@{'https://www.16personalities.com/ch/ENFP-%E4%BA%BA%E6%A0%BC'}">竞选者</a>
th:href="@{'https://www.16personalities.com/ch/ENFP-%E4%BA%BA%E6%A0%BC'}">竞选者</a>
</div>
</th:block>
@ -471,11 +471,11 @@
<span class="author-content-item-title">总经理</span>
<div class="title2" style="color: #56a178;">ESTJ</div>
<div class="image"><img src="/themes/theme-hao/assets/images/estj.svg"
style="transform: rotateY(180deg);"></div>
style="transform: rotateY(180deg);"></div>
<div class="post-tips"><a href="https://www.16personalities.com/"
rel="noopener nofollow" target="_blank">16personalities</a>
rel="noopener nofollow" target="_blank">16personalities</a>
了解更多关于 <a rel="noopener external nofollow" target="_blank"
th:href="@{'https://www.16personalities.com/ch/ESTJ-%E4%BA%BA%E6%A0%BC'}">总经理</a>
th:href="@{'https://www.16personalities.com/ch/ESTJ-%E4%BA%BA%E6%A0%BC'}">总经理</a>
</div>
</th:block>
@ -483,11 +483,11 @@
<span class="author-content-item-title">企业家</span>
<div class="title2" style="color: #56a178;">ESTP</div>
<div class="image"><img src="/themes/theme-hao/assets/images/estp.svg"
style="transform: rotateY(180deg);"></div>
style="transform: rotateY(180deg);"></div>
<div class="post-tips"><a href="https://www.16personalities.com/"
rel="noopener nofollow" target="_blank">16personalities</a>
rel="noopener nofollow" target="_blank">16personalities</a>
了解更多关于 <a rel="noopener external nofollow" target="_blank"
th:href="@{'https://www.16personalities.com/ch/ESTP-%E4%BA%BA%E6%A0%BC'}">企业家</a>
th:href="@{'https://www.16personalities.com/ch/ESTP-%E4%BA%BA%E6%A0%BC'}">企业家</a>
</div>
</th:block>
@ -495,11 +495,11 @@
<span class="author-content-item-title">执政官</span>
<div class="title2" style="color: #56a178;">ESFJ</div>
<div class="image"><img src="/themes/theme-hao/assets/images/esfj.svg"
style="transform: rotateY(180deg);"></div>
style="transform: rotateY(180deg);"></div>
<div class="post-tips"><a href="https://www.16personalities.com/"
rel="noopener nofollow" target="_blank">16personalities</a>
rel="noopener nofollow" target="_blank">16personalities</a>
了解更多关于 <a rel="noopener external nofollow" target="_blank"
th:href="@{'https://www.16personalities.com/ch/ESFJ-%E4%BA%BA%E6%A0%BC'}">执政官</a>
th:href="@{'https://www.16personalities.com/ch/ESFJ-%E4%BA%BA%E6%A0%BC'}">执政官</a>
</div>
</th:block>
@ -507,11 +507,11 @@
<span class="author-content-item-title">表演者</span>
<div class="title2" style="color: #56a178;">ESFP</div>
<div class="image"><img src="/themes/theme-hao/assets/images/esfp.svg"
style="transform: rotateY(180deg);"></div>
style="transform: rotateY(180deg);"></div>
<div class="post-tips"><a href="https://www.16personalities.com/"
rel="noopener nofollow" target="_blank">16personalities</a>
rel="noopener nofollow" target="_blank">16personalities</a>
了解更多关于 <a rel="noopener external nofollow" target="_blank"
th:href="@{'https://www.16personalities.com/ch/ESFP-%E4%BA%BA%E6%A0%BC'}">表演者</a>
th:href="@{'https://www.16personalities.com/ch/ESFP-%E4%BA%BA%E6%A0%BC'}">表演者</a>
</div>
</th:block>
@ -519,11 +519,11 @@
<span class="author-content-item-title">提倡者</span>
<div class="title2" style="color: #56a178;">INFJ</div>
<div class="image"><img src="/themes/theme-hao/assets/images/infj.svg"
style="transform: rotateY(180deg);"></div>
style="transform: rotateY(180deg);"></div>
<div class="post-tips"><a href="https://www.16personalities.com/"
rel="noopener nofollow" target="_blank">16personalities</a>
rel="noopener nofollow" target="_blank">16personalities</a>
了解更多关于 <a rel="noopener external nofollow" target="_blank"
th:href="@{'https://www.16personalities.com/ch/INFJ-%E4%BA%BA%E6%A0%BC'}">提倡者</a>
th:href="@{'https://www.16personalities.com/ch/INFJ-%E4%BA%BA%E6%A0%BC'}">提倡者</a>
</div>
</th:block>
@ -531,11 +531,11 @@
<span class="author-content-item-title">物流师</span>
<div class="title2" style="color: #56a178;">ISTJ</div>
<div class="image"><img src="/themes/theme-hao/assets/images/istj.svg"
style="transform: rotateY(180deg);"></div>
style="transform: rotateY(180deg);"></div>
<div class="post-tips"><a href="https://www.16personalities.com/"
rel="noopener nofollow" target="_blank">16personalities</a>
rel="noopener nofollow" target="_blank">16personalities</a>
了解更多关于 <a rel="noopener external nofollow" target="_blank"
th:href="@{'https://www.16personalities.com/ch/ISTJ-%E4%BA%BA%E6%A0%BC'}">物流师</a>
th:href="@{'https://www.16personalities.com/ch/ISTJ-%E4%BA%BA%E6%A0%BC'}">物流师</a>
</div>
</th:block>
@ -543,11 +543,11 @@
<span class="author-content-item-title">鉴赏家</span>
<div class="title2" style="color: #56a178;">ISTP</div>
<div class="image"><img src="/themes/theme-hao/assets/images/istp.svg"
style="transform: rotateY(180deg);"></div>
style="transform: rotateY(180deg);"></div>
<div class="post-tips"><a href="https://www.16personalities.com/"
rel="noopener nofollow" target="_blank">16personalities</a>
rel="noopener nofollow" target="_blank">16personalities</a>
了解更多关于 <a rel="noopener external nofollow" target="_blank"
th:href="@{'https://www.16personalities.com/ch/ISTP-%E4%BA%BA%E6%A0%BC'}">鉴赏家</a>
th:href="@{'https://www.16personalities.com/ch/ISTP-%E4%BA%BA%E6%A0%BC'}">鉴赏家</a>
</div>
</th:block>
@ -555,11 +555,11 @@
<span class="author-content-item-title">守卫者</span>
<div class="title2" style="color: #56a178;">ISFJ</div>
<div class="image"><img src="/themes/theme-hao/assets/images/isfj.svg"
style="transform: rotateY(180deg);"></div>
style="transform: rotateY(180deg);"></div>
<div class="post-tips"><a href="https://www.16personalities.com/"
rel="noopener nofollow" target="_blank">16personalities</a>
rel="noopener nofollow" target="_blank">16personalities</a>
了解更多关于 <a rel="noopener external nofollow" target="_blank"
th:href="@{'https://www.16personalities.com/ch/ISFJ-%E4%BA%BA%E6%A0%BC'}">守卫者</a>
th:href="@{'https://www.16personalities.com/ch/ISFJ-%E4%BA%BA%E6%A0%BC'}">守卫者</a>
</div>
</th:block>
@ -567,17 +567,17 @@
<span class="author-content-item-title">探险家</span>
<div class="title2" style="color: #56a178;">ISFP</div>
<div class="image"><img src="/themes/theme-hao/assets/images/isfp.svg"
style="transform: rotateY(180deg);"></div>
style="transform: rotateY(180deg);"></div>
<div class="post-tips"><a href="https://www.16personalities.com/"
rel="noopener nofollow" target="_blank">16personalities</a>
rel="noopener nofollow" target="_blank">16personalities</a>
了解更多关于 <a rel="noopener external nofollow" target="_blank"
th:href="@{'https://www.16personalities.com/ch/ISFP-%E4%BA%BA%E6%A0%BC'}">探险家</a>
th:href="@{'https://www.16personalities.com/ch/ISFP-%E4%BA%BA%E6%A0%BC'}">探险家</a>
</div>
</th:block>
</div>
<div class="author-content-item myphoto"><img alt="自拍" class="author-content-img"
th:src="${theme.config.about.authorCareersPhoto}">
th:src="${theme.config.about.authorCareersPhoto}">
</div>
</div>
@ -587,7 +587,7 @@
<div class="author-content-item-tips" th:text="${texts[0].tittle}">座右铭</div>
<span class="maxim-title">
<span style="opacity: 0.6;margin-bottom:8px;"
th:text="${texts[0].textarea_up}">生活原本沉闷,</span>
th:text="${texts[0].textarea_up}">生活原本沉闷,</span>
<span th:text="${texts[0].textarea_down}">但跑起来就有风。</span>
</span>
</div>
@ -597,7 +597,7 @@
<div class="author-content-item-tips" th:text="${texts[1].tittle}">特长</div>
<span class="buff-title">
<span style="opacity: 0.6;margin-bottom:8px;"
th:text="${texts[1].textarea_up}">玄学流电脑疑难问题解决
th:text="${texts[1].textarea_up}">玄学流电脑疑难问题解决
<span class="inline-word">专家</span>
</span>
<span th:text="${texts[1].textarea_down}">软件学习能力</span>
@ -607,13 +607,12 @@
</div>
<div class="author-content">
<div class="author-content-item game-lol"
th:style="'background: url('+ @{${theme.config.about.game.game_bg}} +') top / cover no-repeat'">
th:style="'background: url('+ @{${theme.config.about.game.game_bg}} +') top / cover no-repeat'">
<div class="card-content">
<div class="author-content-item-tips" th:text="${theme.config.about.game.game_tips}">
</div>
<span class="author-content-item-title"
th:text="${theme.config.about.game.game_title}"></span>
</div><span class="author-content-item-title"
th:text="${theme.config.about.game.game_title}"></span>
<div class="content-bottom">
<div class="icon-group">
<div class="loading-bar" role="presentation" aria-hidden="true"></div>
@ -623,13 +622,12 @@
</div>
</div>
<div class="author-content-item game-wolf"
th:style="'background: url('+ @{${theme.config.about.game2.game2_bg}} +') top / cover no-repeat'">
th:style="'background: url('+ @{${theme.config.about.game2.game2_bg}} +') top / cover no-repeat'">
<div class="card-content">
<div class="author-content-item-tips" th:text="${theme.config.about.game2.game2_tips}">
</div>
<span class="author-content-item-title"
th:text="${theme.config.about.game2.game2_title}"></span>
</div><span class="author-content-item-title"
th:text="${theme.config.about.game2.game2_title}"></span>
<div class="content-bottom">
<div class="tips" th:text="${theme.config.about.game2.game2_uid}"></div>
</div>
@ -640,13 +638,13 @@
<div class="author-content">
<div class="author-content-item like-technology"
th:style="'background: url('+ @{${theme.config.about.like.like_bg}} +') top / cover no-repeat;'">
th:style="'background: url('+ @{${theme.config.about.like.like_bg}} +') top / cover no-repeat;'">
<div class="card-content">
<div class="author-content-item-tips" th:text="${theme.config.about.like.like_tips}">
</div>
<span class="author-content-item-title"
th:text="${theme.config.about.like.like_title}"></span>
th:text="${theme.config.about.like.like_title}"></span>
<div class="content-bottom">
<div class="tips" th:text="${theme.config.about.like.like_bottom}"></div>
</div>
@ -654,13 +652,13 @@
</div>
<div class="author-content-item like-music"
th:style="'background: url('+ @{${theme.config.about.music.music_bg}} +') top / cover no-repeat'">
th:style="'background: url('+ @{${theme.config.about.music.music_bg}} +') top / cover no-repeat'">
<div class="card-content">
<div class="author-content-item-tips" th:text="${theme.config.about.music.music_tips}">
</div>
<span class="author-content-item-title"
th:text="${theme.config.about.music.music_title}"></span>
th:text="${theme.config.about.music.music_title}"></span>
<div class="content-bottom">
<div class="tips">跟 [[${site.title}]] 一起欣赏更多音乐</div>
</div>
@ -677,24 +675,22 @@
<div class="author-content">
<div class="about-statistic author-content-item"
style="background: url(https://bu.dusays.com/2023/03/12/640dc8c72f623.webp);">
style="background: url(https://bu.dusays.com/2023/03/12/640dc8c72f623.webp);">
<div class="card-content">
<div class="author-content-item-tips">数据</div>
<span class="author-content-item-title">访问统计</span>
<div id="statistic"></div>
<div class="post-tips">统计信息来自 <a href="https://invite.51.la/1NzKqTeb?target=V6"
rel="noopener nofollow"
target="_blank">51la网站统计</a></div>
<div class="banner-button-group"><a class="banner-button"
onclick="pjax.loadUrl('/archives')"
data-pjax-state=""><i
class="anzhiyufont anzhiyu-icon-arrow-circle-right"></i><span
class="banner-button-text">文章隧道</span></a></div>
rel="noopener nofollow" target="_blank">51la网站统计</a></div>
<div class="banner-button-group"><a class="banner-button" onclick="pjax.loadUrl('/archives')"
data-pjax-state=""><i
class="anzhiyufont anzhiyu-icon-arrow-circle-right"></i><span
class="banner-button-text">文章隧道</span></a></div>
</div>
</div>
<script>
// 链接替换即可,不需要后面的参数
fetch("[[${theme.config.about.LingQueMonitorID}]]")
fetch("https://v6-widget.51.la/v6/[[${theme.config.about.LingQueMonitorID}]]/quote.js")
.then(res => res.text())
.then(data => {
let title = ["最近活跃", "今日人数", "今日访问", "昨日人数", "昨日访问", "本月访问", "总访问量"];
@ -723,19 +719,18 @@
<b>[[${theme.config.about.map.StrengthenTitle}]]</b></span>
</div>
<div class="author-content-item selfInfo single"
th:if="${not #lists.isEmpty(theme.config.about.map.authorInfo)}"
th:with="texts = ${theme.config.about.map.authorInfo}">
th:if="${not #lists.isEmpty(theme.config.about.map.authorInfo)}"
th:with="texts = ${theme.config.about.map.authorInfo}">
<div><span class="selfInfo-title" th:text="${texts[0].authorInfoTitle}">生于</span><span
class="selfInfo-content" th:style="'color:' + ${texts[0].authorInfoColor}"
th:text="${texts[0].authorInfoContent}">2000</span>
</div>
<div><span class="selfInfo-title"
th:text="${texts[1].authorInfoTitle}">太原理工大学</span><span
th:text="${texts[1].authorInfoTitle}">太原理工大学</span><span
class="selfInfo-content" th:style="'color:' + ${texts[1].authorInfoColor}"
th:text="${texts[1].authorInfoContent}">计算机科学</span>
</div>
<div><span class="selfInfo-title"
th:text="${texts[2].authorInfoTitle}">现在职业</span><span
<div><span class="selfInfo-title" th:text="${texts[2].authorInfoTitle}">现在职业</span><span
class="selfInfo-content" th:style="'color:' + ${texts[2].authorInfoColor}"
th:text="${texts[2].authorInfoContent}">BI工程师</span>
</div>
@ -770,65 +765,70 @@
<div class="author-content">
<div class="author-content-item single reward">
<div class="author-content-item-tips">致谢</div>
<span class="author-content-item-title"
th:text="${theme.config.aboutReward.title}">赞赏名单</span>
<div class="author-content-item-description" th:text="${theme.config.aboutReward.content}">
感谢赞赏的人,因为你们,让我感受到写博客这件事情能够给你们创造了价值。这会让我在这条路上走得更远。
<span class="author-content-item-title" >[[${theme.config.aboutReward.title}]]</span>
<div class="author-content-item-description" >
[[${theme.config.aboutReward.content}]]
</div>
<div class="post-reward" th:if="${theme.config.aboutReward.reward.enable_reward}">
<div class="post-reward" onclick="AddRewardMask()"></div>
<div class="reward-button" title="赞赏作者"><i class="heofont icon-hand-heart-fill"></i>
[[${theme.config.aboutReward.reward.name}]]
<div th:if="${theme.config.aboutReward.reward.enable_reward}" class="about-reward">
<div id="con"></div>
<div id="TA-con" onclick="heo.rewardShowConsole()">
<div id="text-con">
<div id="linght"></div>
<div id="TA">[[${theme.config.aboutReward.reward.name}]]</div>
</div>
</div>
<div class="reward-main">
<ul class="reward-all">
<span class="reward-title">
[[${theme.config.aboutReward.reward.content}]]</span>
<ul class="reward-group">
<li class="reward-item">
<a href="" target="_blank"
th:href="@{${theme.config.aboutReward.reward.wxPay}}">
<img alt="微信" class="post-qr-code-img"
th:src="${theme.config.aboutReward.reward.wxPay}">
</a>
<div class="post-qr-code-desc">
微信
</div>
</li>
<li class="reward-item">
<a href="" target="_blank"
th:href="@{${theme.config.aboutReward.reward.alipay}}">
<img alt="支付宝" class="post-qr-code-img"
th:src="${theme.config.aboutReward.reward.alipay}">
</a>
<div class="post-qr-code-desc">
支付宝
</div>
</li>
</ul>
</ul>
<div id="tube-con"><svg viewBox="0 0 1028 385" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M1 77H234.226L307.006 24H790" stroke="#e5e9ef" stroke-width="20"></path>
<path d="M0 140H233.035L329.72 71H1028" stroke="#e5e9ef" stroke-width="20"></path>
<path d="M1 255H234.226L307.006 307H790" stroke="#e5e9ef" stroke-width="20"></path>
<path d="M0 305H233.035L329.72 375H1028" stroke="#e5e9ef" stroke-width="20"></path>
<rect y="186" width="236" height="24" fill="#e5e9ef"></rect>
<ellipse cx="790" cy="25.5" rx="25" ry="25.5" fill="#e5e9ef"></ellipse>
<circle r="14" transform="matrix(1 0 0 -1 790 25)" fill="white"></circle>
<ellipse cx="790" cy="307.5" rx="25" ry="25.5" fill="#e5e9ef"></ellipse>
<circle r="14" transform="matrix(1 0 0 -1 790 308)" fill="white"></circle>
</svg>
<div id="mask"><svg viewBox="0 0 1028 385" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M1 77H234.226L307.006 24H790" stroke="#f25d8e" stroke-width="20"></path>
<path d="M0 140H233.035L329.72 71H1028" stroke="#f25d8e" stroke-width="20"></path>
<path d="M1 255H234.226L307.006 307H790" stroke="#f25d8e" stroke-width="20"></path>
<path d="M0 305H233.035L329.72 375H1028" stroke="#f25d8e" stroke-width="20"></path>
<rect y="186" width="236" height="24" fill="#f25d8e"></rect>
<ellipse cx="790" cy="25.5" rx="25" ry="25.5" fill="#f25d8e"></ellipse>
<circle r="14" transform="matrix(1 0 0 -1 790 25)" fill="white"></circle>
<ellipse cx="790" cy="307.5" rx="25" ry="25.5" fill="#f25d8e"></ellipse>
<circle r="14" transform="matrix(1 0 0 -1 790 308)" fill="white"></circle>
</svg></div>
<div id="orange-mask"><svg viewBox="0 0 1028 385" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M1 77H234.226L307.006 24H790" stroke="#ffd52b" stroke-width="20"></path>
<path d="M0 140H233.035L329.72 71H1028" stroke="#ffd52b" stroke-width="20"></path>
<path d="M1 255H234.226L307.006 307H790" stroke="#ffd52b" stroke-width="20"></path>
<path d="M0 305H233.035L329.72 375H1028" stroke="#ffd52b" stroke-width="20"></path>
<rect y="186" width="236" height="24" fill="#ffd52b"></rect>
<ellipse cx="790" cy="25.5" rx="25" ry="25.5" fill="#ffd52b"></ellipse>
<circle r="14" transform="matrix(1 0 0 -1 790 25)" fill="white"></circle>
<ellipse cx="790" cy="307.5" rx="25" ry="25.5" fill="#ffd52b"></ellipse>
<circle r="14" transform="matrix(1 0 0 -1 790 308)" fill="white"></circle>
</svg></div>
<!-- <p id="people">共<b>29</b>人</p> -->
</div>
</div>
<div class="reward-list-all" th:if="${not #lists.isEmpty(theme.config.aboutReward.reward_list)}"
th:with="authorRewardList = ${theme.config.aboutReward.reward_list}">
th:with="authorRewardList = ${theme.config.aboutReward.reward_list}">
<div class="reward-list-item" th:each="authorReward : ${authorRewardList}">
<div class="reward-list-item-name">[[${authorReward.name}]]</div>
<div class="reward-list-bottom-group">
<div th:if="${authorReward.sign == 'N'}" class="reward-list-item-money">¥
[[${authorReward.amount}]]
</div>
[[${authorReward.amount}]]</div>
<div th:if="${authorReward.sign == 'Y'}" class="reward-list-item-money"
style="background: var(--heo-vip);">¥ [[${authorReward.amount}]]
style="background: var(--heo-vip);">¥ [[${authorReward.amount}]]
</div>
<time class="datatime reward-list-item-time">[[${authorReward.datatime}]]</time>
</div>
</div>
</div>
</div>
</div>

View File

@ -400,10 +400,22 @@ var heo = {
return arr[0]
},
// 显示打赏中控台
rewardShowConsole: function () {
$('.console-card-group-reward').attr('style', 'display: flex');
$('.console-card-group').attr('style', 'display: none');
document.querySelector("#console").classList.add("show");
},
//显示中控台
showConsole: function () {
$('.console-card-group-reward').attr('style', 'display: none');
$('.console-card-group').attr('style', 'display: flex');
document.querySelector("#console").classList.add("show");
},
//隐藏中控台
@ -447,5 +459,6 @@ var heo = {
$htmlDom.contains('hide-aside')
? document.querySelector("#consoleHideAside").classList.add("on")
: document.querySelector("#consoleHideAside").classList.remove("on")
}
},
}

View File

@ -4,9 +4,9 @@ var commentBarrageConfig = {
//弹幕显示间隔时间ms
barrageTime: 4000,
//twikoo部署地址腾讯云的为环境ID
twikooUrl: "https://twikoo.yzczi.com/",
twikooUrl: "xxxx",
//token获取见上方
accessToken: "a0b1120dcbdd45579833ceab6ec112f7",
accessToken: "xxxx",
pageUrl: window.location.pathname,
barrageTimer: [],
barrageList: [],

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -124,7 +124,37 @@
<!-- Tocbot 目录生成 end -->
<script>
!function(p) {
"use strict";
!function(t) {
var s = window
, e = document
, i = p
, c = "".concat("https:" === e.location.protocol ? "https://" : "http://", "sdk.51.la/js-sdk-pro.min.js")
, n = e.createElement("script")
, r = e.getElementsByTagName("script")[0];
n.type = "text/javascript",
n.setAttribute("charset", "UTF-8"),
n.async = !0,
n.src = c,
n.id = "LA_COLLECT",
i.d = n;
var o = function() {
s.LA.ids.push(i)
};
s.LA ? s.LA.ids && o() : (s.LA = p,
s.LA.ids = [],
o()),
r.parentNode.insertBefore(n, r)
}()
}({
id: "[[${theme.config.about.LingQueMonitorID}]]",
ck: "[[${theme.config.about.LingQueMonitorID}]]",
hashMode: true
});
</script>
<script >

View File

@ -39,7 +39,7 @@
th:href="@{${post.status.permalink}}"
th:text="${post.spec.title}">
</a>
<div class="content" th:text="${post.status.excerpt}"></div>
<!-- <div class="content" th:text="${post.status.excerpt}"></div> -->
</div>

View File

@ -0,0 +1,377 @@
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<!-- 文章ai摘要 -->
<script data-pjax th:fragment="postHeadAiDescription" th:if="${theme.config.aiDescription.enable}">
(function () {
let ai = "[[${post.status.excerpt}]]"
let randomNum = [[${theme.config.aiDescription.randomNum}]] //按钮最大的随机次数,也就是一篇文章最大随机出来几种
let basicWordCount = [[${theme.config.aiDescription.basicWordCount}]] // 最低获取字符数, 最小1000, 最大1999
let btnLink = "[[${theme.config.aiDescription.btnLink}]]"
let gptName = "[[${theme.config.aiDescription.gptName}]]"
let modeName = "[[${theme.config.aiDescription.modeName}]]" //默认模式 可选值: tianli/local
let switchBtn = [[${theme.config.aiDescription.switchBtn}]] //# 可以配置是否显示切换按钮 以切换tianli/local
let keys = "[[${theme.config.aiDescription.key}]]"
let Referers = "[[${theme.config.aiDescription.Referer}]]"
// 当前随机到的ai摘要到index
let lastAiRandomIndex = -1;
let animationRunning = true; // 标志变量,控制动画函数的运行
// 当前gpt模式
let mode = modeName
// 刷新点击次数
let refreshNum = 0
// 记录上一次传递给aiAbstract的参数
let prevParam;
const aiTitleRefreshIcon = document.querySelector(".ai-title .anzhiyufont.anzhiyu-icon-arrow-rotate-right")
const explanation = document.querySelector(".ai-explanation");
const post_ai = document.querySelector(".post-ai");
let ai_str = "";
let ai_str_length = "";
let delay_init = 600;
let i = 0;
let j = 0;
let sto = [];
let elapsed = 0;
const animate = timestamp => {
if (!animationRunning) {
return; // 动画函数停止运行
}
if (!animate.start) animate.start = timestamp;
elapsed = timestamp - animate.start;
if (elapsed >= 20) {
animate.start = timestamp;
if (i < ai_str_length - 1) {
let char = ai_str.charAt(i + 1);
let delay = /[,.,。!?]/.test(char) ? 150 : 20;
if (explanation.firstElementChild) {
explanation.removeChild(explanation.firstElementChild);
}
explanation.innerHTML += char;
let div = document.createElement("div");
div.className = "ai-cursor";
explanation.appendChild(div);
i++;
if (delay === 150) {
document.querySelector(".ai-explanation .ai-cursor").style.opacity = "0";
}
if (i === ai_str_length - 1) {
observer.disconnect(); // 暂停监听
explanation.removeChild(explanation.firstElementChild);
}
sto[0] = setTimeout(() => {
requestAnimationFrame(animate);
}, delay);
}
} else {
requestAnimationFrame(animate);
}
};
const observer = new IntersectionObserver(
entries => {
let isVisible = entries[0].isIntersecting;
animationRunning = isVisible; // 标志变量更新
if (animationRunning) {
delay_init = i === 0 ? 200 : 20;
sto[1] = setTimeout(() => {
if (j) {
i = 0;
j = 0;
}
if (i === 0) {
explanation.innerHTML = ai_str.charAt(0);
}
requestAnimationFrame(animate);
}, delay_init);
}
},
{ threshold: 0 }
);
function clearSTO() {
if (sto.length) {
sto.forEach(item => {
if (item) {
clearTimeout(item);
}
});
}
}
function startAI(str, df = true) {
i = 0; //重置计数器
j = 1;
clearSTO();
animationRunning = false;
elapsed = 0;
observer.disconnect(); // 暂停上一次监听
explanation.innerHTML = df ? "生成中. . ." : "请等待. . .";
ai_str = str;
ai_str_length = ai_str.length;
observer.observe(post_ai); //启动新监听
}
async function aiAbstract(num = basicWordCount) {
i = 0; //重置计数器
j = 1;
clearSTO();
animationRunning = false;
elapsed = 0;
observer.disconnect(); // 暂停上一次监听
if (mode === "tianli") {
num = Math.max(10, Math.min(2000, num));
const options = {
key: keys,
Referer: Referers
};
const truncateDescription = getTitleAndContent(num);
const queryParams = `key=${options.key}&content=${truncateDescription}`;
const requestOptions = {
method: "GET",
headers: {
"Content-Type": "application/json",
Referer: options.Referer
},
};
try {
let animationInterval = null
if (animationInterval) clearInterval(animationInterval);
animationInterval = setInterval(() => {
const animationText = "生成中" + ".".repeat(j);
explanation.innerHTML = animationText;
j = (j % 3) + 1; // 在 1、2、3 之间循环
}, 500);
const response = await fetch(`https://summary.tianli0.top/?${queryParams}`, requestOptions);
const result = await response.json();
const summary = result.summary.trim();
setTimeout(() => {
aiTitleRefreshIcon.style.opacity = "1";
}, 300)
startAI(summary);
clearInterval(animationInterval)
} catch (error) {
console.error(error);
}
} else {
const strArr = ai.split(",").map(item => item.trim()); // 将字符串转换为数组,去除每个字符串前后的空格
if (strArr.length !== 1) {
let randomIndex = Math.floor(Math.random() * strArr.length); // 随机生成一个索引
while (randomIndex === lastAiRandomIndex) { // 如果随机到了上次的索引
randomIndex = Math.floor(Math.random() * strArr.length); // 再次随机
}
lastAiRandomIndex = randomIndex; // 更新上次随机到的索引
startAI(strArr[randomIndex]);
} else {
startAI(strArr[0])
}
setTimeout(() => {
aiTitleRefreshIcon.style.opacity = "1";
}, 600)
}
}
function aiRecommend() {
i = 0; //重置计数器
j = 1;
clearSTO();
animationRunning = false;
elapsed = 0;
explanation.innerHTML = "生成中. . .";
ai_str = "";
ai_str_length = "";
observer.disconnect(); // 暂停上一次监听
sto[2] = setTimeout(() => {
explanation.innerHTML = recommendList();
}, 600);
}
function aiGoHome() {
startAI("正在前往博客主页...", false);
sto[2] = setTimeout(() => {
pjax.loadUrl("/");
}, 1000);
}
const ai_btn_item = document.querySelectorAll(".ai-btn-item");
function Introduce() {
if (mode == "tianli") {
startAI("我是文章辅助AI: TianliGPT点击下方的按钮让我生成本文简介、推荐相关文章等。")
} else {
startAI("我是文章辅助AI: " + gptName + " GPT点击下方的按钮让我生成本文简介、推荐相关文章等。")
}
}
function aiTitleRefreshIconClick() {
aiTitleRefreshIcon.click()
}
const aiFunctions = [Introduce, aiTitleRefreshIconClick, aiRecommend, aiGoHome];
ai_btn_item.forEach((item, index) => {
item.addEventListener("click", () => {
aiFunctions[index]();
});
});
function recommendList() {
let thumbnail = document.querySelectorAll('.relatedPosts-list a');
if (!thumbnail.length) {
const cardRecentPost = document.querySelector('.card-widget.card-recent-post');
if (!cardRecentPost) return '';
thumbnail = cardRecentPost.querySelectorAll('.aside-list-item a');
let list = '';
for (let i = 0; i < thumbnail.length; i++) {
const item = thumbnail[i];
list += `<div class="ai-recommend-item"><span class="index">${i + 1}</span><a href="javascript:;" onclick="pjax.loadUrl('${item.href}')" title="${item.title}" data-pjax-state="">${item.title}</a></div>`;
}
return `很抱歉,无法找到类似的文章,你也可以看看本站最新发布的文章:<br /><div class="ai-recommend">${list}</div>`;
}
let list = '';
for (let i = 0; i < thumbnail.length; i++) {
const item = thumbnail[i];
list += `<div class="ai-recommend-item"><span>推荐${i + 1}</span><a href="javascript:;" onclick="pjax.loadUrl('${item.href}')" title="${item.title}" data-pjax-state="">${item.title}</a></div>`;
}
return `推荐文章:<br /><div class="ai-recommend">${list}</div>`;
}
function changeShowMode() {
if (mode === "tianli") {
mode = "local";
document.getElementById("ai-tag").innerHTML = gptName + " GPT";
aiAbstract(basicWordCount);
} else {
mode = "tianli";
document.getElementById("ai-tag").innerHTML = "Tianli GPT";
const truncateDescription = getTitleAndContent(basicWordCount);
let value = Math.floor(Math.random() * randomNum) + basicWordCount;
while (value === prevParam || truncateDescription.length - value === prevParam) {
value = Math.floor(Math.random() * randomNum) + basicWordCount;
}
aiTitleRefreshIcon.style.opacity = "0.2";
aiTitleRefreshIcon.style.transitionDuration = "0.3s";
aiTitleRefreshIcon.style.transform = "rotate(" + 360 * refreshNum + "deg)";
if (truncateDescription.length <= 1000) {
let param = truncateDescription.length - Math.floor(Math.random() * randomNum);
while (param === prevParam) {
param = truncateDescription.length - Math.floor(Math.random() * randomNum);
}
aiAbstract(param);
prevParam = param;
} else {
aiAbstract(value);
prevParam = value;
}
refreshNum++;
}
}
//- 监听tag点击事件
document.getElementById("ai-tag").addEventListener("click", () => {
if (mode === "tianli") {
document.querySelectorAll(".ai-btn-item").forEach(item => item.style.display = "none");
document.getElementById("go-tianli-blog").style.display = "block";
startAI("你好我是Tianli开发的摘要生成助理TianliGPT是一个基于GPT-4的生成式AI。我在这里只负责摘要的预生成和显示你无法与我直接沟通如果你也需要一个这样的AI摘要接口可以在下方购买。暂未开放购买敬请期待")
} else {
document.getElementById("go-tianli-blog").style.display = "none";
startAI("你好,我是本站摘要生成助理" + gptName + " GPT是一个基于GPT-4的生成式AI。我在这里只负责摘要的预生成和显示你无法与我直接沟通。")
}
});
aiTitleRefreshIcon.addEventListener("click", () => {
const truncateDescription = getTitleAndContent(basicWordCount);
let value = Math.floor(Math.random() * randomNum) + basicWordCount;
while (value === prevParam || truncateDescription.length - value === prevParam) {
value = Math.floor(Math.random() * randomNum) + basicWordCount;
}
aiTitleRefreshIcon.style.opacity = "0.2";
aiTitleRefreshIcon.style.transitionDuration = "0.3s";
aiTitleRefreshIcon.style.transform = "rotate(" + 360 * refreshNum + "deg)";
if (truncateDescription.length <= 1000) {
let param = truncateDescription.length - Math.floor(Math.random() * randomNum);
while (param === prevParam) {
param = truncateDescription.length - Math.floor(Math.random() * randomNum);
}
aiAbstract(param);
prevParam = param;
} else {
aiAbstract(value);
prevParam = value;
}
showAiBtn();
refreshNum++;
});
document.getElementById("go-tianli-blog").addEventListener("click", () => {
window.open(btnLink, "_blank");
});
if (switchBtn) {
document.getElementById("ai-Toggle").addEventListener("click", () => {
changeShowMode()
});
}
function showAiBtn() {
document.querySelectorAll(".ai-btn-item").forEach(item => {
if (item.id !== "go-tianli-blog") {
item.style.display = "block";
}
if (item.id === "go-tianli-blog") {
item.style.display = "none";
}
});
}
//读取文章中的所有文本
function getTitleAndContent(basicWordCount) {
try {
const title = document.title;
const container = document.querySelector('#post #article-container');
if (!container) {
console.warn('TianliGPT找不到文章容器。请尝试将引入的代码放入到文章容器之后。如果本身没有打算使用摘要功能可以忽略此提示。');
return '';
}
const paragraphs = container.getElementsByTagName('p');
const headings = container.querySelectorAll('h1, h2, h3, h4, h5');
let content = '';
for (let h of headings) {
content += h.innerText + ' ';
}
for (let p of paragraphs) {
// 移除包含'http'的链接
const filteredText = p.innerText.replace(/https?:\/\/[^\s]+/g, '');
content += filteredText;
}
const combinedText = title + ' ' + content;
let wordLimit = 1000;
if (basicWordCount !== "undefined") {
wordLimit = basicWordCount;
}
const truncatedText = combinedText.slice(0, wordLimit);
return truncatedText;
} catch (e) {
console.error('TianliGPT错误可能由于一个或多个错误导致没有正常运行原因出在获取文章容器中的内容失败或者可能是在文章转换过程中失败。', e);
return '';
}
}
aiAbstract();
showAiBtn()
})()
</script>
</html>

View File

@ -3,84 +3,97 @@
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<!-- TODO 控制台功能 -->
<div id="console" th:fragment="console">
<div class="close-btn" href="javascript:void(0);" onclick="heo.hideConsole()">
<i class="anzhiyufont anzhiyu-icon-circle-xmark" style="font-size:35px"></i>
<div class="close-btn" href="javascript:void(0);" onclick="heo.hideConsole()">
<i class="anzhiyufont anzhiyu-icon-circle-xmark" style="font-size:35px"></i>
</div>
<div class="console-card-group">
<!-- 评论,需要使用评论插件,获取最近评论 -->
<div class="console-card-group-left">
<div class="console-card" id="card-newest-comments" onclick="heo.hideConsole()">
<div class="card-content">
<div class="author-content-item-tips">互动</div>
<span class="author-content-item-title">最近评论</span>
</div>
<div class="aside-list"><span>正在加载中...</span></div>
</div>
</div>
<div class="console-card-group">
<!-- 评论,需要使用评论插件,获取最近评论 -->
<div class="console-card-group-left">
<div class="console-card" id="card-newest-comments" onclick="heo.hideConsole()">
<div class="card-content">
<div class="author-content-item-tips">互动</div>
<span class="author-content-item-title">最近评论</span>
</div>
<div class="aside-list"><span>正在加载中...</span></div>
</div>
<!-- 右侧展示 tag -->
<div class="console-card-group-right">
<div class="console-card tags" onclick="heo.hideConsole()">
<div class="card-content">
<div class="author-content-item-tips">标签</div>
<span class="author-content-item-title">寻找感兴趣的领域</span>
</div>
<!-- 右侧展示 tag -->
<div class="console-card-group-right">
<div class="console-card tags" onclick="heo.hideConsole()">
<div class="card-content">
<div class="author-content-item-tips">标签</div>
<span class="author-content-item-title">寻找感兴趣的领域</span>
</div>
<div class="card-tag-cloud" th:with="tags = ${tagFinder.listAll()}">
<a style="font-size:1em;color:#d3d3d3" th:each="tag : ${tags}" th:href="@{${tag.status.permalink}}">
[[${tag.spec.displayName}]]<sup th:text="${tag.status.visiblePostCount}"></sup>
</a>
</div>
</div>
<!-- 底部展示时间归档 -->
<div class="console-card history" onclick="heo.hideConsole()">
<div class="item-headline"><i class="fas fa-archive"></i><span>文章</span></div>
<ul class="card-archive-list" th:with="archives = ${postFinder.archives(1,1000)}">
<th:block th:each="archive : ${archives.items}">
<li class="card-archive-list-item" th:each="month,monthStat : ${archive.months}">
<a class="card-archive-list-link"
th:href="@{'/archives/'+${archive.year}+'/'+${month.month}}"
data-pjax-state="load"><span
class="card-archive-list-date">[[${archive.year}]]-[[${month.month}]]</span>
<div class="card-archive-list-count-group"><span
class="card-archive-list-count">[[${month.posts.size()}]]</span>
<span class="card-archive-list-count-unit"></span>
</div>
</a>
</li>
</th:block>
</ul>
</div>
<div class="card-tag-cloud" th:with="tags = ${tagFinder.listAll()}">
<a style="font-size:1em;color:#d3d3d3" th:each="tag : ${tags}" th:href="@{${tag.status.permalink}}">
[[${tag.spec.displayName}]]<sup th:text="${tag.status.visiblePostCount}"></sup>
</a>
</div>
</div>
<!-- 底部展示时间归档 -->
<div class="console-card history" onclick="heo.hideConsole()">
<div class="item-headline"><i class="fas fa-archive"></i><span>文章</span></div>
<ul class="card-archive-list" th:with="archives = ${postFinder.archives(1,1000)}">
<th:block th:each="archive : ${archives.items}">
<li class="card-archive-list-item" th:each="month,monthStat : ${archive.months}">
<a class="card-archive-list-link" th:href="@{'/archives/'+${archive.year}+'/'+${month.month}}"
data-pjax-state="load"><span
class="card-archive-list-date">[[${archive.year}]]-[[${month.month}]]</span>
<div class="card-archive-list-count-group"><span
class="card-archive-list-count">[[${month.posts.size()}]]</span>
<span class="card-archive-list-count-unit"></span>
</div>
</a>
</li>
</th:block>
</ul>
</div>
</div>
<div class="button-group">
<div class="console-btn-item">
<!-- 用到了 rightmenu.js 的功能,还需要调整 -->
<a class="darkmode_switchbutton" href="javascript:void(0);" onclick="rm.switchDarkMode()"
rel="external nofollow"
title="显示模式切换"><i class="iconfont icon-moon" style="font-size:1rem"></i>
</a>
</div>
<div class="console-btn-item" id="consoleHideAside" onclick="heo.hideAsideBtn()" title="边栏显示控制"><a
class="asideSwitch" data-pjax-state=""><i class="anzhiyufont anzhiyu-icon-arrows-left-right"></i></a>
</div>
<div class="console-btn-item on" id="consoleCommentBarrage" onclick="heo.switchCommentBarrage()"
title="热评开关"><a
class="commentBarrage" data-pjax-state=""><i class="anzhiyufont anzhiyu-icon-message"></i></a></div>
</div>
<!--<div class="console-btn-item" id="consoleKeyboard" onclick="heo.keyboardToggle()" title="快捷键开关"><a-->
<!-- class="keyboard-switch"><i class="fa-duotone fa-keyboard"></i></a>-->
<!--</div>-->
<!--<div class="console-btn-item" id="assist-open" onclick="heo.hideConsole()" title="无障碍工具栏"><a-->
<!-- class="assist-btn"><i class="fa-duotone fa-wheelchair"></i></a>-->
<!--</div>-->
<!--<div class="console-btn-item" id="consoleMusic" onclick="heo.musicToggle()" title="音乐开关"><a-->
<!-- class="music-switch"><i class="fa-duotone fa-music"></i></a>-->
<!--</div>-->
</div>
<div class="console-mask" href="javascript:void(0);" onclick="heo.hideConsole()" rel="external nofollow">
<div class="console-card-group-reward" th:if="${theme.config.aboutReward.reward.enable_reward}">
<ul class="reward-all console-card">
<li class="reward-item"><a th:href="@{${theme.config.aboutReward.reward.wxPay}}"
rel="external nofollow noreferrer" target="_blank" draggable="false"><img
class=" entered loaded" alt="微信"
th:src="${theme.config.aboutReward.reward.wxPay}"></a>
<div class="post-qr-code-desc">微信</div>
</li>
<li class="reward-item"><a th:href="@{${theme.config.aboutReward.reward.alipay}}"
rel="external nofollow noreferrer" target="_blank" draggable="false"><img
class=" entered loaded" alt="支付宝"
th:src="${theme.config.aboutReward.reward.alipay}"></a>
<div class="post-qr-code-desc">支付宝</div>
</li>
</ul>
</div>
<div class="button-group">
<div class="console-btn-item">
<!-- 用到了 rightmenu.js 的功能,还需要调整 -->
<a class="darkmode_switchbutton" href="javascript:void(0);" onclick="rm.switchDarkMode()" rel="external nofollow"
title="显示模式切换"><i class="iconfont icon-moon" style="font-size:1rem"></i>
</a>
</div>
<div class="console-btn-item" id="consoleHideAside" onclick="heo.hideAsideBtn()" title="边栏显示控制"><a
class="asideSwitch" data-pjax-state=""><i class="anzhiyufont anzhiyu-icon-arrows-left-right"></i></a></div>
<div class="console-btn-item on" id="consoleCommentBarrage" onclick="heo.switchCommentBarrage()" title="热评开关"><a
class="commentBarrage" data-pjax-state=""><i class="anzhiyufont anzhiyu-icon-message"></i></a></div>
<!-- 最近评论 -->
<script th:replace="~{modules/widgets/cardNewestComments :: cardNewestComments}"></script>
<!--<div class="console-btn-item" id="consoleKeyboard" onclick="heo.keyboardToggle()" title="快捷键开关"><a-->
<!-- class="keyboard-switch"><i class="fa-duotone fa-keyboard"></i></a>-->
<!--</div>-->
<!--<div class="console-btn-item" id="assist-open" onclick="heo.hideConsole()" title="无障碍工具栏"><a-->
<!-- class="assist-btn"><i class="fa-duotone fa-wheelchair"></i></a>-->
<!--</div>-->
<!--<div class="console-btn-item" id="consoleMusic" onclick="heo.musicToggle()" title="音乐开关"><a-->
<!-- class="music-switch"><i class="fa-duotone fa-music"></i></a>-->
<!--</div>-->
</div>
<div class="console-mask" href="javascript:void(0);" onclick="heo.hideConsole()" rel="external nofollow">
</div>
<!-- 最近评论 -->
<script th:replace="~{modules/widgets/cardNewestComments :: cardNewestComments}"></script>
</div>
</html>

View File

@ -97,18 +97,15 @@
<main class="layout" id="content-inner" th:classappend="${theme.config.sidebar.location}">
<div id="post">
<!-- <link rel="stylesheet" href="https://cdn1.tianli0.top/gh/zhheo/Post-Abstract-AI@0.7/tianli_gpt.css">
<script>
let tianliGPT_postSelector = '#post #article-container';
let tianliGPT_key = 'QokJo3m2LZ53uAqICeLO';
</script>
<script src="https://blog.zhheo.com/js/heo_gpt.js"></script> -->
<!-- <div class="post-ai">
<!-- 文章ai摘要 -->
<div class="post-ai" th:if="${theme.config.aiDescription.enable}">
<div class="ai-title"><i class="anzhiyufont anzhiyu-icon-bilibili"></i>
<div class="ai-title-text">AI-摘要</div><i
class="anzhiyufont anzhiyu-icon-arrow-rotate-right"></i>
<div class="ai-tag" id="ai-tag">Tianli GPT</div>
<div class="ai-title-text">AI-摘要</div>
<div th:if="${theme.config.aiDescription.switchBtn}" id="ai-Toggle">切换</div>
<i class="anzhiyufont anzhiyu-icon-arrow-rotate-right"></i>
<div class="ai-tag" id="ai-tag">[[${theme.config.aiDescription.gptName}]] GPT</div>
</div>
<div class="ai-explanation" style="display: block;">AI初始化中...</div>
<div class="ai-btn-box">
@ -118,334 +115,22 @@
<div class="ai-btn-item">前往主页</div>
<div class="ai-btn-item" id="go-tianli-blog">前往tianli博客</div>
</div>
<script data-pjax>(function () {
// 当前随机到的ai摘要到index
let lastAiRandomIndex = -1;
let animationRunning = true; // 标志变量,控制动画函数的运行
// 当前gpt模式
let mode = "tianli"
// 刷新点击次数
let refreshNum = 0
// 记录上一次传递给aiAbstract的参数
let prevParam;
const aiTitleRefreshIcon = document.querySelector(".ai-title .anzhiyufont.anzhiyu-icon-arrow-rotate-right")
const explanation = document.querySelector(".ai-explanation");
const post_ai = document.querySelector(".post-ai");
let ai_str = "";
let ai_str_length = "";
let delay_init = 600;
let i = 0;
let j = 0;
let sto = [];
let elapsed = 0;
const animate = timestamp => {
if (!animationRunning) {
return; // 动画函数停止运行
}
if (!animate.start) animate.start = timestamp;
elapsed = timestamp - animate.start;
if (elapsed >= 20) {
animate.start = timestamp;
if (i < ai_str_length - 1) {
let char = ai_str.charAt(i + 1);
let delay = /[,.,。!?]/.test(char) ? 150 : 20;
if (explanation.firstElementChild) {
explanation.removeChild(explanation.firstElementChild);
}
explanation.innerHTML += char;
let div = document.createElement("div");
div.className = "ai-cursor";
explanation.appendChild(div);
i++;
if (delay === 150) {
document.querySelector(".ai-explanation .ai-cursor").style.opacity = "0";
}
if (i === ai_str_length - 1) {
observer.disconnect(); // 暂停监听
explanation.removeChild(explanation.firstElementChild);
}
sto[0] = setTimeout(() => {
requestAnimationFrame(animate);
}, delay);
}
} else {
requestAnimationFrame(animate);
}
};
const observer = new IntersectionObserver(
entries => {
let isVisible = entries[0].isIntersecting;
animationRunning = isVisible; // 标志变量更新
if (animationRunning) {
delay_init = i === 0 ? 200 : 20;
sto[1] = setTimeout(() => {
if (j) {
i = 0;
j = 0;
}
if (i === 0) {
explanation.innerHTML = ai_str.charAt(0);
}
requestAnimationFrame(animate);
}, delay_init);
}
},
{ threshold: 0 }
);
function clearSTO() {
if (sto.length) {
sto.forEach(item => {
if (item) {
clearTimeout(item);
}
});
}
}
function startAI(str, df = true) {
i = 0; //重置计数器
j = 1;
clearSTO();
animationRunning = false;
elapsed = 0;
observer.disconnect(); // 暂停上一次监听
explanation.innerHTML = df ? "生成中. . ." : "请等待. . .";
ai_str = str;
ai_str_length = ai_str.length;
observer.observe(post_ai); //启动新监听
}
</div>
async function aiAbstract(num = 1000) {
i = 0; //重置计数器
j = 1;
clearSTO();
animationRunning = false;
elapsed = 0;
observer.disconnect(); // 暂停上一次监听
if (mode === "tianli") {
num = Math.max(10, Math.min(2000, num));
const options = {
key: "QokJo3m2LZ53uAqICeLO",
Referer: "https://0206.ink/"
};
const truncateDescription = ("Docker Swarm常用命令" + "查看集群节点, Token相关, 创建nginx服务, 查看swarm集群中的服务, kill其中一个容器, 修改服务实例数量为3, 删除nginx服务, 删除swarm节点, docker swarm 常用命令, docker node 常用命令, docker service 常用命令查看集群节点相关查看加入的命令查看加入的命令重置的仅打印创建服务下载私有仓库镜像创建个容器为私有仓库查看集群中的服务其中一个容器等会自动启动一个新的容器修改服务实例数量为删除服务删除节点常用命令初始化集群查看工作节点的查看管理节点的加入集群中常用命令查看所有集群节点删除某个节点强制删除查看节点详情节点降级由管理节点降级为工作节点节点升级由工作节点升级为管理节点更新节点查看节点中的任务常用命令部署服务查看服务详情产看某个服务日志查看所有服务详情删除某个服务强制删除设置某个服务个数更新某个服务").trim().substring(0, num)
const queryParams = `key=${options.key}&content=${truncateDescription}`;
const requestOptions = {
method: "GET",
headers: {
"Content-Type": "application/json",
Referer: options.Referer
},
};
try {
let animationInterval = null
if (animationInterval) clearInterval(animationInterval);
animationInterval = setInterval(() => {
const animationText = "生成中" + ".".repeat(j);
explanation.innerHTML = animationText;
j = (j % 3) + 1; // 在 1、2、3 之间循环
}, 500);
const response = await fetch(`https://summary.tianli0.top/?${queryParams}`, requestOptions);
console.log(response)
const result = await response.json();
const summary = result.summary.trim();
setTimeout(() => {
aiTitleRefreshIcon.style.opacity = "1";
}, 300)
startAI(summary);
clearInterval(animationInterval)
} catch (error) {
console.error(error);
}
} else {
const strArr = "true".split(",").map(item => item.trim()); // 将字符串转换为数组,去除每个字符串前后的空格
if (strArr.length !== 1) {
let randomIndex = Math.floor(Math.random() * strArr.length); // 随机生成一个索引
while (randomIndex === lastAiRandomIndex) { // 如果随机到了上次的索引
randomIndex = Math.floor(Math.random() * strArr.length); // 再次随机
}
lastAiRandomIndex = randomIndex; // 更新上次随机到的索引
startAI(strArr[randomIndex]);
} else {
startAI(strArr[0])
}
setTimeout(() => {
aiTitleRefreshIcon.style.opacity = "1";
}, 600)
}
}
function aiRecommend() {
i = 0; //重置计数器
j = 1;
clearSTO();
animationRunning = false;
elapsed = 0;
explanation.innerHTML = "生成中. . .";
ai_str = "";
ai_str_length = "";
observer.disconnect(); // 暂停上一次监听
sto[2] = setTimeout(() => {
explanation.innerHTML = recommendList();
}, 600);
}
function aiGoHome() {
startAI("正在前往博客主页...", false);
sto[2] = setTimeout(() => {
pjax.loadUrl("/");
}, 1000);
}
const ai_btn_item = document.querySelectorAll(".ai-btn-item");
function Introduce() {
if (mode == "tianli") {
startAI("我是文章辅助AI: TianliGPT点击下方的按钮让我生成本文简介、推荐相关文章等。")
} else {
startAI("我是文章辅助AI: KunKunYu GPT点击下方的按钮让我生成本文简介、推荐相关文章等。")
}
}
function aiTitleRefreshIconClick() {
aiTitleRefreshIcon.click()
}
const aiFunctions = [Introduce, aiTitleRefreshIconClick, aiRecommend, aiGoHome];
ai_btn_item.forEach((item, index) => {
item.addEventListener("click", () => {
aiFunctions[index]();
});
});
function recommendList() {
let thumbnail = document.querySelectorAll('.relatedPosts-list a');
if (!thumbnail.length) {
const cardRecentPost = document.querySelector('.card-widget.card-recent-post');
if (!cardRecentPost) return '';
thumbnail = cardRecentPost.querySelectorAll('.aside-list-item a');
let list = '';
for (let i = 0; i < thumbnail.length; i++) {
const item = thumbnail[i];
list += `<div class="ai-recommend-item"><span class="index">${i + 1}</span><a href="javascript:;" onclick="pjax.loadUrl('${item.href}')" title="${item.title}" data-pjax-state="">${item.title}</a></div>`;
}
return `很抱歉,无法找到类似的文章,你也可以看看本站最新发布的文章:<br /><div class="ai-recommend">${list}</div>`;
}
let list = '';
for (let i = 0; i < thumbnail.length; i++) {
const item = thumbnail[i];
list += `<div class="ai-recommend-item"><span>推荐${i + 1}</span><a href="javascript:;" onclick="pjax.loadUrl('${item.href}')" title="${item.title}" data-pjax-state="">${item.title}</a></div>`;
}
return `推荐文章:<br /><div class="ai-recommend">${list}</div>`;
}
function changeShowMode() {
if (mode === "tianli") {
mode = "local";
document.getElementById("ai-tag").innerHTML = "KunKunYu GPT";
aiAbstract(1000);
} else {
mode = "tianli";
document.getElementById("ai-tag").innerHTML = "Tianli GPT";
const truncateDescription = ("" + "查看集群节点, Token相关, 创建nginx服务, 查看swarm集群中的服务, kill其中一个容器, 修改服务实例数量为3, 删除nginx服务, 删除swarm节点, docker swarm 常用命令, docker node 常用命令, docker service 常用命令查看集群节点相关查看加入的命令查看加入的命令重置的仅打印创建服务下载私有仓库镜像创建个容器为私有仓库查看集群中的服务其中一个容器等会自动启动一个新的容器修改服务实例数量为删除服务删除节点常用命令初始化集群查看工作节点的查看管理节点的加入集群中常用命令查看所有集群节点删除某个节点强制删除查看节点详情节点降级由管理节点降级为工作节点节点升级由工作节点升级为管理节点更新节点查看节点中的任务常用命令部署服务查看服务详情产看某个服务日志查看所有服务详情删除某个服务强制删除设置某个服务个数更新某个服务").trim().substring(0, 1000);
let value = Math.floor(Math.random() * 3) + 1000;
while (value === prevParam || truncateDescription.length - value === prevParam) {
value = Math.floor(Math.random() * 3) + 1000;
}
aiTitleRefreshIcon.style.opacity = "0.2";
aiTitleRefreshIcon.style.transitionDuration = "0.3s";
aiTitleRefreshIcon.style.transform = "rotate(" + 360 * refreshNum + "deg)";
if (truncateDescription.length <= 1000) {
let param = truncateDescription.length - Math.floor(Math.random() * 3);
while (param === prevParam) {
param = truncateDescription.length - Math.floor(Math.random() * 3);
}
aiAbstract(param);
prevParam = param;
} else {
aiAbstract(value);
prevParam = value;
}
refreshNum++;
}
}
//- 监听tag点击事件
document.getElementById("ai-tag").addEventListener("click", () => {
if (mode === "tianli") {
document.querySelectorAll(".ai-btn-item").forEach(item => item.style.display = "none");
document.getElementById("go-tianli-blog").style.display = "block";
startAI("你好我是Tianli开发的摘要生成助理TianliGPT是一个基于GPT-4的生成式AI。我在这里只负责摘要的预生成和显示你无法与我直接沟通如果你也需要一个这样的AI摘要接口可以在下方购买。暂未开放购买敬请期待")
} else {
document.getElementById("go-tianli-blog").style.display = "none";
startAI("你好我是本站摘要生成助理KunKunYu GPT是一个基于GPT-4的生成式AI。我在这里只负责摘要的预生成和显示你无法与我直接沟通。")
}
});
aiTitleRefreshIcon.addEventListener("click", () => {
const truncateDescription = ("" + "查看集群节点, Token相关, 创建nginx服务, 查看swarm集群中的服务, kill其中一个容器, 修改服务实例数量为3, 删除nginx服务, 删除swarm节点, docker swarm 常用命令, docker node 常用命令, docker service 常用命令查看集群节点相关查看加入的命令查看加入的命令重置的仅打印创建服务下载私有仓库镜像创建个容器为私有仓库查看集群中的服务其中一个容器等会自动启动一个新的容器修改服务实例数量为删除服务删除节点常用命令初始化集群查看工作节点的查看管理节点的加入集群中常用命令查看所有集群节点删除某个节点强制删除查看节点详情节点降级由管理节点降级为工作节点节点升级由工作节点升级为管理节点更新节点查看节点中的任务常用命令部署服务查看服务详情产看某个服务日志查看所有服务详情删除某个服务强制删除设置某个服务个数更新某个服务").trim().substring(0, 1000);
let value = Math.floor(Math.random() * 3) + 1000;
while (value === prevParam || truncateDescription.length - value === prevParam) {
value = Math.floor(Math.random() * 3) + 1000;
}
aiTitleRefreshIcon.style.opacity = "0.2";
aiTitleRefreshIcon.style.transitionDuration = "0.3s";
aiTitleRefreshIcon.style.transform = "rotate(" + 360 * refreshNum + "deg)";
if (truncateDescription.length <= 1000) {
let param = truncateDescription.length - Math.floor(Math.random() * 3);
while (param === prevParam) {
param = truncateDescription.length - Math.floor(Math.random() * 3);
}
aiAbstract(param);
prevParam = param;
} else {
aiAbstract(value);
prevParam = value;
}
showAiBtn();
refreshNum++;
});
document.getElementById("go-tianli-blog").addEventListener("click", () => {
window.open("https://afdian.net/item/886a79d4db6711eda42a52540025c377", "_blank");
});
if (false) {
document.getElementById("ai-Toggle").addEventListener("click", () => {
changeShowMode()
});
}
function showAiBtn() {
document.querySelectorAll(".ai-btn-item").forEach(item => {
if (item.id !== "go-tianli-blog") {
item.style.display = "block";
}
if (item.id === "go-tianli-blog") {
item.style.display = "none";
}
});
}
aiAbstract();
showAiBtn()
})()</script>
</div> -->
<!-- 文章内容 -->
<article class="post-content line-numbers" id="article-container" th:utext="${post.content.content}">
</article>
<!-- 文章ai摘要 -->
<script th:replace="~{modules/postHeadAiDescription :: postHeadAiDescription}"></script>
<div class="post-tools" id="post-tools">
<div class="post-tools-left">
<!-- 打赏 -->
<div th:if="${theme.config.post.reward.enable_reward && (not #strings.isEmpty(theme.config.post.reward.wxPay) || not #strings.isEmpty(theme.config.post.reward.alipay))}"
<div th:if="${theme.config.aboutReward.reward.enable_reward_wz}"
class="post-reward" onclick="AddRewardMask()">
<div class="reward-button button&#45;&#45;animated" title="赞赏作者"><i
class="fas fa-hamburger"></i>
@ -454,19 +139,19 @@
<div class="reward-main">
<ul class="reward-all"><span class="reward-title">感谢你赐予我前进的力量</span>
<ul class="reward-group">
<li class="reward-item"><a th:href="@{${theme.config.post.reward.wxPay}}"
<li class="reward-item"><a th:href="@{${theme.config.aboutReward.reward.wxPay}}"
target="_blank">
<img alt="微信" class="post-qr-code-img"
th:src="${theme.config.post.reward.wxPay}"></a>
th:src="${theme.config.aboutReward.reward.wxPay}"></a>
<div class="post-qr-code-desc">微信</div>
</li>
<li class="reward-item"><a th:href="@{${theme.config.post.reward.alipay}}"
target="_blank"><img alt="支付宝" class="post-qr-code-img"
th:src="${theme.config.post.reward.alipay}"></a>
</li>
<li class="reward-item"><a th:href="@{${theme.config.aboutReward.reward.alipay}}"
target="_blank"><img alt="支付宝" class="post-qr-code-img"
th:src="${theme.config.aboutReward.reward.alipay}"></a>
<div class="post-qr-code-desc">支付宝</div>
</li>
</ul>
<a class="reward-main-btn" th:href="@{${theme.config.post.reward.reward_md_url}}"
<a class="reward-main-btn" th:href="@{${theme.config.aboutReward.reward.reward_md_url}}"
target="_blank">
<div class="reward-text">赞赏者名单</div>
<div class="reward-dec">因为你们的支持让我意识到写文章的价值🙏</div>