1
0
mirror of https://github.com/1Panel-dev/1Panel.git synced 2025-02-07 17:10:07 +08:00

fix: 解决进程守护命令不能输入空格的问题 (#4997)

This commit is contained in:
zhengkunwang 2024-05-13 11:34:30 +08:00 committed by GitHub
parent 5979e8b5d4
commit b3ce35d516
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -307,7 +307,7 @@ func (h *HostToolService) OperateSupervisorProcess(req request.SupervisorProcess
if err != nil { if err != nil {
return err return err
} }
_, _ = section.NewKey("command", req.Command) _, _ = section.NewKey("command", strings.TrimSpace(req.Command))
_, _ = section.NewKey("directory", req.Dir) _, _ = section.NewKey("directory", req.Dir)
_, _ = section.NewKey("autorestart", "true") _, _ = section.NewKey("autorestart", "true")
_, _ = section.NewKey("startsecs", "3") _, _ = section.NewKey("startsecs", "3")
@ -338,7 +338,7 @@ func (h *HostToolService) OperateSupervisorProcess(req request.SupervisorProcess
} }
commandKey := section.Key("command") commandKey := section.Key("command")
commandKey.SetValue(req.Command) commandKey.SetValue(strings.TrimSpace(req.Command))
directoryKey := section.Key("directory") directoryKey := section.Key("directory")
directoryKey.SetValue(req.Dir) directoryKey.SetValue(req.Dir)
userKey := section.Key("user") userKey := section.Key("user")

View File

@ -21,7 +21,7 @@
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item :label="$t('tool.supervisor.command')" prop="command"> <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>
<el-form-item :label="$t('tool.supervisor.numprocs')" prop="numprocsNum"> <el-form-item :label="$t('tool.supervisor.numprocs')" prop="numprocsNum">
<el-input type="number" v-model.number="process.numprocsNum"></el-input> <el-input type="number" v-model.number="process.numprocsNum"></el-input>