Changeset 5924 for source/ariba/overlay
- Timestamp:
- Aug 13, 2009, 2:15:09 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
source/ariba/overlay/BaseOverlay.cpp
r5921 r5924 204 204 std::string BaseOverlay::getLinkHTMLInfo() { 205 205 std::ostringstream s; 206 207 s << "<h2 color=\"#606060\">Links</h2>"; 208 s << "<table width=\"100%\" cellpadding=\"0\" border=\"0\" cellspacing=\"0\">"; 209 s << "<tr background=\"#e0e0e0\">"; 210 s << "<td>Id</td><td>Remote</td><td>Path</td>"; 211 s << "</tr>"; 212 213 BOOST_FOREACH( LinkDescriptor* ld, links ) { 214 if (!ld->isVital() || ld->service != OverlayInterface::OVERLAY_SERVICE_ID) continue; 215 s << "<tr>"; 216 s << "<td>" << ld->overlayId.toString().substr(0,4) << "..</td>"; 217 s << "<td>" << ld->remoteNode.toString().substr(0,4) << "..</td>"; 218 s << "<td>"; 219 if (ld->routeRecord.size()>0) { 220 for (size_t i=0; i<ld->routeRecord.size(); i++) 221 s << ld->routeRecord[i].toString().substr(0,4) << ".. "; 222 } 223 s << "</td>"; 206 vector<NodeID> nodes; 207 if (links.size()==0) { 208 s << "<h2 color=\"#606060\">No links established!</h2>"; 209 } else { 210 s << "<h2 color=\"#606060\">Links</h2>"; 211 s << "<table width=\"100%\" cellpadding=\"0\" border=\"0\" cellspacing=\"0\">"; 212 s << "<tr background=\"#e0e0e0\">"; 213 s << "<td>Id</td><td>Remote</td><td>Path</td>"; 224 214 s << "</tr>"; 225 } 226 s << "</table>"; 227 215 216 BOOST_FOREACH( LinkDescriptor* ld, links ) { 217 if (!ld->isVital() || ld->service != OverlayInterface::OVERLAY_SERVICE_ID) continue; 218 bool found = false; 219 BOOST_FOREACH(NodeID& id, nodes) 220 if (id == ld->remoteNode) found = true; 221 if (found) continue; 222 nodes.push_back(ld->remoteNode); 223 s << "<tr>"; 224 s << "<td>" << ld->overlayId.toString().substr(0,4) << "..</td>"; 225 s << "<td>" << ld->remoteNode.toString().substr(0,4) << "..</td>"; 226 s << "<td>"; 227 if (ld->routeRecord.size()>0) { 228 for (size_t i=0; i<ld->routeRecord.size(); i++) 229 s << ld->routeRecord[i].toString().substr(0,4) << ".. "; 230 } 231 s << "</td>"; 232 s << "</tr>"; 233 } 234 s << "</table>"; 235 } 228 236 return s.str(); 229 237 }
Note:
See TracChangeset
for help on using the changeset viewer.