Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
J
jumpserver
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ops
jumpserver
Commits
29ff0efd
Commit
29ff0efd
authored
Dec 17, 2018
by
ibuler
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of github.com:jumpserver/jumpserver into dev
parents
c7ac93fc
985bd6fc
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
247 additions
and
159 deletions
+247
-159
tasks.py
apps/assets/tasks.py
+11
-10
forms.py
apps/common/forms.py
+11
-0
models.py
apps/common/models.py
+2
-0
conf.py
apps/jumpserver/conf.py
+6
-1
settings.py
apps/jumpserver/settings.py
+6
-0
django.mo
apps/locale/zh/LC_MESSAGES/django.mo
+0
-0
django.po
apps/locale/zh/LC_MESSAGES/django.po
+204
-145
serializers.py
apps/ops/serializers.py
+1
-1
api_urls.py
apps/ops/urls/api_urls.py
+1
-0
adhoc.py
apps/ops/views/adhoc.py
+5
-2
No files found.
apps/assets/tasks.py
View file @
29ff0efd
...
...
@@ -141,11 +141,11 @@ def update_assets_hardware_info_period():
logger
.
debug
(
"Period task disabled, update assets hardware info pass"
)
return
from
ops.utils
import
update_or_create_ansible_task
from
orgs.models
import
Organization
orgs
=
Organization
.
objects
.
all
()
.
values_list
(
'id'
,
flat
=
True
)
orgs
.
append
(
''
)
task_name
=
_
(
"Update assets hardware info period"
)
#
from ops.utils import update_or_create_ansible_task
#
from orgs.models import Organization
#
orgs = Organization.objects.all().values_list('id', flat=True)
#
orgs.append('')
#
task_name = _("Update assets hardware info period")
# for org_id in orgs:
# org_id = str(org_id)
# hostname_list = [
...
...
@@ -354,11 +354,12 @@ def test_system_user_connectability_period():
if
PERIOD_TASK
!=
"on"
:
logger
.
debug
(
"Period task disabled, test system user connectability pass"
)
return
system_users
=
SystemUser
.
objects
.
all
()
for
system_user
in
system_users
:
task_name
=
_
(
"Test system user connectability period: {}"
)
.
format
(
system_user
)
# task_name = _("定期测试系统用户可连接性: {}".format(system_user))
test_system_user_connectability_util
(
system_user
,
task_name
)
# Todo: 暂时禁用定期测试
# system_users = SystemUser.objects.all()
# for system_user in system_users:
# task_name = _("Test system user connectability period: {}").format(system_user)
# # task_name = _("定期测试系统用户可连接性: {}".format(system_user))
# test_system_user_connectability_util(system_user, task_name)
#### Push system user tasks ####
...
...
apps/common/forms.py
View file @
29ff0efd
...
...
@@ -134,6 +134,14 @@ class TerminalSettingForm(BaseForm):
(
'hostname'
,
_
(
'Hostname'
)),
(
'ip'
,
_
(
'IP'
)),
)
PAGE_SIZE_CHOICES
=
(
(
'all'
,
_
(
'All'
)),
(
'auto'
,
_
(
'Auto'
)),
(
10
,
10
),
(
15
,
15
),
(
25
,
25
),
(
50
,
50
),
)
TERMINAL_PASSWORD_AUTH
=
forms
.
BooleanField
(
initial
=
True
,
required
=
False
,
label
=
_
(
"Password auth"
)
)
...
...
@@ -146,6 +154,9 @@ class TerminalSettingForm(BaseForm):
TERMINAL_ASSET_LIST_SORT_BY
=
forms
.
ChoiceField
(
choices
=
SORT_BY_CHOICES
,
initial
=
'hostname'
,
label
=
_
(
"List sort by"
)
)
TERMINAL_ASSET_LIST_PAGE_SIZE
=
forms
.
ChoiceField
(
choices
=
PAGE_SIZE_CHOICES
,
initial
=
'auto'
,
label
=
_
(
"List page size"
),
)
class
TerminalCommandStorage
(
BaseForm
):
...
...
apps/common/models.py
View file @
29ff0efd
...
...
@@ -45,6 +45,8 @@ class Setting(models.Model):
def
cleaned_value
(
self
):
try
:
value
=
self
.
value
if
not
isinstance
(
value
,
(
str
,
bytes
)):
return
value
if
self
.
encrypted
:
value
=
signer
.
unsign
(
value
)
value
=
json
.
loads
(
value
)
...
...
apps/jumpserver/conf.py
View file @
29ff0efd
...
...
@@ -312,7 +312,12 @@ defaults = {
'SESSION_COOKIE_AGE'
:
3600
*
24
,
'SESSION_EXPIRE_AT_BROWSER_CLOSE'
:
False
,
'AUTH_OPENID'
:
False
,
'EMAIL_SUFFIX'
:
'jumpserver.org'
'EMAIL_SUFFIX'
:
'jumpserver.org'
,
'TERMINAL_PASSWORD_AUTH'
:
True
,
'TERMINAL_PUBLIC_KEY_AUTH'
:
True
,
'TERMINAL_HEARTBEAT_INTERVAL'
:
5
,
'TERMINAL_ASSET_LIST_SORT_BY'
:
'hostname'
,
'TERMINAL_ASSET_LIST_PAGE_SIZE'
:
'auto'
,
}
...
...
apps/jumpserver/settings.py
View file @
29ff0efd
...
...
@@ -484,6 +484,12 @@ SECURITY_PASSWORD_RULES = [
'SECURITY_PASSWORD_SPECIAL_CHAR'
]
TERMINAL_PASSWORD_AUTH
=
CONFIG
.
TERMINAL_PASSWORD_AUTH
TERMINAL_PUBLIC_KEY_AUTH
=
CONFIG
.
TERMINAL_PUBLIC_KEY_AUTH
TERMINAL_HEARTBEAT_INTERVAL
=
CONFIG
.
TERMINAL_HEARTBEAT_INTERVAL
TERMINAL_ASSET_LIST_SORT_BY
=
CONFIG
.
TERMINAL_ASSET_LIST_SORT_BY
TERMINAL_ASSET_LIST_PAGE_SIZE
=
CONFIG
.
TERMINAL_ASSET_LIST_PAGE_SIZE
# Django bootstrap3 setting, more see http://django-bootstrap3.readthedocs.io/en/latest/settings.html
BOOTSTRAP3
=
{
'horizontal_label_class'
:
'col-md-2'
,
...
...
apps/locale/zh/LC_MESSAGES/django.mo
View file @
29ff0efd
No preview for this file type
apps/locale/zh/LC_MESSAGES/django.po
View file @
29ff0efd
...
...
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Jumpserver 0.3.3\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-12-
07 18:11
+0800\n"
"POT-Creation-Date: 2018-12-
17 10:14
+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: ibuler <ibuler@qq.com>\n"
"Language-Team: Jumpserver team<ibuler@qq.com>\n"
...
...
@@ -34,8 +34,8 @@ msgid "Test if the assets under the node are connectable: {}"
msgstr "测试节点下资产是否可连接: {}"
#: assets/forms/asset.py:27 assets/models/asset.py:83 assets/models/user.py:113
#: assets/templates/assets/asset_detail.html:1
87
#: assets/templates/assets/asset_detail.html:19
5
#: assets/templates/assets/asset_detail.html:1
91
#: assets/templates/assets/asset_detail.html:19
9
#: assets/templates/assets/system_user_asset.html:95 perms/models.py:32
msgid "Nodes"
msgstr "节点管理"
...
...
@@ -62,7 +62,8 @@ msgid "Label"
msgstr "标签"
#: assets/forms/asset.py:37 assets/forms/asset.py:76 assets/models/asset.py:79
#: assets/models/domain.py:24 assets/models/domain.py:50
#: assets/models/domain.py:26 assets/models/domain.py:52
#: assets/templates/assets/asset_detail.html:81
#: assets/templates/assets/user_asset_list.html:157
#: xpack/plugins/orgs/templates/orgs/org_list.html:17
msgid "Domain"
...
...
@@ -105,7 +106,7 @@ msgid "Select assets"
msgstr "选择资产"
#: assets/forms/asset.py:108 assets/models/asset.py:76
#: assets/models/domain.py:
48
assets/templates/assets/admin_user_assets.html:53
#: assets/models/domain.py:
50
assets/templates/assets/admin_user_assets.html:53
#: assets/templates/assets/asset_detail.html:69
#: assets/templates/assets/domain_gateway_list.html:58
#: assets/templates/assets/system_user_asset.html:52
...
...
@@ -137,13 +138,13 @@ msgstr "端口"
msgid "Asset"
msgstr "资产"
#: assets/forms/domain.py:4
2
#: assets/forms/domain.py:4
6
msgid "Password should not contain special characters"
msgstr "不能包含特殊字符"
#: assets/forms/domain.py:
59
assets/forms/user.py:80 assets/forms/user.py:143
#: assets/forms/domain.py:
63
assets/forms/user.py:80 assets/forms/user.py:143
#: assets/models/base.py:22 assets/models/cluster.py:18
#: assets/models/cmd_filter.py:20 assets/models/domain.py:
18
#: assets/models/cmd_filter.py:20 assets/models/domain.py:
20
#: assets/models/group.py:20 assets/models/label.py:18
#: assets/templates/assets/admin_user_detail.html:56
#: assets/templates/assets/admin_user_list.html:26
...
...
@@ -183,7 +184,7 @@ msgstr "不能包含特殊字符"
msgid "Name"
msgstr "名称"
#: assets/forms/domain.py:6
0
assets/forms/user.py:81 assets/forms/user.py:144
#: assets/forms/domain.py:6
4
assets/forms/user.py:81 assets/forms/user.py:144
#: assets/models/base.py:23 assets/templates/assets/admin_user_detail.html:60
#: assets/templates/assets/admin_user_list.html:27
#: assets/templates/assets/domain_gateway_list.html:60
...
...
@@ -256,7 +257,7 @@ msgid ""
"password."
msgstr "如果选择手动登录模式,用户名和密码可以不填写"
#: assets/models/asset.py:73 assets/models/domain.py:4
7
#: assets/models/asset.py:73 assets/models/domain.py:4
9
#: assets/templates/assets/_asset_list_modal.html:46
#: assets/templates/assets/admin_user_assets.html:52
#: assets/templates/assets/asset_detail.html:61
...
...
@@ -285,7 +286,7 @@ msgstr "IP"
msgid "Hostname"
msgstr "主机名"
#: assets/models/asset.py:75 assets/models/domain.py:
49
#: assets/models/asset.py:75 assets/models/domain.py:
51
#: assets/models/user.py:117 assets/templates/assets/asset_detail.html:73
#: assets/templates/assets/domain_gateway_list.html:59
#: assets/templates/assets/system_user_detail.html:70
...
...
@@ -295,14 +296,14 @@ msgstr "主机名"
msgid "Protocol"
msgstr "协议"
#: assets/models/asset.py:77 assets/templates/assets/asset_detail.html:10
1
#: assets/models/asset.py:77 assets/templates/assets/asset_detail.html:10
5
#: assets/templates/assets/user_asset_list.html:154
msgid "Platform"
msgstr "系统平台"
#: assets/models/asset.py:84 assets/models/cmd_filter.py:21
#: assets/models/domain.py:5
2 assets/models/label.py:21
#: assets/templates/assets/asset_detail.html:1
09
#: assets/models/domain.py:5
4 assets/models/label.py:22
#: assets/templates/assets/asset_detail.html:1
13
#: assets/templates/assets/user_asset_list.html:158
msgid "Is active"
msgstr "激活"
...
...
@@ -311,19 +312,19 @@ msgstr "激活"
msgid "Public IP"
msgstr "公网IP"
#: assets/models/asset.py:92 assets/templates/assets/asset_detail.html:1
17
#: assets/models/asset.py:92 assets/templates/assets/asset_detail.html:1
21
msgid "Asset number"
msgstr "资产编号"
#: assets/models/asset.py:96 assets/templates/assets/asset_detail.html:8
1
#: assets/models/asset.py:96 assets/templates/assets/asset_detail.html:8
5
msgid "Vendor"
msgstr "制造商"
#: assets/models/asset.py:98 assets/templates/assets/asset_detail.html:8
5
#: assets/models/asset.py:98 assets/templates/assets/asset_detail.html:8
9
msgid "Model"
msgstr "型号"
#: assets/models/asset.py:100 assets/templates/assets/asset_detail.html:11
3
#: assets/models/asset.py:100 assets/templates/assets/asset_detail.html:11
7
msgid "Serial number"
msgstr "序列号"
...
...
@@ -343,7 +344,7 @@ msgstr "CPU核数"
msgid "CPU vcpus"
msgstr "CPU总数"
#: assets/models/asset.py:108 assets/templates/assets/asset_detail.html:9
3
#: assets/models/asset.py:108 assets/templates/assets/asset_detail.html:9
7
msgid "Memory"
msgstr "内存"
...
...
@@ -355,7 +356,7 @@ msgstr "硬盘大小"
msgid "Disk info"
msgstr "硬盘信息"
#: assets/models/asset.py:115 assets/templates/assets/asset_detail.html:10
5
#: assets/models/asset.py:115 assets/templates/assets/asset_detail.html:10
9
#: assets/templates/assets/user_asset_list.html:155
msgid "OS"
msgstr "操作系统"
...
...
@@ -373,7 +374,7 @@ msgid "Hostname raw"
msgstr "主机名原始"
#: assets/models/asset.py:125 assets/templates/assets/asset_create.html:34
#: assets/templates/assets/asset_detail.html:22
4
#: assets/templates/assets/asset_detail.html:22
8
#: assets/templates/assets/asset_update.html:39 templates/_nav.html:26
msgid "Labels"
msgstr "标签管理"
...
...
@@ -382,7 +383,7 @@ msgstr "标签管理"
#: assets/models/cluster.py:28 assets/models/cmd_filter.py:25
#: assets/models/cmd_filter.py:55 assets/models/group.py:21
#: assets/templates/assets/admin_user_detail.html:68
#: assets/templates/assets/asset_detail.html:12
1
#: assets/templates/assets/asset_detail.html:12
5
#: assets/templates/assets/cmd_filter_detail.html:77
#: assets/templates/assets/domain_detail.html:72
#: assets/templates/assets/system_user_detail.html:100
...
...
@@ -394,8 +395,8 @@ msgid "Created by"
msgstr "创建者"
#: assets/models/asset.py:130 assets/models/cluster.py:26
#: assets/models/domain.py:2
1
assets/models/group.py:22
#: assets/models/label.py:2
4
assets/templates/assets/admin_user_detail.html:64
#: assets/models/domain.py:2
3
assets/models/group.py:22
#: assets/models/label.py:2
5
assets/templates/assets/admin_user_detail.html:64
#: assets/templates/assets/cmd_filter_detail.html:69
#: assets/templates/assets/domain_detail.html:68
#: assets/templates/assets/system_user_detail.html:96
...
...
@@ -413,11 +414,11 @@ msgstr "创建日期"
#: assets/models/asset.py:132 assets/models/base.py:27
#: assets/models/cluster.py:29 assets/models/cmd_filter.py:22
#: assets/models/cmd_filter.py:52 assets/models/domain.py:
19
#: assets/models/domain.py:5
1
assets/models/group.py:23
#: assets/models/label.py:2
2
assets/templates/assets/admin_user_detail.html:72
#: assets/models/cmd_filter.py:52 assets/models/domain.py:
21
#: assets/models/domain.py:5
3
assets/models/group.py:23
#: assets/models/label.py:2
3
assets/templates/assets/admin_user_detail.html:72
#: assets/templates/assets/admin_user_list.html:32
#: assets/templates/assets/asset_detail.html:1
29
#: assets/templates/assets/asset_detail.html:1
33
#: assets/templates/assets/cmd_filter_detail.html:65
#: assets/templates/assets/cmd_filter_list.html:27
#: assets/templates/assets/cmd_filter_rule_list.html:62
...
...
@@ -487,7 +488,7 @@ msgid "Default"
msgstr "默认"
#: assets/models/cluster.py:36 assets/models/label.py:14
#: users/models/user.py:42
2
#: users/models/user.py:42
0
msgid "System"
msgstr "系统"
...
...
@@ -516,7 +517,7 @@ msgid "Regex"
msgstr "正则表达式"
#: assets/models/cmd_filter.py:36 ops/models/command.py:19
#: ops/templates/ops/command_execution_list.html:
46
terminal/models.py:144
#: ops/templates/ops/command_execution_list.html:
60
terminal/models.py:144
#: terminal/templates/terminal/command_list.html:55
#: terminal/templates/terminal/command_list.html:71
#: terminal/templates/terminal/session_detail.html:48
...
...
@@ -591,7 +592,7 @@ msgstr "每行一个命令"
msgid "Action"
msgstr "动作"
#: assets/models/domain.py:
59
assets/templates/assets/domain_detail.html:21
#: assets/models/domain.py:
61
assets/templates/assets/domain_detail.html:21
#: assets/templates/assets/domain_detail.html:64
#: assets/templates/assets/domain_gateway_list.html:21
#: assets/templates/assets/domain_list.html:27
...
...
@@ -613,8 +614,8 @@ msgstr "默认资产组"
#: audits/templates/audits/operate_log_list.html:66
#: audits/templates/audits/password_change_log_list.html:33
#: audits/templates/audits/password_change_log_list.html:50
#: ops/templates/ops/command_execution_list.html:
22
#: ops/templates/ops/command_execution_list.html:
45
perms/forms.py:28
#: ops/templates/ops/command_execution_list.html:
34
#: ops/templates/ops/command_execution_list.html:
59
perms/forms.py:28
#: perms/models.py:29
#: perms/templates/perms/asset_permission_create_update.html:36
#: perms/templates/perms/asset_permission_list.html:54
...
...
@@ -623,10 +624,10 @@ msgstr "默认资产组"
#: terminal/templates/terminal/command_list.html:32
#: terminal/templates/terminal/command_list.html:72
#: terminal/templates/terminal/session_list.html:33
#: terminal/templates/terminal/session_list.html:71 users/forms.py:31
0
#: users/models/user.py:33 users/models/user.py:4
10
#: terminal/templates/terminal/session_list.html:71 users/forms.py:31
4
#: users/models/user.py:33 users/models/user.py:4
08
#: users/templates/users/user_group_detail.html:78
#: users/templates/users/user_group_list.html:13 users/views/user.py:38
4
#: users/templates/users/user_group_list.html:13 users/views/user.py:38
6
#: xpack/plugins/orgs/forms.py:26
#: xpack/plugins/orgs/templates/orgs/org_detail.html:113
#: xpack/plugins/orgs/templates/orgs/org_list.html:14
...
...
@@ -638,7 +639,7 @@ msgstr "用户"
msgid "Value"
msgstr "值"
#: assets/models/label.py:2
0
#: assets/models/label.py:2
1
msgid "Category"
msgstr "分类"
...
...
@@ -899,9 +900,9 @@ msgstr "其它"
#: common/templates/common/replay_storage_create.html:139
#: common/templates/common/security_setting.html:70
#: common/templates/common/terminal_setting.html:68
#: perms/templates/perms/asset_permission_create_update.html:
69
#: perms/templates/perms/asset_permission_create_update.html:
75
#: terminal/templates/terminal/terminal_update.html:47
#: users/templates/users/_user.html:
46
#: users/templates/users/_user.html:
50
#: users/templates/users/user_bulk_update.html:23
#: users/templates/users/user_detail.html:176
#: users/templates/users/user_password_update.html:71
...
...
@@ -932,11 +933,11 @@ msgstr "重置"
#: common/templates/common/replay_storage_create.html:140
#: common/templates/common/security_setting.html:71
#: common/templates/common/terminal_setting.html:70
#: perms/templates/perms/asset_permission_create_update.html:7
0
#: perms/templates/perms/asset_permission_create_update.html:7
6
#: terminal/templates/terminal/command_list.html:103
#: terminal/templates/terminal/session_list.html:127
#: terminal/templates/terminal/terminal_update.html:48
#: users/templates/users/_user.html:
47
#: users/templates/users/_user.html:
51
#: users/templates/users/forgot_password.html:45
#: users/templates/users/user_bulk_update.html:24
#: users/templates/users/user_list.html:45
...
...
@@ -999,12 +1000,12 @@ msgid "Quick update"
msgstr "快速更新"
#: assets/templates/assets/admin_user_assets.html:72
#: assets/templates/assets/asset_detail.html:17
2
#: assets/templates/assets/asset_detail.html:17
6
msgid "Test connective"
msgstr "测试可连接性"
#: assets/templates/assets/admin_user_assets.html:75
#: assets/templates/assets/asset_detail.html:17
5
#: assets/templates/assets/asset_detail.html:17
9
#: assets/templates/assets/system_user_asset.html:75
#: assets/templates/assets/system_user_asset.html:161
#: assets/templates/assets/system_user_detail.html:151
...
...
@@ -1087,7 +1088,7 @@ msgid "Select nodes"
msgstr "选择节点"
#: assets/templates/assets/admin_user_detail.html:100
#: assets/templates/assets/asset_detail.html:20
4
#: assets/templates/assets/asset_detail.html:20
8
#: assets/templates/assets/asset_list.html:633
#: assets/templates/assets/cmd_filter_detail.html:106
#: assets/templates/assets/system_user_asset.html:112
...
...
@@ -1153,28 +1154,28 @@ msgstr "选择需要修改属性"
msgid "Select all"
msgstr "全选"
#: assets/templates/assets/asset_detail.html:
89
#: assets/templates/assets/asset_detail.html:
93
msgid "CPU"
msgstr "CPU"
#: assets/templates/assets/asset_detail.html:
97
#: assets/templates/assets/asset_detail.html:
101
msgid "Disk"
msgstr "硬盘"
#: assets/templates/assets/asset_detail.html:12
5
#: assets/templates/assets/asset_detail.html:12
9
#: users/templates/users/user_detail.html:115
#: users/templates/users/user_profile.html:104
msgid "Date joined"
msgstr "创建日期"
#: assets/templates/assets/asset_detail.html:14
1
#: assets/templates/assets/asset_detail.html:14
5
#: terminal/templates/terminal/session_detail.html:81
#: users/templates/users/user_detail.html:138
#: users/templates/users/user_profile.html:146
msgid "Quick modify"
msgstr "快速修改"
#: assets/templates/assets/asset_detail.html:1
47
#: assets/templates/assets/asset_detail.html:1
51
#: assets/templates/assets/asset_list.html:95
#: assets/templates/assets/user_asset_list.html:47 perms/models.py:34
#: perms/models.py:82
...
...
@@ -1191,15 +1192,15 @@ msgstr "快速修改"
msgid "Active"
msgstr "激活中"
#: assets/templates/assets/asset_detail.html:16
4
#: assets/templates/assets/asset_detail.html:16
8
msgid "Refresh hardware"
msgstr "更新硬件信息"
#: assets/templates/assets/asset_detail.html:1
67
#: assets/templates/assets/asset_detail.html:1
71
msgid "Refresh"
msgstr "刷新"
#: assets/templates/assets/asset_detail.html:30
4
#: assets/templates/assets/asset_detail.html:30
8
#: users/templates/users/user_detail.html:305
#: users/templates/users/user_detail.html:332
msgid "Update successfully!"
...
...
@@ -1680,7 +1681,7 @@ msgid "Filename"
msgstr "文件名"
#: audits/models.py:22 audits/templates/audits/ftp_log_list.html:76
#: ops/templates/ops/command_execution_list.html:
49
#: ops/templates/ops/command_execution_list.html:
64
#: ops/templates/ops/task_list.html:39 users/models/authentication.py:73
#: users/templates/users/user_detail.html:456 xpack/plugins/cloud/api.py:61
msgid "Success"
...
...
@@ -1706,7 +1707,7 @@ msgstr "修改者"
#: audits/templates/audits/ftp_log_list.html:77
#: ops/templates/ops/adhoc_history.html:52
#: ops/templates/ops/adhoc_history_detail.html:61
#: ops/templates/ops/command_execution_list.html:
50
#: ops/templates/ops/command_execution_list.html:
65
#: ops/templates/ops/task_history.html:58 perms/models.py:35
#: perms/templates/perms/asset_permission_detail.html:86 terminal/models.py:148
#: terminal/templates/terminal/session_list.html:78
...
...
@@ -1722,8 +1723,8 @@ msgstr "选择用户"
#: audits/templates/audits/login_log_list.html:40
#: audits/templates/audits/operate_log_list.html:58
#: audits/templates/audits/password_change_log_list.html:42
#: ops/templates/ops/command_execution_list.html:
30
#: ops/templates/ops/command_execution_list.html:
35
#: ops/templates/ops/command_execution_list.html:
42
#: ops/templates/ops/command_execution_list.html:
47
#: ops/templates/ops/task_list.html:21 ops/templates/ops/task_list.html:26
#: templates/_base_list.html:43 templates/_header_bar.html:8
#: terminal/templates/terminal/command_list.html:60
...
...
@@ -1751,7 +1752,7 @@ msgstr "Agent"
msgid "City"
msgstr "城市"
#: audits/templates/audits/login_log_list.html:54 users/forms.py:1
68
#: audits/templates/audits/login_log_list.html:54 users/forms.py:1
72
#: users/models/authentication.py:82 users/models/user.py:75
#: users/templates/users/first_login.html:45
msgid "MFA"
...
...
@@ -1785,23 +1786,23 @@ msgid "Datetime"
msgstr "日期"
#: audits/views.py:68 audits/views.py:112 audits/views.py:148
#: audits/views.py:192 audits/views.py:223 templates/_nav.html:7
1
#: audits/views.py:192 audits/views.py:223 templates/_nav.html:7
2
msgid "Audits"
msgstr "日志审计"
#: audits/views.py:69 templates/_nav.html:7
5
#: audits/views.py:69 templates/_nav.html:7
6
msgid "FTP log"
msgstr "FTP日志"
#: audits/views.py:113 templates/_nav.html:7
6
#: audits/views.py:113 templates/_nav.html:7
7
msgid "Operate log"
msgstr "操作日志"
#: audits/views.py:149 templates/_nav.html:7
7
#: audits/views.py:149 templates/_nav.html:7
8
msgid "Password change log"
msgstr "改密日志"
#: audits/views.py:193 templates/_nav.html:7
4
#: audits/views.py:193 templates/_nav.html:7
5
msgid "Login log"
msgstr "登录日志"
...
...
@@ -1958,64 +1959,76 @@ msgid "Enable LDAP auth"
msgstr "启用LDAP认证"
#: common/forms.py:138
msgid "All"
msgstr "全部"
#: common/forms.py:139
msgid "Auto"
msgstr "自动"
#: common/forms.py:144
msgid "Password auth"
msgstr "密码认证"
#: common/forms.py:14
1
#: common/forms.py:14
7
msgid "Public key auth"
msgstr "密钥认证"
#: common/forms.py:1
44
#: common/forms.py:1
50
msgid "Heartbeat interval"
msgstr "心跳间隔"
#: common/forms.py:1
44
ops/models/adhoc.py:38
#: common/forms.py:1
50
ops/models/adhoc.py:38
msgid "Units: seconds"
msgstr "单位: 秒"
#: common/forms.py:1
47
#: common/forms.py:1
53
msgid "List sort by"
msgstr "资产列表排序"
#: common/forms.py:159
#: common/forms.py:156
msgid "List page size"
msgstr "资产列表页面大小"
#: common/forms.py:168
msgid "MFA Secondary certification"
msgstr "MFA 二次认证"
#: common/forms.py:1
61
#: common/forms.py:1
70
msgid ""
"After opening, the user login must use MFA secondary authentication (valid "
"for all users, including administrators)"
msgstr "开启后,用户登录必须使用MFA二次认证(对所有用户有效,包括管理员)"
#: common/forms.py:1
68
#: common/forms.py:1
77
msgid "Limit the number of login failures"
msgstr "限制登录失败次数"
#: common/forms.py:1
73
#: common/forms.py:1
82
msgid "No logon interval"
msgstr "禁止登录时间间隔"
#: common/forms.py:1
75
#: common/forms.py:1
84
msgid ""
"Tip: (unit/minute) if the user has failed to log in for a limited number of "
"times, no login is allowed during this time interval."
msgstr ""
"提示:(单位:分)当用户登录失败次数达到限制后,那么在此时间间隔内禁止登录"
#: common/forms.py:1
82
#: common/forms.py:1
91
msgid "Connection max idle time"
msgstr "SSH最大空闲时间"
#: common/forms.py:1
84
#: common/forms.py:1
93
msgid ""
"If idle time more than it, disconnect connection(only ssh now) Unit: minute"
msgstr "提示:(单位:分)如果超过该配置没有操作,连接会被断开(仅ssh)"
#: common/forms.py:19
0
#: common/forms.py:19
9
msgid "Password expiration time"
msgstr "密码过期时间"
#: common/forms.py:
193
#: common/forms.py:
202
msgid ""
"Tip: (unit: day) If the user does not update the password during the time, "
"the user password will expire failure;The password expiration reminder mail "
...
...
@@ -2025,45 +2038,45 @@ msgstr ""
"提示:(单位:天)如果用户在此期间没有更新密码,用户密码将过期失效; 密码过期"
"提醒邮件将在密码过期前5天内由系统(每天)自动发送给用户"
#: common/forms.py:2
02
#: common/forms.py:2
11
msgid "Password minimum length"
msgstr "密码最小长度 "
#: common/forms.py:2
08
#: common/forms.py:2
17
msgid "Must contain capital letters"
msgstr "必须包含大写字母"
#: common/forms.py:21
0
#: common/forms.py:21
9
msgid ""
"After opening, the user password changes and resets must contain uppercase "
"letters"
msgstr "开启后,用户密码修改、重置必须包含大写字母"
#: common/forms.py:2
16
#: common/forms.py:2
25
msgid "Must contain lowercase letters"
msgstr "必须包含小写字母"
#: common/forms.py:2
17
#: common/forms.py:2
26
msgid ""
"After opening, the user password changes and resets must contain lowercase "
"letters"
msgstr "开启后,用户密码修改、重置必须包含小写字母"
#: common/forms.py:2
23
#: common/forms.py:2
32
msgid "Must contain numeric characters"
msgstr "必须包含数字字符"
#: common/forms.py:2
24
#: common/forms.py:2
33
msgid ""
"After opening, the user password changes and resets must contain numeric "
"characters"
msgstr "开启后,用户密码修改、重置必须包含数字字符"
#: common/forms.py:23
0
#: common/forms.py:23
9
msgid "Must contain special characters"
msgstr "必须包含特殊字符"
#: common/forms.py:2
31
#: common/forms.py:2
40
msgid ""
"After opening, the user password changes and resets must contain special "
"characters"
...
...
@@ -2126,7 +2139,7 @@ msgstr "安全设置"
#: common/templates/common/command_storage_create.html:50
#: ops/models/adhoc.py:161 ops/templates/ops/adhoc_detail.html:53
#: ops/templates/ops/command_execution_list.html:
44
#: ops/templates/ops/command_execution_list.html:
58
#: ops/templates/ops/task_adhoc.html:59 ops/templates/ops/task_list.html:38
msgid "Hosts"
msgstr "主机"
...
...
@@ -2227,7 +2240,7 @@ msgstr "不能包含特殊字符"
#: common/views.py:18 common/views.py:44 common/views.py:70 common/views.py:99
#: common/views.py:126 common/views.py:138 common/views.py:151
#: templates/_nav.html:10
6
#: templates/_nav.html:10
7
msgid "Settings"
msgstr "系统设置"
...
...
@@ -2339,15 +2352,15 @@ msgstr "汇总"
msgid "Result"
msgstr "结果"
#: ops/models/command.py:5
2
#: ops/models/command.py:5
5
msgid "Task start"
msgstr "任务开始"
#: ops/models/command.py:6
4
#: ops/models/command.py:6
7
msgid "Command `{}` is forbidden ........"
msgstr "命令 `{}` 不允许被执行 ......."
#: ops/models/command.py:7
0
#: ops/models/command.py:7
3
msgid "Task end"
msgstr "任务结束"
...
...
@@ -2362,7 +2375,9 @@ msgid "Version run history"
msgstr "执行历史"
#: ops/templates/ops/adhoc_detail.html:72
#: ops/templates/ops/adhoc_detail.html:77 ops/templates/ops/task_adhoc.html:61
#: ops/templates/ops/adhoc_detail.html:77
#: ops/templates/ops/command_execution_list.html:61
#: ops/templates/ops/task_adhoc.html:61
msgid "Run as"
msgstr "运行用户"
...
...
@@ -2424,7 +2439,7 @@ msgid "Run history detail"
msgstr "执行历史详情"
#: ops/templates/ops/adhoc_history_detail.html:22
#: ops/templates/ops/command_execution_list.html:
47
#: ops/templates/ops/command_execution_list.html:
62
#: terminal/backends/command/models.py:16
msgid "Output"
msgstr "输出"
...
...
@@ -2450,24 +2465,20 @@ msgstr "没有资产"
msgid "Success assets"
msgstr "成功资产"
#: ops/templates/ops/command_execution_create.html:
67
#: ops/templates/ops/command_execution_create.html:
71
#: terminal/templates/terminal/session_detail.html:91
#: terminal/templates/terminal/session_detail.html:100
msgid "Go"
msgstr ""
#: ops/templates/ops/command_execution_create.html:2
44
#: ops/templates/ops/command_execution_create.html:2
53
msgid "Pending"
msgstr ""
#: ops/templates/ops/command_execution_list.html:
48
#: ops/templates/ops/command_execution_list.html:
63
msgid "Finished"
msgstr "结束"
#: ops/templates/ops/command_execution_list.html:51
msgid "Date finished"
msgstr "结束日期"
#: ops/templates/ops/task_adhoc.html:19 ops/templates/ops/task_detail.html:20
#: ops/templates/ops/task_history.html:19 ops/views/adhoc.py:72
msgid "Task detail"
...
...
@@ -2535,7 +2546,8 @@ msgstr "任务列表"
msgid "Task run history"
msgstr "执行历史"
#: ops/views/command.py:68 templates/_nav.html:78 templates/_nav_user.html:9
#: ops/views/command.py:68 templates/_nav.html:67 templates/_nav.html:79
#: templates/_nav_user.html:9
msgid "Command execution"
msgstr "命令执行"
...
...
@@ -2546,7 +2558,7 @@ msgstr "组织管理"
#: perms/forms.py:31 perms/models.py:30 perms/models.py:80
#: perms/templates/perms/asset_permission_list.html:55
#: perms/templates/perms/asset_permission_list.html:145 templates/_nav.html:14
#: users/forms.py:28
0
users/models/group.py:26 users/models/user.py:59
#: users/forms.py:28
4
users/models/group.py:26 users/models/user.py:59
#: users/templates/users/_select_user_modal.html:16
#: users/templates/users/user_detail.html:211
#: users/templates/users/user_list.html:26
...
...
@@ -2688,14 +2700,14 @@ msgstr "文档"
msgid "Commercial support"
msgstr "商业支持"
#: templates/_header_bar.html:89 templates/_nav_user.html:14 users/forms.py:1
47
#: users/templates/users/_user.html:
39
#: templates/_header_bar.html:89 templates/_nav_user.html:14 users/forms.py:1
51
#: users/templates/users/_user.html:
43
#: users/templates/users/first_login.html:39
#: users/templates/users/user_password_update.html:40
#: users/templates/users/user_profile.html:17
#: users/templates/users/user_profile_update.html:37
#: users/templates/users/user_profile_update.html:57
#: users/templates/users/user_pubkey_update.html:37 users/views/user.py:36
6
#: users/templates/users/user_pubkey_update.html:37 users/views/user.py:36
8
msgid "Profile"
msgstr "个人信息"
...
...
@@ -2783,8 +2795,8 @@ msgstr ""
#: templates/_nav.html:10 users/views/group.py:28 users/views/group.py:44
#: users/views/group.py:60 users/views/group.py:76 users/views/group.py:92
#: users/views/login.py:346 users/views/user.py:68 users/views/user.py:83
#: users/views/user.py:11
1 users/views/user.py:192 users/views/user.py:353
#: users/views/user.py:40
3 users/views/user.py:437
#: users/views/user.py:11
3 users/views/user.py:194 users/views/user.py:355
#: users/views/user.py:40
5 users/views/user.py:439
msgid "Users"
msgstr "用户管理"
...
...
@@ -2831,15 +2843,15 @@ msgstr "终端管理"
msgid "Job Center"
msgstr "作业中心"
#: templates/_nav.html:8
4
#: templates/_nav.html:8
5
msgid "XPack"
msgstr ""
#: templates/_nav.html:9
2
xpack/plugins/cloud/views.py:26
#: templates/_nav.html:9
3
xpack/plugins/cloud/views.py:26
msgid "Account list"
msgstr "账户列表"
#: templates/_nav.html:9
3
#: templates/_nav.html:9
4
msgid "Sync instance"
msgstr "同步实例"
...
...
@@ -3309,11 +3321,11 @@ msgstr "MFA 验证码"
msgid "Role"
msgstr "角色"
#: users/forms.py:55 users/forms.py:2
26
#: users/forms.py:55 users/forms.py:2
30
msgid "ssh public key"
msgstr "ssh公钥"
#: users/forms.py:56 users/forms.py:2
27
#: users/forms.py:56 users/forms.py:2
31
msgid "ssh-rsa AAAA..."
msgstr ""
...
...
@@ -3325,15 +3337,15 @@ msgstr "复制用户公钥到这里"
msgid "Join user groups"
msgstr "添加到用户组"
#: users/forms.py:110 users/forms.py:24
1
#: users/forms.py:110 users/forms.py:24
5
msgid "Public key should not be the same as your old one."
msgstr "不能和原来的密钥相同"
#: users/forms.py:114 users/forms.py:24
5
users/serializers/v1.py:51
#: users/forms.py:114 users/forms.py:24
9
users/serializers/v1.py:51
msgid "Not a valid ssh public key"
msgstr "ssh密钥不合法"
#: users/forms.py:15
3
#: users/forms.py:15
7
msgid ""
"Tip: when enabled, you will enter the MFA binding process the next time you "
"log in. you can also directly bind in \"personal information -> quick "
...
...
@@ -3342,11 +3354,11 @@ msgstr ""
"提示:启用之后您将会在下次登录时进入MFA绑定流程;您也可以在(个人信息->快速修"
"改->更改MFA设置)中直接绑定!"
#: users/forms.py:16
3
#: users/forms.py:16
7
msgid "* Enable MFA authentication to make the account more secure."
msgstr "* 启用MFA认证,使账号更加安全."
#: users/forms.py:17
3
#: users/forms.py:17
7
msgid ""
"In order to protect you and your company, please keep your account, password "
"and key sensitive information properly. (for example: setting complex "
...
...
@@ -3355,41 +3367,41 @@ msgstr ""
"为了保护您和公司的安全,请妥善保管您的账户、密码和密钥等重要敏感信息;(如:"
"设置复杂密码,启用MFA认证)"
#: users/forms.py:18
0
users/templates/users/first_login.html:48
#: users/forms.py:18
4
users/templates/users/first_login.html:48
#: users/templates/users/first_login.html:107
#: users/templates/users/first_login.html:130
msgid "Finish"
msgstr "完成"
#: users/forms.py:1
86
#: users/forms.py:1
90
msgid "Old password"
msgstr "原来密码"
#: users/forms.py:19
1
#: users/forms.py:19
5
msgid "New password"
msgstr "新密码"
#: users/forms.py:
196
#: users/forms.py:
200
msgid "Confirm password"
msgstr "确认密码"
#: users/forms.py:2
06
#: users/forms.py:2
10
msgid "Old password error"
msgstr "原来密码错误"
#: users/forms.py:21
4
#: users/forms.py:21
8
msgid "Password does not match"
msgstr "密码不一致"
#: users/forms.py:22
4
#: users/forms.py:22
8
msgid "Automatically configure and download the SSH key"
msgstr "自动配置并下载SSH密钥"
#: users/forms.py:2
28
#: users/forms.py:2
32
msgid "Paste your id_rsa.pub here."
msgstr "复制你的公钥到这里"
#: users/forms.py:2
56
users/models/user.py:83
#: users/forms.py:2
60
users/models/user.py:83
#: users/templates/users/first_login.html:42
#: users/templates/users/user_password_update.html:46
#: users/templates/users/user_profile.html:68
...
...
@@ -3398,7 +3410,7 @@ msgstr "复制你的公钥到这里"
msgid "Public key"
msgstr "ssh公钥"
#: users/forms.py:26
3 users/forms.py:268 users/forms.py:314
#: users/forms.py:26
7 users/forms.py:272 users/forms.py:318
#: xpack/plugins/orgs/forms.py:30
msgid "Select users"
msgstr "选择用户"
...
...
@@ -3456,7 +3468,7 @@ msgstr "Agent"
msgid "Date login"
msgstr "登录日期"
#: users/models/user.py:32 users/models/user.py:41
8
#: users/models/user.py:32 users/models/user.py:41
6
msgid "Administrator"
msgstr "管理员"
...
...
@@ -3502,7 +3514,7 @@ msgstr "用户来源"
msgid "Date password last updated"
msgstr "最后更新密码日期"
#: users/models/user.py:4
21
#: users/models/user.py:4
19
msgid "Administrator is the super user of system"
msgstr "Administrator是初始的超级管理员"
...
...
@@ -3790,7 +3802,7 @@ msgid "Reset link will be generated and sent to the user. "
msgstr "生成重置密码连接,通过邮件发送给用户"
#: users/templates/users/user_detail.html:19
#: users/templates/users/user_granted_asset.html:18 users/views/user.py:19
3
#: users/templates/users/user_granted_asset.html:18 users/views/user.py:19
5
msgid "User detail"
msgstr "用户详情"
...
...
@@ -3985,8 +3997,8 @@ msgstr "安装完成后点击下一步进入绑定页面(如已安装,直接
msgid "Administrator Settings force MFA login"
msgstr "管理员设置强制使用MFA登录"
#: users/templates/users/user_profile.html:120 users/views/user.py:2
29
#: users/views/user.py:28
3
#: users/templates/users/user_profile.html:120 users/views/user.py:2
31
#: users/views/user.py:28
5
msgid "User groups"
msgstr "用户组"
...
...
@@ -4036,7 +4048,7 @@ msgid ""
"corresponding private key."
msgstr "新的公钥已设置成功,请下载对应的私钥"
#: users/templates/users/user_update.html:4 users/views/user.py:11
2
#: users/templates/users/user_update.html:4 users/views/user.py:11
4
msgid "Update user"
msgstr "更新用户"
...
...
@@ -4243,7 +4255,7 @@ msgstr "用户组授权资产"
msgid "Please enable cookies and try again."
msgstr "设置你的浏览器支持cookie"
#: users/views/login.py:191 users/views/user.py:52
4 users/views/user.py:549
#: users/views/login.py:191 users/views/user.py:52
6 users/views/user.py:551
msgid "MFA code invalid, or ntp sync server time"
msgstr "MFA验证码不正确,或者服务器端时间不对"
...
...
@@ -4288,7 +4300,7 @@ msgstr "Token错误或失效"
msgid "Password not same"
msgstr "密码不一致"
#: users/views/login.py:308 users/views/user.py:12
6 users/views/user.py:420
#: users/views/login.py:308 users/views/user.py:12
8 users/views/user.py:422
msgid "* Your password does not meet the requirements"
msgstr "* 您的密码不符合要求"
...
...
@@ -4296,51 +4308,51 @@ msgstr "* 您的密码不符合要求"
msgid "First login"
msgstr "首次登陆"
#: users/views/user.py:14
3
#: users/views/user.py:14
5
msgid "Bulk update user success"
msgstr "批量更新用户成功"
#: users/views/user.py:17
3
#: users/views/user.py:17
5
msgid "Bulk update user"
msgstr "批量更新用户"
#: users/views/user.py:2
58
#: users/views/user.py:2
60
msgid "Invalid file."
msgstr "文件不合法"
#: users/views/user.py:35
4
#: users/views/user.py:35
6
msgid "User granted assets"
msgstr "用户授权资产"
#: users/views/user.py:38
5
#: users/views/user.py:38
7
msgid "Profile setting"
msgstr "个人信息设置"
#: users/views/user.py:40
4
#: users/views/user.py:40
6
msgid "Password update"
msgstr "密码更新"
#: users/views/user.py:4
38
#: users/views/user.py:4
40
msgid "Public key update"
msgstr "密钥更新"
#: users/views/user.py:4
79
#: users/views/user.py:4
81
msgid "Password invalid"
msgstr "用户名或密码无效"
#: users/views/user.py:5
79
#: users/views/user.py:5
81
msgid "MFA enable success"
msgstr "MFA 绑定成功"
#: users/views/user.py:58
0
#: users/views/user.py:58
2
msgid "MFA enable success, return login page"
msgstr "MFA 绑定成功,返回到登录页面"
#: users/views/user.py:58
2
#: users/views/user.py:58
4
msgid "MFA disable success"
msgstr "MFA 解绑成功"
#: users/views/user.py:58
3
#: users/views/user.py:58
5
msgid "MFA disable success, return login page"
msgstr "MFA 解绑成功,返回登录页面"
...
...
@@ -4474,6 +4486,50 @@ msgstr "AWS (中国)"
msgid "AWS (International)"
msgstr "AWS (国际)"
#: xpack/plugins/cloud/providers/base.py:76
msgid "任务执行开始: {}\n"
msgstr ""
#: xpack/plugins/cloud/providers/base.py:79
msgid "检测账户有效性: {}"
msgstr ""
#: xpack/plugins/cloud/providers/base.py:82
msgid "账户无效!\n"
msgstr ""
#: xpack/plugins/cloud/providers/base.py:86
msgid "账户有效!\n"
msgstr ""
#: xpack/plugins/cloud/providers/base.py:90
msgid ""
"\n"
"任务执行结束!\n"
msgstr ""
#: xpack/plugins/cloud/providers/base.py:91
msgid ""
"查看任务详细信息路径: XPack -> 云管中心 -> 任务列表 -> 任务详情(点击任务名"
"称) -> 查看同步历史列表/实例列表\n"
msgstr ""
#: xpack/plugins/cloud/providers/base.py:126
msgid "同步实例列表: {}"
msgstr ""
#: xpack/plugins/cloud/providers/base.py:135
msgid "同步地域列表: {}\n"
msgstr ""
#: xpack/plugins/cloud/providers/base.py:138
msgid "地域: {}"
msgstr ""
#: xpack/plugins/cloud/providers/base.py:148
msgid "实例: {}, 地域: {}"
msgstr ""
#: xpack/plugins/cloud/providers/qcloud.py:14
msgid "Qcloud"
msgstr "腾讯云"
...
...
@@ -4605,6 +4661,9 @@ msgstr "创建组织"
msgid "Update org"
msgstr "更新组织"
#~ msgid "Date finished"
#~ msgstr "结束日期"
#, fuzzy
#~| msgid "Audits"
#~ msgid "Audit"
...
...
apps/ops/serializers.py
View file @
29ff0efd
...
...
@@ -53,7 +53,7 @@ class AdHocRunHistorySerializer(serializers.ModelSerializer):
@staticmethod
def
get_stat
(
obj
):
return
{
"total"
:
len
(
obj
.
adhoc
.
hosts
),
"total"
:
obj
.
adhoc
.
hosts
.
count
(
),
"success"
:
len
(
obj
.
summary
.
get
(
"contacted"
,
[])),
"failed"
:
len
(
obj
.
summary
.
get
(
"dark"
,
[])),
}
...
...
apps/ops/urls/api_urls.py
View file @
29ff0efd
...
...
@@ -11,6 +11,7 @@ app_name = "ops"
router
=
DefaultRouter
()
router
.
register
(
r'tasks'
,
api
.
TaskViewSet
,
'task'
)
router
.
register
(
r'adhoc'
,
api
.
AdHocViewSet
,
'adhoc'
)
router
.
register
(
r'history'
,
api
.
AdHocRunHistoryViewSet
,
'history'
)
router
.
register
(
r'command-executions'
,
api
.
CommandExecutionViewSet
,
'command-execution'
)
urlpatterns
=
[
...
...
apps/ops/views/adhoc.py
View file @
29ff0efd
...
...
@@ -27,7 +27,7 @@ class TaskListView(AdminUserRequiredMixin, DatetimeSearchMixin, ListView):
def
get_queryset
(
self
):
queryset
=
super
()
.
get_queryset
()
if
current_org
.
is_real
()
:
if
current_org
:
queryset
=
queryset
.
filter
(
created_by
=
current_org
.
id
)
else
:
queryset
=
queryset
.
filter
(
created_by
=
''
)
...
...
@@ -62,8 +62,11 @@ class TaskDetailView(AdminUserRequiredMixin, DetailView):
def
get_queryset
(
self
):
queryset
=
super
()
.
get_queryset
()
if
current_org
:
# Todo: 需要整理默认组织等东西
if
current_org
.
is_real
():
queryset
=
queryset
.
filter
(
created_by
=
current_org
.
id
)
else
:
queryset
=
queryset
.
filter
(
created_by
=
''
)
return
queryset
def
get_context_data
(
self
,
**
kwargs
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment