Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix dubbo admin console dispaly error in https://github.com/alibaba/… #780

Merged
merged 11 commits into from
Dec 6, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
* <p>Providers.</p>
Expand Down Expand Up @@ -107,11 +109,35 @@ else if (application != null && application.length() > 0) {
}

context.put("providers", providers);
context.put("serviceAppMap", getServiceAppMap(providers));

// 设置搜索结果到cookie中
setSearchHistroy(context, value);
}

/**
* @author WangXin
* 计算各个服务对应的应用列表,方便页面对"重复"的提示
* @param providers app services
*/
private Map<String, Set<String>> getServiceAppMap(List<Provider> providers) {
Map<String, Set<String>> serviceAppMap = new HashMap<String, Set<String>>();
if (providers != null && providers.size() >= 0) {
for (Provider provider : providers) {
Set<String> appSet;
String service = provider.getService();
if (serviceAppMap.get(service) == null) {
appSet = new HashSet<String>();
} else {
appSet = serviceAppMap.get(service);
}
appSet.add(provider.getApplication());
serviceAppMap.put(service, appSet);
}
}
return serviceAppMap;
}

/**
* 设置search记录到cookie中,操作步骤:
* 检查加入的记录是否已经存在cookie中,如果存在,则更新列表次序;如果不存在,则插入到最前面
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ confirm.batch.tostatic=\u786e\u5b9a\u8f6c\u4e3a\u9759\u6001\u6240\u9009\u9879?
confirm.batch.todynamic=\u786e\u5b9a\u8f6c\u4e3a\u52a8\u6001\u6240\u9009\u9879?
current.user=\u5f53\u524d\u7528\u6237
CheckProviderLocalAddress={0}\u4E0D\u662F\u6709\u6548\u7684\u8FDC\u7A0B\u670D\u52A1\u5730\u5740\uFF0C\u8BF7\u68C0\u67E5\u63D0\u4F9B\u65B9/etc/hosts\u6620\u5C04\u662F\u5426\u6B63\u786E\u3002
CheckProviderApplicationDifferent=\u591a\u4e2a\u4e0d\u540c\u5e94\u7528\u6ce8\u518c\u4e86\u76f8\u540c\u670d\u52a1\uFF0C\u8BF7\u68C0\u67E5{0}\u548C{1}\u4E2D\u662F\u5426\u6709\u8BEF\u66B4\u9732\u3002
CheckProviderApplicationDifferent=\u591a\u4e2a\u4e0d\u540c\u5e94\u7528\u6ce8\u518c\u4e86\u76f8\u540c\u670d\u52a1\uff0c\u8bf7\u68c0\u67e5{0}\u4e2d\u662f\u5426\u6709\u8bef\u66b4\u9732\u3002
CheckProviderAddressMismatch=\u670d\u52a1URL\u4e0a\u7684IP\u4e0e\u8fde\u63a5\u6ce8\u518c\u4e2d\u5fc3\u7684IP\u4e0d\u76f8\u540c
CheckConnectionDisconnected=\u8be5\u8fde\u63a5\u5df2\u65ad\u5f00\uff0c\u6570\u636e\u5e93\u810f\u6570\u636e\uff0c\u8bf7\u70b9\u51fb\u201c\u91cd\u8fde\u201d
CheckConnectionExpired=\u8be5\u8fde\u63a5\u6240\u5728\u6ce8\u518c\u4e2d\u5fc3\u5df2\u4e0d\u5b58\u5728\uff08\u6570\u636e\u4f1a\u81ea\u52a8\u5b9a\u671f\u6e05\u7406\uff09
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ confirm.batch.tostatic=\u78ba\u5b9a\u8f49\u70ba\u975c\u614b\u6240\u9078\u9805?
confirm.batch.todynamic=\u78ba\u5b9a\u8f49\u70ba\u52d5\u614b\u6240\u9078\u9805?
current.user=\u7576\u524d\u7528\u6236
CheckProviderAddressMismatch=\u670d\u52d9URL\u4e0a\u7684IP\u8207\u9023\u63a5\u8a3b\u518a\u4e2d\u5fc3\u7684IP\u4e0d\u76f8\u540c
CheckProviderApplicationDifferent=\u591a\u500b\u4e0d\u540c\u61c9\u7528\u8a3b\u518a\u4e86\u76f8\u540c\u670d\u52d9
CheckProviderApplicationDifferent=\u591a\u500b\u4e0d\u540c\u61c9\u7528\u8a3b\u518a\u4e86\u76f8\u540c\u670d\u52d9\uff0c\u8acb\u6aa2\u67e5{0}\u4e2d\u662f\u5426\u6709\u8aa4\u66b4\u9732\u3002
CheckConnectionDisconnected=\u8a72\u9023\u63a5\u5df2\u65b7\u958b\uff0c\u8cc7\u6599\u5eab\u9ad2\u8cc7\u6599\uff0c\u8acb\u9ede\u64ca\u201c\u91cd\u9023\u201d
CheckConnectionExpired=\u8a72\u9023\u63a5\u6240\u5728\u8a3b\u518a\u4e2d\u5fc3\u5df2\u4e0d\u5b58\u5728\uff08\u8cc7\u6599\u6703\u81ea\u52d5\u5b9a\u671f\u6e05\u7406\uff09
CheckDatabaseMiss=\u8cc7\u6599\u5eab\u8cc7\u6599\u610f\u5916\u4e1f\u5931\u6b64\u8cc7\u6599\uff0c\u8acb\u9ede\u64ca\u201c\u6062\u5fa9\u201d
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,11 @@
<td>
#set($errorLevel = "ok")
#set($errorMessage = "")

#if ($providerApplication == "")
#set($providerApplication = $provider.application)
#end

#if($providerApplication != $provider.application)
#set($appList = $!serviceAppMap.get($provider.service))
#if($appList.size()>1)
#if ($errorLevel != "error") #set($errorLevel = "warn") #end
#set($errorMessage ="$errorMessage<br>$i18n.get('warn'): $i18n.get(
'CheckProviderApplicationDifferent', $providerApplication, $provider.application)")
'CheckProviderApplicationDifferent', $appList)")
#end

#if($provider.address.startsWith("127.") || $provider.address.startsWith(
Expand Down