Index: openacs-4/packages/xotcl-request-monitor/www/last100.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-request-monitor/www/last100.tcl,v diff -u -N -r1.7 -r1.8 --- openacs-4/packages/xotcl-request-monitor/www/last100.tcl 27 Oct 2014 16:42:02 -0000 1.7 +++ openacs-4/packages/xotcl-request-monitor/www/last100.tcl 7 Aug 2017 23:48:30 -0000 1.8 @@ -5,26 +5,28 @@ @cvs-id $Id$ } -query { - {orderby:optional "time,desc"} + {orderby:token,optional "time,desc"} } -properties { title:onevalue context:onevalue } set title "Last 100 Requests" -set context [list "Last 100 Requests"] +set context [list $title] +set admin_p [acs_user::site_wide_admin_p] + set stat [list] foreach {key value} [throttle last100] {lappend stat $value} -Class CustomField -volatile \ +Class create CustomField -volatile \ -instproc render-data {row} { html::div -style { border: 1px solid #a1a5a9; padding: 0px 5px 0px 5px; background: #e2e2e2} { - html::t [$row set [my name]] + html::t [$row set [:name]] } } -TableWidget t1 -volatile \ +TableWidget create t1 -volatile \ -columns { Field time -label "Time" -orderby time -mixin ::template::CustomField AnchorField user -label "Userid" -orderby user @@ -43,12 +45,35 @@ } else { set user_string $requestor } + + # + # Provide the urls only to admins as links. + # + # First of all, it is questionable, whether this page should be + # public. However, when this page is public, and a spider + # (re)submits a previously broken link, and visits then the last100 + # page, it thinks that the site has still the broken page. This + # might happen e.g. with Google bot, leading to worse than necessary + # error rating. + # + if {$admin_p} { + set href "[ad_url]$url" + } else { + set href "" + } t1 add -time [clock format $timestamp -format "%H:%M:%S"] \ -user $user_string \ -user.href [export_vars -base last-requests {{request_key $requestor}}] \ -ms $ms \ -url $url \ - -url.href "[ad_url]$url" + -url.href $href } + set t1 [t1 asHTML] set last_url [ad_return_url] + +# Local variables: +# mode: tcl +# tcl-indent-level: 2 +# indent-tabs-mode: nil +# End: