# HG changeset patch # User Christophe Lincoln # Date 1304782697 -7200 # Node ID ffb061b0826f90ca4ed9653691d9dbbea810cdd7 # Parent 99b24823dbc7f1bfd9dacbf56faae7de0152a8fe Improve web interface, keep and show more activity and cooknote diff -r 99b24823dbc7 -r ffb061b0826f cooker --- a/cooker Sat May 07 16:33:12 2011 +0200 +++ b/cooker Sat May 07 17:38:17 2011 +0200 @@ -56,7 +56,7 @@ } # Lograte activity. -[ -s "$activity" ] && tail -n 20 $activity > /tmp/tail && \ +[ -s "$activity" ] && tail -n 60 $activity > /tmp/tail && \ mv -f /tmp/tail $activity # Log activities, we want first letter capitalized. diff -r 99b24823dbc7 -r ffb061b0826f web/cooker.cgi --- a/web/cooker.cgi Sat May 07 16:33:12 2011 +0200 +++ b/web/cooker.cgi Sat May 07 17:38:17 2011 +0200 @@ -34,7 +34,7 @@ -e 's#no$#no#g' \ -e 's#error$#error#g' \ -e 's#ERROR:#ERROR:#g' \ - -e s"#^Executing:\([^']*\).#\0#"g \ + -e s"#^Executing:\([^']*\).#\0#"g \ -e s"#^====\([^']*\).#\0#"g \ -e s"#^[a-zA-Z0-9]\([^']*\) :: #\0#"g \ -e s"#ftp://\([^']*\).*#\0#"g \ @@ -121,23 +121,34 @@ else echo "
No log: $pkg
" fi ;; - log=*) - log=${QUERY_STRING#log=} - file=$LOGS/$log.log - echo "

Log for: $log

" - if [ -f "$LOGS/$log.log" ]; then - if fgrep -q "Summary" $file; then + file=*) + # Dont allown all files on the system for security reason. + file=${QUERY_STRING#file=} + case "$file" in + activity|cooknotes) + echo "

DB: $file

" echo '
'
-				grep -A 8 "^Summary" $file | sed /^$/d | \
-					syntax_highlighter log
-				echo '
' - fi - echo '
'
-			cat $file | syntax_highlighter log
-			echo '
' - else - echo "
No log for: $log
" - fi ;; + tac $CACHE/$file | \ + sed s"#^\([^']* : \)#\0#"g + echo '' ;; + *.log) + file=$LOGS/$file + name=$(basename $file) + echo "

Log for: ${name%.log}

" + if [ -f "$LOGS/$log.log" ]; then + if fgrep -q "Summary" $file; then + echo '
'
+						grep -A 8 "^Summary" $file | sed /^$/d | \
+							syntax_highlighter log
+						echo '
' + fi + echo '
'
+					cat $file | syntax_highlighter log
+					echo '
' + else + echo "
No log for: $log
" + fi ;; + esac ;; receipt=*) pkg=${QUERY_STRING#receipt=} echo "

Receipt for: $pkg

" @@ -164,23 +175,29 @@ Packages in wok : $(ls $WOK | wc -l) Wok revision : $(cd $WOK && hg head --template '{rev}\n') Commits to cook : $(cat $commits | wc -l) +Current cooklist : $(cat $cooklist | wc -l) Broken packages : $(cat $broken | wc -l)
- Latest logs: cookorder - commits + Logs: + cookorder + commits

Activity

-$(tac $CACHE/activity | sed s"#^\([^']* : \)#\0#"g)
+$(tac $CACHE/activity | head -n 12 | \
+	sed s"#^\([^']* : \)#\0#"g)
 
+More activity

Cooknotes

-$(cat $cooknotes)
+$(tac $cooknotes | head -n 12 | \
+	sed s"#^\([^']* : \)#\0#"g)
 
+More notes

Commits

diff -r 99b24823dbc7 -r ffb061b0826f web/style.css
--- a/web/style.css	Sat May 07 16:33:12 2011 +0200
+++ b/web/style.css	Sat May 07 17:38:17 2011 +0200
@@ -1,6 +1,6 @@
 /* CSS style for SliTaz Cooker */
 
-body { font: 96% sans-serif, vernada, arial; margin: 0; }
+body { font: 13px sans-serif, vernada, arial; margin: 0; }
 h1 { margin: 0; padding: 8px; color: #fff; font-size: 20px; }
 h1 a { color: #fff; text-decoration: none; }
 h2 { color: #444; } h3 { color: #666; font-size: 140%; }
@@ -9,8 +9,8 @@
 	background-color: #f8f8f8;
 	border: 1px solid #ddd;
 	padding: 10px;
-	border-radius: 4px;
 	overflow: auto;
+	font-size: 96%;
 }
 
 #header {
@@ -39,3 +39,32 @@
 .log-date { color: #666; font-size: 95%; }
 .sh-comment { color: #b20000; }
 .sh-val { color: #f35a00; }
+
+/* Buttons */
+
+.button {
+	padding: 2px 4px;
+	margin: 0;
+	background-color: #f1f1f1;
+	border: 1px solid #ddd;
+	cursor: pointer;
+	color: #000;
+}
+
+a.button  {
+	text-decoration: none;
+	color: #666;
+}
+
+.button:hover {
+	background-color: #ddd;
+	border: 1px solid #999;
+}
+
+/* Round corner */
+
+pre, .button {
+	/*-moz-border-radius: 4px;
+	-webkit-border-radius: 4px; */
+	border-radius: 4px;
+}