1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
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;
}
}
|