Roxen.git / server / base_server / mainconfig.pike

version» Context lines:

Roxen.git/server/base_server/mainconfig.pike:1:   inherit "config/builders"; - string cvs_version = "$Id: mainconfig.pike,v 1.69 1997/08/13 22:29:29 grubba Exp $"; + string cvs_version = "$Id: mainconfig.pike,v 1.70 1997/08/14 15:59:50 grubba Exp $";   inherit "roxenlib";   inherit "config/draw_things";      import Array;   import Stdio;   string status_row(object node);   string display_tabular_header(object node);   object get_template(string t);      /* Work-around for Simulate.perror */
Roxen.git/server/base_server/mainconfig.pike:165:   }         void create()   {    build_root(root);    init_ip_list();    call_out(init_ip_list, 0);   }    + // Note stringification of ACTION and ALIGN + #if 0   #define BUTTON(ACTION,TEXT,ALIGN) do{PUSH("<a href=\"/(ACTION)"+(o?o->path(1):"/")+"?"+(bar++)+"\"><img border=0 hspacing=0 vspacing=0 src=\"/auto/button/"+(lm?"lm/":"")+replace(TEXT," ","%20")+"\" alt=\""+(lm?"/ ":" ")+TEXT+" /\""+(("ALIGN"-" ")=="left"?"":" align="+("ALIGN"-" "))+"></a>");lm=0;}while(0) -  + #else    -  + #define BUTTON(ACTION,TEXT,ALIGN) do{buttons += ({({"<a href=\"/(ACTION)"+(o?o->path(1):"/")+"?"+(bar++)+"\"><img border=0 hspacing=0 vspacing=0 src=\"/auto/button/"+(lm?"lm/":""),replace(TEXT," ","%20")+"\" alt=\""+(lm?"/ ":" ")+TEXT+" /\""+(("ALIGN"-" ")=="left"?"":" align="+("ALIGN"-" "))+"></a>"})});lm=0;}while(0) + #define PUSH_BUTTONS(CLEAR) do{if(sizeof(buttons)){buttons[-1][0]+="rm/";res+=`+(@buttons);if(CLEAR){PUSH("<br clear=all>");}}lm=1;buttons=({});}while(0) +  + #endif /* 0 */ +  +    string default_head(string h, string|void save)   {    return ("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Draft//EN\">"    "<head><title>"+h+"</title></head>\n"+ BODY+"\n");   }      object find_node(string l)   {    array tmp = l/"/"-({""});    object o;
Roxen.git/server/base_server/mainconfig.pike:767:    return 1;    }    return !strlen(name);   }      int low_enable_configuration(string name, string type)   {    object node;    object o, o2, confnode;    array(string) arr = replace(type,"."," ")/" "; +  object template;       if(check_config_name(name)) return 0;       if((type = lower_case(arr[0])) == "copy")    {    string from;    mapping tmp;    if ((sizeof(arr) > 1) &&    (sscanf(arr[1..]*" ", "%*s'%s'", from) == 2) &&    (tmp = roxen->copy_configuration(from, name)))    {    tmp["spider#0"]->LogFile =    "../logs/" + roxenp()->short_name(name) + "/Log";    roxenp()->save_it(name);    roxen->enable_configuration(name);    }    } else -  get_template(type)->enable(roxen->enable_configuration(name)); +  (template = get_template(type))->enable(roxen->enable_configuration(name));       confnode = root->descend("Configurations");    node=confnode->descend(name);       node->describer = describe_configuration;    node->saver = save_configuration;    node->data = roxen->configurations[-1];    node->type = NODE_CONFIGURATION;    build_configuration(node);    node->folded=0;    node->change(1);    -  if(get_template(type)->post) -  get_template(type)->post(node); +  if(template && template->post) +  template->post(node);       if(o = node->descend( "Global", 1 )) {    o->folded = 0;    if(o2 = o->descend( "Listen ports", 1 )) {    o2->folded = 0;    o2->change(1);    }    }       if(o = node->descend( "Filesystem", 1 )) {
Roxen.git/server/base_server/mainconfig.pike:1634:    if(!id->supports->font)    tmp = parse_html(tmp, ([]),(["font":remove_font, ]));    PUSH("<dl><dt>");    PUSH(tmp);    PUSH("</dl>");    o->folded=i;       PUSH("<p><br clear=all>&nbsp;\n");       int lm=1; +  array(mixed) buttons = ({});       if(o->type == NODE_CONFIGURATIONS)    BUTTON(newconfig, "New virtual server", left);       if(o->type == NODE_CONFIGURATION)    BUTTON(addmodule, "Add module", left);       if(o->type == NODE_MODULE)    {    BUTTON(delete, "Delete module", left);
Roxen.git/server/base_server/mainconfig.pike:1670:    if(nunfolded(o))    BUTTON(foldall, "Fold all",left);    if(o->changed)    BUTTON(unfoldmodified, "Unfold modified", left);       if(nfolded(o))    BUTTON(unfoldlevel, "Unfold level", left);   // else if(nfoldedr(o))   // BUTTON(unfoldall, "Unfold all", left);    -  if(!lm) -  { -  PUSH("<img border=0 alt=\"\" hspacing=0 vspacing=0" -  " src=\"/auto/button/rm/%20\">"); -  PUSH("<br clear=all>"); -  lm=1; -  } +  PUSH_BUTTONS(1);       if(!more_mode)    BUTTON(morevars, "More options", left);    else    BUTTON(nomorevars, "Fewer options", 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_BUTTONS(0); +    // PUSH("<br clear=all>");   // PUSH("<p align=right><font size=-1 color=blue><a href=\"$docurl\"><font color=blue>"+roxen->real_version +"</font></a></font></p>");   // PUSH("</table>");    PUSH("</body>\n");    return stores(res*"");   }