Skip to content

Commit

Permalink
feature: 支持容器执行 TencentBlueKing#2725
Browse files Browse the repository at this point in the history
# Reviewed, transaction id: 3200
  • Loading branch information
hLinx committed Mar 1, 2024
1 parent 31ba038 commit 67adc02
Show file tree
Hide file tree
Showing 158 changed files with 2,510 additions and 2,887 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@ support-files/dependJarLists/
**/*.DS_Store
.codecc
build.yml


pre-*-bkcodeai
2 changes: 1 addition & 1 deletion src/frontend/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ module.exports = {
'no-param-reassign': 'off',
'max-len': 'off',
'vue/multi-word-component-names': 'off',
'no-unused-vars': 'off',
'no-unused-vars': 'error',
},
overrides: [
{
Expand Down
3 changes: 2 additions & 1 deletion src/frontend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,5 @@ typings/
dist
*.env.*
.history
.swc
.swc
.codecc
2 changes: 1 addition & 1 deletion src/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"keywords": [],
"license": "ISC",
"dependencies": {
"@blueking/ip-selector": "0.2.0-beta",
"@blueking/ip-selector": "0.3.0-beta.15",
"@blueking/notice-component-vue2": "2.0.0-beta.2",
"@blueking/paas-login": "0.0.11",
"@blueking/user-selector": "1.0.11",
Expand Down
44 changes: 7 additions & 37 deletions src/frontend/src/common/fully-import.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ import ElementTeleport from '@components/element-teleport';
import Empty from '@components/empty';
import Exception from '@components/exception';
import Icon from '@components/icon';
// import createIpSelector from '@components/ip-selector/index.js';
import JbBreadcrumb from '@components/jb-breadcrumb';
import JbBreadcrumbItem from '@components/jb-breadcrumb/jb-breadcrumb-item';
import JbDialog from '@components/jb-dialog';
Expand All @@ -70,47 +69,13 @@ import 'bk-magic-vue/dist/bk-magic-vue.min.css';
import '@blueking/ip-selector/dist/styles/vue2.6.x.css';

const IpSelector = createIpSelector({
version: '7',
version: '8',
// panelList: ['staticTopo', 'dynamicTopo', 'dynamicGroup', 'manualInput', 'containerStaticTopo', 'containerManualInput'],
panelList: ['staticTopo', 'dynamicTopo', 'dynamicGroup', 'manualInput'],
unqiuePanelValue: false,
nameStyle: 'camelCase',
hostTableDefaultSelectAllMode: true,
hostSearchSelect: true,
// hostTableCustomColumnList: [
// {
// key: 'a1',
// label: '测试列一',
// index: 3,
// field: 'a1',
// width: '100px',
// renderHead: h => h('span', '测试列一header'),
// renderCell: h => h('span', 'render a1'),
// },
// {
// key: 'A2',
// label: '测试列二',
// field: 'A2',
// index: 4,
// width: '100px',
// renderHead: h => h('span', '测试列二header'),
// renderCell: h => h('span', 'render test1'),
// },
// ],
// hostTableRenderColumnList: ['ip', 'alive', 'osName', 'ipv6', 'cloudArea'],
// hostMemuExtends: [
// {
// name: '复制更多一',
// action: () => {
// console.log('复制更多一');
// },
// },
// {
// name: '复制更多二',
// action: () => {
// console.log('复制更多二');
// },
// },
// ],
fetchTopologyHostCount: HostManageService.fetchTopologyWithCount,
fetchTopologyHostsNodes: HostManageService.fetchTopologyHost,
fetchTopologyHostIdsNodes: HostManageService.fetchTopogyHostIdList,
Expand All @@ -121,6 +86,11 @@ const IpSelector = createIpSelector({
fetchDynamicGroups: HostManageService.fetchDynamicGroup,
fetchHostsDynamicGroup: HostManageService.fetchDynamicGroupHost,
fetchHostAgentStatisticsDynamicGroups: HostManageService.fetchBatchGroupAgentStatistics,
fetchTopologyContainerWithCount: HostManageService.fetchTopologyContainerWithCount,
fetchTopologyContainerContainer: HostManageService.fetchTopologyContainerContainer,
fetchContainerTopologyContainerIdList: HostManageService.fetchTopologyContainerContainerIdList,
fetchContainerDetail: HostManageService.fetchContainerInfoById,
fetchContainerCheck: HostManageService.fetchInputParseContainerList,
fetchCustomSettings: CustomSettingsService.fetchAll,
updateCustomSettings: CustomSettingsService.update,
fetchConfig: () => QueryGlobalSettingService.fetchRelatedSystemUrls()
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/src/components/back-top/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
mounted() {
this.smartPosition();
window.addEventListener('resize', this.smartPosition);
const observer = new MutationObserver((payload) => {
const observer = new MutationObserver(() => {
this.smartPosition();
});
observer.observe(this.target(), {
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/src/components/cursor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const init = function (el, binding) {
el.element.style.left = `${elLeft}px`;
el.element.style.top = `${elTop}px`;
};
el.mouseLeaveHandler = function (event) {
el.mouseLeaveHandler = function () {
el.element && el.element.remove();
el.element = null;
el.removeEventListener('mousemove', el.mouseMoveHandler);
Expand Down
34 changes: 17 additions & 17 deletions src/frontend/src/components/global-variable/edit/host.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@
</div>
<ip-selector
ref="ipSelector"
:original-value="originalHostNodeInfo"
:original-value="originalExecuteObjectsInfo"
:show-dialog="isShowChooseIp"
show-view
:show-view-diff="showViewDiff"
:value="hostNodeInfo"
:value="executeObjectsInfo"
@change="handleChange"
@close-dialog="handleCloseIpSelector" />
<p
Expand All @@ -67,10 +67,10 @@
<script>
import _ from 'lodash';

import TaskHostNodeModel from '@model/task-host-node';
import ExecuteTargetModel from '@model/execute-target';

import {
removeIllegalHostFromHostNodeInfo,
removeIllegalHostFromExecuteObjectsInfo,
} from '@utils/assist';

export default {
Expand All @@ -95,13 +95,13 @@
data() {
return {
isShowChooseIp: false,
hostNodeInfo: {},
originalHostNodeInfo: {},
executeObjectsInfo: {},
originalExecuteObjectsInfo: {},
};
},
computed: {
isNotEmpty() {
return !TaskHostNodeModel.isHostNodeInfoEmpty(this.hostNodeInfo);
return !ExecuteTargetModel.isExecuteObjectsInfoEmpty(this.executeObjectsInfo);
},
isError() {
if (this.data.required !== 1) {
Expand Down Expand Up @@ -135,11 +135,11 @@
*/
init() {
if (!this.data.defaultTargetValue.isEmpty) {
this.hostNodeInfo = this.data.defaultTargetValue.hostNodeInfo;
this.executeObjectsInfo = this.data.defaultTargetValue.executeObjectsInfo;
} else {
this.hostNodeInfo = this.data.targetValue.hostNodeInfo;
this.executeObjectsInfo = this.data.targetValue.executeObjectsInfo;
}
this.originalHostNodeInfo = Object.freeze(_.cloneDeep(this.hostNodeInfo));
this.originalExecuteObjectsInfo = Object.freeze(_.cloneDeep(this.executeObjectsInfo));
},
/**
* @desc 外部调用——移除无效主机
Expand All @@ -161,15 +161,15 @@
* @desc 清空主机列表
*/
handleClear() {
const { hostNodeInfo } = new TaskHostNodeModel({});
this.hostNodeInfo = hostNodeInfo;
const { executeObjectsInfo } = new ExecuteTargetModel({});
this.executeObjectsInfo = executeObjectsInfo;
window.changeFlag = true;
},
/**
* @desc 提交编辑的数据
*/
handleChange(hostNodeInfo) {
this.hostNodeInfo = Object.freeze(hostNodeInfo);
handleChange(executeObjectsInfo) {
this.executeObjectsInfo = Object.freeze(executeObjectsInfo);
window.changeFlag = true;
},
/**
Expand All @@ -182,8 +182,8 @@
* @desc 外部调用——移除无效主机
*/
removeIllegalHost() {
this.hostNodeInfo = Object.freeze(removeIllegalHostFromHostNodeInfo(this.hostNodeInfo));
this.originalHostNodeInfo = Object.freeze(_.cloneDeep(this.hostNodeInfo));
this.executeObjectsInfo = Object.freeze(removeIllegalHostFromExecuteObjectsInfo(this.executeObjectsInfo));
this.originalExecuteObjectsInfo = Object.freeze(_.cloneDeep(this.executeObjectsInfo));
},
/**
* @desc 外部调用——值验证
Expand All @@ -202,7 +202,7 @@
type,
value: '',
targetValue: {
hostNodeInfo: this.hostNodeInfo,
executeObjectsInfo: this.executeObjectsInfo,
},
});
});
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/src/components/global-variable/view/host.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<ip-selector
readonly
show-view
:value="data.defaultTargetValue.hostNodeInfo" />
:value="data.defaultTargetValue.executeObjectsInfo" />
</div>
</template>
<script>
Expand Down
26 changes: 0 additions & 26 deletions src/frontend/src/components/ip-selector/adapter/custom-settings.js

This file was deleted.

31 changes: 0 additions & 31 deletions src/frontend/src/components/ip-selector/adapter/dynamic-groups.js

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 67adc02

Please sign in to comment.