!752
static S html(S subUri, Map params) {
O dispatcher = getDispatcher();
L bots = cast call(dispatcher, "getSubBots");
S showID = params.get("id");
if (showID != null) {
Class c = cast call(dispatcher, "getBot", showID);
S src = cast call(getJavaX(), "getSourceCodeForClass", c);
ret h3("Live source code of " + formatSnippetID(showID)) + sourceCodeToHTML(src);
}
new L found;
for (O bot : bots) {
S id = cast get(bot, "id");
Class c = cast call(dispatcher, "getClassOfSubBot", id);
if (c != null) {
S src = cast call(getJavaX(), "getSourceCodeForClass", c);
if (src != null)
found.add(tag("a", id, "href", selfLink(params, litstringlist(), "id", id)) + " (" + l(toUtf8(src)) + " bytes)");
}
}
ret tag("p", "Source code found for bots:")
+ ul(found)
+ tag("p", "Unaccounted: " + (l(bots)-l(found)));
}