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
bf23d6d7
Commit
bf23d6d7
authored
Dec 06, 2015
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix some bug
parent
35c818f4
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
93 additions
and
183 deletions
+93
-183
views.py
jumpserver/views.py
+1
-32
user_api.py
juser/user_api.py
+3
-3
views.py
juser/views.py
+14
-13
base.html
templates/base.html
+0
-3
footer.html
templates/footer.html
+1
-1
change_info.html
templates/juser/change_info.html
+5
-2
reset_password.html
templates/juser/reset_password.html
+31
-11
user_add.html
templates/juser/user_add.html
+16
-15
user_detail.html
templates/juser/user_detail.html
+9
-1
user_edit.html
templates/juser/user_edit.html
+4
-8
nav.html
templates/nav.html
+2
-2
nav_li_profile.html
templates/nav_li_profile.html
+7
-7
test.html
templates/test.html
+0
-0
test2.html
templates/test2.html
+0
-85
No files found.
jumpserver/views.py
View file @
bf23d6d7
...
@@ -78,39 +78,8 @@ def get_count_by_date(date_li, item):
...
@@ -78,39 +78,8 @@ def get_count_by_date(date_li, item):
@require_role
(
role
=
'user'
)
@require_role
(
role
=
'user'
)
def
index_cu
(
request
):
def
index_cu
(
request
):
# user_id = request.user.id
# user = get_object(User, id=user_id)
login_types
=
{
'L'
:
'LDAP'
,
'M'
:
'MAP'
}
username
=
request
.
user
.
username
username
=
request
.
user
.
username
# TODO: need fix,liuzheng need Asset help
return
HttpResponseRedirect
(
'/juser/user_detail/'
)
GUP
=
get_group_user_perm
(
request
.
user
)
print
GUP
assets
=
GUP
.
get
(
'asset'
)
idcs
=
[]
for
i
in
assets
:
if
i
.
idc_id
:
idcs
.
append
(
i
.
idc_id
)
idc_all
=
IDC
.
objects
.
filter
(
id__in
=
idcs
)
for
i
in
idc_all
:
print
i
.
name
# idc_all = []
# for i in assets:
# idc_all.append(i.idc)
# print i.idc.name
asset_group_all
=
GUP
.
get
(
'asset_group'
)
# posts = Asset.object.all()
# host_count = len(posts)
#
# new_posts = []
# post_five = []
# for post in posts:
# if len(post_five) < 5:
# post_five.append(post)
# else:
# new_posts.append(post_five)
# post_five = []
# new_posts.append(post_five)
return
render_to_response
(
'index_cu.html'
,
locals
(),
context_instance
=
RequestContext
(
request
))
@require_role
(
role
=
'user'
)
@require_role
(
role
=
'user'
)
...
...
juser/user_api.py
View file @
bf23d6d7
...
@@ -129,8 +129,8 @@ def gen_ssh_key(username, password='',
...
@@ -129,8 +129,8 @@ def gen_ssh_key(username, password='',
生成一个用户ssh密钥对
生成一个用户ssh密钥对
"""
"""
logger
.
debug
(
'生成ssh key, 并设置authorized_keys'
)
logger
.
debug
(
'生成ssh key, 并设置authorized_keys'
)
private_key_file
=
os
.
path
.
join
(
key_dir
,
username
)
private_key_file
=
os
.
path
.
join
(
key_dir
,
username
,
'pem'
)
mkdir
(
key_dir
,
mode
=
777
)
mkdir
(
key_dir
,
mode
=
0
777
)
if
os
.
path
.
isfile
(
private_key_file
):
if
os
.
path
.
isfile
(
private_key_file
):
os
.
unlink
(
private_key_file
)
os
.
unlink
(
private_key_file
)
ret
=
bash
(
'echo -e "y
\n
"|ssh-keygen -t rsa -f
%
s -b
%
s -P "
%
s"'
%
(
private_key_file
,
length
,
password
))
ret
=
bash
(
'echo -e "y
\n
"|ssh-keygen -t rsa -f
%
s -b
%
s -P "
%
s"'
%
(
private_key_file
,
length
,
password
))
...
@@ -142,7 +142,7 @@ def gen_ssh_key(username, password='',
...
@@ -142,7 +142,7 @@ def gen_ssh_key(username, password='',
with
open
(
private_key_file
+
'.pub'
)
as
pub_f
:
with
open
(
private_key_file
+
'.pub'
)
as
pub_f
:
with
open
(
authorized_key_file
,
'w'
)
as
auth_f
:
with
open
(
authorized_key_file
,
'w'
)
as
auth_f
:
auth_f
.
write
(
pub_f
.
read
())
auth_f
.
write
(
pub_f
.
read
())
os
.
chmod
(
authorized_key_file
,
0600
)
os
.
chmod
(
authorized_key_file
,
mode
=
0600
)
chown
(
authorized_key_file
,
username
)
chown
(
authorized_key_file
,
username
)
...
...
juser/views.py
View file @
bf23d6d7
...
@@ -162,7 +162,7 @@ def user_add(request):
...
@@ -162,7 +162,7 @@ def user_add(request):
ssh_key_pwd
=
PyCrypt
.
gen_rand_pass
(
16
)
ssh_key_pwd
=
PyCrypt
.
gen_rand_pass
(
16
)
extra
=
request
.
POST
.
getlist
(
'extra'
,
[])
extra
=
request
.
POST
.
getlist
(
'extra'
,
[])
is_active
=
False
if
'0'
in
extra
else
True
is_active
=
False
if
'0'
in
extra
else
True
ssh_key_login_need
=
True
if
'1'
in
extra
else
False
ssh_key_login_need
=
True
send_mail_need
=
True
if
'2'
in
extra
else
False
send_mail_need
=
True
if
'2'
in
extra
else
False
try
:
try
:
...
@@ -191,7 +191,7 @@ def user_add(request):
...
@@ -191,7 +191,7 @@ def user_add(request):
user_groups
=
[]
user_groups
=
[]
for
user_group_id
in
groups
:
for
user_group_id
in
groups
:
user_groups
.
extend
(
UserGroup
.
objects
.
filter
(
id
=
user_group_id
))
user_groups
.
extend
(
UserGroup
.
objects
.
filter
(
id
=
user_group_id
))
print
user_groups
except
IndexError
,
e
:
except
IndexError
,
e
:
error
=
u'添加用户
%
s 失败
%
s '
%
(
username
,
e
)
error
=
u'添加用户
%
s 失败
%
s '
%
(
username
,
e
)
try
:
try
:
...
@@ -302,7 +302,7 @@ def forget_password(request):
...
@@ -302,7 +302,7 @@ def forget_password(request):
"""
%
(
user
.
name
,
URL
,
user
.
uuid
,
timestamp
,
hash_encode
)
"""
%
(
user
.
name
,
URL
,
user
.
uuid
,
timestamp
,
hash_encode
)
send_mail
(
'忘记跳板机密码'
,
msg
,
MAIL_FROM
,
[
email
],
fail_silently
=
False
)
send_mail
(
'忘记跳板机密码'
,
msg
,
MAIL_FROM
,
[
email
],
fail_silently
=
False
)
msg
=
u'请登陆邮箱,点击邮件重设密码'
msg
=
u'请登陆邮箱,点击邮件重设密码'
return
HttpResponse
(
msg
)
return
http_success
(
request
,
msg
)
else
:
else
:
error
=
u'用户不存在或邮件地址错误'
error
=
u'用户不存在或邮件地址错误'
...
@@ -310,10 +310,16 @@ def forget_password(request):
...
@@ -310,10 +310,16 @@ def forget_password(request):
def
reset_password
(
request
):
def
reset_password
(
request
):
uuid
=
request
.
GET
.
get
(
'uuid'
,
''
)
uuid
_r
=
request
.
GET
.
get
(
'uuid'
,
''
)
timestamp
=
request
.
GET
.
get
(
'timestamp'
,
''
)
timestamp
=
request
.
GET
.
get
(
'timestamp'
,
''
)
hash_encode
=
request
.
GET
.
get
(
'hash'
,
''
)
hash_encode
=
request
.
GET
.
get
(
'hash'
,
''
)
action
=
'/juser/reset_password/?uuid=
%
s×tamp=
%
s&hash=
%
s'
%
(
uuid
,
timestamp
,
hash_encode
)
action
=
'/juser/reset_password/?uuid=
%
s×tamp=
%
s&hash=
%
s'
%
(
uuid_r
,
timestamp
,
hash_encode
)
if
hash_encode
==
PyCrypt
.
md5_crypt
(
uuid_r
+
timestamp
+
KEY
):
if
int
(
time
.
time
())
-
int
(
timestamp
)
>
600
:
return
http_error
(
request
,
u'链接已超时'
)
else
:
return
render_to_response
(
'juser/reset_password.html'
,
locals
())
if
request
.
method
==
'POST'
:
if
request
.
method
==
'POST'
:
password
=
request
.
POST
.
get
(
'password'
)
password
=
request
.
POST
.
get
(
'password'
)
...
@@ -325,16 +331,10 @@ def reset_password(request):
...
@@ -325,16 +331,10 @@ def reset_password(request):
if
user
:
if
user
:
user
.
password
=
PyCrypt
.
md5_crypt
(
password
)
user
.
password
=
PyCrypt
.
md5_crypt
(
password
)
user
.
save
()
user
.
save
()
return
HttpResponse
(
'密码重设成功'
)
return
http_success
(
request
,
u
'密码重设成功'
)
else
:
else
:
return
HttpResponse
(
'用户不存在'
)
return
HttpResponse
(
'用户不存在'
)
if
hash_encode
==
PyCrypt
.
md5_crypt
(
uuid
+
timestamp
+
KEY
):
if
int
(
time
.
time
())
-
int
(
timestamp
)
>
600
:
return
HttpResponse
(
'链接已超时'
)
else
:
return
render_to_response
(
'juser/reset_password.html'
,
locals
())
return
http_error
(
request
,
u'错误请求'
)
return
http_error
(
request
,
u'错误请求'
)
...
@@ -428,7 +428,8 @@ def change_info(request):
...
@@ -428,7 +428,8 @@ def change_info(request):
if
''
in
[
name
,
email
]:
if
''
in
[
name
,
email
]:
error
=
'不能为空'
error
=
'不能为空'
if
len
(
password
)
>
0
and
len
(
password
)
<
6
:
if
len
(
password
)
<
6
:
error
=
'密码须大于6位'
error
=
'密码须大于6位'
if
not
error
:
if
not
error
:
...
...
templates/base.html
View file @
bf23d6d7
...
@@ -2,7 +2,6 @@
...
@@ -2,7 +2,6 @@
<html>
<html>
<head>
<head>
<meta
charset=
"utf-8"
>
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
...
@@ -12,8 +11,6 @@
...
@@ -12,8 +11,6 @@
{% include 'link_css.html' %}
{% include 'link_css.html' %}
{% include 'head_script.html' %}
{% include 'head_script.html' %}
{% block self_head_css_js %} {% endblock %}
{% block self_head_css_js %} {% endblock %}
</head>
</head>
<body>
<body>
...
...
templates/footer.html
View file @
bf23d6d7
<div
class=
"footer fixed"
>
<div
class=
"footer fixed"
>
<div
class=
"pull-right"
>
<div
class=
"pull-right"
>
Version
<strong>
0.
2
.0
</strong>
GPL.
Version
<strong>
0.
3
.0
</strong>
GPL.
</div>
</div>
<div>
<div>
<strong>
Copyright
</strong>
Jumpserver.org Team
©
2014-2015
<strong>
Copyright
</strong>
Jumpserver.org Team
©
2014-2015
...
...
templates/juser/change_info.html
View file @
bf23d6d7
...
@@ -45,7 +45,7 @@
...
@@ -45,7 +45,7 @@
<div
class=
"col-sm-8"
>
<div
class=
"col-sm-8"
>
<input
id=
"password"
name=
"password"
placeholder=
"Password"
type=
"password"
class=
"form-control"
>
<input
id=
"password"
name=
"password"
placeholder=
"Password"
type=
"password"
class=
"form-control"
>
<span
class=
"help-block m-b-none"
>
<span
class=
"help-block m-b-none"
>
登陆web的密码
登陆web的密码
, 不修改请留空
</span>
</span>
</div>
</div>
</div>
</div>
...
@@ -88,10 +88,13 @@
...
@@ -88,10 +88,13 @@
$
(
'#userForm'
).
validator
({
$
(
'#userForm'
).
validator
({
timely
:
2
,
timely
:
2
,
theme
:
"yellow_right_effect"
,
theme
:
"yellow_right_effect"
,
rules
:
{
check_pass
:
[
/^
\w
+$/
,
'数字和字符'
]
},
fields
:
{
fields
:
{
"password"
:
{
"password"
:
{
rule
:
"length[6~50]"
,
rule
:
"length[6~50]
;check_pass
"
,
tip
:
"输入密码"
,
tip
:
"输入密码"
,
ok
:
""
,
ok
:
""
,
msg
:
{
required
:
"必须填写!"
}
msg
:
{
required
:
"必须填写!"
}
...
...
templates/juser/reset_password.html
View file @
bf23d6d7
...
@@ -7,21 +7,20 @@
...
@@ -7,21 +7,20 @@
<link
href=
"/static/css/bootstrap.min.css"
rel=
"stylesheet"
>
<link
href=
"/static/css/bootstrap.min.css"
rel=
"stylesheet"
>
<link
href=
"/static/font-awesome/css/font-awesome.css"
rel=
"stylesheet"
>
<link
href=
"/static/font-awesome/css/font-awesome.css"
rel=
"stylesheet"
>
<link
href=
"/static/css/animate.css"
rel=
"stylesheet"
>
<link
href=
"/static/css/animate.css"
rel=
"stylesheet"
>
<link
href=
"/static/css/style.css"
rel=
"stylesheet"
>
<link
href=
"/static/css/style.css"
rel=
"stylesheet"
>
<style
type=
"text/css"
></style></head>
<style
type=
"text/css"
></style></head>
<body
class=
"gray-bg"
>
<body
class=
"gray-bg"
>
<div
class=
"lock-word animated fadeInDown"
>
<div
class=
"lock-word animated fadeInDown"
>
<span
class=
"first-word"
>
Jump
</span><span>
Server
</span>
<span
class=
"first-word"
>
Jump
</span><span>
Server
</span>
</div>
</div>
<div
class=
"middle-box text-center lockscreen animated fadeInDown"
>
<div
class=
"middle-box text-center lockscreen animated fadeInDown"
>
<div>
<div>
<div
class=
"m-b-md"
>
<div
class=
"m-b-md"
>
{#
<img
alt=
"image"
class=
"img-circle circle-border"
src=
"https://s3.amazonaws.com/uifaces/faces/twitter/ok/128.jpg"
>
#}
{% if error %}
{% if error %}
<div
class=
"alert alert-warning text-center"
>
{{ error }}
</div>
<div
class=
"alert alert-warning text-center"
>
{{ error }}
</div>
{% endif %}
{% endif %}
...
@@ -30,7 +29,7 @@
...
@@ -30,7 +29,7 @@
{% endif %}
{% endif %}
</div>
</div>
<h3>
请输入新密码
</h3>
<h3>
请输入新密码
</h3>
<form
class=
"m-t"
role=
"form"
action=
"{{ action }}"
method=
"post"
>
<form
class=
"m-t"
role=
"form"
id=
"restForm"
action=
"{{ action }}"
method=
"post"
>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<input
type=
"password"
name=
'password'
class=
"form-control"
placeholder=
"New Password"
required=
""
>
<input
type=
"password"
name=
'password'
class=
"form-control"
placeholder=
"New Password"
required=
""
>
<input
type=
"password"
name=
'password_confirm'
class=
"form-control"
placeholder=
"Password Confirm"
required=
""
>
<input
type=
"password"
name=
'password_confirm'
class=
"form-control"
placeholder=
"Password Confirm"
required=
""
>
...
@@ -39,12 +38,33 @@
...
@@ -39,12 +38,33 @@
</form>
</form>
</div>
</div>
</div>
</div>
<!-- Mainly scripts -->
<!-- Mainly scripts -->
<script
src=
"/static/js/jquery-2.1.1.js"
></script>
<script
src=
"/static/js/jquery-2.1.1.js"
></script>
<script
src=
"/static/js/bootstrap.min.js"
></script>
<script
src=
"/static/js/bootstrap.min.js"
></script>
<script
src=
"/static/js/validator/jquery.validator.js"
></script>
<script>
$
(
'#restForm'
).
validator
({
timely
:
2
,
theme
:
"yellow_right_effect"
,
rules
:
{
check_pass
:
[
/^
\w
+$/
,
'数字和字符'
]
},
fields
:
{
"password"
:
{
rule
:
"length[6~50];check_pass"
,
</body></html>
tip
:
"输入密码"
,
\ No newline at end of file
ok
:
""
,
msg
:
{
required
:
"必须填写!"
}
},
'password_confirm'
:
{
rule
:
"match[password]"
}
},
valid
:
function
(
form
)
{
form
.
submit
();
}
});
</script>
</body>
</html>
\ No newline at end of file
templates/juser/user_add.html
View file @
bf23d6d7
...
@@ -99,11 +99,11 @@
...
@@ -99,11 +99,11 @@
<label><input
type=
"checkbox"
value=
"0"
name=
"extra"
>
禁用
</label>
<label><input
type=
"checkbox"
value=
"0"
name=
"extra"
>
禁用
</label>
</div>
</div>
</div>
</div>
<div
class=
"col-sm-2"
>
{#
<div
class=
"col-sm-2"
>
#}
<div
class=
"checkbox i-checks"
>
{#
<div
class=
"checkbox i-checks"
>
#}
<label><input
type=
"checkbox"
value=
"1"
name=
"extra"
>
ssh key登录
</label>
{#
<label><input
type=
"checkbox"
value=
"1"
name=
"extra"
>
ssh key登录
</label>
#}
</div>
{#
</div>
#}
</div>
{#
</div>
#}
<div
class=
"col-sm-2"
>
<div
class=
"col-sm-2"
>
<div
class=
"checkbox i-checks"
>
<div
class=
"checkbox i-checks"
>
<label><input
type=
"checkbox"
value=
"2"
name=
"extra"
>
发送邮件
</label>
<label><input
type=
"checkbox"
value=
"2"
name=
"extra"
>
发送邮件
</label>
...
@@ -167,16 +167,16 @@ $('#userForm').validator({
...
@@ -167,16 +167,16 @@ $('#userForm').validator({
}
}
});
});
$
(
"document"
).
ready
(
function
(){
{
#
$
(
"document"
).
ready
(
function
(){
#
}
$
(
"input.role"
).
click
(
function
(){
{
#
$
(
"input.role"
).
click
(
function
(){
#
}
if
(
$
(
"input.role[value=GA]"
).
is
(
":checked"
)){
{
#
if
(
$
(
"input.role[value=GA]"
).
is
(
":checked"
)){
#
}
$
(
"#admin_groups"
).
css
(
"display"
,
'block'
);
{
#
$
(
"#admin_groups"
).
css
(
"display"
,
'block'
);
#
}
}
{
#
}
#
}
else
{
{
#
else
{
#
}
$
(
"#admin_groups"
).
css
(
"display"
,
'none'
);
{
#
$
(
"#admin_groups"
).
css
(
"display"
,
'none'
);
#
}
}
{
#
}
#
}
})
{
#
})
#
}
})
{
#
})
#
}
</script>
</script>
{% endblock %}
{% endblock %}
\ No newline at end of file
templates/juser/user_detail.html
View file @
bf23d6d7
...
@@ -45,9 +45,17 @@
...
@@ -45,9 +45,17 @@
<td>
{{ user.name }}
</td>
<td>
{{ user.name }}
</td>
</tr>
</tr>
<tr>
<tr>
<td
class=
"text-navy"
>
角色
</td>
<td
class=
"text-navy"
>
权限
</td>
<td>
{{ user.id | get_role }}
</td>
<td>
{{ user.id | get_role }}
</td>
</tr>
</tr>
<tr>
<td
class=
"text-navy"
>
key
</td>
{% if user.username|key_exist %}
<td><a
href=
"/juser/down_key/?id={{ user.id }}"
>
下载
</a></td>
{% else %}
<td><span
style=
"color: #586b7d"
>
下载
</span></td>
{% endif %}
</tr>
<tr>
<tr>
<td
class=
"text-navy"
>
Email
</td>
<td
class=
"text-navy"
>
Email
</td>
<td>
{{ user.email }}
</td>
<td>
{{ user.email }}
</td>
...
...
templates/juser/user_edit.html
View file @
bf23d6d7
...
@@ -140,13 +140,9 @@
...
@@ -140,13 +140,9 @@
$
(
'#userForm'
).
validator
({
$
(
'#userForm'
).
validator
({
timely
:
2
,
timely
:
2
,
theme
:
"yellow_right_effect"
,
theme
:
"yellow_right_effect"
,
{
#
rules
:
{
#
}
rules
:
{
{
#
check_ip
:
[
/^
(\d{1,2}
|1
\d\d
|2
[
0-4
]\d
|25
[
0-5
])(\.(\d{1,2}
|1
\d\d
|2
[
0-4
]\d
|25
[
0-5
])){3}
$/
,
'ip地址不正确'
],
#
}
check_pass
:
[
/^
\w
+$/
,
'数字和字符'
]
{
#
check_port
:
[
/^
\d{1,5}
$/
,
'端口号不正确'
],
#
}
},
{
#
type_m
:
function
(
element
)
{
#
}
{
#
return
$
(
"#M"
).
is
(
":checked"
);
#
}
{
#
}
#
}
{
#
},
#
}
fields
:
{
fields
:
{
"username"
:
{
"username"
:
{
rule
:
"required"
,
rule
:
"required"
,
...
@@ -155,7 +151,7 @@ $('#userForm').validator({
...
@@ -155,7 +151,7 @@ $('#userForm').validator({
msg
:
{
required
:
"必须填写!"
}
msg
:
{
required
:
"必须填写!"
}
},
},
"password"
:
{
"password"
:
{
rule
:
"length[6~50]"
,
rule
:
"length[6~50]
;check_pass
"
,
tip
:
"输入密码"
,
tip
:
"输入密码"
,
ok
:
""
,
ok
:
""
,
msg
:
{
required
:
"必须填写!"
}
msg
:
{
required
:
"必须填写!"
}
...
...
templates/nav.html
View file @
bf23d6d7
...
@@ -62,8 +62,8 @@
...
@@ -62,8 +62,8 @@
<div
class=
"sidebar-collapse"
>
<div
class=
"sidebar-collapse"
>
<ul
class=
"nav"
id=
"side-menu"
>
<ul
class=
"nav"
id=
"side-menu"
>
{% include 'nav_li_profile.html' %}
{% include 'nav_li_profile.html' %}
<li
id=
"
index
"
>
<li
id=
"
juser
"
>
<a
href=
"/"
><i
class=
"fa fa-dashboard"
></i>
<span
class=
"nav-label"
>
仪表盘
</span><span
class=
"label label-info pull-right"
></span></a>
<a
href=
"/
juser/user_detail/
"
><i
class=
"fa fa-dashboard"
></i>
<span
class=
"nav-label"
>
仪表盘
</span><span
class=
"label label-info pull-right"
></span></a>
</li>
</li>
<li
id=
"jasset"
>
<li
id=
"jasset"
>
<a
href=
"/jasset/asset_list/"
><i
class=
"fa fa-inbox"
></i>
<span
class=
"nav-label"
>
查看主机
</span><span
class=
"label label-info pull-right"
></span></a>
<a
href=
"/jasset/asset_list/"
><i
class=
"fa fa-inbox"
></i>
<span
class=
"nav-label"
>
查看主机
</span><span
class=
"label label-info pull-right"
></span></a>
...
...
templates/nav_li_profile.html
View file @
bf23d6d7
...
@@ -17,13 +17,13 @@
...
@@ -17,13 +17,13 @@
<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_user"
>
个人信息
</a></li>
<li><a
value=
"/juser/profile/?id={{ session_user_id }}"
class=
"iframe_user"
>
个人信息
</a></li>
<li><a
href=
"/juser/change_info/"
>
修改信息
</a></li>
<li><a
href=
"/juser/change_info/"
>
修改信息
</a></li>
{% if not user.role == 'CU' %
}
{# {% if not user.role == 'CU' %}#
}
{% if request.session.role_id == 0 %
}
{# {% if request.session.role_id == 0 %}#
}
<li><a
href=
"/juser/change_role/"
>
系统后台
</a></li>
{#
<li><a
href=
"/juser/change_role/"
>
系统后台
</a></li>
#}
{% else %
}
{# {% else %}#
}
<li><a
href=
"/juser/change_role/"
>
主机控制台
</a></li>
{#
<li><a
href=
"/juser/change_role/"
>
主机控制台
</a></li>
#}
{% endif %
}
{# {% endif %}#
}
{% endif %
}
{# {% endif %}#
}
<li
class=
"divider"
></li>
<li
class=
"divider"
></li>
<li><a
href=
"/logout/"
>
注销
</a></li>
<li><a
href=
"/logout/"
>
注销
</a></li>
</ul>
</ul>
...
...
templates/test.html
deleted
100644 → 0
View file @
35c818f4
templates/test2.html
deleted
100644 → 0
View file @
35c818f4
<html>
<body>
<div
id=
"main"
style=
"height:400px;"
></div>
...
<script
src=
"/static/js/echarts/echarts.js"
></script>
<script
type=
"text/javascript"
>
require
.
config
({
paths
:
{
'echarts'
:
'/static/js/echarts/chart'
,
'echarts/chart/line'
:
'/static/js/echarts/chart/line'
}
});
require
(
[
'echarts'
,
'echarts/chart/line'
],
function
(
ec
)
{
var
myChart
=
ec
.
init
(
document
.
getElementById
(
'main'
));
var
option
=
{
title
:
{
text
:
'某楼盘销售情况'
,
subtext
:
'纯属虚构'
},
tooltip
:
{
trigger
:
'axis'
},
legend
:
{
data
:[
'意向'
,
'预购'
,
'成交'
]
},
toolbox
:
{
show
:
true
,
feature
:
{
mark
:
{
show
:
true
},
dataView
:
{
show
:
true
,
readOnly
:
false
},
magicType
:
{
show
:
true
,
type
:
[
'line'
,
'bar'
,
'stack'
,
'tiled'
]},
restore
:
{
show
:
true
},
saveAsImage
:
{
show
:
true
}
}
},
calculable
:
true
,
xAxis
:
[
{
type
:
'category'
,
boundaryGap
:
false
,
data
:
[
'周一'
,
'周二'
,
'周三'
,
'周四'
,
'周五'
,
'周六'
,
'周日'
]
}
],
yAxis
:
[
{
type
:
'value'
}
],
series
:
[
{
name
:
'成交'
,
type
:
'line'
,
smooth
:
true
,
itemStyle
:
{
normal
:
{
areaStyle
:
{
type
:
'default'
}}},
data
:[
10
,
12
,
21
,
54
,
260
,
830
,
710
]
},
{
name
:
'预购'
,
type
:
'line'
,
smooth
:
true
,
itemStyle
:
{
normal
:
{
areaStyle
:
{
type
:
'default'
}}},
data
:[
30
,
182
,
434
,
791
,
390
,
30
,
10
]
},
{
name
:
'意向'
,
type
:
'line'
,
smooth
:
true
,
itemStyle
:
{
normal
:
{
areaStyle
:
{
type
:
'default'
}}},
data
:[
1320
,
1132
,
601
,
234
,
120
,
90
,
20
]
}
]
};
myChart
.
setOption
(
option
);
}
);
</script>
</body>
</html>
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