feat: 快捷命令增加设置执行目录

This commit is contained in:
Aaron3S
2023-10-09 17:18:18 +08:00
committed by Bryan
parent c50db4089c
commit f54d819ec8
5 changed files with 33 additions and 3 deletions

View File

@@ -16,9 +16,8 @@
>
<i :class="item.icon" style="margin-right: 4px;" />{{ item.name }}
</el-button>
<el-autocomplete
v-if="item.type === 'input' && item.el.autoComplete"
v-if="item.type === 'input' &&item.el && item.el.autoComplete"
v-model="item.value"
:placeholder="item.placeholder"
:fetch-suggestions="item.el.query"
@@ -27,7 +26,14 @@
@select="item.callback(item.value)"
@change="item.callback(item.value)"
/>
<el-input
v-else-if="item.type==='input'"
v-model="item.value"
:placeholder="item.placeholder"
class="inline-input"
size="mini"
@change="item.callback(item.value)"
/>
<div v-if="item.type==='select' && item.el && item.el.create" class="select-content">
<span class="filter-label">
{{ item.name }}:

View File

@@ -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:",

View File

@@ -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": "選択済アセット:",

View File

@@ -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": "选择左侧资产, 选择运行的系统用户,批量执行命令",

View File

@@ -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'