Skip to content

Commit

Permalink
feat: 重装数据中有包含直连通道的数据才请求
Browse files Browse the repository at this point in the history
# Reviewed, transaction id: 14052
  • Loading branch information
hyunfa committed Aug 5, 2024
1 parent 893d09e commit 32700ca
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions frontend/src/views/agent/agent-setup/agent-import.vue
Original file line number Diff line number Diff line change
Expand Up @@ -367,15 +367,15 @@ export default class AgentImport extends Mixins(mixin) {
});
data = JSON.parse(JSON.stringify(formatData));
}
if (MainStore.AUTO_JUDGE_INSTALL_CHANNEL) {
const filterData = data.filter(item => item.bk_cloud_id === 0);
const filterData = data.filter(item => item.bk_cloud_id === 0);
if (MainStore.AUTO_JUDGE_INSTALL_CHANNEL && filterData.length > 0) {
const params = filterData.map((item: any) => ({
bk_host_id: item.bk_host_id,
inner_ip: item.inner_ip,
}));
const res = await AgentStore.getJudgeChannelList(params);
res?.data && data.forEach((item: any) => {
const channel = res.data.find((resItem: any) => resItem.bk_host_id === item.bk_host_id);
res && data.forEach((item: any) => {
const channel = res.find((resItem: any) => resItem.bk_host_id === item.bk_host_id);
if (channel) {
item.install_channel_id = channel.install_channel_id === null ? 'default' : channel.install_channel_id;
}
Expand Down

0 comments on commit 32700ca

Please sign in to comment.