update v0.1.5.8

This commit is contained in:
HibiKier
2022-06-05 19:51:23 +08:00
parent d4d6e736a4
commit 74e9c55a09
13 changed files with 65 additions and 24 deletions
+5 -5
View File
@@ -29,7 +29,7 @@ disk_data = {"data": []}
@app.get("/webui/system")
async def _(user: User = Depends(token_to_user)) -> Result:
async def _() -> Result:
return await get_system_data()
@@ -74,7 +74,7 @@ async def _(user: User = Depends(token_to_user)) -> Result:
)
async def get_system_data():
async def get_system_data(user: User = Depends(token_to_user)):
"""
说明:
获取系统信息,资源文件大小,网络状态等
@@ -92,7 +92,7 @@ async def get_system_data():
logger.warning(f"访问Google失败... {type(e)}: {e}")
google = 404
network = SystemNetwork(baidu=baidu, google=google)
disk = await asyncio.get_event_loop().run_in_executor(None, _get_system_disk)
disk = await asyncio.get_event_loop().run_in_executor(None, _get_system_disk, None)
status = await asyncio.get_event_loop().run_in_executor(None, _get_system_status)
return Result(
code=200,
@@ -105,7 +105,7 @@ async def get_system_data():
)
def _get_system_status() -> SystemStatus:
def _get_system_status(user: User = Depends(token_to_user)) -> SystemStatus:
"""
说明:
获取系统信息等
@@ -123,7 +123,7 @@ def _get_system_status() -> SystemStatus:
def _get_system_disk(
type_: Optional[str],
type_: Optional[str], user: User = Depends(token_to_user)
) -> Union[SystemFolderSize, Dict[str, Union[float, datetime]]]:
"""
说明: