tazwok view web/index.php @ rev 344
Small change web interface
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Tue Feb 22 16:28:56 2011 +0100 (2011-02-22) |
parents | 35136c9a1cd6 |
children | 585f029d24a5 |
line source
1 <?php
2 $version=$_GET["version"];
3 if (file_exists("conf-$version.php")) {
4 include("conf-$version.php");
5 }
6 else {
7 if (file_exists("conf.php")) {
8 include("conf.php");
9 }
10 }
12 function include_and_link($file)
13 {
14 global $log_dir, $version;
15 if (($fp = fopen($file,"r")) === false) return;
16 while (($pkg = fgets($fp)) !== false) {
17 $pkg = chop($pkg);
18 if (file_exists("$log_dir/$pkg.html"))
19 echo "<a href=\"log.php?version=$version&package=$pkg\">$pkg</a>\n";
20 else echo "$pkg\n";
21 }
22 fclose($fp);
23 }
25 function list_last_cooked($dir, $suffix)
26 {
27 global $version;
28 $path=basename($dir);
29 system("cd $dir && ls -1t *.$suffix | head -20 | \
30 while read file; do echo -n \$(stat -c '%y' $dir/\$file | \
31 cut -d. -f1); echo ' <a href=\"download.php?version=$version&package=$path/'\$file'\">'\$file'</a>'; done");
32 }
34 ?>
35 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
36 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
37 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
38 <head>
39 <title>SliTaz Build Bot</title>
40 <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
41 <meta name="description" content="Tazbb web interface" />
42 <meta name="robots" content="index nofollow" />
43 <link rel="shortcut icon" href="web/favicon.ico" />
44 <link rel="stylesheet" type="text/css" href="web/slitaz.css" />
45 </head>
46 <body>
48 <!-- Header -->
49 <div id="header">
50 <!-- Access -->
51 <div id="access">
52 <?php
53 $versions_list = fopen('repositories.list', 'r');
54 if($versions_list)
55 {
56 $otherversion = '';
57 while(!feof($versions_list))
58 {
59 $otherversion = fgets($versions_list);
60 echo "<a href=\"?version=$otherversion\">$otherversion</a>";
61 }
62 fclose($versions_list);
63 }
64 ?>
65 </div>
66 <a href="http://bb.slitaz.org/"><img id="logo"
67 src="web/logo.png"
68 title="bb.slitaz.org" alt="bb.slitaz.org" /></a>
69 <p id="titre">#!/Build/Bot/<?php echo $version; ?></p>
70 </div>
72 <!-- Content -->
73 <div id="content-full">
75 <!-- Block begin -->
76 <div class="block">
77 <!-- Nav block begin -->
78 <div id="block_nav">
79 <h3><img src="pics/website/development.png" alt="" />Developers</h3>
80 <ul>
81 <li><a href="http://www.slitaz.org/en/devel/">Website/devel</a></li>
82 <li><a href="http://labs.slitaz.org/">Laboratories</a></li>
83 <li><a href="http://hg.slitaz.org/">Mercurial Repos</a></li>
84 <li><a href="http://people.slitaz.org/">People Stuff</a></li>
85 <li><a href="http://scn.slitaz.org/">Community Network</a></li>
86 </ul>
87 <!-- Nav block end -->
88 </div>
89 <!-- Top block begin -->
90 <div id="block_top">
91 <h1>Build Bot</h1>
92 <p>
93 Tazwok is a <a href="http://www.slitaz.org/">SliTaz GNU/Linux</a>
94 Build Bot, it automatically cooks and tests packages commited in
95 the wok. SliTaz <a href="http://pkgs.slitaz.org/">packages</a> are
96 cooked on the project main server: code name
97 <a href="http://tank.slitaz.org">Tank</a>. This web interface gives
98 the current status of the build bot and the last report
99 about any packages modified by the SliTaz contributors in
100 the Mercurial repositories, aka
101 <a href="http://hg.slitaz.org/">Hg repos</a>.
102 </p>
103 <!-- Top block end -->
104 </div>
105 <!-- Block end -->
106 </div>
108 <h2>Cooklog</h2>
110 <p>
111 <form action="log.php" method="get">
112 <input type="hidden" name="version" value="<?php
113 echo "$version";
114 ?>
115 " />
116 Show pkg log:<br />
117 <input type="text" name="package" style="width: 320px;" />
118 <!-- <input type="submit" value="Show" /> -->
119 </form><br />
120 Note:<br />
121 Flavors/Iso build logs are named: iso-?flavor <br />
122 Temporary toolchain logs are named: tmp-toolchain-?package <br />
123 Check-incoming log is named: incoming
124 </p>
126 <h2>Summary</h2>
127 <ul>
128 <?php
129 // Check curent status (update in real time) and display summary.
130 if (file_exists($lockfile)) {
131 echo "<li>Status: Chroot is mounted</li>\n";
132 }
133 else {
134 echo "<li>Status: Chroot is not mounted</li>\n";
135 }
136 //include("$db_dir/summary");
137 ?>
138 <li>Packages in the wok: <?php
139 system("cd $wok && ls -1 | wc -l"); ?></li>
140 <li>Packages in the main repository: <?php
141 system("cd $packages && ls -1t *.tazpkg | wc -l"); ?></li>
142 <li>Packages in the incoming repository: <?php
143 system("cd $incoming && ls -1t *.tazpkg | wc -l"); ?></li>
144 <li>Commited packages: <?php
145 system("wc -l $packages/commit | cut -f 1 -d ' '"); ?></li>
146 <li>Packages to cook: <?php
147 system("wc -l $packages/cooklist | cut -f 1 -d ' '"); ?></li>
148 <li>Broken packages: <?php
149 system("wc -l $packages/broken | cut -f 1 -d ' '"); ?></li>
150 <li>Blocked packages: <?php
151 system("wc -l $packages/blocked | cut -f 1 -d ' '"); ?></li>
152 </ul>
154 <h3>Commit</h3>
155 <pre class="package">
156 <?php
157 include("$db_dir/commit");
158 ?>
159 </pre>
161 <h3>Cooklist</h3>
162 <pre class="package">
163 <?php
164 include("$db_dir/cooklist");
165 ?>
166 </pre>
168 <h3>Broken</h3>
169 <pre class="package">
170 <?php
171 include_and_link("$db_dir/broken");
172 ?>
173 </pre>
175 <h3>Blocked</h3>
176 <pre class="package">
177 <?php
178 include_and_link("$db_dir/blocked");
179 ?>
180 </pre>
182 <h3>Last cooked packages</h3>
183 <pre class="package">
184 <?php
185 list_last_cooked($incoming, "tazpkg");
186 ?>
187 </pre>
189 <h3>Last removed packages</h3>
190 <pre class="package">
191 <?php
192 include("$db_dir/removed");
193 ?>
194 </pre>
196 <h3>Last cooked flavors</h3>
197 <pre class="package">
198 <?php
199 list_last_cooked($packages, "flavor");
200 ?>
201 </pre>
203 <!-- End of content -->
204 </div>
206 <!-- Footer -->
207 <div id="footer">
208 <div class="right_box">
209 <h4>SliTaz Network</h4>
210 <ul>
211 <li><a href="http://www.slitaz.org/">Main Website</a></li>
212 <li><a href="http://doc.slitaz.org/">Documentation</a></li>
213 <li><a href="http://forum.slitaz.org/">Support Forum</a></li>
214 <li><a href="http://scn.slitaz.org/">Community Network</a></li>
215 <li><a href="http://labs.slitaz.org/">Laboratories</a></li>
216 <li><a href="http://twitter.com/slitaz">SliTaz on Twitter</a></li>
217 <li><a href="http://www.facebook.com/slitaz">SliTaz on Facebook</a></li>
218 </ul>
219 </div>
220 <h4>SliTaz Website</h4>
221 <ul>
222 <li><a href="#header">Top of the page</a></li>
223 <li>Copyright © <span class="year"></span>
224 <a href="http://www.slitaz.org/">SliTaz</a></li>
225 <li><a href="http://www.slitaz.org/en/about/">About the project</a></li>
226 <li><a href="http://www.slitaz.org/netmap.php">Network Map</a></li>
227 <li>Page modified the <?php echo (date( "d M Y", getlastmod())); ?></li>
228 <li><a href="http://validator.w3.org/check?uri=referer"><img
229 src="pics/website/xhtml10.png" alt="Valid XHTML 1.0"
230 title="Code validé XHTML 1.0"
231 style="width: 80px; height: 15px; vertical-align: middle;" /></a></li>
232 </ul>
233 </div>
235 </body>
236 </html>