Skip to content

Commit

Permalink
fix(backend): 支持变更SQL单据的非审批配置 TencentBlueKing#5072
Browse files Browse the repository at this point in the history
  • Loading branch information
iSecloud authored and zhangzhw8 committed Jun 20, 2024
1 parent 091dd9c commit 903bb5c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def list_account_rules(self, rule_filter: AccountRuleMeta) -> Dict:
# 如果是通过id过滤的,则不管集群类型
if rule_filter.rule_ids:
rules_list = DBPrivManagerApi.list_account_rules(
{"bk_biz_id": self.bk_biz_id, "ids": rule_filter.rule_ids}
{"bk_biz_id": self.bk_biz_id, "cluster_type": self.account_type, "ids": rule_filter.rule_ids}
)
else:
rules_list = DBPrivManagerApi.list_account_rules(
Expand Down
16 changes: 10 additions & 6 deletions dbm-ui/backend/ticket/builders/mysql/mysql_import_sqlfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,14 +178,18 @@ def init_ticket_flows(self):
details=MysqlSqlImportFlowParamBuilder(self.ticket).get_params(),
flow_alias=_("SQL模拟执行状态查询"),
),
Flow(
ticket=self.ticket,
flow_type=FlowType.BK_ITSM.value,
details=MysqlSqlImportItsmParamBuilder(self.ticket).get_params(),
flow_alias=_("单据审批"),
),
]

if self.need_itsm:
flows.append(
Flow(
ticket=self.ticket,
flow_type=FlowType.BK_ITSM.value,
details=MysqlSqlImportItsmParamBuilder(self.ticket).get_params(),
flow_alias=_("单据审批"),
)
)

mode = self.ticket.details["ticket_mode"]["mode"]
if mode == SQLExecuteTicketMode.MANUAL.value:
flows.append(Flow(ticket=self.ticket, flow_type=FlowType.PAUSE.value, flow_alias=_("人工确认执行")))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,18 @@ def init_ticket_flows(self):
details=TenDBClusterSqlImportFlowParamBuilder(self.ticket).get_params(),
flow_alias=_("模拟执行"),
),
Flow(
ticket=self.ticket,
flow_type=FlowType.BK_ITSM.value,
details=TenDBClusterSqlImportItsmParamBuilder(self.ticket).get_params(),
flow_alias=_("单据审批"),
),
]

if self.need_itsm:
flows.append(
Flow(
ticket=self.ticket,
flow_type=FlowType.BK_ITSM.value,
details=TenDBClusterSqlImportItsmParamBuilder(self.ticket).get_params(),
flow_alias=_("单据审批"),
)
)

mode = self.ticket.details["ticket_mode"]["mode"]
if mode == SQLExecuteTicketMode.MANUAL.value:
flows.append(Flow(ticket=self.ticket, flow_type=FlowType.PAUSE.value, flow_alias=_("人工确认执行")))
Expand Down

0 comments on commit 903bb5c

Please sign in to comment.