Skip to content

Commit

Permalink
Merge pull request TencentBlueKing#3066 from hLinx/hotfix_3.9.x
Browse files Browse the repository at this point in the history
merge frontend
  • Loading branch information
hLinx authored Jun 17, 2024
2 parents 179bf9e + 6cac4df commit 2a48e44
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 19 deletions.
27 changes: 22 additions & 5 deletions src/frontend/src/common/fully-import.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import Vue from 'vue';
import VueProgressBar from 'vue-progressbar';

import CustomSettingsService from '@service/custom-settings';
import FeatureService from '@service/feature';
import HostManageService from '@service/host-manage';
import QueryGlobalSettingService from '@service/query-global-setting';

Expand Down Expand Up @@ -65,6 +66,8 @@ import TippyTips from '@components/tippy-tips';

import createIpSelector from '@blueking/ip-selector';

import i18n from '@/i18n';

import 'bk-magic-vue/dist/bk-magic-vue.min.css';
import '@blueking/ip-selector/dist/styles/vue2.6.x.css';

Expand Down Expand Up @@ -93,14 +96,28 @@ const IpSelector = createIpSelector({
fetchContainerCheck: HostManageService.fetchInputParseContainerList,
fetchCustomSettings: CustomSettingsService.fetchAll,
updateCustomSettings: CustomSettingsService.update,
fetchConfig: () => QueryGlobalSettingService.fetchRelatedSystemUrls()
.then(data => ({
fetchConfig: () => Promise.all([
QueryGlobalSettingService.fetchRelatedSystemUrls(),
FeatureService.fetchList(),
])
.then(([systemUrls, featureData]) => ({
// eslint-disable-next-line max-len
bk_cmdb_dynamic_group_url: `${data.BK_CMDB_ROOT_URL}/#/business/${window.PROJECT_CONFIG.SCOPE_ID}/custom-query`,
bk_cmdb_dynamic_group_url: `${systemUrls.BK_CMDB_ROOT_URL}/#/business/${window.PROJECT_CONFIG.SCOPE_ID}/custom-query`,
// eslint-disable-next-line max-len
bk_cmdb_static_topo_url: `${data.BK_CMDB_ROOT_URL}/#/business/${window.PROJECT_CONFIG.SCOPE_ID}/custom-query`,
container_enable: true,
bk_cmdb_static_topo_url: `${systemUrls.BK_CMDB_ROOT_URL}/#/business/${window.PROJECT_CONFIG.SCOPE_ID}/custom-query`,
container_enable: featureData.containerExecution,
})),
functionalDependency: { // 功能依赖展示
container: {
title: i18n.t('暂未开启“容器执行”功能'),
functionDesc: i18n.t('功能开启后,即可以基于配置平台的业务容器拓扑,对容器管理平台纳管的容器实例进行脚本指令执行和文件分发'),
guideTitle: i18n.t('如需使用该功能,须具备以下条件:'),
guideDescList: [
i18n.t('1. 部署容器管理平台(BCS)并开启容器拓扑同步至配置平台(CC)'),
i18n.t('2. 联系作业平台管理员打开容器执行功能'),
],
},
},
});

Vue.use(bkMagicVue);
Expand Down
34 changes: 34 additions & 0 deletions src/frontend/src/domain/service/feature.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* Tencent is pleased to support the open source community by making BK-JOB蓝鲸智云作业平台 available.
*
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
*
* BK-JOB蓝鲸智云作业平台 is licensed under the MIT License.
*
* License for BK-JOB蓝鲸智云作业平台:
*
* ---------------------------------------------------
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
* the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*/

/* eslint-disable no-param-reassign */
import FeatureSource from '../source/feature';

export default {
fetchList() {
return FeatureSource.getList()
.then(({ data }) => data);
},
};
5 changes: 5 additions & 0 deletions src/frontend/src/i18n/local.js
Original file line number Diff line number Diff line change
Expand Up @@ -605,4 +605,9 @@ export default {
'想要再次查阅「版本日志」也可以从此处进入喔~': 'Click here to access all the \'Release notes\', to stay updated on all changes and improvements.',
'已成功保存到历史缓存!': 'Successful',
'请注意!脚本输出的内容大小上限为5M,超过可能导致日志被丢弃。': 'The maximum size limit for script output is 5MB, Exceeding the limit may loss the logs.',
'暂未开启“容器执行”功能': 'Container execution feature is not yet enabled.',
'功能开启后,即可以基于配置平台的业务容器拓扑,对容器管理平台纳管的容器实例进行脚本指令执行和文件分发': 'After the feature is enabled, you can launch script or transfer files on container instances managed by the container management platform(BCS) based on the container topo. of the configuration platform(CC).',
'如需使用该功能,须具备以下条件:': 'To use this feature, the following conditions must be met:',
'1. 部署容器管理平台(BCS)并开启容器拓扑同步至配置平台(CC)': '1. Deploy the container management platform (BCS) and enable container topology synchronization to the configuration platform (CC).',
'2. 联系作业平台管理员打开容器执行功能': '2. Contact the JOB administrator to enable the container execution feature.',
};
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<td>{{ item.name }}</td>
<td>{{ item.typeText }}</td>
<td class="variable-value">
{{ item.value }}
<span> {{ item.value }}</span>
</td>
</tr>
</tbody>
Expand All @@ -69,12 +69,6 @@
type: Number,
required: true,
},
ip: {
type: String,
},
host: {
type: Object,
},
},
data() {
return {
Expand All @@ -85,7 +79,6 @@
watch: {
name: {
handler() {
this.isLoading = true;
this.fetchStepVariables();
},
immediate: true,
Expand All @@ -94,14 +87,9 @@
methods: {
// 步骤使用的变量
fetchStepVariables() {
if (!this.ip) {
this.isLoading = false;
return;
}
this.isLoading = true;
TaskExecuteService.fetchStepVariables({
stepInstanceId: this.stepInstanceId,
hostId: this.host.hostId,
ip: `${this.host.cloudAreaId}:${this.host.ipv4}`,
}).then((data) => {
this.variableList = Object.freeze(data);
})
Expand Down

0 comments on commit 2a48e44

Please sign in to comment.