feat:关于页面&对接websocket

This commit is contained in:
zy7y
2022-09-17 17:57:09 +08:00
parent 8da0127729
commit 8e37bba724
21 changed files with 5639 additions and 118 deletions

View File

@@ -38,5 +38,10 @@ def get_system_info():
"cpu": f"{random.random() * 100: .2}",
"memory": f"{random.random() * 100: .2}",
"disk": f"{random.random() * 100: .2}",
}
},
"performance": {
"rps": f"{random.random() * random.randint(1, 50): .2}",
"time": f"{random.random() * random.randint(1, 50): .2}",
"user": f"{random.randint(1, 50)}",
},
}

View File

@@ -19,8 +19,12 @@ app.mount("/", ws_app)
if __name__ == "__main__":
import uvicorn
from fastapi.routing import Mount
for i in app.routes:
logger.info(f"{i.path}, {i.methods}, {i.__dict__.get('summary')}, {i.endpoint}")
if not isinstance(i, Mount):
logger.info(
f"{i.path}, {i.methods}, {i.__dict__.get('summary')}, {i.endpoint}"
)
uvicorn.run("main:app", reload=True)

View File

@@ -1,35 +1,13 @@
aiosqlite==0.17.0
anyio==3.6.1
attrs==22.1.0
bcrypt==4.0.0
certifi==2022.6.15.1
charset-normalizer==2.1.1
click==8.1.3
colorama==0.4.5
ecdsa==0.18.0
fastapi==0.82.0
h11==0.13.0
idna==3.3
iniconfig==1.1.1
iso8601==1.0.2
packaging==21.3
passlib==1.7.4
pluggy==1.0.0
py==1.11.0
pyasn1==0.4.8
pydantic==1.10.2
pyparsing==3.0.9
pypika-tortoise==0.1.6
pytest==7.1.3
python-jose==3.3.0
pytz==2022.2.1
requests==2.28.1
rsa==4.9
six==1.16.0
sniffio==1.3.0
starlette==0.19.1
tomli==2.0.1
uvicorn==0.18.3
tortoise-orm==0.19.2
typing-extensions==4.3.0
urllib3==1.26.12
uvicorn==0.18.3
websockets==10.3