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
88c10e85
Commit
88c10e85
authored
Mar 07, 2018
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] 修改推送任务
parent
2def25ca
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
46 additions
and
29 deletions
+46
-29
asset.py
apps/assets/forms/asset.py
+4
-1
tasks.py
apps/assets/tasks.py
+11
-1
system_user_asset.html
apps/assets/templates/assets/system_user_asset.html
+1
-1
system_user_detail.html
apps/assets/templates/assets/system_user_detail.html
+3
-1
django.mo
apps/i18n/zh/LC_MESSAGES/django.mo
+0
-0
django.po
apps/i18n/zh/LC_MESSAGES/django.po
+27
-25
No files found.
apps/assets/forms/asset.py
View file @
88c10e85
...
...
@@ -34,8 +34,10 @@ class AssetCreateForm(forms.ModelForm):
'hostname'
:
'* required'
,
'ip'
:
'* required'
,
'port'
:
'* required'
,
'admin_user'
:
_
(
'Admin user is a privilege user exist on this asset,'
'admin_user'
:
_
(
'Admin user is a privilege user exist on this asset,'
'Example: root or other NOPASSWD sudo privilege user'
'If asset not support ansible, set any one'
)
}
...
...
@@ -67,6 +69,7 @@ class AssetUpdateForm(forms.ModelForm):
'admin_user'
:
_
(
'Admin user is a privilege user exist on this asset,'
'Example: root or other NOPASSWD sudo privilege user'
'If asset not support ansible, set any one'
)
}
...
...
apps/assets/tasks.py
View file @
88c10e85
...
...
@@ -343,7 +343,11 @@ def push_system_user_util(system_users, assets, task_name):
from
ops.utils
import
update_or_create_ansible_task
tasks
=
[]
for
system_user
in
system_users
:
if
system_user
.
is_need_push
():
if
not
system_user
.
is_need_push
():
msg
=
"push system user `{}` passed, may be not auto push or ssh "
\
"protocol is not ssh"
.
format
(
system_user
.
name
)
logger
.
info
(
msg
)
continue
tasks
.
extend
(
get_push_system_user_tasks
(
system_user
))
if
not
tasks
:
...
...
@@ -376,6 +380,12 @@ def push_system_user_to_node(system_user, node):
@shared_task
def
push_system_user_related_nodes
(
system_user
):
if
not
system_user
.
is_need_push
():
msg
=
"push system user `{}` passed, may be not auto push or ssh "
\
"protocol is not ssh"
.
format
(
system_user
.
name
)
logger
.
info
(
msg
)
return
nodes
=
system_user
.
nodes
.
all
()
for
node
in
nodes
:
push_system_user_to_node
(
system_user
,
node
)
...
...
apps/assets/templates/assets/system_user_asset.html
View file @
88c10e85
...
...
@@ -67,7 +67,7 @@
<table
class=
"table"
>
<tbody>
<tr
class=
"no-borders-tr"
>
<td
width=
"50%"
>
{% trans 'Push system user
manually
' %}:
</td>
<td
width=
"50%"
>
{% trans 'Push system user
now
' %}:
</td>
<td>
<span
style=
"float: right"
>
<button
type=
"button"
class=
"btn btn-primary btn-xs btn-push"
style=
"width: 54px"
>
{% trans 'Push' %}
</button>
...
...
apps/assets/templates/assets/system_user_detail.html
View file @
88c10e85
...
...
@@ -131,7 +131,8 @@
</td>
</tr>
<tr
class=
"no-borders-tr"
>
<td
width=
"50%"
>
{% trans 'Push system user manually' %}:
</td>
{% if system_user.auto_push %}
<td
width=
"50%"
>
{% trans 'Push system user now' %}:
</td>
<td>
<span
style=
"float: right"
>
<button
type=
"button"
class=
"btn btn-primary btn-xs btn-push"
style=
"width: 54px"
>
{% trans 'Push' %}
</button>
...
...
@@ -139,6 +140,7 @@
</td>
</tr>
<tr>
{% endif %}
<td
width=
"50%"
>
{% trans 'Test assets connective' %}:
</td>
<td>
<span
style=
"float: right"
>
...
...
apps/i18n/zh/LC_MESSAGES/django.mo
View file @
88c10e85
No preview for this file type
apps/i18n/zh/LC_MESSAGES/django.po
View file @
88c10e85
...
...
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Jumpserver 0.3.3\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-03-07
11:54
+0800\n"
"POT-Creation-Date: 2018-03-07
21:18
+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"
...
...
@@ -21,40 +21,42 @@ msgstr ""
msgid "New node {}"
msgstr "新节点 {}"
#: assets/forms/asset.py:23 assets/forms/asset.py:5
2
assets/forms/user.py:125
#: assets/forms/asset.py:23 assets/forms/asset.py:5
4
assets/forms/user.py:125
#: assets/models/asset.py:53 assets/models/user.py:218
#: assets/templates/assets/asset_detail.html:181
#: assets/templates/assets/asset_detail.html:189
#: assets/templates/assets/system_user_detail.html:16
4
#: assets/templates/assets/system_user_detail.html:16
6
msgid "Nodes"
msgstr "节点管理"
#: assets/forms/asset.py:26 assets/forms/asset.py:5
5 assets/forms/asset.py:90
#: assets/forms/asset.py:9
4
assets/models/asset.py:57
#: assets/forms/asset.py:26 assets/forms/asset.py:5
7 assets/forms/asset.py:93
#: assets/forms/asset.py:9
7
assets/models/asset.py:57
#: assets/models/cluster.py:19 assets/models/user.py:187
#: assets/templates/assets/asset_detail.html:73 templates/_nav.html:24
msgid "Admin user"
msgstr "管理用户"
#: assets/forms/asset.py:29 assets/forms/asset.py:
58
assets/models/asset.py:81
#: assets/forms/asset.py:29 assets/forms/asset.py:
60
assets/models/asset.py:81
#: assets/templates/assets/asset_create.html:32
#: assets/templates/assets/asset_detail.html:218
#: assets/templates/assets/asset_update.html:37 templates/_nav.html:26
msgid "Labels"
msgstr "标签管理"
#: assets/forms/asset.py:3
7 assets/forms/asset.py:68
#: assets/forms/asset.py:3
8 assets/forms/asset.py:70
msgid ""
"Admin user is a privilege user exist on this asset,Example: root or other "
"NOPASSWD sudo privilege user"
msgstr "管理用户是资产上已经存在的特权用户,如 root或者其它有NOPASSWD的用户"
"NOPASSWD sudo privilege userIf asset not support ansible, set any one"
msgstr ""
"管理用户是资产上已经存在的特权用户,如 root或者其它有NOPASSWD的用户, 如果资产"
"不支持ansible, 任意设置一个即可"
#: assets/forms/asset.py:
77 assets/forms/asset.py:81
assets/forms/label.py:15
#: assets/forms/asset.py:
80 assets/forms/asset.py:84
assets/forms/label.py:15
#: perms/templates/perms/asset_permission_asset.html:88 users/forms.py:242
msgid "Select assets"
msgstr "选择资产"
#: assets/forms/asset.py:8
6
assets/models/asset.py:52
#: assets/forms/asset.py:8
9
assets/models/asset.py:52
#: assets/templates/assets/admin_user_assets.html:53
#: assets/templates/assets/asset_detail.html:69
#: assets/templates/assets/system_user_asset.html:51
...
...
@@ -62,11 +64,11 @@ msgstr "选择资产"
msgid "Port"
msgstr "端口"
#: assets/forms/asset.py:10
6
assets/templates/assets/asset_create.html:36
#: assets/forms/asset.py:10
9
assets/templates/assets/asset_create.html:36
msgid "Select labels"
msgstr "选择标签"
#: assets/forms/asset.py:1
09
assets/templates/assets/admin_user_detail.html:91
#: assets/forms/asset.py:1
12
assets/templates/assets/admin_user_detail.html:91
msgid "Select nodes"
msgstr "选择节点"
...
...
@@ -454,11 +456,11 @@ msgstr "测试系统用户可连接性: {}"
msgid "test system user connectability period: {}"
msgstr "测试系统用户可连接性: {}"
#: assets/tasks.py:36
5
#: assets/tasks.py:36
9
msgid "Push system user to node: {} => {}"
msgstr "推送系统用户到节点: {}->{}"
#: assets/tasks.py:
39
7
#: assets/tasks.py:
40
7
msgid "Push system users to node: {}"
msgstr "推送系统用户到节点: {}"
...
...
@@ -748,7 +750,7 @@ msgstr "测试可连接性"
#: assets/templates/assets/admin_user_assets.html:75
#: assets/templates/assets/asset_detail.html:170
#: assets/templates/assets/system_user_asset.html:81
#: assets/templates/assets/system_user_detail.html:14
5
#: assets/templates/assets/system_user_detail.html:14
7
msgid "Test"
msgstr "测试"
...
...
@@ -763,7 +765,7 @@ msgstr "替换资产的管理员"
#: assets/templates/assets/admin_user_detail.html:100
#: assets/templates/assets/asset_detail.html:198
#: assets/templates/assets/asset_list.html:541
#: assets/templates/assets/system_user_detail.html:18
1
#: assets/templates/assets/system_user_detail.html:18
3
#: assets/templates/assets/system_user_list.html:135 templates/_modal.html:16
#: terminal/templates/terminal/session_detail.html:108
#: users/templates/users/user_detail.html:339
...
...
@@ -936,27 +938,27 @@ msgid "Assets of "
msgstr "资产"
#: assets/templates/assets/system_user_asset.html:70
#: assets/templates/assets/system_user_detail.html:13
4
msgid "Push system user
manually
"
msgstr "
手动
推送系统"
#: assets/templates/assets/system_user_detail.html:13
5
msgid "Push system user
now
"
msgstr "
立刻
推送系统"
#: assets/templates/assets/system_user_asset.html:73
#: assets/templates/assets/system_user_detail.html:13
7
#: assets/templates/assets/system_user_detail.html:13
8
msgid "Push"
msgstr "推送"
#: assets/templates/assets/system_user_asset.html:78
#: assets/templates/assets/system_user_detail.html:14
2
#: assets/templates/assets/system_user_detail.html:14
4
msgid "Test assets connective"
msgstr "测试资产可连接性"
#: assets/templates/assets/system_user_asset.html:147
#: assets/templates/assets/system_user_detail.html:30
1
#: assets/templates/assets/system_user_detail.html:30
3
msgid "Task has been send, Go to ops task list seen result"
msgstr "任务已下发,查看ops任务列表"
#: assets/templates/assets/system_user_asset.html:159
#: assets/templates/assets/system_user_detail.html:31
3
#: assets/templates/assets/system_user_detail.html:31
5
msgid "Task has been send, seen left assets status"
msgstr "任务已下发,查看左侧资产状态"
...
...
@@ -968,7 +970,7 @@ msgstr "家目录"
msgid "Uid"
msgstr "Uid"
#: assets/templates/assets/system_user_detail.html:17
2
#: assets/templates/assets/system_user_detail.html:17
4
msgid "Add to node"
msgstr "添加到节点"
...
...
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