def XPACK_INTERFACE_LOGIN_TITLE(self): default_title = _('Welcome to the JumpServer open source fortress') if not HAS_XPACK: return default_title try: from xpack.plugins.interface.models import Interface return Interface.get_login_title() except: return default_title
def get_logo_urls(): logo_urls = { 'logo_logout': static('img/logo.png'), 'logo_index': static('img/logo_text.png'), 'login_image': static('img/login_image.png'), 'favicon': static('img/facio.ico') } if not settings.XPACK_ENABLED: return logo_urls from xpack.plugins.interface.models import Interface obj = Interface.interface() if not obj: return logo_urls for attr in ['logo_logout', 'logo_index', 'login_image', 'favicon']: if getattr(obj, attr, '') and getattr(obj, attr).url: logo_urls.update({attr: getattr(obj, attr).url}) return logo_urls
def LOGO_URLS(self): logo_urls = {'logo_logout': static('img/logo.png'), 'logo_index': static('img/logo_text.png'), 'login_image': static('img/login_image.png'), 'favicon': static('img/facio.ico')} if not HAS_XPACK: return logo_urls try: from xpack.plugins.interface.models import Interface obj = Interface.interface() if obj: if obj.logo_logout: logo_urls.update({'logo_logout': obj.logo_logout.url}) if obj.logo_index: logo_urls.update({'logo_index': obj.logo_index.url}) if obj.login_image: logo_urls.update({'login_image': obj.login_image.url}) if obj.favicon: logo_urls.update({'favicon': obj.favicon.url}) except: pass return logo_urls
def get_interface_setting(): if not settings.XPACK_ENABLED: return default_interface from xpack.plugins.interface.models import Interface return Interface.get_interface_setting()
def get_login_title(): default_title = _('Welcome to the JumpServer open source Bastion Host') if not settings.XPACK_ENABLED: return default_title from xpack.plugins.interface.models import Interface return Interface.get_login_title()
def get_login_title_setting(): login_title = None if settings.XPACK_ENABLED: from xpack.plugins.interface.models import Interface login_title = Interface.get_login_title() return {'TERMINAL_HEADER_TITLE': login_title}