Skip to content
Snippets Groups Projects
Commit ab6cc7c7 authored by rswindell's avatar rswindell
Browse files

Added optional location to node list (use -l)

Added Runkeeper's modification for Login button to work around IE table bug.
parent 2c31d707
No related branches found
No related tags found
No related merge requests found
...@@ -7,10 +7,22 @@ var start=new Date(); ...@@ -7,10 +7,22 @@ var start=new Date();
load("nodedefs.js"); load("nodedefs.js");
var include_age_gender=true;
var include_location=false;
// Parse arguments // Parse arguments
for(i=0;i<argc;i++) for(i=0;i<argc;i++)
if(argv[i].toLowerCase()=="-r") switch(argv[i].toLowerCase()) {
refresh_rate=Number(argv[++i]); case "-r":
refresh_rate=Number(argv[++i]);
break;
case "-n":
include_age_gender=false;
break;
case "-l":
include_location=true;
break;
}
// Write a string to the client socket // Write a string to the client socket
function write(str) function write(str)
...@@ -43,11 +55,25 @@ writeln("</head>"); ...@@ -43,11 +55,25 @@ writeln("</head>");
writeln("<body bgcolor=teal text=white link=yellow vlink=lime alink=white>"); writeln("<body bgcolor=teal text=white link=yellow vlink=lime alink=white>");
writeln("<font face=Arial,Helvetica,sans-serif>"); writeln("<font face=Arial,Helvetica,sans-serif>");
// Table // Login Button - Modified by RuneMaster of RuneKeep BBS
writeln("<table border=0 width=100%>"); writeln("<table border=0 width=100%>");
writeln("<caption align=left><font color=lime>"); writeln("<tr>");
writeln("<td align=left>");
writeln("<font color='lime'>");
writeln(format("<h1><i>%s BBS - Node List</i></h1>",system.name)); writeln(format("<h1><i>%s BBS - Node List</i></h1>",system.name));
writeln("</caption>"); writeln("</font>");
writeln("</td>");
writeln("<td align=right>");
writeln("<form>");
writeln("<input type=button value='Login' onClick='location=\"telnet://"
+ system.inetaddr + "\";'>");
writeln("</form>");
writeln("</td>");
writeln("</tr>");
writeln("</table>");
// Table
writeln("<table border=0 width=100%>");
// Header // Header
writeln("<thead>"); writeln("<thead>");
...@@ -57,8 +83,12 @@ font_color = "<font color=black>"; ...@@ -57,8 +83,12 @@ font_color = "<font color=black>";
write(format("<th align=center width=7%>%sNode",font_color)); write(format("<th align=center width=7%>%sNode",font_color));
write(format("<th align=center width=20%>%sUser",font_color)); write(format("<th align=center width=20%>%sUser",font_color));
write(format("<th align=left>%sAction/Status",font_color)); write(format("<th align=left>%sAction/Status",font_color));
write(format("<th align=center width=7%>%sAge",font_color)); if(include_location)
write(format("<th align=center width=10%>%sGender\r\n",font_color)); write(format("<th align=left>%sLocation",font_color));
if(include_age_gender) {
write(format("<th align=center width=7%>%sAge",font_color));
write(format("<th align=center width=10%>%sGender\r\n",font_color));
}
write(format("<th align=center width=10%>%sTime\r\n",font_color)); write(format("<th align=center width=10%>%sTime\r\n",font_color));
writeln("</thead>"); writeln("</thead>");
...@@ -80,11 +110,20 @@ for(n=0;n<system.node_list.length;n++) { ...@@ -80,11 +110,20 @@ for(n=0;n<system.node_list.length;n++) {
,user.alias ,user.alias
)); ));
write(format( write(format(
"<td><font color=yellow>%s<td align=center>%d<td align=center>%s" "<td><font color=yellow>%s"
,action ,action
,user.age
,user.gender
)); ));
if(include_location)
write(format(
"<td align=left>%s"
,user.location
));
if(include_age_gender)
write(format(
"<td align=center>%d<td align=center>%s"
,user.age
,user.gender
));
t=time()-user.logontime; t=time()-user.logontime;
write(format( write(format(
"<td align=center>%u:%02u:%02u" "<td align=center>%u:%02u:%02u"
...@@ -101,14 +140,6 @@ for(n=0;n<system.node_list.length;n++) { ...@@ -101,14 +140,6 @@ for(n=0;n<system.node_list.length;n++) {
writeln("</tbody>"); writeln("</tbody>");
writeln("</table>"); writeln("</table>");
// Login Button
writeln("<form>");
writeln("<table align=right>");
writeln("<tr><td><input type=button value='Login' onClick='location=\"telnet://"
+ system.inetaddr + "\";'>");
writeln("</table>");
writeln("</form>");
writeln("<p><font color=silver><font size=-2>"); writeln("<p><font color=silver><font size=-2>");
writeln(format("Auto-refresh in %d seconds",refresh_rate)); writeln(format("Auto-refresh in %d seconds",refresh_rate));
write(format("<br>Dynamically generated in %lu milliseconds " write(format("<br>Dynamically generated in %lu milliseconds "
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment