perf: Export pdf using days parameter

pull/15888/head
wangruidong 2025-08-20 18:32:26 +08:00 committed by 老广
parent 3f1d7fa230
commit e1c9f5180d
1 changed files with 3 additions and 1 deletions

View File

@ -44,6 +44,7 @@ charts_map = {
def export_chart_to_pdf(chart_name, sessionid, request=None):
chart_info = charts_map.get(chart_name)
if not chart_info:
return None, None
@ -51,9 +52,10 @@ def export_chart_to_pdf(chart_name, sessionid, request=None):
url = request.build_absolute_uri(urllib.parse.unquote(chart_info['path']))
else:
url = urllib.parse.unquote(chart_info['path'])
if settings.DEBUG_DEV:
url = url.replace(":8080", ":9528")
days = request.GET.get('days', 7)
url = url + f"?days={days}"
print("Url: ", url)
with sync_playwright() as p: