Commits

Marcin Kuzminski committed a801c45

added useful system info + packages to settings page.

  • Participants
  • Parent commits 050c8f0

Comments (0)

Files changed (2)

File rhodecode/controllers/admin/settings.py

 import logging
 import traceback
 import formencode
+import pkg_resources
+import platform
 
 from sqlalchemy import func
 from formencode import htmlfill
     def __before__(self):
         c.admin_user = session.get('admin_user')
         c.admin_username = session.get('admin_username')
+        c.modules = sorted([(p.project_name, p.version) 
+                            for p in pkg_resources.working_set])
+        c.py_version = platform.python_version()
+        c.platform = platform.platform()        
         super(SettingsController, self).__before__()
 
     @HasPermissionAllDecorator('hg.admin')
 
         defaults = RhodeCodeSetting.get_app_settings()
         defaults.update(self.get_hg_ui_settings())
+
         return htmlfill.render(
             render('admin/settings/settings.html'),
             defaults=defaults,

File rhodecode/templates/admin/settings/settings.html

     </div>
     ${h.end_form()}
 
+    <h3>${_('System Info and Packages')}</h3>
+    <div class="form">
+    <div>
+        <h5 id="expand_modules" style="cursor: pointer">&darr; ${_('show')} &darr;</h5>
+    </div>
+      <div id="expand_modules_table"  style="display:none">
+      <h5>Python - ${c.py_version}</h5>
+      <h5>System - ${c.platform}</h5>
+      
+      <table class="table" style="margin:0px 0px 0px 20px">
+          <colgroup>
+              <col style="width:220px">
+          </colgroup>
+          <tbody>
+              %for key, value in c.modules:
+                  <tr>
+                      <th>${key}</th>
+                      <td>${value}</td>
+                  </tr>
+              %endfor
+          </tbody>
+      </table>
+      </div>    
+    </div>
+    
+    <script type="text/javascript">
+    YUE.on('expand_modules','click',function(e){
+    	YUD.setStyle('expand_modules_table','display','');
+    	YUD.setStyle('expand_modules','display','none');
+    })
+    </script>
+    
 </div>
 </%def>