Skip to content

Commit cafde02

Browse files
committed
Fixed the front-end
1 parent a90c2ac commit cafde02

6 files changed

Lines changed: 136 additions & 73 deletions

File tree

apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/GlobalSearchValueController.java renamed to apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/GlobalSearchController.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import com.ctrip.framework.apollo.portal.component.config.PortalConfig;
2323
import com.ctrip.framework.apollo.portal.entity.vo.ItemInfo;
2424
import com.ctrip.framework.apollo.portal.environment.Env;
25-
import com.ctrip.framework.apollo.portal.service.GlobalSearchValueService;
25+
import com.ctrip.framework.apollo.portal.service.GlobalSearchService;
2626
import com.google.gson.Gson;
2727
import org.springframework.http.HttpStatus;
2828
import org.springframework.http.MediaType;
@@ -40,20 +40,20 @@
4040

4141

4242
@RestController
43-
public class GlobalSearchValueController {
43+
public class GlobalSearchController {
4444
private final PortalSettings portalSettings;
45-
private final GlobalSearchValueService globalSearchValueService;
45+
private final GlobalSearchService globalSearchService;
4646
private final PortalConfig portalConfig;
4747

48-
public GlobalSearchValueController(final PortalSettings portalSettings, final GlobalSearchValueService globalSearchValueService, final PortalConfig portalConfig) {
48+
public GlobalSearchController(final PortalSettings portalSettings, final GlobalSearchService globalSearchService, final PortalConfig portalConfig) {
4949
this.portalSettings = portalSettings;
50-
this.globalSearchValueService = globalSearchValueService;
50+
this.globalSearchService = globalSearchService;
5151
this.portalConfig = portalConfig;
5252
}
5353

5454
@PreAuthorize(value = "@permissionValidator.isSuperAdmin()")
5555
@GetMapping("/global-search/item-info/by-key-or-value")
56-
public ResponseEntity<?> get_ItemInfo_BySearch(@RequestParam(value = "key", required = false, defaultValue = "") String key,
56+
public ResponseEntity<?> getItemInfoBySearch(@RequestParam(value = "key", required = false, defaultValue = "") String key,
5757
@RequestParam(value = "value", required = false , defaultValue = "") String value) {
5858

5959
if(key.isEmpty() && value.isEmpty()) {
@@ -76,7 +76,7 @@ public ResponseEntity<?> get_ItemInfo_BySearch(@RequestParam(value = "key", requ
7676
List<String> envBeyondLimit = new ArrayList<>();
7777
AtomicBoolean hasMoreData = new AtomicBoolean(false);
7878
activeEnvs.forEach(env -> {
79-
PageDTO<ItemInfo> perEnvItemInfos = globalSearchValueService.get_PerEnv_ItemInfo_BySearch(env, key, value,0, portalConfig.getPerEnvSearchMaxResults());
79+
PageDTO<ItemInfo> perEnvItemInfos = globalSearchService.getPerEnvItemInfoBySearch(env, key, value,0, portalConfig.getPerEnvSearchMaxResults());
8080
if (!perEnvItemInfos.hasContent()) {
8181
return;
8282
}

apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/service/GlobalSearchValueService.java renamed to apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/service/GlobalSearchService.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,16 @@
3030
import java.util.List;
3131

3232
@Service
33-
public class GlobalSearchValueService {
33+
public class GlobalSearchService {
3434

35-
private static final Logger LOGGER = LoggerFactory.getLogger(GlobalSearchValueService.class);
35+
private static final Logger LOGGER = LoggerFactory.getLogger(GlobalSearchService.class);
3636
private final AdminServiceAPI.ItemAPI itemAPI;
3737

38-
public GlobalSearchValueService(AdminServiceAPI.ItemAPI itemAPI) {
38+
public GlobalSearchService(AdminServiceAPI.ItemAPI itemAPI) {
3939
this.itemAPI = itemAPI;
4040
}
4141

42-
public PageDTO<ItemInfo> get_PerEnv_ItemInfo_BySearch(Env env, String key, String value, int page, int size) {
42+
public PageDTO<ItemInfo> getPerEnvItemInfoBySearch(Env env, String key, String value, int page, int size) {
4343
List<ItemInfo> perEnvItemInfos = new ArrayList<>();
4444
PageDTO<ItemInfoDTO> perEnvItemInfoDTOs = itemAPI.getPerEnvItemInfoBySearch(env, key, value, page, size);
4545
perEnvItemInfoDTOs.getContent().forEach(itemInfoDTO -> {

apollo-portal/src/main/resources/static/global_search_value.html

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
<th style="text-align: left;width: 10%">{{'Global.Cluster' | translate }}</th>
7474
<th style="text-align: left;width: 10%">{{'Global.NameSpace' | translate }}</th>
7575
<th style="text-align: left;width: 15%">{{'Global.Key' | translate }}</th>
76-
<th style="text-align: left;width: 35%">{{'Global.Value' | translate }}</th>
76+
<th style="text-align: left;width: 35%" id="valueColumn">{{'Global.Value' | translate }}</th>
7777
<th style="text-align: left;width: 10%">{{'Global.Operate' | translate }}</th>
7878
</tr>
7979
<tr ng-repeat="item in pageItemInfo track by $index" href="#" class="hover cursor-pointer">
@@ -82,18 +82,21 @@
8282
<td>{{ item.clusterName }}</td>
8383
<td>{{ item.namespaceName }}</td>
8484
<td>
85-
<span ng-if="isPageItemInfoDirectlyDisplayKey[$index] == '0'">{{ item.key }}</span>
86-
<span ng-if="!(isPageItemInfoDirectlyDisplayKey[$index] == '0')" ng-bind-html="highlightKeyword(item.key,needToBeHighlightedKey)"></span>
85+
<span ng-if="isPageItemInfoDirectlyDisplayKeyWithoutShowHighlightKeyword[$index] == '0'">{{ item.key }}</span>
86+
<span ng-if="!(isPageItemInfoDirectlyDisplayKeyWithoutShowHighlightKeyword[$index] == '0')" ng-bind-html="highlightKeyword(item.key,needToBeHighlightedKey)"></span>
8787
</td>
8888
<td>
89-
<span ng-if="isPageItemInfoDirectlyDisplayValue[$index] == '0'">{{ item.value }}</span>
90-
<span ng-if="!(isPageItemInfoDirectlyDisplayValue[$index] == '0')">
91-
<span ng-show="(isPageItemInfoDirectlyDisplayValue[$index] == '1') && (!isShowHighlightKeyword[$index])" ng-model="needToBeHighlightedValue">{{ needToBeHighlightedValue }}...</span>
92-
<span ng-show="(isPageItemInfoDirectlyDisplayValue[$index] == '2') && (!isShowHighlightKeyword[$index])" ng-model="needToBeHighlightedValue">...{{ needToBeHighlightedValue }}</span>
93-
<span ng-show="(isPageItemInfoDirectlyDisplayValue[$index] == '3') && (!isShowHighlightKeyword[$index])" ng-model="needToBeHighlightedValue">...{{ needToBeHighlightedValue }}...</span>
94-
<a ng-show="!isShowHighlightKeyword[$index]" href="#" ng-click="isShowAllValue($index)">| {{'Global.Expand' | translate }}</a>
95-
<span ng-show="isShowHighlightKeyword[$index]" ng-bind-html="highlightKeyword(item.value,needToBeHighlightedValue)"></span>
96-
<a ng-show="isShowHighlightKeyword[$index]" href="#" ng-click="isShowAllValue($index)">| {{'Global.Abbreviate' | translate }}</a>
89+
<span ng-if="isPageItemInfoDirectlyDisplayValueWithoutShowHighlightKeyword[$index] == '0'">{{ item.value }}</span>
90+
<span ng-if="!(isPageItemInfoDirectlyDisplayValueWithoutShowHighlightKeyword[$index] == '0')">
91+
<span ng-if="isPageItemInfoDisplayValueInARow[$index] == '0'" ng-bind-html="highlightKeyword(item.value,needToBeHighlightedValue)">{{ item.value }}</span>
92+
<span ng-if="!(isPageItemInfoDisplayValueInARow[$index] == '0')">
93+
<span ng-show="(isPageItemInfoDisplayValueInARow[$index] == '1') && (!isShowHighlightKeyword[$index])" ng-model="needToBeHighlightedValue">{{ needToBeHighlightedValue }}...</span>
94+
<span ng-show="(isPageItemInfoDisplayValueInARow[$index] == '2') && (!isShowHighlightKeyword[$index])" ng-model="needToBeHighlightedValue">...{{ needToBeHighlightedValue }}</span>
95+
<span ng-show="(isPageItemInfoDisplayValueInARow[$index] == '3') && (!isShowHighlightKeyword[$index])" ng-model="needToBeHighlightedValue">...{{ needToBeHighlightedValue }}...</span>
96+
<a ng-show="!isShowHighlightKeyword[$index]" href="#" ng-click="isShowAllValue($index)">| {{'Global.Expand' | translate }}</a>
97+
<span ng-show="isShowHighlightKeyword[$index]" ng-bind-html="highlightKeyword(item.value,needToBeHighlightedValue)"></span>
98+
<a ng-show="isShowHighlightKeyword[$index]" href="#" ng-click="isShowAllValue($index)">| {{'Global.Abbreviate' | translate }}</a>
99+
</span>
97100
</span>
98101
</td>
99102
<td>

0 commit comments

Comments
 (0)