Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 规则审计-策略新增/编辑-后端接口 --story=121513458 #526

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/backend/locale/en/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-01-09 20:42+0800\n"
"POT-Creation-Date: 2025-01-13 13:47+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down Expand Up @@ -2248,8 +2248,9 @@ msgstr "Cluster Not Exists"
msgid "Control Not Exists"
msgstr "Cluster Not Exists"

msgid "Not Support DataSource"
msgstr "Not Support DataSource"
#, python-format
msgid "Not Support DataSource; source_type: %s; result_table: %s"
msgstr "Not Support DataSource; source_type: %s; result_table: %s"

msgid "操作行为审计"
msgstr "Operation Audit"
Expand Down
7 changes: 4 additions & 3 deletions src/backend/locale/zh_CN/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-01-09 20:42+0800\n"
"POT-Creation-Date: 2025-01-13 13:47+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down Expand Up @@ -2248,8 +2248,9 @@ msgstr "集群不存在"
msgid "Control Not Exists"
msgstr "控件不存在"

msgid "Not Support DataSource"
msgstr "不支持的数据源"
#, python-format
msgid "Not Support DataSource; source_type: %s; result_table: %s"
msgstr "不支持的数据源;来源类型: %s;结果表: %s"

msgid "操作行为审计"
msgstr "操作行为审计"
Expand Down
2 changes: 1 addition & 1 deletion src/backend/services/web/analyze/controls/rule_audit.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def check_source_type(self, result_table_id: str) -> str:
return FlowDataSourceNodeType.BATCH_REAL
# 4. 未支持:异常
else:
raise NotSupportDataSource()
raise NotSupportDataSource(source_type, result_table_id)

@cached_property
def rt_ids(self) -> List[str]:
Expand Down
6 changes: 5 additions & 1 deletion src/backend/services/web/analyze/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,8 @@ class ControlNotExist(AnalyzeException):
class NotSupportDataSource(AnalyzeException):
STATUS_CODE = 400
ERROR_CODE = "003"
MESSAGE = gettext_lazy("Not Support DataSource")
MESSAGE = gettext_lazy("Not Support DataSource; source_type: %s; result_table: %s")

def __init__(self, source_type, result_table, *args, **kwargs):
self.MESSAGE = self.MESSAGE % (source_type, result_table)
super().__init__(*args, **kwargs)
2 changes: 1 addition & 1 deletion src/backend/services/web/strategy_v2/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -926,7 +926,7 @@ def perform_request(self, validated_request_data):
# 获取最新版本的联表
link_tables = LinkTable.list_max_version_link_table().filter(**validated_request_data)
# 过滤标签
if no_tag:
if no_tag or int(NO_TAG_ID) in tags:
link_table_uids = LinkTableTag.objects.values_list("link_table_uid").distinct()
link_tables = link_tables.exclude(uid__in=link_table_uids)
elif tags:
Expand Down
Loading