From f54d819ec8e53c887ec17520c805998e3ec8f5c4 Mon Sep 17 00:00:00 2001 From: Aaron3S Date: Mon, 9 Oct 2023 17:18:18 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=BF=AB=E6=8D=B7=E5=91=BD=E4=BB=A4?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=AE=BE=E7=BD=AE=E6=89=A7=E8=A1=8C=E7=9B=AE?= =?UTF-8?q?=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Form/FormFields/CodeEditor.vue | 12 +++++++++--- src/i18n/langs/en.json | 3 +++ src/i18n/langs/ja.json | 3 +++ src/i18n/langs/zh.json | 3 +++ src/views/ops/Job/QuickJob.vue | 15 +++++++++++++++ 5 files changed, 33 insertions(+), 3 deletions(-) diff --git a/src/components/Form/FormFields/CodeEditor.vue b/src/components/Form/FormFields/CodeEditor.vue index fa8119e5e..49a7f7158 100644 --- a/src/components/Form/FormFields/CodeEditor.vue +++ b/src/components/Form/FormFields/CodeEditor.vue @@ -16,9 +16,8 @@ > {{ item.name }} - - +
{{ item.name }}: diff --git a/src/i18n/langs/en.json b/src/i18n/langs/en.json index fb1feb655..5971cf402 100644 --- a/src/i18n/langs/en.json +++ b/src/i18n/langs/en.json @@ -983,10 +983,12 @@ }, "ops": { "EnterRunUser": "Enter run user", + "EnterRunningPath": "Enter running path", "Save": "Save", "Reset": "Reset", "SystemError": "System Error", "RunasHelpText": "Fill in the user name to run the script", + "RunningPathHelpText": "Fill in the running path of the script. This setting only takes effect for shell scripts.", "RunasPolicyHelpText": "Indicates the account selection strategy when there is no running user on the current asset", "StatusGreen": "Recently in good condition", "StatusRed": "The last task execution failed", @@ -1021,6 +1023,7 @@ "ratio": "Ratio", "run": "Run", "runAs": "Run as", + "runningPath": "Running path", "runTimes": "Run times", "selectAssetsMessage": "Select the left asset, select the running system user, execute command in batch", "selectedAssets": "Selected assets:", diff --git a/src/i18n/langs/ja.json b/src/i18n/langs/ja.json index c9f5f5123..74c41f719 100644 --- a/src/i18n/langs/ja.json +++ b/src/i18n/langs/ja.json @@ -981,11 +981,13 @@ }, "ops": { "EnterRunUser": "実行ユーザーの入力", + "EnterRunningPath": "実行パスの入力", "Save": "保存#ホゾン#", "Reset": "リストア", "SystemError": "システムエラー", "RunasHelpText": "スクリプトを実行するユーザー名を入力", "RunasPolicyHelpText": "現在の資産にこの実行ユーザーが存在しない場合にアカウント選択ポリシーを実行することを示します", + "RunningPathHelpText": "スクリプトの実行パスを入力します。この設定はシェル スクリプトにのみ有効です", "StatusGreen": "最近調子がいい", "StatusRed": "最後のタスクの実行に失敗しました", "StatusYellow": "最近の存在の実行に失敗しました", @@ -1019,6 +1021,7 @@ "ratio": "スケール", "run": "実行", "runAs": "実行ユーザー", + "runningPath":"実行パス", "runTimes": "実行回数", "selectAssetsMessage": "左側の資産を選択し、実行するシステムユーザーを選択し、コマンドを一括実行します", "selectedAssets": "選択済アセット:", diff --git a/src/i18n/langs/zh.json b/src/i18n/langs/zh.json index cdb8cffe5..d3be8a741 100644 --- a/src/i18n/langs/zh.json +++ b/src/i18n/langs/zh.json @@ -960,10 +960,12 @@ }, "ops": { "EnterRunUser": "输入运行用户", + "EnterRunningPath": "输入运行路径", "Save": "保存", "Reset": "还原", "SystemError": "系统错误", "RunasHelpText": "填写运行脚本的用户名", + "RunningPathHelpText": "填写脚本的运行路径,此设置仅 shell 脚本生效", "RunasPolicyHelpText": "当前资产上没此运行用户时,采取什么账号选择策略。跳过:不执行。优先特权账号:如果有特权账号先选特权账号,如果没有就选普通账号。仅特权账号:只从特权账号中选择,如果没有则不执行", "StatusGreen": "近期状态良好", "StatusRed": "上一次任务执行失败", @@ -1057,6 +1059,7 @@ "ratio": "比例", "run": "执行", "runAs": "运行用户", + "runningPath": "运行路径", "RunasPolicy": "账号策略", "runTimes": "执行次数", "selectAssetsMessage": "选择左侧资产, 选择运行的系统用户,批量执行命令", diff --git a/src/views/ops/Job/QuickJob.vue b/src/views/ops/Job/QuickJob.vue index d33473909..710c67a2c 100644 --- a/src/views/ops/Job/QuickJob.vue +++ b/src/views/ops/Job/QuickJob.vue @@ -81,6 +81,7 @@ export default { DataZTree: 0, runas: '', runasPolicy: 'skip', + chdir: '', command: '', module: 'shell', timeout: -1, @@ -200,6 +201,17 @@ export default { callback: (option) => { this.timeout = option } + }, + chdir: { + type: 'input', + name: this.$t('ops.runningPath'), + align: 'left', + value: '', + placeholder: this.$tc('ops.EnterRunningPath'), + tip: this.$tc('ops.RunningPathHelpText'), + callback: (val) => { + this.chdir = val + } } }, right: { @@ -401,6 +413,9 @@ export default { is_periodic: false, timeout: this.timeout } + if (this.chdir) { + data.chdir = this.chdir + } createJob(data).then(res => { this.executionInfo.timeCost = 0 this.executionInfo.status = 'running'