diff options
Diffstat (limited to 'Report/HTML.php')
-rw-r--r-- | Report/HTML.php | 132 |
1 files changed, 132 insertions, 0 deletions
diff --git a/Report/HTML.php b/Report/HTML.php new file mode 100644 index 0000000..6e27f14 --- /dev/null +++ b/Report/HTML.php @@ -0,0 +1,132 @@ +<?php +/** + * HTML rendering box. + * + * PHP version 5 + * + * @category Dashboard + * @package Buildsystem + * @author Romain d'Alverny <rda@mageia.org> + * @license MIT License, see LICENSE.txt + * @link http://svnweb.mageia.org/svn/soft/dashboard/ +*/ + +/** +*/ +class Report_HTML +{ + + /** + * + */ + function render($r) + { + $ret = ''; + foreach ($r as $r1) { + $lis = ''; + foreach ($r1['values'] as $v) + $lis .= sprintf('<li class="%s">%s</li>', $v['c'], $v['t']); + + if ($r1['status'] >= 1) + $status = '<span class="ok">OK</span>'; + elseif ($r1['status'] > 0.7) + $status = '<span class="good">GOOD</span>'; + elseif ($r1['status'] < 0.5) + $status = '<span class="failed">NOT READY</span>'; + + $links = $r1['links']; + $ret .= <<<S +<li class="{$working}"><h3>{$r1['title']}</h3> + <p>Status: {$status}</p> + <ul>{$lis}</ul> + <p>{$links}</p> +</li> +S; + } + $s = <<<S + <!DOCTYPE html> + <html lang="en"> + <head> + <meta charset="utf-8"> + <meta name="robots" content="noindex,nosnippet,nocache,nofollow"> + <title>Mageia buildsystem status overview</title> + <style> + body { font-size: 80%; font-family: Helvetica; background: #aaa; } + a:link, a:visited { color: #2383C2; text-decoration: none; } + .clear, hr { clear: both; } + ul.boxes { margin: 0; padding: 0; /*width: 1800px;*/ } + ul.boxes > li { padding-bottom: 2em; } + ul.boxes > li { + background: #fff; + position: relative; + list-style: none; + display: block; + float: left; + padding: 0 1em 2em 1em; + max-width: 600px; + z-index: 1; + margin: 12px; + -webkit-box-shadow: 0 2px 6px #444; + -webkit-border-radius: 6px; + -moz-box-shadow: 0 2px 6px #444; + -moz-border-radius: 6px; + box-shadow: 0 2px 6px #444; + border-radius: 6px; + } + ul.boxes > li:after { + content: "\\02192"; + display: block; + position: absolute; + top: 0px; + right: -16px; + font-size: 200%; + font-weight: bold; + background: #fff; + z-index: 5; + background: -webkit-gradient(linear, left top, right top, from(#fff), to(#aaa)); + background: -moz-gradient(linear, left top, right top, from(#fff), to(#aaa)); + background: gradient(linear, left top, right top, from(#fff), to(#aaa)); + + } + ul.boxes > li:last-child:after { + content: ""; + } + ul.boxes h3 { } + .light { font-weight: normal; } + ul.boxes li ul { padding-left: 1.5em; } + li.warn { color: red; list-style-type: disc; } + .todo { font-style: italic; color: #bbb; } + .todo:before { content: "(";} + .todo:after { content: ")";} + .info { color: #222; } + .unk, .unk a { color: #aaa; text-decoration: none; } + .warning { color: orange; list-style-type: disc; } + .error, .failed { color: red; list-style-type: disc; } + .ok { color: green; } + .isobuild td, + .isobuild th { vertical-align: top; } + td.build-id { text-align: right; } + div.dnotes { color: #666; border: 1px solid #666; padding: 0.6em; font-size: 90%; } + div.dnotes:before { content: "Design Notes"; color: #666; font-weight: bold; text-decoration: underline; } + </style> + </head> + <body> + <h1>Mageia build chain dashboard</h1> + <ul class="boxes">{$ret}</ul> + + <hr> + <div class="dnotes"> + <ul> + <li>Light gray values are unknown for now.</li> + <li><strong>ISO Build block is still a mockup, doesn't work for now!</strong></li> + <li>code is in <a href="http://svnweb.mageia.org/soft/dashboard/">svnweb.mageia.org/soft/dashboard</a>; + to get a copy of the code: <pre>$ svn checkout svn://svn.mageia.org/svn/soft/dashboard</pre> + patches welcome!</li> + </ul> + </div> + </body> + </html> +S; + return $s; + } +}
\ No newline at end of file |