Roxen.git
/
server
/
base_server
/
mainconfig.pike
version
»
Context lines:
10
20
40
80
file
none
3
Roxen.git/server/base_server/mainconfig.pike:1:
inherit "config/builders";
-
string cvs_version = "$Id: mainconfig.pike,v 1.
19
1996/12/
04
09
:
40
:
03
per Exp $";
+
string cvs_version = "$Id: mainconfig.pike,v 1.
20
1996/12/
05
01
:
54
:
44
per Exp $";
inherit "roxenlib"; inherit "config/draw_things"; #include <confignode.h> #include <module.h> #define dR "00"
-
#define dG "
20
"
-
#define dB "
50
"
+
#define dG "
10
"
+
#define dB "
30
"
#define bdR "00" #define bdG "50" #define bdB "90"
-
#define BODY "<body bgcolor=#
002050
text=#ffffff link=#ffffaa vlink=#ffffaa alink=#f0e0f0>"
+
#define BODY "<body bgcolor=#
"+dR+dG+dB+"
text=#ffffff link=#ffffaa vlink=#ffffaa alink=#f0e0f0>"
#define TABLEP(x, y) (id->supports->tables ? x : y) #define PUSH(X) do{res+=({(X)});}while(0) int bar=time(1); class Node { inherit "struct/node"; mixed original;
Roxen.git/server/base_server/mainconfig.pike:807:
string tablist(array(string) nodes, array(string) links, int selected) { array res = ({}); for(int i=0; i<sizeof(nodes); i++) if(i!=selected) PUSH("<a href=\""+links[i]+"\"><img alt=\"/"+nodes[i][1..strlen(nodes[i])-2]+"\\_\" src=/auto/unselected/"+replace(nodes[i]," ","%20")+" border=0></a>"); else PUSH("<a href=\""+links[i]+"\"><b><img alt=\"/"+nodes[i][1..strlen(nodes[i])-2]+"\\_\" src=/auto/selected/"+replace(nodes[i]," ","%20")+" border=0></b></a>");
-
PUSH("<br>");
+
//
PUSH("<br>");
return res*""; } mapping (string:string) selected_nodes = ([ "Configurations":"/Configurations", "Globals":"/Globals", "Status":"/Status", "Errors":"/Errors", ]);
Roxen.git/server/base_server/mainconfig.pike:928:
return r; } string remove_font(string t, mapping m, string c) { return "<b>"+c+"</b>"; }
+
int nfolded(object o)
+
{
+
int i;
+
if(o = o->down)
+
do { i+=!!o->folded; } while(o=o->next);
+
return i;
+
}
+
+
int nfoldedr(object o)
+
{
+
object node;
+
int i;
+
i = o->folded;
+
node=o->down;
+
while(node)
+
{
+
i+=nfoldedr(node);
+
node=node->next;
+
}
+
return i;
+
}
+
+
mapping configuration_parse(object id) { array (string) res=({}); string tmp; // Is it an image? if(sscanf(id->not_query, "/image/%s", tmp)) return file_image(tmp) || (["data":"No such image"]); object o; int i;
Roxen.git/server/base_server/mainconfig.pike:1012:
break; // There is no button for this in the configuration interface, // the results are quite horrible, especially when applied to // one of the top nodes. case "unfoldall": o->map(lambda(object o) { o->folded=0; }); break;
+
case "unfoldlevel":
+
object node;
+
node=o->down;
+
while(node)
+
{
+
node->folded=0;
+
node = node->next;
+
}
+
break;
-
+
// And now the actual actions.. // Re-read a module from disk // This is _not_ as easy as it sounds, since quite a lot of // caches and stuff has to be unvalidated.. case "refresh": case "reload": object mod; string name, modname; mapping cmod;
Roxen.git/server/base_server/mainconfig.pike:1311:
o->change(-1); else if(!o->changed) o->change(1); } break; } return std_redirect(o, id); } PUSH(default_head("Roxen server configuration", root->changed?o->path(1):0));
-
PUSH("\n"+display_tabular_header( o )+"\n<br>
\n
");
+
//
PUSH("
<table width=\"100%\" cellpadding=0 cellspacing=0>
\n"
);
+
// PUSH("<tr><td>\n");
+
PUSH("\n"
+display_tabular_header( o )+"\n
");
+
PUSH("
<br>");
+
// PUSH("</td></tr><tr><td width=\"100%\" bgcolor=#000000><br>");
if(o->up != root && o->up) PUSH("<a href=\""+ o->up->path(1)+"?"+(bar++)+"\">" "<img src=/auto/back alt='[Up]' align=left hspace=0 border=0></a>\n"); if(i=o->folded) o->folded=0; string tmp = o->describe(1); if(!id->supports->font) tmp = parse_html(tmp, ([]),(["font":remove_font, ])); PUSH(tmp); o->folded=i;
-
PUSH("<br clear=all>\n");
+
//
PUSH("<
/td></tr></table>\n");
+
// PUSH("<
br clear=all>\n");
int lm=1; if(o->type == NODE_CONFIGURATIONS) BUTTON(newconfig, "New virtual server", left); if(o->type == NODE_CONFIGURATION) BUTTON(newmodule, "New module", left); if(o->type == NODE_MODULE)
Roxen.git/server/base_server/mainconfig.pike:1353:
|| o->type == NODE_MODULE_COPY_VARIABLES) { BUTTON(delete, "Delete", left); BUTTON(refresh, "Reload", left); } if(o->type == NODE_CONFIGURATION) BUTTON(delete,"Delete this server", left); if(nunfolded(o))
-
BUTTON(foldall, "
Close
all",left);
+
BUTTON(foldall, "
Fold
all",left);
if(o->changed)
-
BUTTON(unfoldmodified, "
Open
modified", left);
+
BUTTON(unfoldmodified, "
Unfold
modified", left);
-
+
if(nfolded(o))
+
BUTTON(unfoldlevel, "Unfold level", left);
+
else if(nfoldedr(o))
+
BUTTON(unfoldall, "Unfold all", left);
+
+
if((o->changed||root->changed)) BUTTON(save, "Save", left);
-
+
BUTTON(restart, "Restart", left); BUTTON(shutdown,"Shutdown", left); PUSH("<img border=0 alt=\"\" hspacing=0 vspacing=0 src=/auto/button/rm/%20>"); PUSH("</nobr><br clear=all>"); // PUSH("<a href=$docurl>"+roxen->real_version +"</a>" PUSH("</body>\n"); return stores(res*""); }