Skip to content

Commit

Permalink
Merge pull request TencentBlueKing#1738 from jsonwan/github_feature/ipv6
Browse files Browse the repository at this point in the history
bugfix: IP选择器静态拓扑搜索条件前加上空格后筛选失效 TencentBlueKing#1737
  • Loading branch information
wangyu096 authored Feb 10, 2023
2 parents 85f8c01 + ad02f02 commit 98aeaa1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -606,9 +606,15 @@ public Response<List<HostInfoVO>> getHostDetails(String username,
.map(HostIdWithMeta::getHostId)
.collect(Collectors.toList());
List<ApplicationHostDTO> hostList = hostDetailService.listHostDetails(appResourceScope, hostIds);
// 排序:Agent异常机器在前,Agent正常机器在后
List<HostInfoVO> hostInfoVOList = hostList.parallelStream()
.filter(hostDTO -> !hostDTO.getGseAgentAlive())
.map(ApplicationHostDTO::toVO)
.collect(Collectors.toList());
hostInfoVOList.addAll(hostList.parallelStream()
.filter(ApplicationHostDTO::getGseAgentAlive)
.map(ApplicationHostDTO::toVO)
.collect(Collectors.toList()));
return Response.buildSuccessResp(hostInfoVOList);
}

Expand Down Expand Up @@ -649,7 +655,6 @@ public Response<AgentStatistics> agentStatistics(String username,
}
List<String> dynamicGroupIdList = agentStatisticsReq.getDynamicGroupIds();
if (CollectionUtils.isNotEmpty(dynamicGroupIdList)) {
long bizId = Long.parseLong(scopeId);
List<ApplicationHostDTO> hostsByDynamicGroup = new ArrayList<>();
for (String id : dynamicGroupIdList) {
hostsByDynamicGroup.addAll(bizDynamicGroupHostService.listHostByDynamicGroup(appResourceScope, id));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,15 @@
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StopWatch;

import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;

/**
* 资源范围下的主机服务
Expand Down Expand Up @@ -235,7 +237,9 @@ private BasicParsedSearchConditions buildSearchConditions(AppResourceScope appRe

List<String> searchContents = null;
if (searchContent != null) {
searchContents = StringUtil.splitByNormalSeparator(searchContent);
searchContents = StringUtil.splitByNormalSeparator(searchContent.trim()).stream()
.filter(StringUtils::isNotBlank)
.collect(Collectors.toList());
}

//获取所有云区域,找出名称符合条件的所有CloudAreaId
Expand Down

0 comments on commit 98aeaa1

Please sign in to comment.