Skip to content

Commit

Permalink
fix: 解决进程守护命令不能输入空格的问题 (#4997)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhengkunwang223 authored and wanghe-fit2cloud committed May 22, 2024
1 parent c815490 commit b808038
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions backend/app/service/host_tool.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ func (h *HostToolService) OperateSupervisorProcess(req request.SupervisorProcess
if err != nil {
return err
}
_, _ = section.NewKey("command", req.Command)
_, _ = section.NewKey("command", strings.TrimSpace(req.Command))
_, _ = section.NewKey("directory", req.Dir)
_, _ = section.NewKey("autorestart", "true")
_, _ = section.NewKey("startsecs", "3")
Expand Down Expand Up @@ -338,7 +338,7 @@ func (h *HostToolService) OperateSupervisorProcess(req request.SupervisorProcess
}

commandKey := section.Key("command")
commandKey.SetValue(req.Command)
commandKey.SetValue(strings.TrimSpace(req.Command))
directoryKey := section.Key("directory")
directoryKey.SetValue(req.Dir)
userKey := section.Key("user")
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/toolbox/supervisor/create/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
</el-input>
</el-form-item>
<el-form-item :label="$t('tool.supervisor.command')" prop="command">
<el-input v-model.trim="process.command"></el-input>
<el-input v-model="process.command"></el-input>
</el-form-item>
<el-form-item :label="$t('tool.supervisor.numprocs')" prop="numprocsNum">
<el-input type="number" v-model.number="process.numprocsNum"></el-input>
Expand Down

0 comments on commit b808038

Please sign in to comment.