Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
gjl2004yn
jumpserver
提交
1ac8537a
J
jumpserver
项目概览
gjl2004yn
/
jumpserver
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
J
jumpserver
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
1ac8537a
编写于
4月 08, 2021
作者:
L
liuboF2c
提交者:
xinwen
4月 08, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat:支持配置全局组织的显示名称 (#5919)
Co-authored-by:
N
liubo
<
liubo@fit2cloud.com
>
上级
dcaa798c
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
18 addition
and
2 deletion
+18
-2
apps/jumpserver/conf.py
apps/jumpserver/conf.py
+1
-0
apps/jumpserver/settings/custom.py
apps/jumpserver/settings/custom.py
+3
-0
apps/locale/zh/LC_MESSAGES/django.mo
apps/locale/zh/LC_MESSAGES/django.mo
+0
-0
apps/locale/zh/LC_MESSAGES/django.po
apps/locale/zh/LC_MESSAGES/django.po
+8
-0
apps/orgs/models.py
apps/orgs/models.py
+2
-2
apps/settings/serializers/settings.py
apps/settings/serializers/settings.py
+4
-0
未找到文件。
apps/jumpserver/conf.py
浏览文件 @
1ac8537a
...
...
@@ -143,6 +143,7 @@ class Config(dict):
'REDIS_DB_SESSION'
:
5
,
'REDIS_DB_WS'
:
6
,
'GLOBAL_ORG_DISPLAY_NAME'
:
''
,
'SITE_URL'
:
'http://localhost:8080'
,
'CAPTCHA_TEST_MODE'
:
None
,
'TOKEN_EXPIRATION'
:
3600
*
24
,
...
...
apps/jumpserver/settings/custom.py
浏览文件 @
1ac8537a
...
...
@@ -120,3 +120,6 @@ CONNECTION_TOKEN_ENABLED = CONFIG.CONNECTION_TOKEN_ENABLED
DISK_CHECK_ENABLED
=
CONFIG
.
DISK_CHECK_ENABLED
FORGOT_PASSWORD_URL
=
CONFIG
.
FORGOT_PASSWORD_URL
# 自定义默认组织名
GLOBAL_ORG_DISPLAY_NAME
=
CONFIG
.
GLOBAL_ORG_DISPLAY_NAME
apps/locale/zh/LC_MESSAGES/django.mo
浏览文件 @
1ac8537a
无法预览此类型文件
apps/locale/zh/LC_MESSAGES/django.po
浏览文件 @
1ac8537a
...
...
@@ -2077,6 +2077,14 @@ msgstr "用户第一次登录,修改profile后重定向到地址, 可以是 wi
msgid "Forgot password 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
msgid ""
"The forgot password url on login page, If you use ldap or cas external "
...
...
apps/orgs/models.py
浏览文件 @
1ac8537a
...
...
@@ -7,7 +7,7 @@ from django.db.models import signals
from
django.db.models
import
Q
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.db.models
import
ChoiceSet
...
...
@@ -193,7 +193,7 @@ class Organization(models.Model):
@
classmethod
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
):
return
self
.
id
==
self
.
ROOT_ID
...
...
apps/settings/serializers/settings.py
浏览文件 @
1ac8537a
...
...
@@ -24,6 +24,10 @@ class BasicSettingSerializer(serializers.Serializer):
help_text
=
_
(
'The forgot password url on login page, If you use '
'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
):
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录