mirror of https://github.com/jumpserver/jumpserver
asset:update assets_list by tag
parent
a3683f184e
commit
4e1f9c97a5
|
@ -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,
|
||||||
{% 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,
|
||||||
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,
|
||||||
"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"},
|
||||||
|
|
|
@ -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: 15px;
|
line-height: 0px;
|
||||||
}
|
}
|
||||||
.mar-j {
|
.mar-j {
|
||||||
margin-left: 3px;
|
margin-left: 3px;
|
||||||
|
|
Loading…
Reference in New Issue