X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=index.cgi;h=29bdb1d8cdb0cdce662bdd89e60b2d554fcae121;hb=37eb35361390ffd597c653f15c5147856d40e7b3;hp=f3a4a7e76f11921aaa61c96a893a54b734fa0cd8;hpb=1e266b439c4550432abc1c20512f6edf2786c88e;p=vpaste diff --git a/index.cgi b/index.cgi index f3a4a7e..29bdb1d 100755 --- a/index.cgi +++ b/index.cgi @@ -70,19 +70,30 @@ function message { function do_cmd { header text/plain case "$1" in + ls) + ls -t db | column + ;; head) - awk ' - BEGIN { rows=4; cols=60; } + awk -v 'rows=4' -v 'cols=60' ' FNR==1 { gsub(/.*\//, "", FILENAME); print FILENAME print "-----" } FNR==1,/^$/ { next } /\S/ { i++; printf "%."cols"s\n", $0 } - i>=rows { i=0; print ""; nextfile } + i>=rows { nextfile } + ENDFILE { i=0; print "" } ' $(ls -t db/*) ;; - ls) - ls -t db | column + stat) + ls -l --time-style='+%Y %m' db | + awk -v 'hdr=Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec' ' + BEGIN { printf "%64s\n", hdr } + NR>1 { cnt[$6+0][$7+0]++ } + END { for (y in cnt) { + printf "%4d", y + for (m=1; m<=12; m++) + printf "%5s", cnt[y][m] + printf "\n" } }' ;; esac } @@ -172,6 +183,7 @@ function do_help { uploads=$(ls -t db | head -n 5) filetype=$(get_param '^(ft|filet(y(pe?)?)?)$') vpaste='vpaste' + repo='https://lug.rose-hulman.edu/svn/misc/trunk/htdocs/vpaste/' header text/html cat <<-EOF @@ -189,6 +201,7 @@ function do_help { padding: 0; } body { margin: 4em 8em 4em 8em; font-family: sans-serif; } + input { padding: 2px 6px 3px 6px; } /* Items */ textarea { width: 100%; margin-bottom: 0.5em; } @@ -302,16 +315,20 @@ function do_help {

See individual files for licenses

Source code

- + sitemap.xml +
Patches
+
2html.patch
+
Subversion
+
$repo
+

Bugs

list all

sample all

+

statistics

@@ -348,6 +366,8 @@ if [ "$pathinfo" = ls ]; then do_cmd ls elif [ "$pathinfo" = head ]; then do_cmd head +elif [ "$pathinfo" = stat ]; then + do_cmd stat elif [ "$pathinfo" ]; then do_print "$pathinfo" elif [ "$CONTENT_TYPE" ]; then