app/docs/README.md
2024-08-17 02:24:25 +08:00

123 lines
4.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
home: true
icon: home
title: 首页
heroImage: https://cdn.liteyuki.icu/static/svg/lylogo-full.svg
heroImageDark: https://cdn.liteyuki.icu/static/svg/lylogo-full-dark.svg
bgImage:
bgImageDark:
bgImageStyle:
background-attachment: fixed
heroText: LiteyukiBot
tagline: LiteyukiBot 轻雪机器人,综合性的机器人应用及管理框架
actions:
- text: 快速部署
icon: rocket
link: ./deployment/install.html
type: primary
- text: 使用手册
icon: book
link: ./usage/basic_command.html
highlights:
- header: 简洁至上
image: /assets/image/layout.svg
bgImage: https://theme-hope-assets.vuejs.press/bg/2-light.svg
bgImageDark: https://theme-hope-assets.vuejs.press/bg/2-dark.svg
bgImageStyle:
background-repeat: repeat
background-size: initial
features:
- title: 支持多种框架
icon: robot
details: 兼容nonebotmelobot等拥有良好的生态支持
link: https://nonebot.dev/
- title: 便捷管理
icon: plug
details: 使用包管理器,便捷管理插件及资源包
- title: 主题支持
icon: paint-brush
details: 使用资源包对外观进行完全自定义
link: https://bot.liteyuki.icu/usage/resource_pack.html
- title: 国际化
icon: globe
details: 通过资源包支持多种语言
link: https://baike.baidu.com/item/i18n/6771940
- title: 简易使用
icon: cog
details: 无需繁琐前期过程,开箱即用
link: https://bot.liteyuki.icu/deployment/config.html
- title: 超高性能
icon: tachometer-alt
details: 500个插件2s内启动
- title: 滚动更新
icon: cloud-download
details: 让你的机器人保持最新提交
- title: 开源项目
icon: code
details: 项目遵循MIT LICENCE开源欢迎各位的贡献
- header: 快速部署
image: /assets/image/box.svg
bgImage: https://theme-hope-assets.vuejs.press/bg/3-light.svg
bgImageDark: https://theme-hope-assets.vuejs.press/bg/3-dark.svg
highlights:
- title: 安装 Git 及 Python3.10+
- title: 使用 <code>git clone https://github.com/LiteyukiStudio/LiteyukiBot --depth=1</code> 以克隆项目至本地。
details: 如果无法连接到GitHub可以使用 <code>git clone https://gitee.com/snowykami/LiteyukiBot --depth=1</code>
- title: 使用 <code>cd LiteyukiBot</code> 切换到项目目录。
- title: 使用 <code>pip install -r requirements.txt</code> 安装项目依赖。
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>
// 定义全局变量来存储数据
let globalTotal = 0;
let globalOnline = 0;
// 从API获取数据并更新全局变量
function fetchAndUpdateData() {
Promise.all([
fetch("https://api.liteyuki.icu/count").then(res => res.json()),
fetch("https://api.liteyuki.icu/online").then(res => res.json())
])
.then(([countRes, onlineRes]) => {
globalTotal = countRes.register;
globalOnline = onlineRes.online;
})
.catch(err => {
console.error("Error fetching data:", err);
});
}
// 更新页面显示,使用全局变量中的数据
function updatePageDisplay() {
let countInfo = document.getElementById("count-info");
if (!countInfo) {
let info = `<div id="count-info" style="text-align: center; font-size: 20px; font-weight: 500">
全球实例:<span id="total">${globalTotal}</span>&nbsp;&nbsp;&nbsp;&nbsp;当前在线:<span id="online">${globalOnline}</span></div>`;
let mainDescription = document.querySelector("#main-description");
if (mainDescription) {
mainDescription.insertAdjacentHTML('afterend', info);
}
}
}
// 初始调用更新数据
fetchAndUpdateData();
updatePageDisplay();
// 设置定时器,分别以不同频率调用更新数据和更新页面的函数
setInterval(fetchAndUpdateData, 10000); // 每10秒更新一次数据
setInterval(updatePageDisplay, 1000); // 每1秒更新一次页面显示
</script>