31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
+
-
-
+
+
+
+
+
+
|
set status "Queued"
}
}
if {[info exists outfile]} {
if {[file exists $outfile]} {
set status "Complete"
set terminal 1
set url "http://kitcreator.rkeene.org/kits/$key/$filename"
} elseif {[file exists "${outfile}.buildfail"]} {
set status "Failed"
set terminal 1
} else {
set status "Building"
}
}
puts "Content-Type: text/html"
if {[info exists url]} {
puts "Location: $url"
# Use a refresh here instead of a "Location" so that
# the client can see the page
puts "Refresh: 0;url=$url"
} else {
if {!$terminal} {
puts "Refresh: 30;url=."
}
}
puts ""
puts "<html>"
puts "\t<head>"
puts "\t\t<title>KitCreator, Web Interface</title>"
puts "\t</head>"
puts "\t<body>"
puts "\t\t<h1>KitCreator Web Interface</h1>"
puts "\t\t<p><b>Status:</b> $status</p>"
if {[info exists url]} {
puts "\t\t<p><b>URL:</b> <a href=\"$url\">$url</a></p>"
}
puts "\t</body>"
puts "</html>"
|