aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorallen <allen@1faa4e14-9dd3-4be0-9f0e-ffe519881164>2003-07-05 14:38:38 +0000
committerallen <allen@1faa4e14-9dd3-4be0-9f0e-ffe519881164>2003-07-05 14:38:38 +0000
commit02fb378aecebcfebc874e11b98650f4bc24e1337 (patch)
tree023bf0b4b7417edab90d1d490f5b0ab200895176 /src
parente6cb6f3e481c5aba5b50b87f7a736dd59daa2ae5 (diff)
Added more info to front page and fixed wrong compile date (was using the
compile date just for that thorn). Fixes Cactus/1227 (except for adding start time but did not feel like adding more string functions for these, although they would be useful to have) git-svn-id: http://svn.cactuscode.org/arrangements/CactusConnect/HTTPD/trunk@176 1faa4e14-9dd3-4be0-9f0e-ffe519881164
Diffstat (limited to 'src')
-rw-r--r--src/Content.c37
1 files changed, 28 insertions, 9 deletions
diff --git a/src/Content.c b/src/Content.c
index 825d634..2a28462 100644
--- a/src/Content.c
+++ b/src/Content.c
@@ -27,6 +27,7 @@
#include "cctk_ActiveThorns.h"
#include "util_String.h"
+#include "util_Network.h"
#include "http_Request.h"
@@ -63,6 +64,8 @@ struct httpLink
int flags;
};
+#define HOSTLENGTH 255
+
/********************************************************************
********************* Local Routine Prototypes *********************
********************************************************************/
@@ -305,8 +308,10 @@ static int MainPage(const cGH *cctkGH, httpRequest *request, void *data)
char menu[4098];
char *dir;
char *file;
+ char *user;
struct httpLink *hlink;
int seconds,minutes,hours,days,weeks,months,years,millenia;
+ char host[HOSTLENGTH+1];
/* avoid compiler warning about unused parameter */
data = data;
@@ -427,9 +432,9 @@ static int MainPage(const cGH *cctkGH, httpRequest *request, void *data)
"<h3>Simulation:</h3>\n"
"<ul>\n"
"<li>Flesh version <FONT COLOR=RED> %s</FONT></li>\n"
- "<li>Code compiled on <FONT COLOR=RED>"__DATE__ "</FONT>"
- " at <FONT COLOR=RED>"__TIME__"</font></li>\n",
- CCTK_FullVersion());
+ "<li>Flesh compiled on <FONT COLOR=RED>%s</FONT>"
+ " at <FONT COLOR=RED>%s</font></li>\n",
+ CCTK_FullVersion(),CCTK_CompileDate(),CCTK_CompileTime());
HTTP_Write(request, message, strlen(message));
@@ -582,15 +587,29 @@ static int MainPage(const cGH *cctkGH, httpRequest *request, void *data)
HTTP_Write(request, message, strlen(message));
}
-
+
+ Util_GetHostName(host,HOSTLENGTH);
+ host[HOSTLENGTH] = 0;
+
if (CCTK_nProcs(cctkGH) == 1)
{
- strcpy(message,"<li>Single processor run</li>");
+ sprintf(message,
+ "<li>Single processor run</li>\n"
+ "<li>Running on <FONT COLOR=RED>%s</FONT></li>\n",host);
}
else
{
- sprintf(message," <li>Multiprocessor run on %d CPUs</li>",
- CCTK_nProcs(cctkGH));
+ sprintf(message,
+ " <li>Multiprocessor run on %d CPUs</li>\n"
+ " <li>Processor 0 running on <FONT COLOR=RED>%s</FONT></li>\n",
+ CCTK_nProcs(cctkGH),host);
+ }
+ HTTP_Write(request, message, strlen(message));
+
+ user = getenv ("USER");
+ if (user)
+ {
+ sprintf(message, " <li> Started by <FONT COLOR=RED>%s</FONT></li>\n",user);
}
HTTP_Write(request, message, strlen(message));
@@ -601,7 +620,7 @@ static int MainPage(const cGH *cctkGH, httpRequest *request, void *data)
strcpy(message,
"</TD>\n"
"</TR>\n"
- "</TABLE>\n"
+ "</TABLE>\n"
"</CENTER>\n");
HTTP_Write(request, message, strlen(message));
@@ -1135,7 +1154,7 @@ static int ControlTerminationPage(const cGH *cctkGH, httpRequest *request)
sprintf(message, "<h3>Simulation:</h3>"
"<ul> <li>Flesh version <FONT COLOR=RED> %s"
"</FONT></li>\n"
- "<li>Code compiled on <FONT COLOR=RED>"
+ "<li>Flesh compiled on <FONT COLOR=RED>"
__DATE__ "</FONT> at <FONT COLOR=RED>"__TIME__ "</font></li>\n"
,CCTK_FullVersion());