! Copyright (C) 2009 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: accessors arrays combinators db db.tuples furnace.actions http.server.responses kernel mason.platform mason.notify.server mason.report math.order sequences sorting splitting xml.syntax xml.writer io.pathnames io.encodings.utf8 io.files ; IN: webapps.mason : log-file ( -- path ) home "mason.log" append-path ; : recent-events ( -- xml ) log-file utf8 10 file-tail [XML
<->XML] ; : git-link ( id -- link ) [ "http://github.com/slavapestov/factor/commit/" prepend ] keep [XML ><-> XML] ; : building ( builder string -- xml ) swap current-git-id>> git-link [XML <-> for <-> XML] ; : current-status ( builder -- xml ) dup status>> { { "status-dirty" [ drop "Dirty" ] } { "status-clean" [ drop "Clean" ] } { "status-error" [ drop "Error" ] } { "starting" [ "Starting" building ] } { "make-vm" [ "Compiling VM" building ] } { "boot" [ "Bootstrapping" building ] } { "test" [ "Testing" building ] } [ 2drop "Unknown" ] } case ; : binaries-link ( builder -- link ) [ os>> ] [ cpu>> ] bi (platform) "http://downloads.factorcode.org/" prepend dup [XML ><-> XML] ; : clean-image-link ( builder -- link ) [ os>> ] [ cpu>> ] bi (platform) "http://factorcode.org/images/clean/" prepend dup [XML ><-> XML] ; : machine-table ( builder -- xml ) { [ os>> ] [ cpu>> ] [ host-name>> "." split1 drop ] [ current-status ] [ last-git-id>> dup [ git-link ] when ] [ clean-git-id>> dup [ git-link ] when ] [ binaries-link ] [ clean-image-link ] } cleave [XML
| Host name: | <-> |
| Current status: | <-> |
| Last build: | <-> |
| Last clean build: | <-> |
| Binaries: | <-> |
| Clean images: | <-> |