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
4e1f9c97
Commit
4e1f9c97
authored
Oct 16, 2016
by
江世峰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
asset:update assets_list by tag
parent
a3683f18
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
12 deletions
+27
-12
asset_list.html
apps/assets/templates/assets/asset_list.html
+25
-10
jumpserver.css
apps/static/css/jumpserver.css
+2
-2
No files found.
apps/assets/templates/assets/asset_list.html
View file @
4e1f9c97
...
@@ -7,6 +7,9 @@ div.dataTables_wrapper div.dataTables_filter,
...
@@ -7,6 +7,9 @@ div.dataTables_wrapper div.dataTables_filter,
.dataTables_length
{
.dataTables_length
{
float
:
right
!important
;
float
:
right
!important
;
}
}
div
.dataTables_wrapper
div
.dataTables_filter
{
margin-left
:
15px
;
}
.custom
{
.custom
{
float
:
left
;
float
:
left
;
margin-right
:
5px
;
margin-right
:
5px
;
...
@@ -21,21 +24,33 @@ div.dataTables_wrapper div.dataTables_filter,
...
@@ -21,21 +24,33 @@ div.dataTables_wrapper div.dataTables_filter,
{% endblock %}
{% endblock %}
{% block tags_list %}
{% block tags_list %}
<div
class=
"ydxbd"
id=
"ydxbd"
style=
"display:
block
;"
>
<div
class=
"ydxbd"
id=
"ydxbd"
style=
"display:
none
;"
>
<div>
<div>
<p
id=
"tags_p"
>
<p
id=
"tags_p"
>
{% for tag in tag_list %}
{% for tag in tag_list %}
<a
href=
"{% url 'assets:asset-tags' tag_id=tag.0 %}"
<a
href=
"{% url 'assets:asset-tags' tag_id=tag.0 %}"
>
<span
{%
if
tag
.
0
|
IntToStr =
=
tag_id
%}
{%
if
tag
.
0
|
IntToStr =
=
tag_id
%}
class=
"fa fa-tag btn btn-sm btn-primary mar-j"
name=
"tag_on"
>
class=
"label label-warning"
name=
"tag_on"
{%
else
%}
{%
else
%}
class="fa fa-tag btn btn-sm btn-outline btn-primary mar-j">
class=
"label label-default"
{%
endif
%}
{%
endif
%}
<span
class=
"mar"
>
>
{{ tag.1}}({{ tag.2 }})
</span>
<strong>
{{ tag.1}}
</strong>
({{ tag.2 }})
</a>
</span></a>
{#
<a
href=
"{% url 'assets:asset-tags' tag_id=tag.0 %}"
#}
{#
{%
if
tag
.
0
|
IntToStr =
=
tag_id
%}#}
{#
class=
"fa fa-tag btn btn-sm btn-warning btn-rounded mar-j"
name=
"tag_on"
>
#}
{# {% else %}#}
{# class="fa fa-tag btn btn-sm btn-default btn-rounded mar-j">#}
{# {% endif %}#}
{#
<span
class=
"mar"
>
#}
{#
<strong>
{{ tag.1}}
</strong>
({{ tag.2 }})#}
{#
</span></a>
#}
{% endfor %}
{% endfor %}
<a
href=
"{% url 'assets:asset-list' %}"
class=
"btn btn-sm btn-outline btn-default "
>
移除选择
</a>
{#
<a
href=
"{% url 'assets:asset-list' %}"
class=
"btn btn-sm btn-rounded btn-default "
>
移除选择
</a>
#}
<a
href=
"{% url 'assets:asset-list' %}"
><span
class=
"label label-default"
>
移除选择
</span></a>
</p>
</p>
</div>
</div>
</div>
</div>
...
@@ -121,8 +136,8 @@ div.dataTables_wrapper div.dataTables_filter,
...
@@ -121,8 +136,8 @@ div.dataTables_wrapper div.dataTables_filter,
oDiv
.
style
.
display
=
"none"
;
oDiv
.
style
.
display
=
"none"
;
}
}
};
};
$
(
document
).
ready
(
function
(){
$
(
document
).
ready
(
function
(){
var
oTags
=
document
.
getElementById
(
"ydxbd"
);
var
table
=
$
(
'#editable'
).
DataTable
({
var
table
=
$
(
'#editable'
).
DataTable
({
"aLengthMenu"
:
[[
10
,
25
,
50
,
-
1
],
[
"10"
,
"25"
,
"50"
,
"all"
]],
"aLengthMenu"
:
[[
10
,
25
,
50
,
-
1
],
[
"10"
,
"25"
,
"50"
,
"all"
]],
"iDisplayLength"
:
25
,
"iDisplayLength"
:
25
,
...
@@ -130,11 +145,11 @@ div.dataTables_wrapper div.dataTables_filter,
...
@@ -130,11 +145,11 @@ div.dataTables_wrapper div.dataTables_filter,
"aoColumnDefs"
:
[
{
"bSortable"
:
false
,
"aTargets"
:
[
0
]
}],
"aoColumnDefs"
:
[
{
"bSortable"
:
false
,
"aTargets"
:
[
0
]
}],
"bAutoWidth"
:
false
,
"bAutoWidth"
:
false
,
"language"
:
{
"url"
:
"/static/js/plugins/dataTables/i18n/zh-hans.json"
},
"language"
:
{
"url"
:
"/static/js/plugins/dataTables/i18n/zh-hans.json"
},
//"dom": '
<
lf
<
t
>
ip
>
',
"dom"
:
'<"custom">lftip'
,
"dom"
:
'<"custom">lftip'
,
"initComplete"
:
function
()
{
"initComplete"
:
function
()
{
//alert( 'DataTables has finished its initialisation.' );
//alert( 'DataTables has finished its initialisation.' );
$
(
'#editable_length'
).
before
(
"<a href=
\"
{% url 'assets:asset-create' %}
\"
class=
\"
btn btn-sm btn-primary custom
\"
> {% trans 'Create asset' %} </a> <button class='btn btn-sm btn-primary custom' id='zksx' onclick='tagShow()'>标签</button>"
);
$
(
'#editable_length'
).
before
(
"<a href=
\"
{% url 'assets:asset-create' %}
\"
class=
\"
btn btn-sm btn-primary custom
\"
> {% trans 'Create asset' %} </a> <button class='btn btn-sm btn-primary custom' id='zksx' onclick='tagShow()'>标签</button>"
);
$
(
'#editable'
).
before
(
oTags
);
},
},
columns
:
[
columns
:
[
{
data
:
"checkbox"
},
{
data
:
"checkbox"
},
...
...
apps/static/css/jumpserver.css
View file @
4e1f9c97
...
@@ -204,12 +204,12 @@ table.dataTable tbody td.selected td i.text-navy
...
@@ -204,12 +204,12 @@ table.dataTable tbody td.selected td i.text-navy
padding-top
:
15px
;
padding-top
:
15px
;
margin-bottom
:
15px
;
margin-bottom
:
15px
;
display
:
block
;
display
:
block
;
background
:
#f4f4f4
;
/*background: #ccc;*/
padding-left
:
10px
;
padding-left
:
10px
;
}
}
.mar
{
.mar
{
margin-left
:
2px
;
margin-left
:
2px
;
line-height
:
15
px
;
line-height
:
0
px
;
}
}
.mar-j
{
.mar-j
{
margin-left
:
3px
;
margin-left
:
3px
;
...
...
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