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
569e12e8
Commit
569e12e8
authored
Jan 25, 2015
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改授权移动
parent
caff3e5d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
108 additions
and
32 deletions
+108
-32
views.py
jperm/views.py
+3
-0
style.css
static/css/style.css
+3
-0
perm_edit.html
templates/jperm/perm_edit.html
+98
-32
link_css.html
templates/link_css.html
+2
-0
script.html
templates/script.html
+2
-0
No files found.
jperm/views.py
View file @
569e12e8
...
...
@@ -32,6 +32,9 @@ def perm_edit(request):
header_title
,
path1
,
path2
=
u'授权编辑 | Perm Edit.'
,
u'jperm'
,
u'perm_edit'
if
request
.
method
==
'GET'
:
if
request
.
GET
.
get
(
'id'
,
None
):
user_id
=
request
.
GET
.
get
(
'id'
)
user
=
User
.
objects
.
get
(
id
=
user_id
)
assets
=
Asset
.
objects
.
all
()
return
render_to_response
(
'jperm/perm_edit.html'
,
locals
())
...
...
static/css/style.css
View file @
569e12e8
...
...
@@ -2623,6 +2623,9 @@ a:focus {
.b-r
{
border-right
:
1px
solid
#e7eaec
;
}
.b-l
{
border-left
:
1px
solid
#e7eaec
;
}
.hr-line-dashed
{
border-top
:
1px
dashed
#e7eaec
;
color
:
#ffffff
;
...
...
templates/jperm/perm_edit.html
View file @
569e12e8
...
...
@@ -2,13 +2,40 @@
{% load mytags %}
{% block content %}
<script
type=
"text/javascript"
>
function
move
(
from
,
to
)
{
$
(
"#"
+
from
+
" option"
).
each
(
function
(){
if
(
$
(
this
).
prop
(
"selected"
)
==
true
)
{
$
(
"#"
+
to
).
append
(
this
);
}
});
}
function
move_all
(
from
,
to
){
$
(
"#"
+
from
).
children
().
each
(
function
(){
$
(
"#"
+
to
).
append
(
this
);
});
}
function
search_host
(
text
){
$
(
"#host_unperm"
).
children
().
each
(
function
(){
$
(
this
).
remove
();});
$
(
"#host_all"
).
children
().
each
(
function
(){
if
(
$
(
this
).
text
().
search
(
text
)
!=
-
1
)
{
$
(
"#host_unperm"
).
append
(
$
(
this
).
clone
())
}
});
}
</script>
{% include 'nav_cat_bar.html' %}
<div
class=
"wrapper wrapper-content animated fadeInRight"
>
<div
class=
"row"
>
<div
class=
"col-lg-10"
>
<div
class=
"ibox float-e-margins"
>
<!-- title -->
<div
class=
"ibox-title"
>
<h5>
编辑授权 {{ user.name }}
<small>
Edit perm info.
</small></h5>
<h5>
Basic form
<small>
Simple login form example
</small></h5>
<div
class=
"ibox-tools"
>
<a
class=
"collapse-link"
>
<i
class=
"fa fa-chevron-up"
></i>
...
...
@@ -17,9 +44,9 @@
<i
class=
"fa fa-wrench"
></i>
</a>
<ul
class=
"dropdown-menu dropdown-user"
>
<li><a
href=
"#"
>
未启用
1
</a>
<li><a
href=
"#"
>
Config option
1
</a>
</li>
<li><a
href=
"#"
>
未启用
2
</a>
<li><a
href=
"#"
>
Config option
2
</a>
</li>
</ul>
<a
class=
"close-link"
>
...
...
@@ -27,52 +54,90 @@
</a>
</div>
</div>
<!-- end title -->
<div
class=
"ibox-content"
>
<form
method=
"post"
class=
"form-horizontal"
action=
""
>
{% if error %}
<div
class=
"alert alert-warning text-center"
>
{{ error }}
</div>
{% endif %}
{% if msg %}
<div
class=
"alert alert-success text-center"
>
{{ msg }}
</div>
{% endif %}
<div
class=
"form-group"
>
<div
class=
"col-sm-8"
>
<input
name=
"username"
value=
"{{ user.username }}"
readonly=
"readonly"
>
<div
class=
"row"
>
<div
class=
"col-sm-5 "
>
<div
class=
"form-group"
>
<label></label>
<input
type=
"text"
id=
"host_filter"
placeholder=
"过滤"
class=
"form-control"
value=
""
oninput=
"search_host(this.value)"
>
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"col-sm-4"
>
<input
id=
"filter"
name=
"filter"
placeholder=
"过滤"
type=
"text"
class=
"form-control"
>
<select
id=
"host_ids"
name=
"host_ids"
multiple
style=
"width: 100%"
>
{% for host in hosts %}
<option
value=
"{{ host.id }}"
>
{{ host.ip }}
</option>
{% endfor %}
</select>
<div
class=
"col-sm-1 "
>
<div
class=
"form-group"
>
<label></label>
</div>
<div
class=
"col-sm-2"
>
</div>
<div
class=
"col-sm-5 "
>
<div
class=
"form-group"
>
<label></label>
<input
type=
"text"
class=
"form-control"
value=
"{{ user.name }}"
readonly
>
</div>
</div>
</div>
<form
method=
"post"
action=
""
>
<div
class=
"row"
>
<div
class=
"col-sm-5"
><h4>
未授权主机
</h4>
<div>
<select
id=
"host_all"
name=
"host_all"
class=
"form-control"
size=
"10"
multiple
style=
"display: none"
>
{% for asset in assets %}
<option
value=
"{{ asset.ip }}"
>
{{ asset.ip }}
</option>
{% endfor %}
</select>
<select
id=
"host_unperm"
name=
"host_unperm"
class=
"form-control m-b"
size=
"12"
multiple
>
{% for asset in assets %}
<option
value=
"{{ asset.ip }}"
>
{{ asset.ip }}
</option>
{% endfor %}
</select>
</div>
</div>
<div
class=
"col-sm-4"
>
<select
id=
"host_ids"
name=
"host_ids"
multiple
style=
"width: 100%
"
>
{% for host in hosts %}
<
option
value=
"{{ host.id }}"
>
{{ host.ip }}
</opti
on>
{% endfor %}
</
select
>
<div
class=
"col-sm-1
"
>
<div
class=
"btn-group"
style=
"margin-top: 50px;"
>
<
button
type=
"button"
class=
"btn btn-white"
onclick=
"move('host_unperm', 'host_permed')"
><i
class=
"fa fa-chevron-right"
></i></butt
on>
<button
type=
"button"
class=
"btn btn-white"
onclick=
"move('host_permed', 'host_unperm')"
><i
class=
"fa fa-chevron-left"
></i>
</button>
</
div
>
</div>
</div>
<div
class=
"hr-line-dashed"
></div>
<div
class=
"form-group"
>
<div
class=
"col-sm-5"
><h4>
已授权主机
</h4>
<div>
<select
id=
"host_permed"
name=
"host_permed"
class=
"form-control m-b"
size=
"12"
multiple
>
</select>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"form-group"
>
<div
class=
"col-sm-4 col-sm-offset-2"
>
<button
class=
"btn btn-white"
type=
"submit"
>
取消
</button>
<button
id=
"submit_button"
class=
"btn btn-primary"
type=
"submit"
>
确认保存
</button>
<button
class=
"btn btn-primary"
type=
"submit"
>
确认保存
</button>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<script>
var
str
=
document
.
location
.
pathname
.
split
(
"/"
)[
1
];
var
str1
=
document
.
location
.
pathname
.
split
(
"/"
)[
2
];
$
(
"#"
+
str
).
addClass
(
'active'
);
$
(
"#"
+
str1
).
addClass
(
'active'
);
</script>
<script
type=
"text/javascript"
>
$
(
"#host_permed"
).
children
().
each
(
function
(){
$
(
"#host_all"
).
append
(
$
(
this
).
clone
());
if
(
$
(
this
).
prop
(
"selected"
)
==
false
)
{
$
(
"#host_unperm"
).
append
(
this
);
}
$
(
"#host_all"
).
children
().
each
(
function
(){
$
(
this
).
prop
(
"selected"
,
false
)});
});
</script>
{% endblock %}
\ No newline at end of file
templates/link_css.html
View file @
569e12e8
<link
href=
"/static/css/bootstrap.min.css"
rel=
"stylesheet"
>
<link
href=
"/static/font-awesome/css/font-awesome.css"
rel=
"stylesheet"
>
<link
href=
"/static/css/plugins/iCheck/custom.css"
rel=
"stylesheet"
>
<link
href=
"/static/css/plugins/fullcalendar/fullcalendar.css"
rel=
"stylesheet"
>
<link
href=
"/static/css/plugins/fullcalendar/fullcalendar.print.css"
rel=
"stylesheet"
>
<link
href=
"/static/css/animate.css"
rel=
"stylesheet"
>
<link
href=
"/static/css/style.css"
rel=
"stylesheet"
>
<link
href=
"/static/css/colorbox.css"
rel=
"stylesheet"
>
...
...
templates/script.html
View file @
569e12e8
...
...
@@ -27,6 +27,8 @@
<!--</script>-->
<script
src=
"/static/js/plugins/fullcalendar/fullcalendar.min.js"
></script>
<!-- pop windows -->
<script
src=
"/static/js/jquery.colorbox.js"
></script>
...
...
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