This commit is contained in:
wuaho 2021-07-26 20:34:42 +08:00
parent d2ab33b1a9
commit a2d08b35e9
2 changed files with 4 additions and 1 deletions

View File

@ -66,9 +66,11 @@ async def read_report(
for item in reports: for item in reports:
item['added'] = False item['added'] = False
added_ids = [item['report_id'] for item in dashboard.get('reports', [])] item['show_config'] = dict()
added_ids = {item['report_id']: item for item in dashboard.get('reports', [])}
if item['_id'] in added_ids: if item['_id'] in added_ids:
item['added'] = True item['added'] = True
item['show_config'] = added_ids[item['_id']]
return schemas.Msg(code=0, msg='ok', data=reports) return schemas.Msg(code=0, msg='ok', data=reports)

View File

@ -44,6 +44,7 @@ class Report(BaseModel):
report_id: str report_id: str
graph_type: str graph_type: str
model: str model: str
graph_size: str
class AddReport(DBBase): class AddReport(DBBase):