From 3881edd2ba16ea0ed49642e9c751e8034dc7abb1 Mon Sep 17 00:00:00 2001 From: feng <1304903146@qq.com> Date: Sun, 29 Sep 2024 16:10:26 +0800 Subject: [PATCH] perf: Optimize file audit download prompt --- apps/assets/const/base.py | 2 +- apps/i18n/lina/en.json | 4 +++- apps/i18n/lina/ja.json | 1 - apps/i18n/lina/zh.json | 3 +++ apps/i18n/lina/zh_hant.json | 1 - apps/settings/serializers/public.py | 1 + 6 files changed, 8 insertions(+), 4 deletions(-) diff --git a/apps/assets/const/base.py b/apps/assets/const/base.py index 3236050ea..425e384f0 100644 --- a/apps/assets/const/base.py +++ b/apps/assets/const/base.py @@ -112,7 +112,7 @@ class BaseType(TextChoices): @classmethod def get_choices(cls): - if not settings.XPACK_ENABLED: + if not settings.XPACK_LICENSE_IS_VALID: choices = [(tp.value, tp.label) for tp in cls.get_community_types()] else: choices = cls.choices diff --git a/apps/i18n/lina/en.json b/apps/i18n/lina/en.json index 4494ee93f..bd263697d 100644 --- a/apps/i18n/lina/en.json +++ b/apps/i18n/lina/en.json @@ -443,7 +443,9 @@ "Docs": "Docs", "Download": "Download", "DownloadCenter": "Download", - "DownloadFTPFileTip": "The current action does not record files, or the file size exceeds the threshold (default 100m), or it has not yet been saved to the corresponding storage", + "FTPStorageNotEnabled": "The file storage function is not enabled. Please modify the configuration file and add the following configuration: FTP_FILE_MAX_STORE=100 (supports saving files within 100M)", + "FTPFileNotStored": "The file has not been saved to storage yet, please check back later.", + "FTPUnknownStorageState": "Unknown file storage status, please contact your administrator.", "DownloadImportTemplateMsg": "Download creation template", "DownloadReplay": "Download recording", "DownloadUpdateTemplateMsg": "Download update template", diff --git a/apps/i18n/lina/ja.json b/apps/i18n/lina/ja.json index a0f0af624..7e5666a0e 100644 --- a/apps/i18n/lina/ja.json +++ b/apps/i18n/lina/ja.json @@ -458,7 +458,6 @@ "Docs": "文書", "Download": "ダウンロード", "DownloadCenter": "ダウンロードセンター", - "DownloadFTPFileTip": "現在のActionでは、ファイルは記録されず、またはファイルサイズが閾値(デフォルトは100M)を超える、またはまだ対応するストレージに保存されていない", "DownloadImportTemplateMsg": "テンプレートをダウンロードで作成", "DownloadReplay": "ビデオのダウンロード", "DownloadUpdateTemplateMsg": "更新テンプレートをダウンロード", diff --git a/apps/i18n/lina/zh.json b/apps/i18n/lina/zh.json index 00884db00..1bbd96af9 100644 --- a/apps/i18n/lina/zh.json +++ b/apps/i18n/lina/zh.json @@ -444,6 +444,9 @@ "Download": "下载", "DownloadCenter": "下载中心", "DownloadFTPFileTip": "当前动作不记录文件,或者文件大小超过阈值(默认100M),或者还未保存到对应存储中", + "FTPStorageNotEnabled": "文件存储功能未开启,请修改配置文件并添加配置:FTP_FILE_MAX_STORE=100(支持保存100M以内的文件)", + "FTPFileNotStored": "文件尚未保存到存储中,请稍后查看。", + "FTPUnknownStorageState": "未知的文件存储状态,请联系管理员。", "DownloadImportTemplateMsg": "下载创建模板", "DownloadReplay": "下载录像", "DownloadUpdateTemplateMsg": "下载更新模板", diff --git a/apps/i18n/lina/zh_hant.json b/apps/i18n/lina/zh_hant.json index e4b00112a..2660cbe8a 100644 --- a/apps/i18n/lina/zh_hant.json +++ b/apps/i18n/lina/zh_hant.json @@ -593,7 +593,6 @@ "DomainUpdate": "更新網域", "Download": "下載", "DownloadCenter": "下載中心", - "DownloadFTPFileTip": "當前動作不記錄文件,或者檔案大小超過閾值(默認100M),或者還未保存到對應儲存中", "DownloadImportTemplateMsg": "下載創建模板", "DownloadReplay": "下載錄影", "DownloadUpdateTemplateMsg": "下載更新範本", diff --git a/apps/settings/serializers/public.py b/apps/settings/serializers/public.py index 32ab1e61c..bf1ad6e34 100644 --- a/apps/settings/serializers/public.py +++ b/apps/settings/serializers/public.py @@ -62,6 +62,7 @@ class PrivateSettingSerializer(PublicSettingSerializer): CHAT_AI_ENABLED = serializers.BooleanField() GPT_MODEL = serializers.CharField() FILE_UPLOAD_SIZE_LIMIT_MB = serializers.IntegerField() + FTP_FILE_MAX_STORE = serializers.IntegerField() LOKI_LOG_ENABLED = serializers.BooleanField() TOOL_USER_ENABLED = serializers.BooleanField()