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
2ef487a9
Commit
2ef487a9
authored
Nov 14, 2019
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] 修改收集用户
parent
05e7311b
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
213 additions
and
125 deletions
+213
-125
0043_auto_20191114_1111.py
apps/assets/migrations/0043_auto_20191114_1111.py
+23
-0
gathered_user.py
apps/assets/models/gathered_user.py
+5
-6
gathered_user.py
apps/assets/serializers/gathered_user.py
+1
-0
const.py
apps/assets/tasks/const.py
+8
-4
gather_asset_users.py
apps/assets/tasks/gather_asset_users.py
+26
-15
_node_tree.html
apps/assets/templates/assets/_node_tree.html
+19
-1
asset_list.html
apps/assets/templates/assets/asset_list.html
+3
-3
django.mo
apps/locale/zh/LC_MESSAGES/django.mo
+0
-0
django.po
apps/locale/zh/LC_MESSAGES/django.po
+86
-71
adhoc.py
apps/ops/models/adhoc.py
+16
-9
asset_permission_list.html
apps/perms/templates/perms/asset_permission_list.html
+2
-16
0002_auto_20191114_1105.py
apps/tickets/migrations/0002_auto_20191114_1105.py
+24
-0
No files found.
apps/assets/migrations/0043_auto_20191114_1111.py
0 → 100644
View file @
2ef487a9
# Generated by Django 2.2.5 on 2019-11-14 03:11
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'assets'
,
'0042_favoriteasset'
),
]
operations
=
[
migrations
.
AddField
(
model_name
=
'gathereduser'
,
name
=
'date_last_login'
,
field
=
models
.
DateTimeField
(
null
=
True
,
verbose_name
=
'Date last login'
),
),
migrations
.
AddField
(
model_name
=
'gathereduser'
,
name
=
'ip_last_login'
,
field
=
models
.
CharField
(
default
=
''
,
max_length
=
39
,
verbose_name
=
'IP last login'
),
),
]
apps/assets/models/gathered_user.py
View file @
2ef487a9
...
@@ -12,13 +12,12 @@ __all__ = ['GatheredUser']
...
@@ -12,13 +12,12 @@ __all__ = ['GatheredUser']
class
GatheredUser
(
OrgModelMixin
):
class
GatheredUser
(
OrgModelMixin
):
id
=
models
.
UUIDField
(
default
=
uuid
.
uuid4
,
primary_key
=
True
)
id
=
models
.
UUIDField
(
default
=
uuid
.
uuid4
,
primary_key
=
True
)
asset
=
models
.
ForeignKey
(
'assets.Asset'
,
on_delete
=
models
.
CASCADE
,
verbose_name
=
_
(
"Asset"
))
asset
=
models
.
ForeignKey
(
'assets.Asset'
,
on_delete
=
models
.
CASCADE
,
verbose_name
=
_
(
"Asset"
))
username
=
models
.
CharField
(
max_length
=
32
,
blank
=
True
,
db_index
=
True
,
username
=
models
.
CharField
(
max_length
=
32
,
blank
=
True
,
db_index
=
True
,
verbose_name
=
_
(
'Username'
))
verbose_name
=
_
(
'Username'
))
present
=
models
.
BooleanField
(
default
=
True
,
verbose_name
=
_
(
"Present"
))
present
=
models
.
BooleanField
(
default
=
True
,
verbose_name
=
_
(
"Present"
))
date_
created
=
models
.
DateTimeField
(
auto_now_add
=
True
,
date_
last_login
=
models
.
DateTimeField
(
null
=
True
,
verbose_name
=
_
(
"Date last login"
))
verbose_name
=
_
(
"Date created
"
))
ip_last_login
=
models
.
CharField
(
max_length
=
39
,
default
=
''
,
verbose_name
=
_
(
"IP last login
"
))
date_
updated
=
models
.
DateTimeField
(
auto_now
=
True
,
date_
created
=
models
.
DateTimeField
(
auto_now_add
=
True
,
verbose_name
=
_
(
"Date created"
))
verbose_name
=
_
(
"Date updated"
))
date_updated
=
models
.
DateTimeField
(
auto_now
=
True
,
verbose_name
=
_
(
"Date updated"
))
@property
@property
def
hostname
(
self
):
def
hostname
(
self
):
...
...
apps/assets/serializers/gathered_user.py
View file @
2ef487a9
...
@@ -12,6 +12,7 @@ class GatheredUserSerializer(OrgResourceModelSerializerMixin):
...
@@ -12,6 +12,7 @@ class GatheredUserSerializer(OrgResourceModelSerializerMixin):
model
=
GatheredUser
model
=
GatheredUser
fields
=
[
fields
=
[
'id'
,
'asset'
,
'hostname'
,
'ip'
,
'username'
,
'id'
,
'asset'
,
'hostname'
,
'ip'
,
'username'
,
'date_last_login'
,
'ip_last_login'
,
'present'
,
'date_created'
,
'date_updated'
'present'
,
'date_created'
,
'date_updated'
]
]
read_only_fields
=
fields
read_only_fields
=
fields
...
...
apps/assets/tasks/const.py
View file @
2ef487a9
...
@@ -7,10 +7,7 @@ from django.utils.translation import ugettext_lazy as _
...
@@ -7,10 +7,7 @@ from django.utils.translation import ugettext_lazy as _
ENV_PERIOD_TASK
=
os
.
environ
.
get
(
"PERIOD_TASK"
,
"on"
)
==
'on'
ENV_PERIOD_TASK
=
os
.
environ
.
get
(
"PERIOD_TASK"
,
"on"
)
==
'on'
ENV_PERIOD_TASK_ENABLED
=
os
.
environ
.
get
(
"PERIOD_TASK_ENABLED"
,
"on"
)
==
"on"
PERIOD_TASK_ENABLED
=
settings
.
PERIOD_TASK_ENABLED
and
ENV_PERIOD_TASK
PERIOD_TASK_ENABLED
=
settings
.
CONFIG
.
PERIOD_TASK_ENABLE
\
and
ENV_PERIOD_TASK
\
and
ENV_PERIOD_TASK_ENABLED
UPDATE_ASSETS_HARDWARE_TASKS
=
[
UPDATE_ASSETS_HARDWARE_TASKS
=
[
{
{
...
@@ -97,6 +94,13 @@ GATHER_ASSET_USERS_TASKS = [
...
@@ -97,6 +94,13 @@ GATHER_ASSET_USERS_TASKS = [
"args"
:
"database=passwd"
"args"
:
"database=passwd"
},
},
},
},
{
"name"
:
"get last login"
,
"action"
:
{
"module"
:
"shell"
,
"args"
:
"users=$(getent passwd | grep -v 'nologin' | grep -v 'shudown' | awk -F: '{ print $1 }');for i in $users;do last -F $i -1 | head -1 | grep -v '^$' | awk '{ print $1
\"
@
\"
$3
\"
@
\"
$5,$6,$7,$8 }';done"
}
}
]
]
GATHER_ASSET_USERS_TASKS_WINDOWS
=
[
GATHER_ASSET_USERS_TASKS_WINDOWS
=
[
...
...
apps/assets/tasks/gather_asset_users.py
View file @
2ef487a9
...
@@ -2,9 +2,10 @@
...
@@ -2,9 +2,10 @@
import
re
import
re
from
collections
import
defaultdict
from
collections
import
defaultdict
from
celery
import
shared_task
from
celery
import
shared_task
from
django.utils.translation
import
ugettext
as
_
from
django.utils.translation
import
ugettext
as
_
from
django.utils
import
timezone
from
orgs.utils
import
tmp_to_org
from
orgs.utils
import
tmp_to_org
from
common.utils
import
get_logger
from
common.utils
import
get_logger
...
@@ -19,19 +20,25 @@ ignore_login_shell = re.compile(r'nologin$|sync$|shutdown$|halt$')
...
@@ -19,19 +20,25 @@ ignore_login_shell = re.compile(r'nologin$|sync$|shutdown$|halt$')
def
parse_linux_result_to_users
(
result
):
def
parse_linux_result_to_users
(
result
):
task_result
=
{}
users
=
defaultdict
(
dict
)
for
task_name
,
raw
in
result
.
items
():
users_result
=
result
.
get
(
'gather host users'
,
{})
\
res
=
raw
.
get
(
'ansible_facts'
,
{})
.
get
(
'getent_passwd'
)
.
get
(
'ansible_facts'
,
{})
\
if
res
:
.
get
(
'getent_passwd'
)
task_result
=
res
if
not
isinstance
(
users_result
,
dict
):
break
users_result
=
{}
if
not
task_result
or
not
isinstance
(
task_result
,
dict
):
for
username
,
attr
in
users_result
.
items
():
return
[]
users
=
[]
for
username
,
attr
in
task_result
.
items
():
if
ignore_login_shell
.
search
(
attr
[
-
1
]):
if
ignore_login_shell
.
search
(
attr
[
-
1
]):
continue
continue
users
.
append
(
username
)
users
[
username
]
=
{}
last_login_result
=
result
.
get
(
'get last login'
,
{})
.
get
(
'stdout_lines'
,
[])
for
line
in
last_login_result
:
data
=
line
.
split
(
'@'
)
if
len
(
data
)
!=
3
:
continue
username
,
ip
,
dt
=
data
dt
+=
' +0800'
date
=
timezone
.
datetime
.
strptime
(
dt
,
'
%
b
%
d
%
H:
%
M:
%
S
%
Y
%
z'
)
users
[
username
]
=
{
"ip"
:
ip
,
"date"
:
date
}
return
users
return
users
...
@@ -45,7 +52,7 @@ def parse_windows_result_to_users(result):
...
@@ -45,7 +52,7 @@ def parse_windows_result_to_users(result):
if
not
task_result
:
if
not
task_result
:
return
[]
return
[]
users
=
[]
users
=
{}
for
i
in
range
(
4
):
for
i
in
range
(
4
):
task_result
.
pop
(
0
)
task_result
.
pop
(
0
)
...
@@ -55,7 +62,7 @@ def parse_windows_result_to_users(result):
...
@@ -55,7 +62,7 @@ def parse_windows_result_to_users(result):
for
line
in
task_result
:
for
line
in
task_result
:
user
=
space
.
split
(
line
)
user
=
space
.
split
(
line
)
if
user
[
0
]:
if
user
[
0
]:
users
.
append
(
user
[
0
])
users
[
user
[
0
]]
=
{}
return
users
return
users
...
@@ -82,8 +89,12 @@ def add_asset_users(assets, results):
...
@@ -82,8 +89,12 @@ def add_asset_users(assets, results):
with
tmp_to_org
(
asset
.
org_id
):
with
tmp_to_org
(
asset
.
org_id
):
GatheredUser
.
objects
.
filter
(
asset
=
asset
,
present
=
True
)
\
GatheredUser
.
objects
.
filter
(
asset
=
asset
,
present
=
True
)
\
.
update
(
present
=
False
)
.
update
(
present
=
False
)
for
username
in
users
:
for
username
,
data
in
users
.
items
()
:
defaults
=
{
'asset'
:
asset
,
'username'
:
username
,
'present'
:
True
}
defaults
=
{
'asset'
:
asset
,
'username'
:
username
,
'present'
:
True
}
if
data
.
get
(
"ip"
):
defaults
[
"ip_last_login"
]
=
data
[
"ip"
]
if
data
.
get
(
"date"
):
defaults
[
"date_last_login"
]
=
data
[
"date"
]
GatheredUser
.
objects
.
update_or_create
(
GatheredUser
.
objects
.
update_or_create
(
defaults
=
defaults
,
asset
=
asset
,
username
=
username
,
defaults
=
defaults
,
asset
=
asset
,
username
=
username
,
)
)
...
...
apps/assets/templates/assets/_node_tree.html
View file @
2ef487a9
...
@@ -303,9 +303,24 @@ function defaultCallback(action) {
...
@@ -303,9 +303,24 @@ function defaultCallback(action) {
return
logging
return
logging
}
}
function
toggle
()
{
if
(
show
===
0
)
{
$
(
"#split-left"
).
hide
(
500
,
function
()
{
$
(
"#split-right"
).
attr
(
"class"
,
"col-lg-12"
);
$
(
"#toggle-icon"
).
attr
(
"class"
,
"fa fa-angle-right fa-x"
);
show
=
1
;
});
}
else
{
$
(
"#split-right"
).
attr
(
"class"
,
"col-lg-9"
);
$
(
"#toggle-icon"
).
attr
(
"class"
,
"fa fa-angle-left fa-x"
);
$
(
"#split-left"
).
show
(
500
);
show
=
0
;
}
}
$
(
document
).
ready
(
function
()
{
$
(
document
).
ready
(
function
()
{
$
(
'.treebox'
).
css
(
'height'
,
window
.
innerHeight
-
18
0
);
$
(
'.treebox'
).
css
(
'height'
,
window
.
innerHeight
-
6
0
);
})
})
.
on
(
'click'
,
'.btn-show-current-asset'
,
function
(){
.
on
(
'click'
,
'.btn-show-current-asset'
,
function
(){
hideRMenu
();
hideRMenu
();
...
@@ -320,6 +335,9 @@ $(document).ready(function () {
...
@@ -320,6 +335,9 @@ $(document).ready(function () {
$
(
'#show_current_asset'
).
css
(
'display'
,
'inline-block'
);
$
(
'#show_current_asset'
).
css
(
'display'
,
'inline-block'
);
setCookie
(
'show_current_asset'
,
''
);
setCookie
(
'show_current_asset'
,
''
);
location
.
reload
();
location
.
reload
();
}).
on
(
'click'
,
'.tree-toggle-btn'
,
function
(
e
)
{
e
.
preventDefault
();
toggle
();
})
})
</script>
</script>
apps/assets/templates/assets/asset_list.html
View file @
2ef487a9
...
@@ -48,12 +48,12 @@
...
@@ -48,12 +48,12 @@
{% block content %}
{% block content %}
<div
class=
"wrapper wrapper-content"
>
<div
class=
"wrapper wrapper-content"
>
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-lg-3"
id=
"split-left"
style=
"padding-left: 3px"
>
<div
class=
"col-lg-3"
id=
"split-left"
style=
"padding-left: 3px
;padding-right: 0
"
>
{% include 'assets/_node_tree.html' %}
{% include 'assets/_node_tree.html' %}
</div>
</div>
<div
class=
"col-lg-9 animated fadeInRight"
id=
"split-right"
>
<div
class=
"col-lg-9 animated fadeInRight"
id=
"split-right"
>
<div
class=
"tree-toggle"
>
<div
class=
"tree-toggle"
style=
"z-index: 9999"
>
<div
class=
"btn btn-sm btn-primary tree-toggle-btn"
onclick=
"toggle()"
>
<div
class=
"btn btn-sm btn-primary tree-toggle-btn"
>
<i
class=
"fa fa-angle-left fa-x"
id=
"toggle-icon"
></i>
<i
class=
"fa fa-angle-left fa-x"
id=
"toggle-icon"
></i>
</div>
</div>
</div>
</div>
...
...
apps/locale/zh/LC_MESSAGES/django.mo
View file @
2ef487a9
No preview for this file type
apps/locale/zh/LC_MESSAGES/django.po
View file @
2ef487a9
...
@@ -8,7 +8,7 @@ msgid ""
...
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
msgstr ""
"Project-Id-Version: Jumpserver 0.3.3\n"
"Project-Id-Version: Jumpserver 0.3.3\n"
"Report-Msgid-Bugs-To: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-11-1
2 14:10
+0800\n"
"POT-Creation-Date: 2019-11-1
4 11:36
+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: ibuler <ibuler@qq.com>\n"
"Last-Translator: ibuler <ibuler@qq.com>\n"
"Language-Team: Jumpserver team<ibuler@qq.com>\n"
"Language-Team: Jumpserver team<ibuler@qq.com>\n"
...
@@ -96,7 +96,7 @@ msgstr "运行参数"
...
@@ -96,7 +96,7 @@ msgstr "运行参数"
#: terminal/templates/terminal/session_list.html:28
#: terminal/templates/terminal/session_list.html:28
#: terminal/templates/terminal/session_list.html:72
#: terminal/templates/terminal/session_list.html:72
#: xpack/plugins/change_auth_plan/forms.py:73
#: xpack/plugins/change_auth_plan/forms.py:73
#: xpack/plugins/change_auth_plan/models.py:41
9
#: xpack/plugins/change_auth_plan/models.py:41
2
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_create_update.html:46
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_create_update.html:46
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_execution_list.html:54
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_execution_list.html:54
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_execution_subtask_list.html:13
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_execution_subtask_list.html:13
...
@@ -152,7 +152,7 @@ msgstr "资产"
...
@@ -152,7 +152,7 @@ msgstr "资产"
#: users/templates/users/user_profile.html:51
#: users/templates/users/user_profile.html:51
#: users/templates/users/user_pubkey_update.html:57
#: users/templates/users/user_pubkey_update.html:57
#: xpack/plugins/change_auth_plan/forms.py:56
#: xpack/plugins/change_auth_plan/forms.py:56
#: xpack/plugins/change_auth_plan/models.py:6
4
#: xpack/plugins/change_auth_plan/models.py:6
3
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_detail.html:61
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_detail.html:61
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_list.html:12
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_list.html:12
#: xpack/plugins/cloud/models.py:59 xpack/plugins/cloud/models.py:144
#: xpack/plugins/cloud/models.py:59 xpack/plugins/cloud/models.py:144
...
@@ -199,7 +199,7 @@ msgstr "参数"
...
@@ -199,7 +199,7 @@ msgstr "参数"
#: perms/templates/perms/remote_app_permission_detail.html:90
#: perms/templates/perms/remote_app_permission_detail.html:90
#: users/models/user.py:451 users/serializers/group.py:32
#: users/models/user.py:451 users/serializers/group.py:32
#: users/templates/users/user_detail.html:112
#: users/templates/users/user_detail.html:112
#: xpack/plugins/change_auth_plan/models.py:10
9
#: xpack/plugins/change_auth_plan/models.py:10
8
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_detail.html:113
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_detail.html:113
#: xpack/plugins/cloud/models.py:80 xpack/plugins/cloud/models.py:179
#: xpack/plugins/cloud/models.py:80 xpack/plugins/cloud/models.py:179
#: xpack/plugins/gathered_user/models.py:46
#: xpack/plugins/gathered_user/models.py:46
...
@@ -264,7 +264,7 @@ msgstr "创建日期"
...
@@ -264,7 +264,7 @@ msgstr "创建日期"
#: users/templates/users/user_group_detail.html:67
#: users/templates/users/user_group_detail.html:67
#: users/templates/users/user_group_list.html:37
#: users/templates/users/user_group_list.html:37
#: users/templates/users/user_profile.html:138
#: users/templates/users/user_profile.html:138
#: xpack/plugins/change_auth_plan/models.py:10
5
#: xpack/plugins/change_auth_plan/models.py:10
4
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_detail.html:117
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_detail.html:117
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_list.html:19
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_list.html:19
#: xpack/plugins/cloud/models.py:77 xpack/plugins/cloud/models.py:173
#: xpack/plugins/cloud/models.py:77 xpack/plugins/cloud/models.py:173
...
@@ -607,7 +607,7 @@ msgstr "端口"
...
@@ -607,7 +607,7 @@ msgstr "端口"
#: assets/templates/assets/asset_detail.html:196
#: assets/templates/assets/asset_detail.html:196
#: assets/templates/assets/system_user_assets.html:83
#: assets/templates/assets/system_user_assets.html:83
#: perms/models/asset_permission.py:81
#: perms/models/asset_permission.py:81
#: xpack/plugins/change_auth_plan/models.py:7
5
#: xpack/plugins/change_auth_plan/models.py:7
4
#: xpack/plugins/gathered_user/models.py:31
#: xpack/plugins/gathered_user/models.py:31
#: xpack/plugins/gathered_user/templates/gathered_user/task_list.html:17
#: xpack/plugins/gathered_user/templates/gathered_user/task_list.html:17
msgid "Nodes"
msgid "Nodes"
...
@@ -693,7 +693,7 @@ msgid "SSH gateway support proxy SSH,RDP,VNC"
...
@@ -693,7 +693,7 @@ msgid "SSH gateway support proxy SSH,RDP,VNC"
msgstr "SSH网关,支持代理SSH,RDP和VNC"
msgstr "SSH网关,支持代理SSH,RDP和VNC"
#: assets/forms/domain.py:78 assets/forms/user.py:76 assets/forms/user.py:96
#: assets/forms/domain.py:78 assets/forms/user.py:76 assets/forms/user.py:96
#: assets/models/base.py:29 assets/models/gathered_user.py:1
6
#: assets/models/base.py:29 assets/models/gathered_user.py:1
5
#: assets/templates/assets/_asset_user_auth_update_modal.html:15
#: assets/templates/assets/_asset_user_auth_update_modal.html:15
#: assets/templates/assets/_asset_user_auth_view_modal.html:21
#: assets/templates/assets/_asset_user_auth_view_modal.html:21
#: assets/templates/assets/_asset_user_list.html:21
#: assets/templates/assets/_asset_user_list.html:21
...
@@ -714,13 +714,13 @@ msgstr "SSH网关,支持代理SSH,RDP和VNC"
...
@@ -714,13 +714,13 @@ msgstr "SSH网关,支持代理SSH,RDP和VNC"
#: users/templates/users/user_list.html:36
#: users/templates/users/user_list.html:36
#: users/templates/users/user_profile.html:47
#: users/templates/users/user_profile.html:47
#: xpack/plugins/change_auth_plan/forms.py:58
#: xpack/plugins/change_auth_plan/forms.py:58
#: xpack/plugins/change_auth_plan/models.py:6
6
#: xpack/plugins/change_auth_plan/models.py:6
5
#: xpack/plugins/change_auth_plan/models.py:4
15
#: xpack/plugins/change_auth_plan/models.py:4
08
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_detail.html:65
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_detail.html:65
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_execution_list.html:53
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_execution_list.html:53
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_execution_subtask_list.html:12
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_execution_subtask_list.html:12
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_list.html:13
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_list.html:13
#: xpack/plugins/gathered_user/templates/gathered_user/gathered_user_list.html:
7
4
#: xpack/plugins/gathered_user/templates/gathered_user/gathered_user_list.html:
6
4
msgid "Username"
msgid "Username"
msgstr "用户名"
msgstr "用户名"
...
@@ -742,8 +742,8 @@ msgstr "密码或密钥密码"
...
@@ -742,8 +742,8 @@ msgstr "密码或密钥密码"
#: users/templates/users/user_profile_update.html:41
#: users/templates/users/user_profile_update.html:41
#: users/templates/users/user_pubkey_update.html:41
#: users/templates/users/user_pubkey_update.html:41
#: users/templates/users/user_update.html:20
#: users/templates/users/user_update.html:20
#: xpack/plugins/change_auth_plan/models.py:9
6
#: xpack/plugins/change_auth_plan/models.py:9
5
#: xpack/plugins/change_auth_plan/models.py:26
4
#: xpack/plugins/change_auth_plan/models.py:26
3
msgid "Password"
msgid "Password"
msgstr "密码"
msgstr "密码"
...
@@ -801,12 +801,12 @@ msgstr "使用逗号分隔多个命令,如: /bin/whoami,/sbin/ifconfig"
...
@@ -801,12 +801,12 @@ msgstr "使用逗号分隔多个命令,如: /bin/whoami,/sbin/ifconfig"
#: perms/templates/perms/asset_permission_asset.html:58 settings/forms.py:144
#: perms/templates/perms/asset_permission_asset.html:58 settings/forms.py:144
#: users/templates/users/_granted_assets.html:31
#: users/templates/users/_granted_assets.html:31
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_asset_list.html:54
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_asset_list.html:54
#: xpack/plugins/gathered_user/templates/gathered_user/gathered_user_list.html:
7
3
#: xpack/plugins/gathered_user/templates/gathered_user/gathered_user_list.html:
6
3
msgid "IP"
msgid "IP"
msgstr "IP"
msgstr "IP"
#: assets/models/asset.py:136 assets/serializers/asset_user.py:27
#: assets/models/asset.py:136 assets/serializers/asset_user.py:27
#: assets/serializers/gathered_user.py:
19
#: assets/serializers/gathered_user.py:
20
#: assets/templates/assets/_asset_list_modal.html:46
#: assets/templates/assets/_asset_list_modal.html:46
#: assets/templates/assets/_asset_user_auth_update_modal.html:9
#: assets/templates/assets/_asset_user_auth_update_modal.html:9
#: assets/templates/assets/_asset_user_auth_view_modal.html:15
#: assets/templates/assets/_asset_user_auth_view_modal.html:15
...
@@ -818,7 +818,7 @@ msgstr "IP"
...
@@ -818,7 +818,7 @@ msgstr "IP"
#: perms/templates/perms/asset_permission_list.html:73 settings/forms.py:143
#: perms/templates/perms/asset_permission_list.html:73 settings/forms.py:143
#: users/templates/users/_granted_assets.html:30
#: users/templates/users/_granted_assets.html:30
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_asset_list.html:53
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_asset_list.html:53
#: xpack/plugins/gathered_user/templates/gathered_user/gathered_user_list.html:
7
2
#: xpack/plugins/gathered_user/templates/gathered_user/gathered_user_list.html:
6
2
msgid "Hostname"
msgid "Hostname"
msgstr "主机名"
msgstr "主机名"
...
@@ -937,21 +937,21 @@ msgstr "版本"
...
@@ -937,21 +937,21 @@ msgstr "版本"
msgid "AuthBook"
msgid "AuthBook"
msgstr ""
msgstr ""
#: assets/models/base.py:31 xpack/plugins/change_auth_plan/models.py:
100
#: assets/models/base.py:31 xpack/plugins/change_auth_plan/models.py:
99
#: xpack/plugins/change_auth_plan/models.py:27
1
#: xpack/plugins/change_auth_plan/models.py:27
0
msgid "SSH private key"
msgid "SSH private key"
msgstr "ssh密钥"
msgstr "ssh密钥"
#: assets/models/base.py:32 xpack/plugins/change_auth_plan/models.py:10
3
#: assets/models/base.py:32 xpack/plugins/change_auth_plan/models.py:10
2
#: xpack/plugins/change_auth_plan/models.py:26
7
#: xpack/plugins/change_auth_plan/models.py:26
6
msgid "SSH public key"
msgid "SSH public key"
msgstr "ssh公钥"
msgstr "ssh公钥"
#: assets/models/base.py:35 assets/models/gathered_user.py:2
1
#: assets/models/base.py:35 assets/models/gathered_user.py:2
0
#: assets/templates/assets/cmd_filter_detail.html:73 common/mixins/models.py:52
#: assets/templates/assets/cmd_filter_detail.html:73 common/mixins/models.py:52
#: ops/models/adhoc.py:46
#: ops/models/adhoc.py:46
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_detail.html:109
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_detail.html:109
#: xpack/plugins/gathered_user/templates/gathered_user/gathered_user_list.html:
76
#: xpack/plugins/gathered_user/templates/gathered_user/gathered_user_list.html:
68
msgid "Date updated"
msgid "Date updated"
msgstr "更新日期"
msgstr "更新日期"
...
@@ -1080,12 +1080,22 @@ msgstr "命令过滤规则"
...
@@ -1080,12 +1080,22 @@ msgstr "命令过滤规则"
msgid "Gateway"
msgid "Gateway"
msgstr "网关"
msgstr "网关"
#: assets/models/gathered_user.py:1
7
#: assets/models/gathered_user.py:1
6
#: xpack/plugins/gathered_user/templates/gathered_user/gathered_user_list.html:
75
#: xpack/plugins/gathered_user/templates/gathered_user/gathered_user_list.html:
67
msgid "Present"
msgid "Present"
msgstr "存在"
msgstr "存在"
#: assets/models/gathered_user.py:32
#: assets/models/gathered_user.py:17
#: xpack/plugins/gathered_user/templates/gathered_user/gathered_user_list.html:65
msgid "Date last login"
msgstr "最后登录日期"
#: assets/models/gathered_user.py:18
#: xpack/plugins/gathered_user/templates/gathered_user/gathered_user_list.html:66
msgid "IP last login"
msgstr "最后登录IP"
#: assets/models/gathered_user.py:31
msgid "GatherUser"
msgid "GatherUser"
msgstr "收集用户"
msgstr "收集用户"
...
@@ -1188,7 +1198,7 @@ msgstr "手动登录"
...
@@ -1188,7 +1198,7 @@ msgstr "手动登录"
#: assets/views/label.py:27 assets/views/label.py:45 assets/views/label.py:73
#: assets/views/label.py:27 assets/views/label.py:45 assets/views/label.py:73
#: assets/views/system_user.py:29 assets/views/system_user.py:46
#: assets/views/system_user.py:29 assets/views/system_user.py:46
#: assets/views/system_user.py:63 assets/views/system_user.py:79
#: assets/views/system_user.py:63 assets/views/system_user.py:79
#: templates/_nav.html:39 xpack/plugins/change_auth_plan/models.py:7
1
#: templates/_nav.html:39 xpack/plugins/change_auth_plan/models.py:7
0
msgid "Assets"
msgid "Assets"
msgstr "资产管理"
msgstr "资产管理"
...
@@ -1237,16 +1247,16 @@ msgstr "系统用户"
...
@@ -1237,16 +1247,16 @@ msgstr "系统用户"
msgid "%(value)s is not an even number"
msgid "%(value)s is not an even number"
msgstr "%(value)s is not an even number"
msgstr "%(value)s is not an even number"
#: assets/models/utils.py:43 assets/tasks/const.py:8
7
#: assets/models/utils.py:43 assets/tasks/const.py:8
4
msgid "Unreachable"
msgid "Unreachable"
msgstr "不可达"
msgstr "不可达"
#: assets/models/utils.py:44 assets/tasks/const.py:8
8
#: assets/models/utils.py:44 assets/tasks/const.py:8
5
#: assets/templates/assets/asset_list.html:99
#: assets/templates/assets/asset_list.html:99
msgid "Reachable"
msgid "Reachable"
msgstr "可连接"
msgstr "可连接"
#: assets/models/utils.py:45 assets/tasks/const.py:8
9
audits/utils.py:30
#: assets/models/utils.py:45 assets/tasks/const.py:8
6
audits/utils.py:30
#: xpack/plugins/license/models.py:78
#: xpack/plugins/license/models.py:78
msgid "Unknown"
msgid "Unknown"
msgstr "未知"
msgstr "未知"
...
@@ -1333,7 +1343,7 @@ msgstr "测试资产可连接性: {}"
...
@@ -1333,7 +1343,7 @@ msgstr "测试资产可连接性: {}"
#: assets/tasks/asset_user_connectivity.py:27
#: assets/tasks/asset_user_connectivity.py:27
#: assets/tasks/push_system_user.py:130
#: assets/tasks/push_system_user.py:130
#: xpack/plugins/change_auth_plan/models.py:52
8
#: xpack/plugins/change_auth_plan/models.py:52
1
msgid "The asset {} system platform {} does not support run Ansible tasks"
msgid "The asset {} system platform {} does not support run Ansible tasks"
msgstr "资产 {} 系统平台 {} 不支持运行 Ansible 任务"
msgstr "资产 {} 系统平台 {} 不支持运行 Ansible 任务"
...
@@ -1353,7 +1363,7 @@ msgstr "更新资产硬件信息"
...
@@ -1353,7 +1363,7 @@ msgstr "更新资产硬件信息"
msgid "Update asset hardware info: {}"
msgid "Update asset hardware info: {}"
msgstr "更新资产硬件信息: {}"
msgstr "更新资产硬件信息: {}"
#: assets/tasks/gather_asset_users.py:
96
#: assets/tasks/gather_asset_users.py:
107
msgid "Gather assets users"
msgid "Gather assets users"
msgstr "收集资产上的用户"
msgstr "收集资产上的用户"
...
@@ -1706,7 +1716,7 @@ msgstr "Jumpserver 使用该用户来 `推送系统用户`、`获取资产硬件
...
@@ -1706,7 +1716,7 @@ msgstr "Jumpserver 使用该用户来 `推送系统用户`、`获取资产硬件
#: audits/templates/audits/login_log_list.html:91
#: audits/templates/audits/login_log_list.html:91
#: users/templates/users/user_group_list.html:10
#: users/templates/users/user_group_list.html:10
#: users/templates/users/user_list.html:10
#: users/templates/users/user_list.html:10
#: xpack/plugins/gathered_user/templates/gathered_user/gathered_user_list.html:
5
9
#: xpack/plugins/gathered_user/templates/gathered_user/gathered_user_list.html:
4
9
#: xpack/plugins/vault/templates/vault/vault.html:55
#: xpack/plugins/vault/templates/vault/vault.html:55
msgid "Export"
msgid "Export"
msgstr "导出"
msgstr "导出"
...
@@ -2288,7 +2298,7 @@ msgid "MFA"
...
@@ -2288,7 +2298,7 @@ msgid "MFA"
msgstr "MFA"
msgstr "MFA"
#: audits/models.py:87 audits/templates/audits/login_log_list.html:63
#: audits/models.py:87 audits/templates/audits/login_log_list.html:63
#: xpack/plugins/change_auth_plan/models.py:4
23
#: xpack/plugins/change_auth_plan/models.py:4
16
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_execution_subtask_list.html:15
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_execution_subtask_list.html:15
#: xpack/plugins/cloud/models.py:278
#: xpack/plugins/cloud/models.py:278
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_history.html:69
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_history.html:69
...
@@ -2317,11 +2327,11 @@ msgstr "登录日期"
...
@@ -2317,11 +2327,11 @@ msgstr "登录日期"
#: perms/templates/perms/asset_permission_detail.html:86
#: perms/templates/perms/asset_permission_detail.html:86
#: perms/templates/perms/remote_app_permission_detail.html:78
#: perms/templates/perms/remote_app_permission_detail.html:78
#: terminal/models.py:167 terminal/templates/terminal/session_list.html:34
#: terminal/models.py:167 terminal/templates/terminal/session_list.html:34
#: xpack/plugins/change_auth_plan/models.py:2
50
#: xpack/plugins/change_auth_plan/models.py:2
49
#: xpack/plugins/change_auth_plan/models.py:4
26
#: xpack/plugins/change_auth_plan/models.py:4
19
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_execution_list.html:59
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_execution_list.html:59
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_execution_subtask_list.html:17
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_execution_subtask_list.html:17
#: xpack/plugins/gathered_user/models.py:14
3
#: xpack/plugins/gathered_user/models.py:14
0
msgid "Date start"
msgid "Date start"
msgstr "开始日期"
msgstr "开始日期"
...
@@ -2888,49 +2898,49 @@ msgstr "Become"
...
@@ -2888,49 +2898,49 @@ msgstr "Become"
msgid "Create by"
msgid "Create by"
msgstr "创建者"
msgstr "创建者"
#: ops/models/adhoc.py:25
2
#: ops/models/adhoc.py:25
4
msgid "{} Start task: {}"
msgid "{} Start task: {}"
msgstr "{} 任务开始: {}"
msgstr "{} 任务开始: {}"
#: ops/models/adhoc.py:26
4
#: ops/models/adhoc.py:26
3
msgid "{} Task finish"
msgid "{} Task finish"
msgstr "{} 任务结束"
msgstr "{} 任务结束"
#: ops/models/adhoc.py:3
56
#: ops/models/adhoc.py:3
60
msgid "Start time"
msgid "Start time"
msgstr "开始时间"
msgstr "开始时间"
#: ops/models/adhoc.py:3
57
#: ops/models/adhoc.py:3
61
msgid "End time"
msgid "End time"
msgstr "完成时间"
msgstr "完成时间"
#: ops/models/adhoc.py:3
58
ops/templates/ops/adhoc_history.html:57
#: ops/models/adhoc.py:3
62
ops/templates/ops/adhoc_history.html:57
#: ops/templates/ops/task_history.html:63 ops/templates/ops/task_list.html:17
#: ops/templates/ops/task_history.html:63 ops/templates/ops/task_list.html:17
#: xpack/plugins/change_auth_plan/models.py:25
3
#: xpack/plugins/change_auth_plan/models.py:25
2
#: xpack/plugins/change_auth_plan/models.py:42
9
#: xpack/plugins/change_auth_plan/models.py:42
2
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_execution_list.html:58
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_execution_list.html:58
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_execution_subtask_list.html:16
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_execution_subtask_list.html:16
#: xpack/plugins/gathered_user/models.py:14
6
#: xpack/plugins/gathered_user/models.py:14
3
msgid "Time"
msgid "Time"
msgstr "时间"
msgstr "时间"
#: ops/models/adhoc.py:3
59
ops/templates/ops/adhoc_detail.html:106
#: ops/models/adhoc.py:3
63
ops/templates/ops/adhoc_detail.html:106
#: ops/templates/ops/adhoc_history.html:55
#: ops/templates/ops/adhoc_history.html:55
#: ops/templates/ops/adhoc_history_detail.html:69
#: ops/templates/ops/adhoc_history_detail.html:69
#: ops/templates/ops/task_detail.html:84 ops/templates/ops/task_history.html:61
#: ops/templates/ops/task_detail.html:84 ops/templates/ops/task_history.html:61
msgid "Is finished"
msgid "Is finished"
msgstr "是否完成"
msgstr "是否完成"
#: ops/models/adhoc.py:36
0
ops/templates/ops/adhoc_history.html:56
#: ops/models/adhoc.py:36
4
ops/templates/ops/adhoc_history.html:56
#: ops/templates/ops/task_history.html:62
#: ops/templates/ops/task_history.html:62
msgid "Is success"
msgid "Is success"
msgstr "是否成功"
msgstr "是否成功"
#: ops/models/adhoc.py:36
1
#: ops/models/adhoc.py:36
5
msgid "Adhoc raw result"
msgid "Adhoc raw result"
msgstr "结果"
msgstr "结果"
#: ops/models/adhoc.py:36
2
#: ops/models/adhoc.py:36
6
msgid "Adhoc result summary"
msgid "Adhoc result summary"
msgstr "汇总"
msgstr "汇总"
...
@@ -3350,7 +3360,7 @@ msgstr "刷新授权缓存"
...
@@ -3350,7 +3360,7 @@ msgstr "刷新授权缓存"
msgid "Validity"
msgid "Validity"
msgstr "有效"
msgstr "有效"
#: perms/templates/perms/asset_permission_list.html:2
44
#: perms/templates/perms/asset_permission_list.html:2
30
msgid "Refresh success"
msgid "Refresh success"
msgstr "刷新成功"
msgstr "刷新成功"
...
@@ -4832,7 +4842,7 @@ msgstr "生成重置密码链接,通过邮件发送给用户"
...
@@ -4832,7 +4842,7 @@ msgstr "生成重置密码链接,通过邮件发送给用户"
msgid "Set password"
msgid "Set password"
msgstr "设置密码"
msgstr "设置密码"
#: users/forms.py:152 xpack/plugins/change_auth_plan/models.py:8
9
#: users/forms.py:152 xpack/plugins/change_auth_plan/models.py:8
8
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_create_update.html:51
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_create_update.html:51
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_detail.html:69
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_detail.html:69
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_execution_list.html:57
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_execution_list.html:57
...
@@ -5762,8 +5772,8 @@ msgstr ""
...
@@ -5762,8 +5772,8 @@ msgstr ""
"具</a>) <br>注意: 如果同时设置了定期执行和周期执行,优先使用定期执行"
"具</a>) <br>注意: 如果同时设置了定期执行和周期执行,优先使用定期执行"
#: xpack/plugins/change_auth_plan/meta.py:9
#: xpack/plugins/change_auth_plan/meta.py:9
#: xpack/plugins/change_auth_plan/models.py:11
7
#: xpack/plugins/change_auth_plan/models.py:11
6
#: xpack/plugins/change_auth_plan/models.py:25
7
#: xpack/plugins/change_auth_plan/models.py:25
6
#: xpack/plugins/change_auth_plan/views.py:33
#: xpack/plugins/change_auth_plan/views.py:33
#: xpack/plugins/change_auth_plan/views.py:50
#: xpack/plugins/change_auth_plan/views.py:50
#: xpack/plugins/change_auth_plan/views.py:74
#: xpack/plugins/change_auth_plan/views.py:74
...
@@ -5774,20 +5784,20 @@ msgstr ""
...
@@ -5774,20 +5784,20 @@ msgstr ""
msgid "Change auth plan"
msgid "Change auth plan"
msgstr "改密计划"
msgstr "改密计划"
#: xpack/plugins/change_auth_plan/models.py:5
8
#: xpack/plugins/change_auth_plan/models.py:5
7
msgid "Custom password"
msgid "Custom password"
msgstr "自定义密码"
msgstr "自定义密码"
#: xpack/plugins/change_auth_plan/models.py:5
9
#: xpack/plugins/change_auth_plan/models.py:5
8
msgid "All assets use the same random password"
msgid "All assets use the same random password"
msgstr "所有资产使用相同的随机密码"
msgstr "所有资产使用相同的随机密码"
#: xpack/plugins/change_auth_plan/models.py:
60
#: xpack/plugins/change_auth_plan/models.py:
59
msgid "All assets use different random password"
msgid "All assets use different random password"
msgstr "所有资产使用不同的随机密码"
msgstr "所有资产使用不同的随机密码"
#: xpack/plugins/change_auth_plan/models.py:7
9
#: xpack/plugins/change_auth_plan/models.py:7
8
#: xpack/plugins/change_auth_plan/models.py:14
8
#: xpack/plugins/change_auth_plan/models.py:14
7
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_detail.html:100
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_detail.html:100
#: xpack/plugins/cloud/models.py:165 xpack/plugins/cloud/models.py:219
#: xpack/plugins/cloud/models.py:165 xpack/plugins/cloud/models.py:219
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_detail.html:91
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_detail.html:91
...
@@ -5796,8 +5806,8 @@ msgstr "所有资产使用不同的随机密码"
...
@@ -5796,8 +5806,8 @@ msgstr "所有资产使用不同的随机密码"
msgid "Cycle perform"
msgid "Cycle perform"
msgstr "周期执行"
msgstr "周期执行"
#: xpack/plugins/change_auth_plan/models.py:8
4
#: xpack/plugins/change_auth_plan/models.py:8
3
#: xpack/plugins/change_auth_plan/models.py:14
6
#: xpack/plugins/change_auth_plan/models.py:14
5
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_detail.html:92
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_detail.html:92
#: xpack/plugins/cloud/models.py:170 xpack/plugins/cloud/models.py:217
#: xpack/plugins/cloud/models.py:170 xpack/plugins/cloud/models.py:217
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_detail.html:83
#: xpack/plugins/cloud/templates/cloud/sync_instance_task_detail.html:83
...
@@ -5806,37 +5816,37 @@ msgstr "周期执行"
...
@@ -5806,37 +5816,37 @@ msgstr "周期执行"
msgid "Regularly perform"
msgid "Regularly perform"
msgstr "定期执行"
msgstr "定期执行"
#: xpack/plugins/change_auth_plan/models.py:9
3
#: xpack/plugins/change_auth_plan/models.py:9
2
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_detail.html:74
#: xpack/plugins/change_auth_plan/templates/change_auth_plan/plan_detail.html:74
msgid "Password rules"
msgid "Password rules"
msgstr "密码规则"
msgstr "密码规则"
#: xpack/plugins/change_auth_plan/models.py:21
3
#: xpack/plugins/change_auth_plan/models.py:21
2
msgid "* For security, do not change {} user's password"
msgid "* For security, do not change {} user's password"
msgstr "* 为了安全,禁止更改 {} 用户的密码"
msgstr "* 为了安全,禁止更改 {} 用户的密码"
#: xpack/plugins/change_auth_plan/models.py:21
7
#: xpack/plugins/change_auth_plan/models.py:21
6
msgid "Assets is empty, please add the asset"
msgid "Assets is empty, please add the asset"
msgstr "资产为空,请添加资产"
msgstr "资产为空,请添加资产"
#: xpack/plugins/change_auth_plan/models.py:26
1
#: xpack/plugins/change_auth_plan/models.py:26
0
msgid "Change auth plan snapshot"
msgid "Change auth plan snapshot"
msgstr "改密计划快照"
msgstr "改密计划快照"
#: xpack/plugins/change_auth_plan/models.py:27
6
#: xpack/plugins/change_auth_plan/models.py:27
5
#: xpack/plugins/change_auth_plan/models.py:4
33
#: xpack/plugins/change_auth_plan/models.py:4
26
msgid "Change auth plan execution"
msgid "Change auth plan execution"
msgstr "改密计划执行"
msgstr "改密计划执行"
#: xpack/plugins/change_auth_plan/models.py:4
42
#: xpack/plugins/change_auth_plan/models.py:4
35
msgid "Change auth plan execution subtask"
msgid "Change auth plan execution subtask"
msgstr "改密计划执行子任务"
msgstr "改密计划执行子任务"
#: xpack/plugins/change_auth_plan/models.py:4
60
#: xpack/plugins/change_auth_plan/models.py:4
53
msgid "Authentication failed"
msgid "Authentication failed"
msgstr "认证失败"
msgstr "认证失败"
#: xpack/plugins/change_auth_plan/models.py:4
62
#: xpack/plugins/change_auth_plan/models.py:4
55
msgid "Connection timeout"
msgid "Connection timeout"
msgstr "连接超时"
msgstr "连接超时"
...
@@ -6186,19 +6196,19 @@ msgid "Periodic"
...
@@ -6186,19 +6196,19 @@ msgid "Periodic"
msgstr "定时执行"
msgstr "定时执行"
#: xpack/plugins/gathered_user/models.py:57
#: xpack/plugins/gathered_user/models.py:57
#: xpack/plugins/gathered_user/templates/gathered_user/gathered_user_list.html:
4
8
#: xpack/plugins/gathered_user/templates/gathered_user/gathered_user_list.html:
3
8
msgid "Gather user task"
msgid "Gather user task"
msgstr "收集用户任务"
msgstr "收集用户任务"
#: xpack/plugins/gathered_user/models.py:1
40
#: xpack/plugins/gathered_user/models.py:1
37
msgid "Task"
msgid "Task"
msgstr "任务"
msgstr "任务"
#: xpack/plugins/gathered_user/models.py:1
52
#: xpack/plugins/gathered_user/models.py:1
49
msgid "gather user task execution"
msgid "gather user task execution"
msgstr "收集用户执行"
msgstr "收集用户执行"
#: xpack/plugins/gathered_user/models.py:15
8
#: xpack/plugins/gathered_user/models.py:15
5
msgid "Assets is empty, please change nodes"
msgid "Assets is empty, please change nodes"
msgstr "资产为空,请更改节点"
msgstr "资产为空,请更改节点"
...
@@ -6446,6 +6456,11 @@ msgstr "密码匣子"
...
@@ -6446,6 +6456,11 @@ msgstr "密码匣子"
msgid "vault create"
msgid "vault create"
msgstr "创建"
msgstr "创建"
#, fuzzy
#~| msgid "Login"
#~ msgid "Login IP"
#~ msgstr "登录"
#~ msgid "succeed: {} failed: {} total: {}"
#~ msgid "succeed: {} failed: {} total: {}"
#~ msgstr "成功:{} 失败:{} 总数:{}"
#~ msgstr "成功:{} 失败:{} 总数:{}"
...
...
apps/ops/models/adhoc.py
View file @
2ef487a9
...
@@ -246,30 +246,35 @@ class AdHoc(models.Model):
...
@@ -246,30 +246,35 @@ class AdHoc(models.Model):
time_start
=
time
.
time
()
time_start
=
time
.
time
()
date_start
=
timezone
.
now
()
date_start
=
timezone
.
now
()
is_success
=
False
is_success
=
False
summary
=
{}
raw
=
''
try
:
try
:
date_start_s
=
datetime
.
datetime
.
now
()
.
strftime
(
'
%
Y-
%
m-
%
d
%
H:
%
M:
%
S'
)
date_start_s
=
datetime
.
datetime
.
now
()
.
strftime
(
'
%
Y-
%
m-
%
d
%
H:
%
M:
%
S'
)
print
(
_
(
"{} Start task: {}"
)
.
format
(
date_start_s
,
self
.
task
.
name
))
print
(
_
(
"{} Start task: {}"
)
.
format
(
date_start_s
,
self
.
task
.
name
))
raw
,
summary
=
self
.
_run_only
()
raw
,
summary
=
self
.
_run_only
()
is_success
=
summary
.
get
(
'success'
,
False
)
is_success
=
summary
.
get
(
'success'
,
False
)
return
raw
,
summary
except
Exception
as
e
:
except
Exception
as
e
:
logger
.
error
(
e
,
exc_info
=
True
)
logger
.
error
(
e
,
exc_info
=
True
)
summary
=
{}
raw
=
{
"dark"
:
{
"all"
:
str
(
e
)},
"contacted"
:
[]}
raw
=
{
"dark"
:
{
"all"
:
str
(
e
)},
"contacted"
:
[]}
return
raw
,
summary
finally
:
finally
:
date_end
=
timezone
.
now
()
date_end
=
timezone
.
now
()
date_end_s
=
date_end
.
strftime
(
'
%
Y-
%
m-
%
d
%
H:
%
M:
%
S'
)
date_end_s
=
date_end
.
strftime
(
'
%
Y-
%
m-
%
d
%
H:
%
M:
%
S'
)
print
(
_
(
"{} Task finish"
)
.
format
(
date_end_s
))
print
(
_
(
"{} Task finish"
)
.
format
(
date_end_s
))
print
(
'.
\n\n
.'
)
print
(
'.
\n\n
.'
)
try
:
summary_text
=
json
.
dumps
(
summary
)
except
json
.
JSONDecodeError
:
summary_text
=
'{}'
AdHocRunHistory
.
objects
.
filter
(
id
=
history
.
id
)
.
update
(
AdHocRunHistory
.
objects
.
filter
(
id
=
history
.
id
)
.
update
(
date_start
=
date_start
,
date_start
=
date_start
,
is_finished
=
True
,
is_finished
=
True
,
is_success
=
is_success
,
is_success
=
is_success
,
date_finished
=
timezone
.
now
(),
date_finished
=
timezone
.
now
(),
timedelta
=
time
.
time
()
-
time_start
timedelta
=
time
.
time
()
-
time_start
,
_summary
=
summary_text
)
)
return
raw
,
summary
def
_run_only
(
self
):
def
_run_only
(
self
):
Task
.
objects
.
filter
(
id
=
self
.
task
.
id
)
.
update
(
date_updated
=
timezone
.
now
())
Task
.
objects
.
filter
(
id
=
self
.
task
.
id
)
.
update
(
date_updated
=
timezone
.
now
())
...
@@ -321,10 +326,9 @@ class AdHoc(models.Model):
...
@@ -321,10 +326,9 @@ class AdHoc(models.Model):
except
AdHocRunHistory
.
DoesNotExist
:
except
AdHocRunHistory
.
DoesNotExist
:
return
None
return
None
def
save
(
self
,
force_insert
=
False
,
force_update
=
False
,
using
=
None
,
def
save
(
self
,
**
kwargs
):
update_fields
=
None
):
instance
=
super
()
.
save
(
**
kwargs
)
super
()
.
save
(
force_insert
=
force_insert
,
force_update
=
force_update
,
return
instance
using
=
using
,
update_fields
=
update_fields
)
def
__str__
(
self
):
def
__str__
(
self
):
return
"{} of {}"
.
format
(
self
.
task
.
name
,
self
.
short_id
)
return
"{} of {}"
.
format
(
self
.
task
.
name
,
self
.
short_id
)
...
@@ -393,7 +397,10 @@ class AdHocRunHistory(models.Model):
...
@@ -393,7 +397,10 @@ class AdHocRunHistory(models.Model):
@summary.setter
@summary.setter
def
summary
(
self
,
item
):
def
summary
(
self
,
item
):
self
.
_summary
=
json
.
dumps
(
item
)
try
:
self
.
_summary
=
json
.
dumps
(
item
)
except
json
.
JSONDecodeError
:
self
.
_summary
=
json
.
dumps
({})
@property
@property
def
success_hosts
(
self
):
def
success_hosts
(
self
):
...
...
apps/perms/templates/perms/asset_permission_list.html
View file @
2ef487a9
...
@@ -23,12 +23,12 @@
...
@@ -23,12 +23,12 @@
{% block content %}
{% block content %}
<div
class=
"wrapper wrapper-content"
>
<div
class=
"wrapper wrapper-content"
>
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-lg-3"
id=
"split-left"
style=
"padding-left: 3px"
>
<div
class=
"col-lg-3"
id=
"split-left"
style=
"padding-left: 3px
;padding-right: 0
"
>
{% include 'assets/_node_tree.html' %}
{% include 'assets/_node_tree.html' %}
</div>
</div>
<div
class=
"col-lg-9 animated fadeInRight"
id=
"split-right"
>
<div
class=
"col-lg-9 animated fadeInRight"
id=
"split-right"
>
<div
class=
"tree-toggle"
>
<div
class=
"tree-toggle"
>
<div
class=
"btn btn-sm btn-primary tree-toggle-btn"
onclick=
"toggle()"
>
<div
class=
"btn btn-sm btn-primary tree-toggle-btn"
>
<i
class=
"fa fa-angle-left fa-x"
id=
"toggle-icon"
></i>
<i
class=
"fa fa-angle-left fa-x"
id=
"toggle-icon"
></i>
</div>
</div>
</div>
</div>
...
@@ -209,20 +209,6 @@ function initTree() {
...
@@ -209,20 +209,6 @@ function initTree() {
})
})
}
}
function
toggle
()
{
if
(
show
===
0
)
{
$
(
"#split-left"
).
hide
(
500
,
function
()
{
$
(
"#split-right"
).
attr
(
"class"
,
"col-lg-12"
);
$
(
"#toggle-icon"
).
attr
(
"class"
,
"fa fa-angle-right fa-x"
);
show
=
1
;
});
}
else
{
$
(
"#split-right"
).
attr
(
"class"
,
"col-lg-9"
);
$
(
"#toggle-icon"
).
attr
(
"class"
,
"fa fa-angle-left fa-x"
);
$
(
"#split-left"
).
show
(
500
);
show
=
0
;
}
}
$
(
document
).
ready
(
function
(){
$
(
document
).
ready
(
function
(){
initTable
();
initTable
();
...
...
apps/tickets/migrations/0002_auto_20191114_1105.py
0 → 100644
View file @
2ef487a9
# Generated by Django 2.2.5 on 2019-11-14 03:05
from
django.db
import
migrations
,
models
import
django.db.models.deletion
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'tickets'
,
'0001_initial'
),
]
operations
=
[
migrations
.
AlterField
(
model_name
=
'comment'
,
name
=
'ticket'
,
field
=
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
related_name
=
'comments'
,
to
=
'tickets.Ticket'
),
),
migrations
.
AlterField
(
model_name
=
'ticket'
,
name
=
'type'
,
field
=
models
.
CharField
(
choices
=
[(
'general'
,
'General'
),
(
'login_confirm'
,
'Login confirm'
)],
default
=
'general'
,
max_length
=
16
,
verbose_name
=
'Type'
),
),
]
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