system-info: add edition type into app info.

This commit is contained in:
Marcin Kuzminski 2016-11-15 00:16:24 +01:00
parent f543920d9d
commit 078d9996e4
2 changed files with 10 additions and 3 deletions

View file

@ -577,7 +577,7 @@ class SettingsController(BaseController):
), ''),
# RhodeCode specific
(_('RhodeCode Version'), c.rhodecode_version, ''),
(_('RhodeCode Version'), val('rhodecode_app')['text'], state('rhodecode_app')),
(_('RhodeCode Server IP'), val('server')['server_ip'], state('server')),
(_('RhodeCode Server ID'), val('server')['server_id'], state('server')),
(_('RhodeCode Configuration'), val('rhodecode_config')['path'], state('rhodecode_config')),

View file

@ -466,11 +466,18 @@ def vcs_server():
def rhodecode_app_info():
import rhodecode
edition = rhodecode.CONFIG.get('rhodecode.edition')
value = dict(
rhodecode_version=rhodecode.__version__,
rhodecode_lib_path=os.path.abspath(rhodecode.__file__)
rhodecode_lib_path=os.path.abspath(rhodecode.__file__),
text=''
)
return SysInfoRes(value=value)
human_value = value.copy()
human_value['text'] = 'RhodeCode {edition}, version {ver}'.format(
edition=edition, ver=value['rhodecode_version']
)
return SysInfoRes(value=value, human_value=human_value)
def rhodecode_config():