diff --git a/dbm-ui/frontend/src/services/model/ticket/details/mysql.ts b/dbm-ui/frontend/src/services/model/ticket/details/mysql.ts index 58ba2b1e34..46f0a1f801 100644 --- a/dbm-ui/frontend/src/services/model/ticket/details/mysql.ts +++ b/dbm-ui/frontend/src/services/model/ticket/details/mysql.ts @@ -27,10 +27,13 @@ export interface MysqlIpItem extends DetailBase { */ export interface MysqlAuthorizationDetails extends DetailBase { authorize_uid: string; + // 普通授权 authorize_data: AuthorizePreCheckData; // 批量导入 excel_url: string; authorize_data_list: AuthorizePreCheckData[]; + // 插件授权 + authorize_plugin_infos: AuthorizePreCheckData[]; } export interface MySQLForceImportSQLFileExecuteSqlFiles { diff --git a/dbm-ui/frontend/src/services/types/permission.ts b/dbm-ui/frontend/src/services/types/permission.ts index e2d39faa01..3760f2e07e 100644 --- a/dbm-ui/frontend/src/services/types/permission.ts +++ b/dbm-ui/frontend/src/services/types/permission.ts @@ -143,6 +143,7 @@ export type AccountRulePrivilegeKey = keyof AccountRulePrivilege; */ export interface AuthorizePreCheckData { access_dbs: string[]; + bk_biz_id?: number; source_ips?: | { bk_host_id?: number; diff --git a/dbm-ui/frontend/src/views/tickets/common/components/demand-factory/mysql/authorize-rule/Index.vue b/dbm-ui/frontend/src/views/tickets/common/components/demand-factory/mysql/authorize-rule/Index.vue index 6449a2767f..877ea22ff3 100644 --- a/dbm-ui/frontend/src/views/tickets/common/components/demand-factory/mysql/authorize-rule/Index.vue +++ b/dbm-ui/frontend/src/views/tickets/common/components/demand-factory/mysql/authorize-rule/Index.vue @@ -66,7 +66,17 @@ } if (props.ticketDetails.ticket_type === TicketTypes.MYSQL_AUTHORIZE_RULES) { - const { authorize_data: authorizeData } = props.ticketDetails.details; + const { authorize_data: authorizeData, authorize_plugin_infos: authorizePluginInfos } = + props.ticketDetails.details; + if (authorizePluginInfos) { + return authorizePluginInfos.map((item) => ({ + ips: item.source_ips as string[], + user: item.user, + accessDbs: item.access_dbs, + clusterDomains: item.target_instances, + privileges: item.privileges, + })); + } return [ { ips: (authorizeData.source_ips as { ip: string }[]).map((item) => item.ip), diff --git a/dbm-ui/frontend/src/views/tickets/common/components/demand-factory/mysql/authorize-rule/components/RenderTable.vue b/dbm-ui/frontend/src/views/tickets/common/components/demand-factory/mysql/authorize-rule/components/RenderTable.vue index e85a6713da..e6b7379ee3 100644 --- a/dbm-ui/frontend/src/views/tickets/common/components/demand-factory/mysql/authorize-rule/components/RenderTable.vue +++ b/dbm-ui/frontend/src/views/tickets/common/components/demand-factory/mysql/authorize-rule/components/RenderTable.vue @@ -49,8 +49,8 @@ + field="user" + :label="t('账号')" />