autodist cgi: lots of improvements in interface output and other fixes
This commit is contained in:
parent
005fe6a6f5
commit
0be3a1fc97
44
autodist-cgi
44
autodist-cgi
@ -13,7 +13,7 @@ LINES=`echo "$QUERY_STRING" | sed -n 's/^.*LINES=\([^&]*\).*$/\1/p' | sed "s/%20
|
|||||||
|
|
||||||
echo -e "Content-type: text/html; charset=UTF-8\n\n"
|
echo -e "Content-type: text/html; charset=UTF-8\n\n"
|
||||||
|
|
||||||
[ ! "$AS_SECONDARY" ] && echo "Show: <a href=\"?NUM=\">ALL</a> "
|
[ ! "$AS_SECONDARY" ] && echo "Build environments: [<a href=\"?NUM=\">ALL</a>]<br>"
|
||||||
|
|
||||||
[ "$SHOWINDEX" -o ! "$AS_SECONDARY" ] && \
|
[ "$SHOWINDEX" -o ! "$AS_SECONDARY" ] && \
|
||||||
for i in `seq 0 ${#AUTOPORT_ARCH[*]}`; do
|
for i in `seq 0 ${#AUTOPORT_ARCH[*]}`; do
|
||||||
@ -34,13 +34,17 @@ done
|
|||||||
if [ "$SHOWINDEX" ]; then
|
if [ "$SHOWINDEX" ]; then
|
||||||
exit 0
|
exit 0
|
||||||
else
|
else
|
||||||
curl "$AUTOPORT_CGI_SECONDARY?AS_SECONDARY=1&SHOWINDEX=1"
|
curl "$AUTOPORT_CGI_SECONDARY?AS_SECONDARY=1&SHOWINDEX=1" 2>/dev/null
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[ ! "$AS_SECONDARY" ] && echo "<br>"
|
[ ! "$AS_SECONDARY" ] && echo "<hr>"
|
||||||
|
|
||||||
[ ! "$SHOWLOG" -a "$SECONDARY" = "$AS_SECONDARY" ] && echo "<h2>Host: `hostname -s` (`uname -m`, kernel `uname -r`)</h2>"
|
[ ! "$SHOWLOG" -a "$SECONDARY" = "$AS_SECONDARY" ] && echo "<h2>Host: `hostname -s` (`uname -m`, kernel `uname -r`)</h2>"
|
||||||
|
|
||||||
|
if [ "$SHOWLOG" -a "$SECONDARY" != "$AS_SECONDARY" ]; then
|
||||||
|
curl "$AUTOPORT_CGI_SECONDARY?AS_SECONDARY=1&SHOWLOG=$SHOWLOG&NUM=$NUM&LOG=$LOG" 2>/dev/null
|
||||||
|
else
|
||||||
|
|
||||||
for i in `seq 0 ${#AUTOPORT_ARCH[*]}`; do
|
for i in `seq 0 ${#AUTOPORT_ARCH[*]}`; do
|
||||||
[ "${AUTOPORT_ARCH[$i]}" ] || continue
|
[ "${AUTOPORT_ARCH[$i]}" ] || continue
|
||||||
[ "${AUTOPORT_DISABLE[$i]}" -a "${AUTOPORT_DISABLE[$i]}" != "0" ] && continue
|
[ "${AUTOPORT_DISABLE[$i]}" -a "${AUTOPORT_DISABLE[$i]}" != "0" ] && continue
|
||||||
@ -64,7 +68,12 @@ for i in `seq 0 ${#AUTOPORT_ARCH[*]}`; do
|
|||||||
fi
|
fi
|
||||||
if [ "$SHOWLOG" ]; then
|
if [ "$SHOWLOG" ]; then
|
||||||
if [ "$SECONDARY" = "$AS_SECONDARY" -a "$NUM" = "$i" ]; then
|
if [ "$SECONDARY" = "$AS_SECONDARY" -a "$NUM" = "$i" ]; then
|
||||||
echo "<pre><code>"
|
echo "<h2>$SHOWLOG log in ${AUTOPORT_REPOSITORIES[$i]}(${AUTOPORT_ARCH[$i]}):</h2>"
|
||||||
|
cat << _EOF
|
||||||
|
<div class=downloadbox align=center>
|
||||||
|
<div align=left style="background-color: white; height: 550px; width: 850px; overflow: auto; font-size: 8pt; border:1px solid #2b6600; margin: 4px; padding:4; background-color: #e0f2d0;">
|
||||||
|
_EOF
|
||||||
|
echo -n "<pre><code>"
|
||||||
if [ "$SHOWLOG" = "current" ]; then
|
if [ "$SHOWLOG" = "current" ]; then
|
||||||
cat $LOGFILE | sed "s|<|\<|g"
|
cat $LOGFILE | sed "s|<|\<|g"
|
||||||
elif [ "$SHOWLOG" = "last" ]; then
|
elif [ "$SHOWLOG" = "last" ]; then
|
||||||
@ -77,11 +86,8 @@ for i in `seq 0 ${#AUTOPORT_ARCH[*]}`; do
|
|||||||
fi
|
fi
|
||||||
[ -e $BUILDLOGFILE ] && cat $BUILDLOGFILE | sed "s|<|\<|g"
|
[ -e $BUILDLOGFILE ] && cat $BUILDLOGFILE | sed "s|<|\<|g"
|
||||||
fi
|
fi
|
||||||
echo "</code></pre>"
|
echo "</code></pre></div></div>"
|
||||||
else
|
|
||||||
curl "$AUTOPORT_CGI_SECONDARY?AS_SECONDARY=1&SHOWLOG=$SHOWLOG&NUM=$i&LOG=$LOG"
|
|
||||||
fi
|
fi
|
||||||
exit 0
|
|
||||||
elif [ ! "$SHOWLOG" ]; then
|
elif [ ! "$SHOWLOG" ]; then
|
||||||
[[ "$NUM" && "$NUM" != "$i" ]] && continue
|
[[ "$NUM" && "$NUM" != "$i" ]] && continue
|
||||||
[[ "$SECONDARY" = "$AS_SECONDARY" ]] || continue
|
[[ "$SECONDARY" = "$AS_SECONDARY" ]] || continue
|
||||||
@ -104,6 +110,10 @@ for i in `seq 0 ${#AUTOPORT_ARCH[*]}`; do
|
|||||||
echo "<b>* <a href=\"?NUM=$i&SECONDARY=$AS_SECONDARY\">cross-platform</a> autoport (arch:${AUTOPORT_CROSS[$i]})</b>"
|
echo "<b>* <a href=\"?NUM=$i&SECONDARY=$AS_SECONDARY\">cross-platform</a> autoport (arch:${AUTOPORT_CROSS[$i]})</b>"
|
||||||
echo " [ <a href=\"?SHOWLOG=current&NUM=$i$SECONDARY_ADD\">last</a> ]</b>"
|
echo " [ <a href=\"?SHOWLOG=current&NUM=$i$SECONDARY_ADD\">last</a> ]</b>"
|
||||||
fi
|
fi
|
||||||
|
cat << _EOF
|
||||||
|
<div class=downloadbox align=center>
|
||||||
|
<div align=left style="background-color: white; height: 250px; width: 850px; overflow: auto; font-size: 8pt; border:1px solid #2b6600; margin: 4px; padding:4; background-color: #e0f2d0;">
|
||||||
|
_EOF
|
||||||
echo "<pre>"
|
echo "<pre>"
|
||||||
if [ "${AUTOPORT_UPDATE[$i]}" ]; then
|
if [ "${AUTOPORT_UPDATE[$i]}" ]; then
|
||||||
unset STARTTIME ENDTIME JOBON BUILDNOW BUILDLOG SCHEDULED
|
unset STARTTIME ENDTIME JOBON BUILDNOW BUILDLOG SCHEDULED
|
||||||
@ -156,7 +166,7 @@ for i in `seq 0 ${#AUTOPORT_ARCH[*]}`; do
|
|||||||
*) [ ! "$AUTODISTON" ] && echo $line ;;
|
*) [ ! "$AUTODISTON" ] && echo $line ;;
|
||||||
esac
|
esac
|
||||||
done < $LOGFILE
|
done < $LOGFILE
|
||||||
BUILDNOWIDX=0
|
BUILDNOWIDX=1
|
||||||
while read line; do
|
while read line; do
|
||||||
line=`echo $line | sed "s|.*\r||"`
|
line=`echo $line | sed "s|.*\r||"`
|
||||||
set -- $line
|
set -- $line
|
||||||
@ -183,10 +193,10 @@ for i in `seq 0 ${#AUTOPORT_ARCH[*]}`; do
|
|||||||
echo "<b>Start:</b> $STARTTIME"
|
echo "<b>Start:</b> $STARTTIME"
|
||||||
echo "<b>Scheduled jobs:</b> $SCHEDULED"
|
echo "<b>Scheduled jobs:</b> $SCHEDULED"
|
||||||
for b in `seq 1 ${#BUILDNOW[*]}`; do
|
for b in `seq 1 ${#BUILDNOW[*]}`; do
|
||||||
set -- ${BUILDNOW[$b-1]}
|
set -- ${BUILDNOW[$b]}
|
||||||
if [ "${BUILDLOG[$b-1]}" ]; then
|
if [ "${BUILDLOG[$b]}" ]; then
|
||||||
echo "<b><a href=\"?SHOWLOG=${BUILDLOG[$b-1]}&NUM=$i$SECONDARY_ADD\">$1</a>:</b> $2 $3 $4 $5 $6 "
|
echo "<b><a href=\"?SHOWLOG=${BUILDLOG[$b]}&NUM=$i$SECONDARY_ADD\">$1</a>:</b> $2 $3 $4 $5 $6 "
|
||||||
else
|
elif [ "$1" ]; then
|
||||||
echo "<b>$1:</b> $2 $3 $4 $5 $6 "
|
echo "<b>$1:</b> $2 $3 $4 $5 $6 "
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
@ -198,13 +208,15 @@ for i in `seq 0 ${#AUTOPORT_ARCH[*]}`; do
|
|||||||
echo
|
echo
|
||||||
# grep -v "^=" $LOGFILE | tail -n "$LINES" | sed "s|.*\r||"
|
# grep -v "^=" $LOGFILE | tail -n "$LINES" | sed "s|.*\r||"
|
||||||
# echo
|
# echo
|
||||||
echo "</pre>"
|
echo "</pre></div></div>"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
if [ "$AUTOPORT_CGI_SECONDARY" -a ! "$SHOWLOG" ]; then
|
if [ "$AUTOPORT_CGI_SECONDARY" -a ! "$SHOWLOG" ]; then
|
||||||
if [ "$NUM" -a "$SECONDARY" ]; then
|
if [ "$NUM" -a "$SECONDARY" ]; then
|
||||||
curl "$AUTOPORT_CGI_SECONDARY?AS_SECONDARY=1&LINES=$LINES&NUM=$NUM&SECONDARY=$SECONDARY"
|
curl "$AUTOPORT_CGI_SECONDARY?AS_SECONDARY=1&LINES=$LINES&NUM=$NUM&SECONDARY=$SECONDARY" 2>/dev/null
|
||||||
elif [ ! "$NUM" ]; then
|
elif [ ! "$NUM" ]; then
|
||||||
curl "$AUTOPORT_CGI_SECONDARY?AS_SECONDARY=1&LINES=$LINES"
|
curl "$AUTOPORT_CGI_SECONDARY?AS_SECONDARY=1&LINES=$LINES" 2>/dev/null
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
[ ! "$AS_SECONDARY" ] && echo "<p><i>Generated by autodist CGI interface. Last update: `date`</i>"
|
||||||
|
Loading…
Reference in New Issue
Block a user