Skip to content

Commit

Permalink
Merge pull request #3053 from hLinx/3.9.x_local
Browse files Browse the repository at this point in the history
perf: 更新shell脚本模板,规避使用eval带来的不可预期的风险 #2992
  • Loading branch information
hLinx authored Jun 12, 2024
2 parents 84b9337 + 483b897 commit d45dc6d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/frontend/src/components/ace-editor/default-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ export default {
'function job_success',
'{',
' local msg="$*"',
' echo "$(job_get_now) job_success: [$msg]"',
' echo "$(job_get_now) job_success:[$msg]"',
' exit 0',
'}',
'',
lang === 'zh-CN' ? '# 在脚本执行失败的逻辑分支处调用,打印当前的时间戳及PID' : '# Call this function when the script execution fails to print the current time and PID with a failure message',
'function job_fail',
'{',
' local msg="$*"',
' echo "$(job_get_now) job_fail: [$msg]"',
' echo "$(job_get_now) job_fail:[$msg]"',
' exit 1',
'}',
'',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -568,9 +568,9 @@
this.strategy = strategy;
if (strategy === 'once') {
this.$refs.timeTaskForm.clearError('cronExpression');
this.formData.executeTime = generatorDefaultCronTime();
this.formData.executeTime = this.formData.executeTime || generatorDefaultCronTime();
} else {
this.formData.cronExpression = '* * * * *';
this.formData.cronExpression = this.formData.cronExpression || '* * * * *';
}
this.formData.endTime = '';
this.formData.notifyChannel = [];
Expand Down

0 comments on commit d45dc6d

Please sign in to comment.