19744: Include text report in HTML report
[arvados.git] / tools / crunchstat-summary / crunchstat_summary / webchart.py
index 31afcf64e906166788bf06b9caa4ed191ead13c9..8adf0fee7eda9c157bd32562cf88e573afea7bf3 100644 (file)
@@ -24,15 +24,24 @@ class WebChart(object):
         self.label = label
         self.summarizers = summarizers
 
-    def html(self):
+    def html(self, bodytext=''):
         return '''<!doctype html><html><head>
         <title>{} stats</title>
         <script type="text/javascript" src="{}"></script>
         <script type="text/javascript">{}</script>
+        <style>
+        table {{
+          width: 80%
+        }}
+        td {{
+          width: 20%;
+        }}
+        </style>
         {}
-        </head><body></body></html>
+        </head><body>{}</body></html>
         '''.format(escape(self.label),
-                   self.JSLIB, self.js(), self.headHTML())
+                   self.JSLIB, self.js(), self.headHTML(),
+                   bodytext)
 
     def js(self):
         return 'var chartdata = {};\n{}'.format(