aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorallen <allen@61ea717e-8e0c-4c3c-b38e-e9c67f54f1f1>2000-09-20 11:07:44 +0000
committerallen <allen@61ea717e-8e0c-4c3c-b38e-e9c67f54f1f1>2000-09-20 11:07:44 +0000
commit9dd842fd58fac21c6940d3aba0f447e8f90e47ca (patch)
tree1ec03b375133b0e7c02da1921f5d50bb05479ab0 /src
parent508e1bc1c45001e1384ec0a6edd23ba08387e126 (diff)
Added viewport
git-svn-id: http://svn.cactuscode.org/arrangements/CactusConnect/HTTPDExtra/trunk@8 61ea717e-8e0c-4c3c-b38e-e9c67f54f1f1
Diffstat (limited to 'src')
-rw-r--r--src/IO.c96
1 files changed, 96 insertions, 0 deletions
diff --git a/src/IO.c b/src/IO.c
index fc96902..163353e 100644
--- a/src/IO.c
+++ b/src/IO.c
@@ -53,6 +53,7 @@ static int IOFileListener(cGH *GH, const char *filename,
const IOUtil_AdvertisedFileDesc_t *description);
static int AdvertisedFilePage(cGH *cctkGH, httpRequest *request, void *data);
+static int ViewportFilePage(cGH *cctkGH, httpRequest *request, void *data);
static int SendFilePage(cGH *cctkGH, httpRequest *request, void *data);
@@ -81,10 +82,14 @@ int HTTP_util_RegisterIOPages(void)
&listener);
HTTP_RegisterPage("/Output/index.html", AdvertisedFilePage, NULL);
+ HTTP_RegisterPage("/Output/viewport.html", ViewportFilePage, NULL);
HTTP_ContentLink("/Output/index.html", "Files",
"Downloadable files",
HTTP_QUICKLINK);
+ HTTP_ContentLink("/Output/viewport.html", "Viewport",
+ "Viewport for certain output files",
+ HTTP_QUICKLINK);
HTTP_RegisterPage("/Output", SendFilePage, NULL);
@@ -217,6 +222,9 @@ static int AdvertisedFilePage(cGH *cctkGH, httpRequest *request, void *data)
"from the simulation. Depending on the software available on your"
" local machine, you can change the browser properties to lauch"
" files directly to visualization clients.</p> \n "
+ "<p>Some of these output files can be directly viewed on "
+ "a browser on the simulation "
+ "<a href=\"/Output/viewport.html\">viewport</a></p>"
"<p>Many IO methods have <i>steerable</i> parameters which "
"allow you to e.g. add fields and customise behaviour."
"Depending on your authorisation, you can access the"
@@ -333,3 +341,91 @@ static int SendFilePage(cGH *cctkGH, httpRequest *request, void *data)
}
+ /*@@
+ @routine AdvertisedFilePage
+ @date Sun Sep 17 18:26:01 2000
+ @author Tom Goodale
+ @desc
+ Page to deal with advertised files.
+ @enddesc
+ @calls
+ @calledby
+ @history
+
+ @endhistory
+
+@@*/
+static int ViewportFilePage(cGH *cctkGH, httpRequest *request, void *data)
+{
+ int retval;
+ char message[4098];
+ struct httpuFileList *list;
+
+ /* Status message */
+ strcpy(message,"HTTP/1.0 200 OK\r\n");
+
+ HTTP_Write(request, message, strlen(message));
+
+ /* Content-Type */
+ strcpy(message,"Content-Type: text/html\r\n\r\n");
+
+ HTTP_Write(request, message, strlen(message));
+
+ /* Start the page */
+ strcpy(message, "<HTML><HEAD><TITLE>Cactus Downloadable Files</TITLE>\n");
+
+ HTTP_Write(request, message, strlen(message));
+
+ /* HTTP_Write out the header part. */
+
+ HTTP_ContentHeader(0,4098,message);
+
+ HTTP_Write(request, message, strlen(message));
+
+ strcpy(message, "<center><h1>Viewport</h1></center>");
+
+ HTTP_Write(request, message, strlen(message));
+
+ strcpy(message,
+ "<p>This page displays certain types of the output files "
+ "from the <a href=\"/Output/index.html\">download</a> page"
+ " as images (currently only jpegs [mime type image/jpeg]).</p>"
+ "<p>Many IO methods have <i>steerable</i> parameters which "
+ "allow you to e.g. add fields and customise behaviour."
+ "Depending on your authorisation, you can access the"
+ " <a href=\"/Parameters/index.html\">parameter steering page</a></p>"
+ "<center>"
+ "<table cellspacing=5 cellpadding=5 border=0\n>"
+ "<tr><th>Variable<br>File Name</th><th>Description</th><th>Image</th></tr>\n");
+
+ HTTP_Write(request, message, strlen(message));
+
+ for (list = filelist; list; list = list->next)
+ {
+ if (CCTK_Equals(list->data.mimetype,"image/jpeg"))
+ {
+ sprintf(message,
+ "<tr><td valign=center><small>%s<br>"
+ "<A HREF=\"/Output/%s\">%s</A></small></td>"
+ "<td valign=center>%s</td>"
+ "<td valign=center><img src=\"%s\"></td></tr>\n",
+ list->data.varname,list->linkname, list->filename,
+ list->data.description,list->linkname);
+ HTTP_Write(request, message, strlen(message));
+ }
+ }
+
+ strcpy(message,"</table></center>");
+ HTTP_Write(request, message, strlen(message));
+
+ /* Write out the footer part. */
+
+ /* HTTP_Write out the footer part. */
+
+ HTTP_ContentFooter(0,4098,message);
+
+ retval = HTTP_Write(request, message, strlen(message));
+
+ return retval;
+}
+