Skip to content

Commit

Permalink
fix: ip选择器容器拓扑树数据量过大卡死 #3057
Browse files Browse the repository at this point in the history
# Reviewed, transaction id: 9784
  • Loading branch information
hLinx committed Jun 14, 2024
1 parent 69ec867 commit e4811ae
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
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.3.0-beta.21",
"@blueking/ip-selector": "0.3.0-beta.26",
"@blueking/login-modal": "1.0.4",
"@blueking/notice-component-vue2": "2.0.0-beta.2",
"@blueking/paas-login": "0.0.11",
Expand Down
18 changes: 14 additions & 4 deletions src/frontend/src/components/task-step/common/rolling/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,10 @@
type: String,
required: true,
},
serverField: {
type: String,
required: true,
},
formData: {
type: Object,
default: () => ({}),
Expand Down Expand Up @@ -200,11 +204,15 @@
},
},
beforeDestroy() {
if (this.popperInstance) {
this.popperInstance.hide();
this.popperInstance.destroy();
}
this.popperInstance = undefined;
},
methods: {
showTips() {
if (this.formData.server.isEmpty) {
if (this.formData[this.serverField].isEmpty) {
this.popperInstance && this.popperInstance.hide();
return;
}
Expand All @@ -221,7 +229,7 @@
size: 'small',
boundary: 'window',
distance: 20,
zIndex: window.__bk_zIndex_manager.nextZIndex(), // eslint-disable-line no-underscore-dangle
zIndex: 990,
});
this.popperInstance.setContent(this.$refs.tips);
}
Expand All @@ -230,11 +238,13 @@
hostList,
nodeList,
containerList,
} = this.formData.server.executeObjectsInfo;
} = this.formData[this.serverField].executeObjectsInfo;

// 选中的主机或者容器大于 100 时直接显示
if (hostList.length >= 100 || containerList.length >= 100) {
this.popperInstance.show();
setTimeout(() => {
this.popperInstance.show();
}, 1000);
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
:form-data="formData"
mode-field="rollingMode"
name="rolling"
server-field="server"
@on-change="handleChange"
@on-reset="handleReset" />
</card-layout>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
:form-data="formData"
mode-field="rollingMode"
name="rolling"
server-field="taskTarget"
@on-change="handleChange"
@on-reset="handleReset" />
</jb-form>
Expand Down

0 comments on commit e4811ae

Please sign in to comment.