Skip to content

Commit

Permalink
Merge pull request #2728 from actiontech/fix_customize_plan_cmd
Browse files Browse the repository at this point in the history
fix: 自定义扫描任务TOKEN没有展示到页面
  • Loading branch information
taolx0 authored Nov 1, 2024
2 parents e8b643f + 254965f commit d396eae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sqle/api/controller/v1/instance_audit_plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,6 @@ func GetAuditPlanExecCmd(projectName string, iap *model.InstanceAuditPlan, ap *m
if !ok {
return ""
}

address := config.GetOptions().SqleOptions.DMSServerAddress
parsedURL, err := url.Parse(address)
if err != nil {
Expand All @@ -838,6 +837,9 @@ func GetAuditPlanExecCmd(projectName string, iap *model.InstanceAuditPlan, ap *m

var cmd string
switch ap.Type {
case auditplan.TypeDefault:
cmdTpl := "--host=%s --port=%s --project=%s --audit_plan_id=%d --token=%s"
return fmt.Sprintf(cmdTpl, ip, port, iap.ProjectId, ap.ID, iap.Token)
case auditplan.TypeAllAppExtract:
cmd = fmt.Sprintf(`SQLE_PROJECT_NAME=%s \
PROJECT_APP_NAME=<Please provide the business parameters here> \
Expand Down
1 change: 1 addition & 0 deletions sqle/server/auditplan/meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ var supportedCmdTypeList = map[string]struct{}{
TypeMySQLSlowLog: {},
TypeTiDBAuditLog: {},
TypeAllAppExtract: {},
TypeDefault: {},
}

func GetSupportedScannerAuditPlanType() map[string]struct{} {
Expand Down

0 comments on commit d396eae

Please sign in to comment.