website gui fixes

This commit is contained in:
mwells
2014-09-01 13:31:13 -07:00
parent 2ccc4626dc
commit 25b79684c5
5 changed files with 49 additions and 99 deletions

@ -1229,6 +1229,9 @@ bool HttpServer::sendReply ( TcpSocket *s , HttpRequest *r , bool isAdmin) {
if ( ! strncmp ( path ,"/bio.html", pathLen ) )
return sendPagePretty ( s , r , "bio.html", "bio");
if ( ! strncmp ( path ,"/appliance.html", pathLen ) )
return sendPagePretty ( s , r , "appliance.html", "appliance");
if ( ! strncmp ( path ,"/api.html", pathLen ) )
return sendPageAPI ( s , r );
@ -2902,7 +2905,7 @@ TcpSocket *HttpServer::unzipReply(TcpSocket* s) {
}
bool printFrontPageShell ( SafeBuf *sb , char *tabName );
bool printFrontPageShell ( SafeBuf *sb , char *tabName , CollectionRec *cr );
bool sendPagePretty ( TcpSocket *s ,
HttpRequest *r ,
@ -2911,8 +2914,10 @@ bool sendPagePretty ( TcpSocket *s ,
SafeBuf sb;
CollectionRec *cr = g_collectiondb.getRec ( r );
// print the chrome
printFrontPageShell ( &sb , tabName ); // -1=pagenum
printFrontPageShell ( &sb , tabName , cr ); // -1=pagenum
SafeBuf ff;
ff.safePrintf("html/%s",filename);

@ -7025,7 +7025,7 @@ bool printDMOZCrumb ( SafeBuf *sb , long catId , bool xml ) {
bool printDmozRadioButtons ( SafeBuf *sb , long catId ) ;
bool printFrontPageShell ( SafeBuf *sb , char *tabName ) ;
bool printFrontPageShell ( SafeBuf *sb , char *tabName , CollectionRec *cr) ;
// if catId >= 1 then print the dmoz radio button
bool printLogoAndSearchBox ( SafeBuf *sb , HttpRequest *hr , long catId ,
@ -7062,7 +7062,8 @@ bool printLogoAndSearchBox ( SafeBuf *sb , HttpRequest *hr , long catId ,
if ( catId > 0 ) {
printFrontPageShell ( sb , "directory"); // PAGE_DIRECTORY
CollectionRec *cr = g_collectiondb.getRec ( hr );
printFrontPageShell ( sb , "directory",cr); // PAGE_DIRECTORY
}
/*

@ -639,7 +639,7 @@ bool expandHtml ( SafeBuf& sb,
}
bool printFrontPageShell ( SafeBuf *sb , char *tabName ) { // long pageNum ) {
bool printFrontPageShell ( SafeBuf *sb , char *tabName , CollectionRec *cr ) {
sb->safePrintf("<html>\n");
sb->safePrintf("<head>\n");
@ -745,24 +745,33 @@ bool printFrontPageShell ( SafeBuf *sb , char *tabName ) { // long pageNum ) {
"width:100px;"
"height:100px;"
"\">"
"<br style=line-height:10px;>"
"<img width=54 height=79 src=/rocket.jpg>"
"</div>"
"</a>"
"</center>"
);
if ( strcmp(tabName,"appliance") == 0 )
sb->safePrintf("<img style=margin-top:21px; width=90 "
"height=57 src=/computer2.png>");
else
sb->safePrintf("<br style=line-height:10px;>"
"<img width=54 height=79 src=/rocket.jpg>"
);
"<br>"
"<br>"
sb->safePrintf ( "</div>"
"</a>"
"</center>"
"<br>"
"<br>"
);
long n = sizeof(mi) / sizeof(MenuItem);
char *coll = "";
if ( cr ) coll = cr->m_coll;
for ( long i = 0 ; i < n ; i++ ) {
sb->safePrintf(
"<a href=%s>"
"<a href=%s?c=%s>"
"<div style=\""
"padding:5px;"
"position:relative;"
@ -776,6 +785,7 @@ bool printFrontPageShell ( SafeBuf *sb , char *tabName ) { // long pageNum ) {
"font-size:14px;"
"x-overflow:;"
, mi[i].m_url
, coll
);
//if ( i == pageNum )
bool matched = false;
@ -828,7 +838,7 @@ bool printFrontPageShell ( SafeBuf *sb , char *tabName ) { // long pageNum ) {
// admin link
sb->safePrintf(
"<a href=/admin/settings>"
"<a href=/admin/settings?c=%s>"
"<div style=\"background-color:green;"
// for try it out bubble:
//"position:relative;"
@ -897,6 +907,7 @@ bool printFrontPageShell ( SafeBuf *sb , char *tabName ) { // long pageNum ) {
"</div>"
"</a>"
"<br>"
, coll
);
@ -943,7 +954,7 @@ bool printWebHomePage ( SafeBuf &sb , HttpRequest *r , TcpSocket *sock ) {
cr );//CollectionRec *cr ) {
}
printFrontPageShell ( &sb , "search" );
printFrontPageShell ( &sb , "search" , cr );
//sb.safePrintf("<br><br>\n");
@ -1351,7 +1362,9 @@ bool printWebHomePage ( SafeBuf &sb , HttpRequest *r , TcpSocket *sock ) {
bool printAddUrlHomePage ( SafeBuf &sb , char *url , HttpRequest *r ) {
printFrontPageShell ( &sb , "add url" );
CollectionRec *cr = g_collectiondb.getRec ( r );
printFrontPageShell ( &sb , "add url" , cr );
sb.safePrintf("<script type=\"text/javascript\">\n"
@ -1386,7 +1399,6 @@ bool printAddUrlHomePage ( SafeBuf &sb , char *url , HttpRequest *r ) {
sb.safePrintf("<form method=GET "
"action=/addurl name=f>\n" );
CollectionRec *cr = g_collectiondb.getRec ( r );
char *coll = "";
if ( cr ) coll = cr->m_coll;
if ( cr )
@ -1549,8 +1561,9 @@ bool printDirHomePage ( SafeBuf &sb , HttpRequest *r ) {
if ( format != FORMAT_HTML )
return printTopDirectory ( sb , format );
CollectionRec *cr = g_collectiondb.getRec ( r );
printFrontPageShell ( &sb , "directory" );
printFrontPageShell ( &sb , "directory" , cr );
sb.safePrintf("<br><br>\n");
sb.safePrintf("<br><br><br>\n");
@ -1559,7 +1572,6 @@ bool printDirHomePage ( SafeBuf &sb , HttpRequest *r ) {
sb.safePrintf("<form method=GET "
"action=/search name=f>\n");
CollectionRec *cr = g_collectiondb.getRec ( r );
if ( cr )
sb.safePrintf("<input type=hidden name=c value=\"%s\">",
cr->m_coll);
@ -2562,7 +2574,9 @@ bool sendPageAdvanced ( TcpSocket *sock , HttpRequest *hr ) {
SafeBuf sb;
printFrontPageShell ( &sb , "advanced" );
CollectionRec *cr = g_collectiondb.getRec ( hr );
printFrontPageShell ( &sb , "advanced" , cr );
sb.safePrintf("<br><br>\n");
sb.safePrintf("<br><br><br>\n");
@ -2571,7 +2585,6 @@ bool sendPageAdvanced ( TcpSocket *sock , HttpRequest *hr ) {
sb.safePrintf("<form method=GET "
"action=/search name=f>\n" );
CollectionRec *cr = g_collectiondb.getRec ( hr );
char *coll = "";
if ( cr ) coll = cr->m_coll;
if ( cr )
@ -2737,7 +2750,9 @@ bool sendPageAbout ( TcpSocket *sock , HttpRequest *hr ) {
SafeBuf sb;
printFrontPageShell ( &sb , "about" );
CollectionRec *cr = g_collectiondb.getRec ( hr );
printFrontPageShell ( &sb , "about" , cr );
sb.safePrintf("<br>\n");
@ -2747,7 +2762,6 @@ bool sendPageAbout ( TcpSocket *sock , HttpRequest *hr ) {
//sb.safePrintf("<form method=GET "
// "action=/addurl name=f>\n" );
CollectionRec *cr = g_collectiondb.getRec ( hr );
char *coll = "";
if ( cr ) coll = cr->m_coll;
if ( cr )
@ -2828,7 +2842,9 @@ bool sendPageHelp ( TcpSocket *sock , HttpRequest *hr ) {
SafeBuf sb;
printFrontPageShell ( &sb , "syntax" );
CollectionRec *cr = g_collectiondb.getRec ( hr );
printFrontPageShell ( &sb , "syntax" , cr );
sb.safePrintf("<br><br>\n");
sb.safePrintf("<br><br><br>\n");
@ -2837,7 +2853,6 @@ bool sendPageHelp ( TcpSocket *sock , HttpRequest *hr ) {
//sb.safePrintf("<form method=GET "
// "action=/addurl name=f>\n" );
// CollectionRec *cr = g_collectiondb.getRec ( hr );
// char *coll = "";
// if ( cr ) coll = cr->m_coll;
// if ( cr )

@ -975,7 +975,7 @@ bool printTopNavButton ( char *text,
else
sb->safePrintf(
"<a style=text-decoration:none; href=%s?%s>"
"<a style=text-decoration:none; href=%s?c=%s>"
"<div "
" onmouseover=\""
@ -2848,7 +2848,7 @@ int parmcmp ( const void *a, const void *b ) {
#define DARK_YELLOW "ffaaaa"
#define LIGHT_YELLOW "ffcccc"
bool printFrontPageShell ( SafeBuf *sb , char *tabName ) ;
bool printFrontPageShell ( SafeBuf *sb , char *tabName , CollectionRec *cr ) ;
// let's use a separate section for each "page"
// then have 3 tables, the input parms,
@ -2876,7 +2876,7 @@ bool sendPageAPI ( TcpSocket *s , HttpRequest *r ) {
// new stuff
printFrontPageShell ( &p , "api" );
printFrontPageShell ( &p , "api" , cr );
//p.safePrintf("<style>body,td,p,.h{font-family:arial,helvetica-neue; "

@ -1,72 +1,3 @@
<html>
<head>
<meta name="description" content="A powerful, new search engine that does real-time indexing!">
<meta name="keywords" content="search, search engine, search engines, search the web, fresh index, green search engine, green search, clean search engine, clean search">
<title>Gigablast - An Alternative Open Source Search Engine</title>
<style><!--
body {
font-family:Arial, Helvetica, sans-serif;
color: #000000;
font-size: 12px;
margin: 0px 0px;
letter-spacing: 0.04em;
}
a {text-decoration:none;}
.bold {font-weight: bold;}
.bluetable {background:#d1e1ff;margin-bottom:15px;font-size:12px;}
.url {color:#008000;}
.cached, .cached a {font-size: 10px;color: #666666;
}
table {
font-family:Arial, Helvetica, sans-serif;
color: #000000;
font-size: 12px;
}
.directory {font-size: 16px;}
.nav {font-size:20px;align:right;}
.grad {
background: rgb(190,201,247);
background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIxMDAlIiB5Mj0iMTAwJSI+CiAgICA8c3RvcCBvZmZzZXQ9IjAlIiBzdG9wLWNvbG9yPSIjYmVjOWY3IiBzdG9wLW9wYWNpdHk9IjEiLz4KICAgIDxzdG9wIG9mZnNldD0iMTAwJSIgc3RvcC1jb2xvcj0iIzBiM2NlZCIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgPC9saW5lYXJHcmFkaWVudD4KICA8cmVjdCB4PSIwIiB5PSIwIiB3aWR0aD0iMSIgaGVpZ2h0PSIxIiBmaWxsPSJ1cmwoI2dyYWQtdWNnZy1nZW5lcmF0ZWQpIiAvPgo8L3N2Zz4=);
background: -moz-linear-gradient(-45deg, rgba(190,201,247,1) 0%, rgba(11,60,237,1) 100%);
background: -webkit-gradient(linear, left top, right bottom, color-stop(0%,rgba(190,201,247,1)), color-stop(100%,rgba(11,60,237,1)));
background: -webkit-linear-gradient(-45deg, rgba(190,201,247,1) 0%,rgba(11,60,237,1) 100%);
background: -o-linear-gradient(-45deg, rgba(190,201,247,1) 0%,rgba(11,60,237,1) 100%);
background: -ms-linear-gradient(-45deg, rgba(190,201,247,1) 0%,rgba(11,60,237,1) 100%);
background: linear-gradient(135deg, rgba(190,201,247,1) 0%,rgba(11,60,237,1) 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#bec9f7', endColorstr='#0b3ced',GradientType=1 );
}
-->
</style>
</head>
<script>
<!--
function x(){document.f.q.focus();}
// --></script>
<body onload="x()">
<TABLE border=0 height=100% cellspacing=0 cellpadding=0>
<TR>
<TD bgcolor=#f3c714 valign=top style="width:210px;border-right:3px solid blue;"><br><center><a href=/><div style="background-color:white;padding:10px;border-radius:100px;border-color:blue;border-width:3px;border-style:solid;width:100px;height:100px;"><img style=margin-top:21px; width=90 height=57 src=/computer2.png></div></a></center><br><br><a href=/>
<a href=/><div style="padding:5px;position:relative;text-align:right;border-width:3px;border-right-width:0px;border-style:solid;margin-left:10px;border-top-left-radius:10px;border-bottom-left-radius:10px;font-size:14px;x-overflow:;border-color:white;color:white;background-color:blue;" onmouseover="this.style.backgroundColor='lightblue';this.style.color='black';" onmouseout="this.style.backgroundColor='blue';this.style.color='white';">
<nobr>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <b>SEARCH</b> &nbsp; &nbsp;</nobr>
</div>
<br>
<a href=/Top><div style="padding:5px;position:relative;text-align:right;border-width:3px;border-right-width:0px;border-style:solid;margin-left:10px;border-top-left-radius:10px;border-bottom-left-radius:10px;font-size:14px;x-overflow:;border-color:white;color:white;background-color:blue;" onmouseover="this.style.backgroundColor='lightblue';this.style.color='black';" onmouseout="this.style.backgroundColor='blue';this.style.color='white';">
<nobr>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <b>DIRECTORY</b> &nbsp; &nbsp;</nobr>
</div>
</a><br><a href=/adv.html><div style="padding:5px;position:relative;text-align:right;border-width:3px;border-right-width:0px;border-style:solid;margin-left:10px;border-top-left-radius:10px;border-bottom-left-radius:10px;font-size:14px;x-overflow:;border-color:white;color:white;background-color:blue;" onmouseover="this.style.backgroundColor='lightblue';this.style.color='black';" onmouseout="this.style.backgroundColor='blue';this.style.color='white';"><nobr>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <b>ADVANCED</b> &nbsp; &nbsp;</nobr></div></a><br><a href=/addurl><div style="padding:5px;position:relative;text-align:right;border-width:3px;border-right-width:0px;border-style:solid;margin-left:10px;border-top-left-radius:10px;border-bottom-left-radius:10px;font-size:14px;x-overflow:;border-color:white;color:white;background-color:blue;" onmouseover="this.style.backgroundColor='lightblue';this.style.color='black';" onmouseout="this.style.backgroundColor='blue';this.style.color='white';"><nobr>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <b>ADD URL</b> &nbsp; &nbsp;</nobr></div></a><br><a href=/about.html><div style="padding:5px;position:relative;text-align:right;border-width:3px;border-right-width:0px;border-style:solid;margin-left:10px;border-top-left-radius:10px;border-bottom-left-radius:10px;font-size:14px;x-overflow:;border-color:white;color:white;background-color:blue;" onmouseover="this.style.backgroundColor='lightblue';this.style.color='black';" onmouseout="this.style.backgroundColor='blue';this.style.color='white';"><nobr>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <b>ABOUT</b> &nbsp; &nbsp;</nobr></div></a><br><a href=/help.html><div style="padding:5px;position:relative;text-align:right;border-width:3px;border-right-width:0px;border-style:solid;margin-left:10px;border-top-left-radius:10px;border-bottom-left-radius:10px;font-size:14px;x-overflow:;border-color:white;color:white;background-color:blue;" onmouseover="this.style.backgroundColor='lightblue';this.style.color='black';" onmouseout="this.style.backgroundColor='blue';this.style.color='white';"><nobr>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <b>HELP</b> &nbsp; &nbsp;</nobr></div></a><br><a href=/api><div style="padding:5px;position:relative;text-align:right;border-width:3px;border-right-width:0px;border-style:solid;margin-left:10px;border-top-left-radius:10px;border-bottom-left-radius:10px;font-size:14px;x-overflow:;border-color:white;color:white;background-color:blue;" onmouseover="this.style.backgroundColor='lightblue';this.style.color='black';" onmouseout="this.style.backgroundColor='blue';this.style.color='white';"><nobr>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <b>API</b> &nbsp; &nbsp;</nobr></div></a><br><a href=/admin/settings><div style="background-color:green;position:relative;padding:5px;text-align:right;border-width:3px;border-right-width:0px;border-style:solid;margin-left:10px;border-color:white;border-top-left-radius:10px;border-bottom-left-radius:10px;font-size:14px;color:white;cursor:hand;cursor:pointer;" onmouseover="this.style.backgroundColor='lightgreen';this.style.color='black';" onmouseout="this.style.backgroundColor='green';this.style.color='white';">
<b>ADMIN</b> &nbsp; &nbsp;</div></a><br>
</TD><TD valign=top style=padding-left:30px;>
<br><br><h1>Gigablast Web Search Appliance (GWSA)</h1>
<br><br>
@ -79,5 +10,3 @@ Please note that the server pictured here is for entertainment only and does not
</div>
</TD></TR></TABLE></body></html>