mirror of https://github.com/jumpserver/jumpserver
parent
32fe8f674c
commit
8b1e202e68
|
@ -143,6 +143,7 @@ class Config(dict):
|
||||||
'REDIS_DB_SESSION': 5,
|
'REDIS_DB_SESSION': 5,
|
||||||
'REDIS_DB_WS': 6,
|
'REDIS_DB_WS': 6,
|
||||||
|
|
||||||
|
'GLOBAL_ORG_DISPLAY_NAME': '',
|
||||||
'SITE_URL': 'http://localhost:8080',
|
'SITE_URL': 'http://localhost:8080',
|
||||||
'CAPTCHA_TEST_MODE': None,
|
'CAPTCHA_TEST_MODE': None,
|
||||||
'TOKEN_EXPIRATION': 3600 * 24,
|
'TOKEN_EXPIRATION': 3600 * 24,
|
||||||
|
|
|
@ -120,3 +120,6 @@ CONNECTION_TOKEN_ENABLED = CONFIG.CONNECTION_TOKEN_ENABLED
|
||||||
DISK_CHECK_ENABLED = CONFIG.DISK_CHECK_ENABLED
|
DISK_CHECK_ENABLED = CONFIG.DISK_CHECK_ENABLED
|
||||||
FORGOT_PASSWORD_URL = CONFIG.FORGOT_PASSWORD_URL
|
FORGOT_PASSWORD_URL = CONFIG.FORGOT_PASSWORD_URL
|
||||||
|
|
||||||
|
|
||||||
|
# 自定义默认组织名
|
||||||
|
GLOBAL_ORG_DISPLAY_NAME = CONFIG.GLOBAL_ORG_DISPLAY_NAME
|
||||||
|
|
Binary file not shown.
|
@ -2077,6 +2077,14 @@ msgstr "用户第一次登录,修改profile后重定向到地址, 可以是 wi
|
||||||
msgid "Forgot password url"
|
msgid "Forgot password url"
|
||||||
msgstr "忘记密码URL"
|
msgstr "忘记密码URL"
|
||||||
|
|
||||||
|
#: settings/serializers/settings.py:23
|
||||||
|
msgid "Global organization name"
|
||||||
|
msgstr "全局组织名"
|
||||||
|
|
||||||
|
#: settings/serializers/settings.py:23
|
||||||
|
msgid "The name of global organization to display"
|
||||||
|
msgstr "全局组织的显示名称,默认为 全局组织"
|
||||||
|
|
||||||
#: settings/serializers/settings.py:24
|
#: settings/serializers/settings.py:24
|
||||||
msgid ""
|
msgid ""
|
||||||
"The forgot password url on login page, If you use ldap or cas external "
|
"The forgot password url on login page, If you use ldap or cas external "
|
||||||
|
|
|
@ -7,7 +7,7 @@ from django.db.models import signals
|
||||||
from django.db.models import Q
|
from django.db.models import Q
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import ugettext_lazy as _
|
||||||
|
|
||||||
from common.utils import is_uuid, lazyproperty
|
from common.utils import lazyproperty, settings
|
||||||
from common.const import choices
|
from common.const import choices
|
||||||
from common.db.models import ChoiceSet
|
from common.db.models import ChoiceSet
|
||||||
|
|
||||||
|
@ -193,7 +193,7 @@ class Organization(models.Model):
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def root(cls):
|
def root(cls):
|
||||||
return cls(id=cls.ROOT_ID, name=cls.ROOT_NAME)
|
return cls(id=cls.ROOT_ID, name=settings.GLOBAL_ORG_DISPLAY_NAME if settings.GLOBAL_ORG_DISPLAY_NAME else cls.ROOT_NAME)
|
||||||
|
|
||||||
def is_root(self):
|
def is_root(self):
|
||||||
return self.id == self.ROOT_ID
|
return self.id == self.ROOT_ID
|
||||||
|
|
|
@ -24,6 +24,10 @@ class BasicSettingSerializer(serializers.Serializer):
|
||||||
help_text=_('The forgot password url on login page, If you use '
|
help_text=_('The forgot password url on login page, If you use '
|
||||||
'ldap or cas external authentication, you can set it')
|
'ldap or cas external authentication, you can set it')
|
||||||
)
|
)
|
||||||
|
GLOBAL_ORG_DISPLAY_NAME = serializers.CharField(
|
||||||
|
required=False, max_length=1024, allow_blank=True, allow_null=True, label=_("Global organization name"),
|
||||||
|
help_text=_('The name of global organization to display')
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class EmailSettingSerializer(serializers.Serializer):
|
class EmailSettingSerializer(serializers.Serializer):
|
||||||
|
|
Loading…
Reference in New Issue