feat: 总览接口添加用户代理情况信息
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
# Contact: DLmaster_361@163.com
|
||||
|
||||
|
||||
import datetime
|
||||
from datetime import datetime
|
||||
from pathlib import Path
|
||||
from fastapi import APIRouter, Body
|
||||
|
||||
@@ -41,8 +41,8 @@ async def search_history(history: HistorySearchIn) -> HistorySearchOut:
|
||||
try:
|
||||
data = await Config.search_history(
|
||||
history.mode,
|
||||
datetime.datetime.strptime(history.start_date, "%Y-%m-%d"),
|
||||
datetime.datetime.strptime(history.end_date, "%Y-%m-%d"),
|
||||
datetime.strptime(history.start_date, "%Y-%m-%d").date(),
|
||||
datetime.strptime(history.end_date, "%Y-%m-%d").date(),
|
||||
)
|
||||
for date, users in data.items():
|
||||
for user, records in users.items():
|
||||
|
||||
@@ -115,12 +115,13 @@ async def get_apps_info() -> InfoOut:
|
||||
)
|
||||
async def add_overview() -> InfoOut:
|
||||
try:
|
||||
data = await Config.get_stage_info("Info")
|
||||
stage = await Config.get_stage_info("Info")
|
||||
proxy = await Config.get_proxy_overview()
|
||||
except Exception as e:
|
||||
return InfoOut(
|
||||
code=500,
|
||||
status="error",
|
||||
message=f"{type(e).__name__}: {str(e)}",
|
||||
data={"ALL": []},
|
||||
data={"Stage": [], "Proxy": []},
|
||||
)
|
||||
return InfoOut(data={"ALL": data})
|
||||
return InfoOut(data={"Stage": stage, "Proxy": proxy})
|
||||
|
||||
Reference in New Issue
Block a user