#include "gb-include.h"
#include "HttpServer.h"
#include "Conf.h"
#include "Pages.h"
#include "Thesaurus.h"
void trimWhite(char *beginning); // AutoBan.cpp, this should really be
// a utility function somewhere
bool sendPageThesaurus( TcpSocket *s, HttpRequest *r ) {
SafeBuf p;
char getBuf[64]; // holds extra values for GET method
char formBuf[256]; // holds extra values for forms
snprintf(getBuf, 64, "c=%s",
r->getString("c", 0, ""));
snprintf(formBuf, 256,
"",
//"",
r->getString("c", 0, ""));
g_pages.printAdminTop( &p, s, r);
if (r->getLong("cancel", 0) != 0) {
g_thesaurus.cancelRebuild();
p.safePrintf("
\n");
p.safePrintf(
"
"
" | "
"|
%s | " "" "1.000/%08lX (1.000/%08lX)" " | " "
" ""); p.safeMemcpy(info.m_syn[i], info.m_len[i]); p.safePrintf("" " | " "" ""); if (info.m_affinity[i] >= 0) { p.safePrintf("%0.3f/%08lX ", (float)info.m_affinity[i] / MAX_AFFINITY, info.m_affinity[i]); } else { p.safePrintf("u "); } if (aff >= 0) { p.safePrintf("(%0.3f/%08lX) ", (float)aff / MAX_AFFINITY, aff); } else { p.safePrintf("(u) "); } p.safePrintf("(%ld) (%ld) (%ld) (%ld) " "(%lld) (%lld)", (long)info.m_type[i], (long)info.m_sort[i], info.m_firstId[i], info.m_lastId[i], info.m_leftSynHash[i], info.m_rightSynHash[i]); for (int j = info.m_firstId[i]; j <= info.m_lastId[i]; j++) { p.safePrintf(" (%lld)", info.m_termId[j]); } p.safePrintf( "" " | " "
"
" | "
"|
rebuild all data " "" "rebuilds synonyms and then begins the rebuild process for " "affinity data; this should only be run on one host, as the " "data is copied when the process is finished; full rebuild " "does not use existing affinity data" "" " | "
""
" | "
"
distribute data " "" "distributes all thesaurus data to all hosts, this is " "normally done automatically but if there was a problem " "with the copy, this lets you do it manually" "" " | "
""
" | "
"
reload data " "" "reloads the synonyms and affinity table on this host only" "" " | "
""
" | "
"
reload data (all hosts) " "" "reloads the synonyms and affinity table on all hosts" "" " | "
""
" | "
"
list synonyms " "" "enter a word here to list all synonym entries and their " "affinities" "" " | "
"" " | " "
"
" | "
"|
cancel running rebuild " "" "cancels the rebuild and throws all intermediate data away" "" " | "
""
" | "
"
rebuild affinity only " "" "begins the rebuild process for affinity data, has no " "effect if a rebuild is already in progress; full rebuild " "does not reuse existing affinity data" "" " | "
""
" | "
"
"
" | "
"|
");
p.safePrintf(
"manually added pairs \n" "place word pairs here that should be linked " "as synonyms, one pair per line, seperated by a pipe '|' " "character, optionally followed by another pipe and a type " "designation; any badly formatted lines will be silently " "ignored \n" " | "
"|
"
"affinity value overrides \n" "place word/phrase pairs here that should have " "there affinity values overridden, format is " "\"word1|word2|value\", where value is a floating point, " "integer (either decimal or hex), or the word \"max\"; " "any badly formatted lines will be silently ignored; note " "that these pairs will only work if the thesaurus otherwise " "has an entry for them, so add them to the manual add file " "above if need be \n" " | "
"
"
" | "
"|
"
" | |
# of total pairs | " "%lli |
# of pairs remaining | " "%lli |
# of pairs processed | " "%lli |
elapsed time in seconds | " "%lli |
estimated remaining time in seconds | " "%lli |
# of requests sent | " "%lli |
# of requests received | " "%lli |
# of request errors | " "%lli |
# of old values reused | " "%lli |
# of cache hits | " "%lli |
cache size | " "%lli |