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
de3695bf
Commit
de3695bf
authored
Aug 06, 2018
by
ibuler
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'github/dev' into dev
parents
7c814080
f5531b60
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
43 additions
and
3 deletions
+43
-3
label.py
apps/assets/api/label.py
+4
-1
label.py
apps/assets/models/label.py
+2
-1
django.mo
apps/i18n/zh/LC_MESSAGES/django.mo
+0
-0
django.po
apps/i18n/zh/LC_MESSAGES/django.po
+0
-0
jumpserver.js
apps/static/js/jumpserver.js
+36
-0
user_otp_authentication.html
apps/users/templates/users/user_otp_authentication.html
+1
-1
No files found.
apps/assets/api/label.py
View file @
de3695bf
...
...
@@ -27,7 +27,6 @@ __all__ = ['LabelViewSet']
class
LabelViewSet
(
BulkModelViewSet
):
queryset
=
Label
.
objects
.
annotate
(
asset_count
=
Count
(
"assets"
))
permission_classes
=
(
IsOrgAdmin
,)
serializer_class
=
serializers
.
LabelSerializer
...
...
@@ -36,3 +35,7 @@ class LabelViewSet(BulkModelViewSet):
self
.
serializer_class
=
serializers
.
LabelDistinctSerializer
self
.
queryset
=
self
.
queryset
.
values
(
"name"
)
.
distinct
()
return
super
()
.
list
(
request
,
*
args
,
**
kwargs
)
def
get_queryset
(
self
):
self
.
queryset
=
Label
.
objects
.
annotate
(
asset_count
=
Count
(
"assets"
))
return
self
.
queryset
apps/assets/models/label.py
View file @
de3695bf
...
...
@@ -4,9 +4,10 @@
import
uuid
from
django.db
import
models
from
django.utils.translation
import
ugettext_lazy
as
_
from
orgs.mixins
import
OrgModelMixin
class
Label
(
models
.
Model
):
class
Label
(
OrgModelMixin
):
SYSTEM_CATEGORY
=
"S"
USER_CATEGORY
=
"U"
CATEGORY_CHOICES
=
(
...
...
apps/i18n/zh/LC_MESSAGES/django.mo
View file @
de3695bf
No preview for this file type
apps/i18n/zh/LC_MESSAGES/django.po
View file @
de3695bf
This diff is collapsed.
Click to expand it.
apps/static/js/jumpserver.js
View file @
de3695bf
...
...
@@ -224,6 +224,42 @@ function objectDelete(obj, name, url, redirectTo) {
});
}
function
orgDelete
(
obj
,
name
,
url
,
redirectTo
){
function
doDelete
()
{
var
body
=
{};
var
success
=
function
()
{
if
(
!
redirectTo
)
{
$
(
obj
).
parent
().
parent
().
remove
();
}
else
{
window
.
location
.
href
=
redirectTo
;
}
};
var
fail
=
function
()
{
swal
(
"错误"
,
"[ "
+
name
+
" ] 组织中存在未删除信息,请删除后重试"
,
"error"
);
};
APIUpdateAttr
({
url
:
url
,
body
:
JSON
.
stringify
(
body
),
method
:
'DELETE'
,
success_message
:
"删除成功"
,
success
:
success
,
error
:
fail
});
}
swal
({
title
:
"请先删除组织内的以下信息:"
,
text
:
"用户列表、用户组、资产列表、网域列表、管理用户、系统用户、标签管理、资产授权规则"
,
type
:
"warning"
,
showCancelButton
:
true
,
cancelButtonText
:
'取消'
,
confirmButtonColor
:
"#ed5565"
,
confirmButtonText
:
'确认'
,
closeOnConfirm
:
true
},
function
()
{
doDelete
();
});
}
$
.
fn
.
serializeObject
=
function
()
{
var
o
=
{};
...
...
apps/users/templates/users/user_otp_authentication.html
View file @
de3695bf
...
...
@@ -6,7 +6,7 @@
<div
class=
"verify"
>
<p
style=
"margin: 20px auto;"
><strong
style=
"color: #000000"
>
账号保护已开启,请根据提示完成以下操作
</strong></p>
<img
src=
"{% static 'img/otp_auth.png' %}"
alt=
""
width=
"72px"
height=
"117"
>
<p
style=
"margin: 20px auto;"
>
请在手机中打开Google Authenticator应用,输入6
为
动态码
</p>
<p
style=
"margin: 20px auto;"
>
请在手机中打开Google Authenticator应用,输入6
位
动态码
</p>
</div>
<form
class=
""
role=
"form"
method=
"post"
action=
""
>
...
...
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