| 63 | } |
| 64 | |
| 65 | func initPageInfo(blockHeight uint32, curNodeType string, ngbrCnt int, ngbrsInfo []NgbNodeInfo) (*Info, error) { |
| 66 | id := fmt.Sprintf("0x%x", node.GetID()) |
| 67 | return &Info{NodeVersion: config.Version, BlockHeight: blockHeight, |
| 68 | NeighborCnt: ngbrCnt, Neighbors: ngbrsInfo, |
| 69 | HttpRestPort: int(config.DefConfig.Restful.HttpRestPort), |
| 70 | HttpWsPort: int(config.DefConfig.Ws.HttpWsPort), |
| 71 | HttpJsonPort: int(config.DefConfig.Rpc.HttpJsonPort), |
| 72 | HttpLocalPort: int(config.DefConfig.Rpc.HttpLocalPort), |
| 73 | NodePort: uint16(config.DefConfig.P2PNode.NodePort), |
| 74 | NodeId: id, NodeType: curNodeType}, nil |
| 75 | } |
| 76 | |
| 77 | func viewHandler(w http.ResponseWriter, r *http.Request) { |
| 78 | var ngbrNodersInfo []NgbNodeInfo |