Changeset 1795

Show
Ignore:
Timestamp:
08/13/08 14:45:13 (3 months ago)
Author:
alo
Message:

--

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • cherokee/trunk/ChangeLog

    r1793 r1795  
    112008-08-13  Alvaro Lopez Ortega  <alvaro@alobbs.com> 
     2 
     3        * cherokee/handler_server_info.c, admin/ModuleServerInfo.py: Both 
     4        the server info handler and its cherokee-admin module have been 
     5        reworked in order to make its configuration options more 
     6        consistent. It was showing too much internal stuff. 
    27 
    38        * cherokee/plugin_loader.c (cherokee_plugin_loader_get_mods_info): 
  • cherokee/trunk/admin/ModuleServerInfo.py

    r1418 r1795  
    33from Module import * 
    44 
    5 NOTE_JUST_ABOUT  = 'Show only the most basic information.' 
    6 NOTE_CONNECTIONS = 'Show status of the ongoing connections.' 
     5NOTE_INFORMATION = 'Which information should be shown.' 
     6 
     7options = [ 
     8    ('normal',             "Server Information"), 
     9    ('just_about',         "Only version information"), 
     10    ('connection_details', "Server Information + Connections") 
     11
    712 
    813class ModuleServerInfo (Module, FormHelper): 
    9     PROPERTIES = [ 
    10         'just_about', 
    11         'connection_details' 
    12     ] 
     14    PROPERTIES = [] 
    1315 
    1416    def __init__ (self, cfg, prefix, submit_url): 
     
    2022 
    2123        table = TableProps() 
    22         self.AddPropCheck (table, "Just 'About'", "%s!just_about" % (self._prefix), False, NOTE_JUST_ABOUT) 
    23         self.AddPropCheck (table, "Show Connections", "%s!connection_details" % (self._prefix), False, NOTE_CONNECTIONS) 
     24        self.AddPropOptions (table, "Show Information",  
     25                             "%s!type" % (self._prefix), 
     26                             options, NOTE_INFORMATION) 
    2427        txt += self.Indent(table) 
    2528 
     
    2730 
    2831    def _op_apply_changes (self, uri, post): 
    29         self.ApplyChangesPrefix (self._prefix, ['just_about'], post) 
     32        None 
  • cherokee/trunk/cherokee/handler_server_info.c

    r1776 r1795  
    138138                cherokee_config_node_t *subconf = CONFIG_NODE(i); 
    139139 
    140                 if (equal_buf_str (&subconf->key, "just_about")) { 
    141                         props->just_about = atoi(subconf->val.buf); 
    142                 } else if (equal_buf_str (&subconf->key, "connection_details")) { 
    143                         props->connection_details = atoi(subconf->val.buf); 
    144                 } else { 
    145                         PRINT_MSG ("ERROR: Handler file: Unknown key: '%s'\n", subconf->key.buf); 
    146                         return ret_error; 
     140                if (equal_buf_str (&subconf->key, "type")) { 
     141                        if (equal_buf_str (&subconf->val, "normal")) { 
     142                                 
     143                        } else if (equal_buf_str (&subconf->val, "just_about")) { 
     144                                props->just_about = true; 
     145                                 
     146                        } else if (equal_buf_str (&subconf->val, "connection_details")) { 
     147                                props->connection_details = true; 
     148 
     149                        } else { 
     150                                PRINT_MSG ("ERROR: Handler server_info: Unknown key value: '%s'\n",  
     151                                           subconf->val.buf); 
     152                                return ret_error; 
     153                        } 
    147154                } 
    148155        }