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
12df8cf0
Commit
12df8cf0
authored
Apr 11, 2015
by
guanghongwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
parent
3c1af0e2
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
24 additions
and
40 deletions
+24
-40
jumpserver.conf
jumpserver.conf
+1
-1
api.py
jumpserver/api.py
+4
-7
views.py
jumpserver/views.py
+5
-3
views.py
juser/views.py
+1
-1
group_add.html
templates/jasset/group_add.html
+1
-0
host_list.html
templates/jasset/host_list.html
+0
-14
dept_list.html
templates/juser/dept_list.html
+0
-1
group_list.html
templates/juser/group_list.html
+0
-1
nav.html
templates/nav.html
+10
-10
nav_li_profile.html
templates/nav_li_profile.html
+2
-2
No files found.
jumpserver.conf
View file @
12df8cf0
...
@@ -22,7 +22,7 @@ root_pw = secret234
...
@@ -22,7 +22,7 @@ root_pw = secret234
[
websocket
]
[
websocket
]
web_socket_host
=
192
.
168
.
173
.
12
9
:
3000
web_socket_host
=
192
.
168
.
20
.
20
9
:
3000
[
web
]
[
web
]
...
...
jumpserver/api.py
View file @
12df8cf0
...
@@ -15,7 +15,7 @@ import subprocess
...
@@ -15,7 +15,7 @@ import subprocess
from
django.core.paginator
import
Paginator
,
EmptyPage
,
InvalidPage
from
django.core.paginator
import
Paginator
,
EmptyPage
,
InvalidPage
from
django.http
import
HttpResponse
,
Http404
from
django.http
import
HttpResponse
,
Http404
from
juser.models
import
User
,
UserGroup
,
DEPT
from
juser.models
import
User
,
UserGroup
,
DEPT
from
jasset.models
import
Asset
,
BisGroup
from
jasset.models
import
Asset
,
BisGroup
,
IDC
from
jlog.models
import
Log
from
jlog.models
import
Log
from
jasset.models
import
AssetAlias
from
jasset.models
import
AssetAlias
from
django.core.exceptions
import
ObjectDoesNotExist
from
django.core.exceptions
import
ObjectDoesNotExist
...
@@ -393,13 +393,10 @@ def validate(request, user_group=None, user=None, asset_group=None, asset=None,
...
@@ -393,13 +393,10 @@ def validate(request, user_group=None, user=None, asset_group=None, asset=None,
if
asset_group
:
if
asset_group
:
dept_asset_groups
=
dept
.
bisgroup_set
.
all
()
dept_asset_groups
=
dept
.
bisgroup_set
.
all
()
asset_groups
=
[]
asset_groups
=
[]
for
asset_group_name
in
dept_asset_groups
:
for
group_id
in
asset_group
:
asset_groups
.
extend
(
asset_group_name
.
name
)
asset_groups
.
extend
(
BisGroup
.
objects
.
filter
(
id
=
int
(
group_id
))
)
if
len
(
asset_groups
)
==
0
:
if
not
set
(
asset_groups
)
.
issubset
(
set
(
dept_asset_groups
)):
return
False
if
not
set
(
asset_group
)
.
issubset
(
set
(
asset_groups
)):
return
False
return
False
if
asset
:
if
asset
:
...
...
jumpserver/views.py
View file @
12df8cf0
...
@@ -6,7 +6,6 @@ from django.shortcuts import render_to_response
...
@@ -6,7 +6,6 @@ from django.shortcuts import render_to_response
from
django.template
import
RequestContext
from
django.template
import
RequestContext
from
django.http
import
HttpResponseNotFound
from
django.http
import
HttpResponseNotFound
from
jperm.models
import
Apply
from
jperm.models
import
Apply
from
multiprocessing
import
Pool
import
paramiko
import
paramiko
from
jumpserver.api
import
*
from
jumpserver.api
import
*
...
@@ -284,10 +283,13 @@ def filter_ajax_api(request):
...
@@ -284,10 +283,13 @@ def filter_ajax_api(request):
def
install
(
request
):
def
install
(
request
):
from
juser.models
import
DEPT
,
User
from
juser.models
import
DEPT
,
User
dept
=
DEPT
(
id
=
1
,
name
=
"超管部"
,
comment
=
"
超级管理员部门
"
)
dept
=
DEPT
(
id
=
1
,
name
=
"超管部"
,
comment
=
"
SUPER DEPT
"
)
dept
.
save
()
dept
.
save
()
dept2
=
DEPT
(
id
=
2
,
name
=
"默认"
,
comment
=
"
默认部门
"
)
dept2
=
DEPT
(
id
=
2
,
name
=
"默认"
,
comment
=
"
DEFAULT DEPT
"
)
dept2
.
save
()
dept2
.
save
()
IDC
(
id
=
1
,
name
=
"默认"
,
comment
=
"DEFAULT IDC"
)
.
save
()
BisGroup
(
id
=
1
,
name
=
"ALL"
,
dept
=
dept
,
comment
=
"ALL USER GROUP"
)
.
save
()
User
(
id
=
5000
,
username
=
"admin"
,
password
=
md5_crypt
(
'admin'
),
User
(
id
=
5000
,
username
=
"admin"
,
password
=
md5_crypt
(
'admin'
),
name
=
'admin'
,
email
=
'admin@jumpserver.org'
,
role
=
'SU'
,
is_active
=
True
,
dept
=
dept
)
.
save
()
name
=
'admin'
,
email
=
'admin@jumpserver.org'
,
role
=
'SU'
,
is_active
=
True
,
dept
=
dept
)
.
save
()
User
(
id
=
5001
,
username
=
"group_admin"
,
password
=
md5_crypt
(
'group_admin'
),
User
(
id
=
5001
,
username
=
"group_admin"
,
password
=
md5_crypt
(
'group_admin'
),
...
...
juser/views.py
View file @
12df8cf0
...
@@ -204,7 +204,7 @@ def dept_list(request):
...
@@ -204,7 +204,7 @@ def dept_list(request):
if
keyword
:
if
keyword
:
contact_list
=
DEPT
.
objects
.
filter
(
Q
(
name__icontains
=
keyword
)
|
Q
(
comment__icontains
=
keyword
))
.
order_by
(
'name'
)
contact_list
=
DEPT
.
objects
.
filter
(
Q
(
name__icontains
=
keyword
)
|
Q
(
comment__icontains
=
keyword
))
.
order_by
(
'name'
)
else
:
else
:
contact_list
=
DEPT
.
objects
.
filter
(
id__gt
=
1
)
contact_list
=
DEPT
.
objects
.
all
()
.
order_by
(
'id'
)
contact_list
,
p
,
contacts
,
page_range
,
current_page
,
show_first
,
show_end
=
pages
(
contact_list
,
request
)
contact_list
,
p
,
contacts
,
page_range
,
current_page
,
show_first
,
show_end
=
pages
(
contact_list
,
request
)
...
...
templates/jasset/group_add.html
View file @
12df8cf0
...
@@ -125,6 +125,7 @@
...
@@ -125,6 +125,7 @@
$
(
'#search'
).
keyup
(
function
()
{
$
(
'#search'
).
keyup
(
function
()
{
var
$rows
=
$
(
'#groups option'
);
var
$rows
=
$
(
'#groups option'
);
console
.
log
(
$rows
);
var
val
=
$
.
trim
(
$
(
this
).
val
()).
replace
(
/ +/g
,
' '
).
toLowerCase
();
var
val
=
$
.
trim
(
$
(
this
).
val
()).
replace
(
/ +/g
,
' '
).
toLowerCase
();
$rows
.
show
().
filter
(
function
()
{
$rows
.
show
().
filter
(
function
()
{
...
...
templates/jasset/host_list.html
View file @
12df8cf0
...
@@ -102,20 +102,6 @@
...
@@ -102,20 +102,6 @@
$
(
'#editable'
).
editableTableWidget
();
$
(
'#editable'
).
editableTableWidget
();
});
});
$
(
".iframe"
).
on
(
'click'
,
function
(){
var
url
=
$
(
this
).
attr
(
"value"
);
$
.
layer
({
type
:
2
,
title
:
'JumpServer主机详情'
,
maxmin
:
true
,
shift
:
'top'
,
border
:
[
2
,
0.3
,
'#1AB394'
],
shade
:
[
0.5
,
'#000000'
],
shadeClose
:
true
,
area
:
[
'800px'
,
'600px'
],
iframe
:
{
src
:
url
}
});
});
function
alter
(
form
)
{
function
alter
(
form
)
{
selectData
=
GetTableDataBox
();
selectData
=
GetTableDataBox
();
...
...
templates/juser/dept_list.html
View file @
12df8cf0
...
@@ -99,7 +99,6 @@
...
@@ -99,7 +99,6 @@
<script>
<script>
$
(
document
).
ready
(
function
(){
$
(
document
).
ready
(
function
(){
$
(
".iframe"
).
colorbox
({
iframe
:
true
,
width
:
"70%"
,
height
:
"70%"
});
var
check_array
=
[]
var
check_array
=
[]
$
(
'#del_btn'
).
click
(
function
(){
$
(
'#del_btn'
).
click
(
function
(){
if
(
confirm
(
"确定删除"
))
{
if
(
confirm
(
"确定删除"
))
{
...
...
templates/juser/group_list.html
View file @
12df8cf0
...
@@ -91,7 +91,6 @@
...
@@ -91,7 +91,6 @@
<script>
<script>
$
(
document
).
ready
(
function
(){
$
(
document
).
ready
(
function
(){
$
(
".iframe"
).
colorbox
({
iframe
:
true
,
width
:
"70%"
,
height
:
"70%"
});
var
check_array
=
[]
var
check_array
=
[]
$
(
'#del_btn'
).
click
(
function
(){
$
(
'#del_btn'
).
click
(
function
(){
if
(
confirm
(
"确定删除"
))
{
if
(
confirm
(
"确定删除"
))
{
...
...
templates/nav.html
View file @
12df8cf0
...
@@ -27,11 +27,11 @@
...
@@ -27,11 +27,11 @@
<a><i
class=
"fa fa-cube"
></i>
<span
class=
"nav-label"
>
资产管理
</span><span
class=
"fa arrow"
></span></a>
<a><i
class=
"fa fa-cube"
></i>
<span
class=
"nav-label"
>
资产管理
</span><span
class=
"fa arrow"
></span></a>
<ul
class=
"nav nav-second-level"
>
<ul
class=
"nav nav-second-level"
>
<li
class=
"host_add host_add_multi"
><a
href=
"/jasset/host_add/"
>
添加资产
</a></li>
<li
class=
"host_add host_add_multi"
><a
href=
"/jasset/host_add/"
>
添加资产
</a></li>
<li
class=
"host_list host_detail"
><a
href=
"/jasset/host_list/"
>
查看资产
&
nbsp
&
nbsp
</span><span
class=
"label label-info pull-right"
>
{{ host_active_num }}/{{ host_total_num}}
</span></a></li>
<li
class=
"host_list host_detail"
><a
href=
"/jasset/host_list/"
>
查看资产
<span
class=
"label label-info pull-right"
>
{{ host_active_num }}/{{ host_total_num}}
</span></a></li>
<li
class=
"idc_add"
><a
href=
"/jasset/idc_add/"
>
添加IDC
</a></li>
<li
class=
"idc_list idc_detail idc_edit"
><a
href=
"/jasset/idc_list/"
>
查看IDC
</a></li>
<li
class=
"group_add"
><a
href=
"/jasset/group_add/"
>
添加主机组
</a></li>
<li
class=
"group_add"
><a
href=
"/jasset/group_add/"
>
添加主机组
</a></li>
<li
class=
"group_list group_detail"
><a
href=
"/jasset/group_list/"
>
查看主机组
</a></li>
<li
class=
"group_list group_detail"
><a
href=
"/jasset/group_list/"
>
查看主机组
</a></li>
<li
class=
"idc_add"
><a
href=
"/jasset/idc_add/"
>
添加IDC
</a></li>
<li
class=
"idc_list idc_detail"
><a
href=
"/jasset/idc_list/"
>
查看IDC
</a></li>
</ul>
</ul>
</li>
</li>
<li
id=
"jperm"
>
<li
id=
"jperm"
>
...
@@ -41,11 +41,11 @@
...
@@ -41,11 +41,11 @@
<a
href=
"/jperm/dept_perm_list/"
>
部门授权
</a>
<a
href=
"/jperm/dept_perm_list/"
>
部门授权
</a>
</li>
</li>
<li
class=
"perm_list perm_edit"
>
<li
class=
"perm_list perm_edit
"
>
<a
href=
"/jperm/perm_list/"
>
小组授权
</a>
<a
href=
"/jperm/perm_list/"
>
小组授权
</a>
</li>
</li>
<li
class=
"sudo_list sudo_edit sudo_add cmd_list cmd_edit"
>
<li
class=
"sudo_list sudo_edit sudo_add cmd_list cmd_edit
cmd_add
"
>
<a
href=
"/jperm/sudo_list/"
>
Sudo授权
</a>
<a
href=
"/jperm/sudo_list/"
>
Sudo授权
</a>
</li>
</li>
<li
class=
"apply_show online"
><a
href=
"/jperm/apply_show/online/"
>
权限审批
</a></li>
<li
class=
"apply_show online"
><a
href=
"/jperm/apply_show/online/"
>
权限审批
</a></li>
...
@@ -89,7 +89,7 @@
...
@@ -89,7 +89,7 @@
<li
class=
"dept_list dept_edit"
><a
href=
"/juser/dept_list/"
>
查看部门
</a></li>
<li
class=
"dept_list dept_edit"
><a
href=
"/juser/dept_list/"
>
查看部门
</a></li>
<li
class=
"group_list group_edit"
><a
href=
"/juser/group_list/"
>
查看小组
</a></li>
<li
class=
"group_list group_edit"
><a
href=
"/juser/group_list/"
>
查看小组
</a></li>
<li
class=
"group_add"
><a
href=
"/juser/group_add/"
>
添加小组
</a></li>
<li
class=
"group_add"
><a
href=
"/juser/group_add/"
>
添加小组
</a></li>
<li
class=
"user_list"
><a
href=
"/juser/user_list/"
>
查看用户
<span
class=
"label {% ifequal user_active_num user_total_num %}label-primary {% else %}label-warning {% endifequal %}pull-right"
>
{{ user_active_num }}/{{ user_total_num }}
</span></a></li>
<li
class=
"user_list
user_detail
"
><a
href=
"/juser/user_list/"
>
查看用户
<span
class=
"label {% ifequal user_active_num user_total_num %}label-primary {% else %}label-warning {% endifequal %}pull-right"
>
{{ user_active_num }}/{{ user_total_num }}
</span></a></li>
<li
class=
"user_add"
><a
href=
"/juser/user_add/"
>
添加用户
</a></li>
<li
class=
"user_add"
><a
href=
"/juser/user_add/"
>
添加用户
</a></li>
</ul>
</ul>
</li>
</li>
...
@@ -97,20 +97,20 @@
...
@@ -97,20 +97,20 @@
<a><i
class=
"fa fa-cube"
></i>
<span
class=
"nav-label"
>
资产管理
</span><span
class=
"fa arrow"
></span></a>
<a><i
class=
"fa fa-cube"
></i>
<span
class=
"nav-label"
>
资产管理
</span><span
class=
"fa arrow"
></span></a>
<ul
class=
"nav nav-second-level"
>
<ul
class=
"nav nav-second-level"
>
<li
class=
"host_add host_add_multi"
><a
href=
"/jasset/host_add/"
>
添加资产
</a></li>
<li
class=
"host_add host_add_multi"
><a
href=
"/jasset/host_add/"
>
添加资产
</a></li>
<li
class=
"host_list host_detail"
><a
href=
"/jasset/host_list/"
>
查看资产
&
nbsp
&
nbsp
</span><span
class=
"label label-info pull-right"
>
{{ host_active_num }}/{{ host_total_num}}
</span></a></li>
<li
class=
"host_list host_detail host_edit"
><a
href=
"/jasset/host_list/"
>
查看资产
<span
class=
"label label-info pull-right"
>
{{ host_active_num }}/{{ host_total_num}}
</span></a></li>
<li
class=
"idc_list idc_detail idc_edit"
><a
href=
"/jasset/idc_list/"
>
查看IDC
</a></li>
<li
class=
"group_add"
><a
href=
"/jasset/group_add/"
>
添加主机组
</a></li>
<li
class=
"group_add"
><a
href=
"/jasset/group_add/"
>
添加主机组
</a></li>
<li
class=
"group_list group_detail"
><a
href=
"/jasset/group_list/"
>
查看主机组
</a></li>
<li
class=
"group_list group_detail"
><a
href=
"/jasset/group_list/"
>
查看主机组
</a></li>
<li
class=
"idc_list idc_detail"
><a
href=
"/jasset/idc_list/"
>
查看IDC
</a></li>
</ul>
</ul>
</li>
</li>
<li
id=
"jperm"
>
<li
id=
"jperm"
>
<a
href=
"#"
><i
class=
"fa fa-edit"
></i>
<span
class=
"nav-label"
>
授权管理
</span><span
class=
"fa arrow"
></span></a>
<a
href=
"#"
><i
class=
"fa fa-edit"
></i>
<span
class=
"nav-label"
>
授权管理
</span><span
class=
"fa arrow"
></span></a>
<ul
class=
"nav nav-second-level"
>
<ul
class=
"nav nav-second-level"
>
<li
id=
"perm_lis
t"
>
<li
class=
"perm_list perm_edi
t"
>
<a
href=
"/jperm/perm_list/"
>
小组授权
</a>
<a
href=
"/jperm/perm_list/"
>
小组授权
</a>
</li>
</li>
<li
id=
"sudo
_add"
>
<li
class=
"sudo_list sudo_edit sudo_add cmd_list cmd_edit cmd
_add"
>
<a
href=
"/jperm/sudo_list/"
>
Sudo授权
</a>
<a
href=
"/jperm/sudo_list/"
>
Sudo授权
</a>
</li>
</li>
<li
class=
"apply_show online"
><a
href=
"/jperm/apply_show/online/"
>
权限审批
</a></li>
<li
class=
"apply_show online"
><a
href=
"/jperm/apply_show/online/"
>
权限审批
</a></li>
...
...
templates/nav_li_profile.html
View file @
12df8cf0
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
</span>
</span>
</a>
</a>
<ul
class=
"dropdown-menu animated fadeInRight m-t-xs"
>
<ul
class=
"dropdown-menu animated fadeInRight m-t-xs"
>
<li><a
value=
"/juser/profile/?id={{ session_user_id }}"
class=
"iframe"
>
个人信息
</a></li>
<li><a
value=
"/juser/profile/?id={{ session_user_id }}"
class=
"iframe
_user
"
>
个人信息
</a></li>
<li><a
href=
"/juser/chg_info/"
>
修改信息
</a></li>
<li><a
href=
"/juser/chg_info/"
>
修改信息
</a></li>
<li><a
href=
"/juser/chg_role/"
>
切换角色
</a></li>
<li><a
href=
"/juser/chg_role/"
>
切换角色
</a></li>
...
@@ -29,7 +29,7 @@
...
@@ -29,7 +29,7 @@
</div>
</div>
</li>
</li>
<script>
<script>
$
(
".iframe"
).
on
(
'click'
,
function
(){
$
(
".iframe
_user
"
).
on
(
'click'
,
function
(){
var
url
=
$
(
this
).
attr
(
"value"
);
var
url
=
$
(
this
).
attr
(
"value"
);
$
.
layer
({
$
.
layer
({
type
:
2
,
type
:
2
,
...
...
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