1
0
forked from bot/app

📝 新增全球统计

This commit is contained in:
2024-08-01 12:23:56 +08:00
parent 6ba983fae3
commit 850dd75822
7 changed files with 88 additions and 5 deletions

View File

@ -9,7 +9,7 @@ bgImageDark:
bgImageStyle:
background-attachment: fixed
heroText: LiteyukiBot
tagline: LiteyukiBot 轻雪机器人基于NoneBot2构建的综合应用型聊天机器人
tagline: LiteyukiBot 轻雪机器人基于NoneBot2构建的综合应用型聊天机器人<br><h4>总实例:<span id="total">0</span>&nbsp;&nbsp;&nbsp;&nbsp;当前在线:<span id="online">0</span></h4>
actions:
- text: 快速部署
@ -79,4 +79,32 @@ highlights:
details: 如果你有多个 Python 环境,请使用 <code>pythonx -m pip install -r requirements.txt</code>
- title: 使用 <code>python main.py</code> 启动项目。
copyright: © 2021-2024 SnowyKami All Rights Reserved
---
<script>
function updatePageData() {
fetch("https://api.liteyuki.icu/count")
.then(res => res.json())
.then(data => {
let total = document.getElementById("total");
if(total !== null) {
total.innerText = data.register;
}
})
.catch(err => console.error(err));
fetch("https://api.liteyuki.icu/online")
.then(res => res.json())
.then(data => {
let online = document.getElementById("online");
if(online !== null) {
online.innerText = data.online;
}
})
.catch(err => console.error(err));
}
updatePageData();
setInterval(updatePageData, 1000);
</script>