]> gitweb.factorcode.org Git - factor.git/blob - extra/webapps/mason/report/report.factor
Make sure URLs are cloned before using set-query-param on them
[factor.git] / extra / webapps / mason / report / report.factor
1 ! Copyright (C) 2010 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: accessors furnace.actions http.server.responses kernel
4 urls xml.syntax webapps.mason.backend webapps.mason.utils ;
5 IN: webapps.mason.report
6
7 : build-report ( -- response )
8     [
9         current-builder [
10             last-report>> <html-content>
11         ] [ <404> ] if*
12     ] with-mason-db ;
13
14 : <build-report-action> ( -- action )
15     <action>
16         [ validate-os/cpu ] >>init
17         [ build-report ] >>display ;
18
19 : report-link ( builder -- xml )
20     [ URL" report" clone ] dip
21     [ os>> "os" set-query-param ]
22     [ cpu>> "cpu" set-query-param ] bi
23     [XML <a href=<->>Latest build report</a> XML] ;