Skip to content

Commit

Permalink
fix(frontend): mysql授权补充插件授权 #7703
Browse files Browse the repository at this point in the history
# Reviewed, transaction id: 24546
  • Loading branch information
JustaCattt authored and hLinx committed Nov 22, 2024
1 parent 9c672ad commit 4e83765
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
3 changes: 3 additions & 0 deletions dbm-ui/frontend/src/services/model/ticket/details/mysql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions dbm-ui/frontend/src/services/types/permission.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@
</template>
</BkTableColumn>
<BkTableColumn
:label="t('账号')"
prop="user" />
field="user"
:label="t('账号')" />
<BkTableColumn
:label="t('访问DB')"
:width="150">
Expand Down

0 comments on commit 4e83765

Please sign in to comment.