Skip to content

Commit 52b06aa

Browse files
authored
Merge pull request #4154 from hLinx/feature_template_container
Feature template container
2 parents 2002cb0 + a8af42d commit 52b06aa

18 files changed

Lines changed: 120 additions & 62 deletions

File tree

src/frontend/src/common/fully-import.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,7 @@ import '@blueking/ip-selector/dist/styles/vue2.6.x.css';
7777

7878
const IpSelector = createIpSelector({
7979
version: '8',
80-
// panelList: ['staticTopo', 'dynamicTopo', 'dynamicGroup', 'manualInput', 'containerStaticTopo', 'containerManualInput'],
81-
panelList: ['staticTopo', 'dynamicTopo', 'dynamicGroup', 'manualInput'],
80+
panelList: ['staticTopo', 'dynamicTopo', 'dynamicGroup', 'manualInput', 'containerStaticTopo', 'containerManualInput'],
8281
unqiuePanelValue: false,
8382
nameStyle: 'camelCase',
8483
hostTableDefaultSelectAllMode: true,

src/frontend/src/components/task-step/common/execute-target/index.vue

Lines changed: 17 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
<bk-select
6969
class="server-global-variable-select"
7070
:clearable="false"
71-
:placeholder="$t('请选择主机列表变量')"
71+
:placeholder="$t('请选择执行目标变量')"
7272
:value="localVariable"
7373
@change="handleVariableChange">
7474
<bk-option
@@ -226,7 +226,7 @@
226226
},
227227
mode: {
228228
type: String,
229-
default: '', // onlyHost: 快速执行只可以选择主机列表
229+
default: '', // onlyHost: 快速执行只可以执行目标列表
230230
},
231231
// 组件被使用的场景,快速执行|作业模板
232232
from: {
@@ -335,35 +335,22 @@
335335
},
336336
created() {
337337
this.ipSelectorConfig = {};
338-
// 快速执行场景
339338
// 业务集和租户集场景不支持动态分组和容器
340-
if (this.from === 'execute') {
341-
if (window.PROJECT_CONFIG.SCOPE_TYPE === 'biz_set') {
342-
this.ipSelectorConfig = {
343-
panelList: [
344-
'staticTopo',
345-
'manualInput',
346-
],
347-
};
348-
} else if (window.PROJECT_CONFIG.SCOPE_TYPE === 'tenant_set') {
349-
this.ipSelectorConfig = {
350-
panelList: [
351-
'staticTopo',
352-
'manualInput',
353-
],
354-
};
355-
} else {
356-
this.ipSelectorConfig = {
357-
panelList: [
358-
'staticTopo',
359-
'dynamicTopo',
360-
'dynamicGroup',
361-
'manualInput',
362-
'containerStaticTopo',
363-
'containerManualInput',
364-
],
365-
};
366-
}
339+
if (window.PROJECT_CONFIG.SCOPE_TYPE === 'biz_set') {
340+
this.ipSelectorConfig = {
341+
panelList: [
342+
'staticTopo',
343+
'dynamicTopo',
344+
'manualInput',
345+
],
346+
};
347+
} else if (window.PROJECT_CONFIG.SCOPE_TYPE === 'tenant_set') {
348+
this.ipSelectorConfig = {
349+
panelList: [
350+
'staticTopo',
351+
'manualInput',
352+
],
353+
};
367354
}
368355
369356
// 执行目标是主机变量

src/frontend/src/components/task-step/common/source-file/view/server/host-and-variable.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
<bk-select
7272
class="server-add-variable"
7373
:clearable="false"
74-
:placeholder="$t('请选择主机列表变量')"
74+
:placeholder="$t('请选择执行目标变量')"
7575
searchable
7676
:value="serverFile.host.variable"
7777
@change="handleVariableChange">

src/frontend/src/domain/model/task/global-variable.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export default class GlobalVariable {
5353
static typeTextMap = {
5454
[TYPE_STRING]: I18n.t('字符串'),
5555
[TYPE_NAMESPACE]: I18n.t('命名空间'),
56-
[TYPE_HOST]: I18n.t('主机列表'),
56+
[TYPE_HOST]: I18n.t('执行目标'),
5757
[TYPE_PASSWORD]: I18n.t('密文'),
5858
[TYPE_RELATE_ARRAY]: I18n.t('数组'),
5959
[TYPE_INDEX_ARRAY]: I18n.t('数组'),

src/frontend/src/i18n/language/en.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
"异常": "Abnormal",
9999
"未安装": "Unkonwn",
100100
"查看更多": "More",
101-
"你还未选择主机": "No Host selected.",
101+
"你还未选择执行目标": "No Host selected.",
102102
"复制成功": "Success",
103103
"个IP": "Host IP Copied.",
104104
"个 Host ID": "Host IP Copied.",
@@ -138,7 +138,7 @@
138138
"目标服务器": "Hosts",
139139
"全局变量": "Global variable",
140140
"手动添加": "Custom",
141-
"请选择主机列表变量": "Choose <host> variables",
141+
"请选择执行目标变量": "Choose <execution target> variables",
142142
"复制IP": "Copy IP",
143143
"全部IP": "All IP",
144144
"异常IP": "Abnormal IP",
@@ -250,7 +250,7 @@
250250
"否": "No",
251251
"字符串": "String",
252252
"命名空间": "Namespace",
253-
"主机列表": "Host",
253+
"执行目标": "Execution target",
254254
"密文": "Ciphertext",
255255
"标签名支持:汉字 A-Z a-z 0-9 _ - ! # @ $ & % ^ ~ = + .": "only letters, numbers, and _ - ! # @ $ & % ^ ~ = + . are allowed",
256256
"版本日志": "Release Notes",

src/frontend/src/i18n/language/zh.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
"异常": "异常",
9999
"未安装": "未安装",
100100
"查看更多": "查看更多",
101-
"你还未选择主机": "你还未选择主机",
101+
"你还未选择执行目标": "你还未选择执行目标",
102102
"复制成功": "复制成功",
103103
"个IP": "个IP",
104104
"个 Host ID": "个 Host ID",
@@ -138,7 +138,7 @@
138138
"目标服务器": "目标服务器",
139139
"全局变量": "全局变量",
140140
"手动添加": "手动添加",
141-
"请选择主机列表变量": "请选择主机列表变量",
141+
"请选择执行目标变量": "请选择执行目标变量",
142142
"复制IP": "复制IP",
143143
"全部IP": "全部IP",
144144
"异常IP": "异常IP",
@@ -250,7 +250,7 @@
250250
"否": "",
251251
"字符串": "字符串",
252252
"命名空间": "命名空间",
253-
"主机列表": "主机列表",
253+
"执行目标": "执行目标",
254254
"密文": "密文",
255255
"标签名支持:汉字 A-Z a-z 0-9 _ - ! # @ $ & % ^ ~ = + .": "标签名支持:汉字 A-Z a-z 0-9 _ - ! # @ $ & % ^ ~ = + .",
256256
"版本日志": "版本日志",

src/frontend/src/views/executive-history/step-detail/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
<div
9898
v-bkloading="{ isLoading: isHostLoading }"
9999
class="container-left">
100-
<!-- 主机列表 -->
100+
<!-- 执行目标 -->
101101
<!-- eslint-disable max-len -->
102102
<result-task-list
103103
:data="dispalyGroup.tasks"

src/frontend/src/views/task-manage/common/render-global-var/batch-operation/create-table-row.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@
197197
},
198198
{
199199
id: GlobalVariableModel.TYPE_HOST,
200-
name: I18n.t('template.主机列表'),
200+
name: I18n.t('template.执行目标'),
201201
},
202202
{
203203
id: GlobalVariableModel.TYPE_PASSWORD,

src/frontend/src/views/task-manage/common/render-global-var/edit-of-plan/host.vue

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<section>
3939
<bk-button @click="handleShowChooseIp">
4040
<icon type="plus" />
41-
{{ $t('template.选择主机') }}
41+
{{ $t('template.执行目标') }}
4242
</bk-button>
4343
<bk-button
4444
v-if="isShowClear"
@@ -48,6 +48,7 @@
4848
</bk-button>
4949
</section>
5050
<jb-ip-selector
51+
:config="ipSelectorConfig"
5152
:original-value="originalExecuteObjectsInfoInfo"
5253
:show-dialog="isShowChooseIp"
5354
show-view
@@ -75,8 +76,6 @@
7576
</jb-form>
7677
</template>
7778
<script>
78-
import _ from 'lodash';
79-
8079
import ExecuteTargetModel from '@model/execute-target';
8180
import TaskGlobalVariableModel from '@model/task/global-variable';
8281
@@ -124,6 +123,24 @@
124123
},
125124
},
126125
created() {
126+
this.ipSelectorConfig = {};
127+
// 业务集和租户集场景不支持动态分组和容器
128+
if (window.PROJECT_CONFIG.SCOPE_TYPE === 'biz_set') {
129+
this.ipSelectorConfig = {
130+
panelList: [
131+
'staticTopo',
132+
'dynamicTopo',
133+
'manualInput',
134+
],
135+
};
136+
} else if (window.PROJECT_CONFIG.SCOPE_TYPE === 'tenant_set') {
137+
this.ipSelectorConfig = {
138+
panelList: [
139+
'staticTopo',
140+
'manualInput',
141+
],
142+
};
143+
}
127144
this.originalExecuteObjectsInfoInfo = ExecuteTargetModel.cloneExecuteObjectsInfo(this.formData.defaultTargetValue.executeObjectsInfo);
128145
},
129146
methods: {

src/frontend/src/views/task-manage/common/render-global-var/edit-of-plan/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
class="item"
5050
:disabled="isTypeDisabled"
5151
value="host">
52-
{{ $t('template.主机列表') }}
52+
{{ $t('template.执行目标') }}
5353
</bk-radio-button>
5454
<bk-radio-button
5555
class="item"

0 commit comments

Comments
 (0)