mirror of https://github.com/jumpserver/jumpserver
perf(settings): public setting API返回LOGIN_TITLE字段
parent
28da819735
commit
91f1280f97
|
@ -18,6 +18,7 @@ from importlib import import_module
|
|||
from django.urls import reverse_lazy
|
||||
from django.contrib.staticfiles.templatetags.staticfiles import static
|
||||
from urllib.parse import urljoin, urlparse
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||
PROJECT_DIR = os.path.dirname(BASE_DIR)
|
||||
|
@ -458,6 +459,16 @@ class DynamicConfig:
|
|||
except:
|
||||
return False
|
||||
|
||||
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 LOGO_URLS(self):
|
||||
logo_urls = {'logo_logout': static('img/logo.png'),
|
||||
'logo_index': static('img/logo_text.png'),
|
||||
|
|
|
@ -96,6 +96,8 @@ AUTH_EXPIRED_SECONDS = 60 * 5
|
|||
# XPACK
|
||||
XPACK_LICENSE_IS_VALID = DYNAMIC.XPACK_LICENSE_IS_VALID
|
||||
|
||||
XPACK_INTERFACE_LOGIN_TITLE = DYNAMIC.XPACK_INTERFACE_LOGIN_TITLE
|
||||
|
||||
LOGO_URLS = DYNAMIC.LOGO_URLS
|
||||
|
||||
CHANGE_AUTH_PLAN_SECURE_MODE_ENABLED = CONFIG.CHANGE_AUTH_PLAN_SECURE_MODE_ENABLED
|
||||
|
|
|
@ -278,6 +278,7 @@ class PublicSettingApi(generics.RetrieveAPIView):
|
|||
"SECURITY_VIEW_AUTH_NEED_MFA": settings.SECURITY_VIEW_AUTH_NEED_MFA,
|
||||
"SECURITY_MFA_VERIFY_TTL": settings.SECURITY_MFA_VERIFY_TTL,
|
||||
"SECURITY_COMMAND_EXECUTION": settings.SECURITY_COMMAND_EXECUTION,
|
||||
"LOGIN_TITLE": settings.XPACK_INTERFACE_LOGIN_TITLE,
|
||||
"LOGO_URLS": settings.LOGO_URLS,
|
||||
"TICKETS_ENABLED": settings.TICKETS_ENABLED,
|
||||
"PASSWORD_RULE": {
|
||||
|
|
Loading…
Reference in New Issue