def create_header(workflow_stat):
    """
	Generates the header html content.
	@param workflow_stat the WorkflowInfo object reference 
	"""
    header_str = (
        """
<html>
<head>
<title>"""
        + workflow_stat.wf_uuid
        + """</title>
<style type ='text/css'>
#host_chart{
border:2px solid orange;
}
#host_chart_footer_div{
border:2px solid #C35617;
border-top-style:none;
}
#host_chart_legend_div{
color:#0066CC;
}
.header_level1{
font-family:"Times New Roman", Times, serif; 
font-size:36px;
}
.header_level2{
font-family:"Times New Roman", Times, serif; 
font-size:30px;
padding-top:25px;
}
</style>
</head>
<body>
<script type='text/javascript' src='js/protovis-r3.2.js'></script>
	"""
    )
    header_str += plot_utils.create_home_button()
    return header_str
Exemple #2
0
def create_header(workflow_stat):
	"""
	Generates the header html content.
	@param workflow_stat the WorkflowInfo object reference 
	"""
	header_str = """
<html>
<head>
<title>"""+ workflow_stat.wf_uuid +"""</title>
<style type ='text/css'>
#time_chart{
border:1px solid orange;
}
#time_chart_footer_div{
border:1px solid #C35617;
}
</style>
</head>
<body>
<script type="text/javascript" src="js/protovis-r3.2.js"></script>
"""
	header_str += plot_utils.create_home_button()
	return header_str
Exemple #3
0
def create_header(workflow_stat):
    """
	Generates the header html content.
	@param workflow_stat the WorkflowInfo object reference 
	"""
    header_str = """
<html>
<head>
<title>""" + workflow_stat.wf_uuid + """</title>
<style type ='text/css'>
#time_chart{
border:1px solid orange;
}
#time_chart_footer_div{
border:1px solid #C35617;
}
</style>
</head>
<body>
<script type="text/javascript" src="js/protovis-r3.2.js"></script>
"""
    header_str += plot_utils.create_home_button()
    return header_str
Exemple #4
0
def create_header(workflow_stat):
	"""
	Generates the header html content.
	@param workflow_stat the WorkflowInfo object reference 
	"""
	header_str = """
<html>
<head>
<title>"""+ workflow_stat.wf_uuid +"""</title>
<style type ='text/css'>
#breakdown_chart{
border:2px solid orange;
}
#breakdown_chart_footer_div{
border:2px solid  #C35617;
border-top-style:none;
}
#breakdown_chart_legend_div{
color:#0066CC;
}
.header_level1{
font-family:"Times New Roman", Times, serif; 
font-size:36px;
}
.header_level2{
font-family:"Times New Roman", Times, serif; 
font-size:30px;
padding-top:25px;
}
</style>
</head>
<body>
<script type='text/javascript' src='js/protovis-r3.2.js'>
</script>
"""
	header_str += plot_utils.create_home_button()
	return header_str
def create_image_gallery(file_name, wf_uuid_list, wf_parent_uuid_list, uuid_image_map, wf_uuid_label_map, isDax):
	"""
	Creates the image gallery.
	@param file_mame the output file name
	@param wf_uuid_list the list of all workflow id's
	@param wf_parent_uuid_list the list of parent workflow id's corresponding to each workflow
	@param uuid_image_map uuid and image file mapping
	@param wf_uuid_label_map uuid and label mapping
	@isDax boolean indicating whether it is a dax file or not.
	"""
	wf_uuid_parent_ref = None
	try:
		fh = open(file_name, "w")
		content = """
<html>
<head>
<style>
.imgbox
{
float:left;
text-align:center;
width:450px;
height:450px;
margin:4px;
margin-bottom:8px;
padding:0px;
}
.thumbnail
{
width:300px;
height:300px;
margin:3px;
}
.box
{
width:450px;
padding:0px;
}
.workflow
{
clear:both;
}
</style>
</head>
<body>
""" + plot_utils.create_home_button() + """
<center>
"""
		if isDax:
			content += "<h3>DAX Graph </h3>" + NEW_LINE_STR
		else:
			content += "<h3>DAG Graph </h3>"+ NEW_LINE_STR
		for index in range(len(wf_uuid_list)):
			uuid = wf_uuid_list[index]
			image = uuid_image_map[index]
			label = wf_uuid_label_map[index]
			parent_uuid =wf_parent_uuid_list[index]
			if parent_uuid is None:
				content += "<h3 class= 'workflow'> Top level workflow (" + uuid + ")</h3>"
			else:
				if parent_uuid != wf_uuid_parent_ref:
					wf_uuid_parent_ref = parent_uuid 
					content += "<h3 class= 'workflow'> Sub  workflow's of workflow (" +  parent_uuid + ")</h3>"
			content += "<div  class ='imgbox' >"
			if image is None:
				content += "<a class= 'thumbnail' href ='#'>\n"
				content +="<img src ='images/not_available.jpg' height='300px' width='300px'>\n"
				content +="</img>\n</a>"
				content +="<div class ='box'>\n"
				content += "wf_uuid :" + uuid +"<br/>"
				if isDax:
					content+= "dax label :" + label
				else:
					if image is not None:
						content += "dag label :" + image
				content +="</div>"					
			else:
				content +="<a class= 'thumbnail'  href ='" + image + "'>"
				content +="<img src ='" + image + "' height='300px' width='300px'>"
				content +="</img>\n</a>\n"
				content +="<div class ='box'>\n"
				content += "wf_uuid :" + uuid +"<br/>"
				if isDax:
					content += "dax label :" + label
				else:
					if label is not None:
						content += "dag label :" + label
				content += "</div>"
			content += "</div>"
		content += """
</center>
</body>
</html>
"""
		fh.write( content)
	except IOError:
		logger.error("Unable to write to file " + data_file)
		sys.exit(1)
	else:
		fh.close()