+ # open description
+ # can't seem to get classes to get through to the google maps API
+ # so have to use hard-wired settings
+ description = ""
+ description += "<table style='border: 1px solid black; padding: 3px; margin-top:5px;' width='300px'>"
+ description += "<thead></thead><tbody>"
+
+ # TESTBED
+ description += "<tr>"
+ description += "<td style='font-weight: bold'>Testbed</td>"
+ (peername,peerurl) = self.peer_info (site,peers)
+ description += "<td style='vertical-align:middle;'>"
+ description += "<p><img src='%(iconurl)s' style='vertical-align:middle;'/>"%locals()
+ description += "<a href='%(peerurl)s' style='text-decoration:none;vertical-align:middle;'> %(peername)s </a>"%locals()
+ description += "</p></td></tr>"
+
+ # URL
+ if site['url']:
+ site_url=site['url']
+ description += "<tr>"
+ description += "<td style='font-weight: bold'>Website</td>"
+ description += "<td>"
+ description += "<a style='text-decoration: none;' href='%(site_url)s'> %(site_url)s </a>"%locals()
+ description += "</td>"
+ description += "</tr>"
+
+ # nodegroup direct link
+ if self.options.nodegroup:
+ nodegroup=self.options.nodegroup
+ description += "<tr>"
+ description += "<td style='font-weight: bold'>Nodegroup</td>"
+ description += "<td>"
+ description += "<a style='text-decoration: none;' href='/planetlab/tags/nodegroups.php?id=%(nodegroup_id)d'> %(nodegroup)s </a>"%locals()
+ description += "</td>"
+ description += "</tr>"
+
+
+ # Usage area
+ if not nodegroup_id: title="Usage"
+ else: title="Nodes"
+ description += "<tr>"
+ description += "<td style='font-weight: bold; margin-bottom:2px;'>%(title)s</td>"%locals()
+
+ # encapsulate usage in a table of its own
+ description += "<td>"
+ description += "<table style=''>"
+ description += "<thead></thead><tbody>"
+
+ # NODES
+ # regular all-sites mode
+ if not nodegroup_id:
+ description += "<tr><td align='center'>"
+ description += "<img src='%(apiurl)s/googlemap/node.png'/>"%locals()
+ description += "</td><td>"
+ if nb_nodes:
+ description += "<a style='text-decoration: none;' href='%(apiurl)s/db/nodes/index.php?site_id=%(site_id)d'>%(nb_nodes)d node(s)</a>"%locals()
+ else:
+ description += "<i>No node</i>"
+ description += "</td></tr>"
+ # nodegroup mode : show all nodes
+ else:
+ for node_id in site['node_ids']:
+ node=node_hash[node_id]
+ hostname=node['hostname']
+ description += "<tr><td align='center'>"
+ description += "<img src='%(apiurl)s/googlemap/node.png'/>"%locals()
+ description += "</td><td>"
+ description += "<a style='text-decoration: none;' href='%(apiurl)s/db/nodes/index.php?id=%(node_id)d'>%(hostname)s </a>"%locals()
+ description += "</td></tr>"
+
+ #SLICES
+ if not nodegroup_id:
+ description += "<tr><td align='center'>"
+ description += "<img src='%(apiurl)s/googlemap/slice.png'/>"%locals()
+ description += "</td><td>"
+ if nb_slices:
+ description += "<a style='text-decoration: none;' href='%(apiurl)s/db/slices/index.php?site_id=%(site_id)d'>%(nb_slices)d slice(s)</a>"%locals()
+ else:
+ description += "<span style='font-style:italic;'>No slice</span>"
+ description += "</td></tr>"
+
+ # close usage table
+ description += "</tbody></table>"
+ description += "</td></tr>"
+
+ # close description
+ description += "</tbody></table>"
+
+ if not self.options.labels:
+ name=""
+ description=""
+