⚡ 使用webp背景图压缩资源包大小
This commit is contained in:
21
liteyuki/plugins/liteyuki_webdash/__init__.py
Normal file
21
liteyuki/plugins/liteyuki_webdash/__init__.py
Normal file
@ -0,0 +1,21 @@
|
||||
from nonebot.plugin import PluginMetadata
|
||||
|
||||
from .main import *
|
||||
|
||||
__author__ = "snowykami"
|
||||
__plugin_meta__ = PluginMetadata(
|
||||
name="网页监控面板",
|
||||
description="网页监控面板,用于查看机器人的状态和信息",
|
||||
usage=(
|
||||
"访问 127.0.0.1:port 查看机器人的状态信息\n"
|
||||
"stat msg -g|--group [group_id] 查看群的统计信息,不带参数为全群\n"
|
||||
"配置项:custom_domain,自定义域名,通常对外用,内网无需"
|
||||
),
|
||||
type="application",
|
||||
homepage="https://github.com/snowykami/LiteyukiBot",
|
||||
extra={
|
||||
"liteyuki" : True,
|
||||
"toggleable" : False,
|
||||
"default_enable": True,
|
||||
}
|
||||
)
|
4
liteyuki/plugins/liteyuki_webdash/common.py
Normal file
4
liteyuki/plugins/liteyuki_webdash/common.py
Normal file
@ -0,0 +1,4 @@
|
||||
from fastapi import FastAPI
|
||||
from nonebot import get_app
|
||||
|
||||
app: FastAPI = get_app()
|
7
liteyuki/plugins/liteyuki_webdash/main.py
Normal file
7
liteyuki/plugins/liteyuki_webdash/main.py
Normal file
@ -0,0 +1,7 @@
|
||||
from fastapi import FastAPI
|
||||
from nonebot import get_app
|
||||
from .restful_api import *
|
||||
|
||||
@app.get("/")
|
||||
async def root():
|
||||
return {"message": "Hello World"}
|
24
liteyuki/plugins/liteyuki_webdash/restful_api.py
Normal file
24
liteyuki/plugins/liteyuki_webdash/restful_api.py
Normal file
@ -0,0 +1,24 @@
|
||||
from fastapi import FastAPI, APIRouter
|
||||
from .common import *
|
||||
|
||||
device_info_router = APIRouter(prefix="/api/device-info")
|
||||
bot_info_router = APIRouter(prefix="/api/bot-info")
|
||||
|
||||
|
||||
@device_info_router.get("/")
|
||||
async def device_info():
|
||||
print("Hello Device Info")
|
||||
return {
|
||||
"message": "Hello Device Info"
|
||||
}
|
||||
|
||||
|
||||
@bot_info_router.get("/")
|
||||
async def bot_info():
|
||||
return {
|
||||
"message": "Hello Bot Info"
|
||||
}
|
||||
|
||||
|
||||
app.include_router(device_info_router)
|
||||
app.include_router(bot_info_router)
|
Reference in New Issue
Block a user