From d4d5224c170a8d3817ba1e04dedf013625a65b3a Mon Sep 17 00:00:00 2001 From: mikebofs Date: Thu, 21 Aug 2025 15:59:27 +0800 Subject: [PATCH] perf: support export dashboard --- apps/i18n/lina/en.json | 8 ++++++-- apps/i18n/lina/zh.json | 8 ++++++-- apps/reports/views.py | 19 +++++++++++++++++-- 3 files changed, 29 insertions(+), 6 deletions(-) diff --git a/apps/i18n/lina/en.json b/apps/i18n/lina/en.json index 47bfd7364..4872b95fc 100644 --- a/apps/i18n/lina/en.json +++ b/apps/i18n/lina/en.json @@ -1608,5 +1608,9 @@ "removeWarningMsg": "Are you sure you want to remove", "setVariable": "Set variable", "userId": "User ID", - "userName": "User name" -} \ No newline at end of file + "userName": "User name", + "ConsoleDashboard": "Console dashboard", + "AuditsDashboard": "Audits dashboard", + "PamDashboard": "PAM dashboard", + "ChangeSecretDashboard": "Change secret dashboard" +} diff --git a/apps/i18n/lina/zh.json b/apps/i18n/lina/zh.json index 44181fcae..ab04f62c4 100644 --- a/apps/i18n/lina/zh.json +++ b/apps/i18n/lina/zh.json @@ -1617,5 +1617,9 @@ "removeWarningMsg": "你确定要移除", "setVariable": "设置参数", "userId": "用户ID", - "userName": "用户名" -} \ No newline at end of file + "userName": "用户名", + "ConsoleDashboard": "控制台仪表盘", + "AuditsDashboard": "审计台仪表盘", + "PamDashboard": "特权账号仪表盘", + "ChangeSecretDashboard": "账号改密仪表盘" +} diff --git a/apps/reports/views.py b/apps/reports/views.py index 45b9e6471..032332485 100644 --- a/apps/reports/views.py +++ b/apps/reports/views.py @@ -34,11 +34,27 @@ charts_map = { }, "AccountStatistics": { "title": _('Account statistics report'), - "path": "/ui/#/reports/accounts/account-statistics" + "path": "/ui/#/reports/accounts/account-statistics?days=30" }, "AccountAutomationReport": { "title": _('Account automation report'), "path": "/ui/#/reports/accounts/account-automation" + }, + "ConsoleDashboard": { + "title": _('ConsoleDashboard'), + "path": "/ui/#/reports/dashboard/console" + }, + "AuditsDashboard": { + "title": _('AuditsDashboard'), + "path": "/ui/#/reports/dashboard/audits" + }, + "PamDashboard": { + "title": _('PamDashboard'), + "path": "/ui/#/reports/dashboard/pam" + }, + "ChangeSecretDashboard": { + "title": _('ChangeSecretDashboard'), + "path": "/ui/#/reports/dashboard/change-secret" } } @@ -57,7 +73,6 @@ def export_chart_to_pdf(chart_name, sessionid, request=None): url = url.replace(":8080", ":9528") days = request.GET.get('days', 7) url = url + f"?days={days}" - print("Url: ", url) with sync_playwright() as p: lang = request.COOKIES.get(settings.LANGUAGE_COOKIE_NAME)