Skip to content

Commit

Permalink
Update for show encode-zookeeper-node-info
Browse files Browse the repository at this point in the history
  • Loading branch information
mauersu committed Feb 24, 2016
1 parent bb9bd9e commit b3937d9
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.alibaba.dubbo.common.utils.ConfigUtils;
import com.dubboclub.dk.web.model.SpyZooResponse;
import com.dubboclub.dk.web.model.SpyZooNode;

import org.apache.commons.lang.StringUtils;
import org.apache.zookeeper.WatchedEvent;
import org.apache.zookeeper.Watcher;
Expand All @@ -18,6 +19,7 @@
import org.springframework.web.bind.annotation.ResponseBody;

import java.io.IOException;
import java.net.URLDecoder;
import java.util.*;

/**
Expand Down Expand Up @@ -60,6 +62,7 @@ SpyZooResponse listByParent(@RequestParam(value = "parent",defaultValue = "/",re
for(String child:children){
SpyZooNode node = new SpyZooNode();
node.setName(child);
node.setDecodeName(URLDecoder.decode(child, "UTF-8"));
node.setParent(parent);
node.setNodeStat(zooKeeper.exists((parent.equals("/")?"":parent)+"/"+child,false));
if(zooKeeper.getChildren((parent.equals("/")?"":parent)+"/"+child,false).size()>0){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ public class SpyZooNode {

private String name;

private String decodeName;

private List<SpyZooNode> childNodes;

private List<SpyZooNode> nodeList;
Expand Down Expand Up @@ -50,8 +52,16 @@ public String getName() {
public void setName(String name) {
this.name = name;
}

public String getDecodeName() {
return decodeName;
}

public void setDecodeName(String decodeName) {
this.decodeName = decodeName;
}

public List<SpyZooNode> getChildNodes() {
public List<SpyZooNode> getChildNodes() {
return childNodes;
}

Expand Down
4 changes: 2 additions & 2 deletions dubbokeeper-ui/src/main/resources/dubbo.properties
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
dubbo.application.name=common-monitor
dubbo.application.owner=bieber
dubbo.registry.address=zookeeper://10.59.32.145:2181
dubbo.registry.address=zookeeper://10.100.142.63:2181

#use netty4
dubbo.reference.client=netty4

#peeper config
peeper.zookeepers=localhost:2181
peeper.zookeepers=10.100.142.63:2181
peeper.zookeeper.session.timeout=60000

#logger
Expand Down
1 change: 0 additions & 1 deletion dubbokeeper-ui/src/main/resources/webApplication.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

<context:component-scan base-package="com.dubboclub.dk.web"/>


<mvc:view-controller path="/" view-name="redirect:/index.htm" />
<bean class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver">
<property name="contentNegotiationManager">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
module.value('treeViewDefaults', {
foldersProperty: 'folders',
filesProperty: 'files',
displayProperty: 'name',
displayProperty: 'decodeName',
collapsible: true
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
节点名
</td>
<td>
{{currentSelectedNode.name}}
{{currentSelectedNode.decodeName}}
</td>
</tr>
<tr>
Expand Down

0 comments on commit b3937d9

Please sign in to comment.