mirror of https://github.com/jumpserver/jumpserver
增加隐藏树功能
parent
1f3b11a223
commit
66b8e8bcf8
|
@ -35,7 +35,7 @@
|
|||
{% block content %}
|
||||
<div class="wrapper wrapper-content">
|
||||
<div class="row">
|
||||
<div class="col-lg-3">
|
||||
<div class="col-lg-3" id="split-left">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-content mailbox-content" style="padding-top: 0">
|
||||
<div class="file-manager ">
|
||||
|
@ -47,7 +47,12 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-9 animated fadeInRight">
|
||||
<div class="col-lg-9 animated fadeInRight" id="split-right">
|
||||
<div class="tree-toggle">
|
||||
<div class="btn btn-sm btn-primary tree-toggle-btn" onclick="toggle()">
|
||||
<i class="fa fa-angle-left fa-2x" id="toggle-icon"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mail-box-header">
|
||||
<div class="uc pull-left m-r-5"><a class="btn btn-sm btn-primary btn-create-asset"> {% trans "Create asset" %} </a></div>
|
||||
<div class="html5buttons">
|
||||
|
@ -68,7 +73,7 @@
|
|||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
<table class="table table-striped table-bordered table-hover " id="asset_list_table" >
|
||||
<table class="table table-striped table-bordered table-hover " id="asset_list_table" style="width: 100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center"><input type="checkbox" class="ipt_check_all"></th>
|
||||
|
@ -122,7 +127,7 @@
|
|||
|
||||
{% block custom_foot_js %}
|
||||
<script>
|
||||
var zTree, rMenu, asset_table;
|
||||
var zTree, rMenu, asset_table, show = 0;
|
||||
function initTable() {
|
||||
var options = {
|
||||
ele: $('#asset_list_table'),
|
||||
|
@ -339,6 +344,21 @@ function initTree() {
|
|||
});
|
||||
}
|
||||
|
||||
function toggle() {
|
||||
if (show === 0) {
|
||||
$("#split-left").hide(500, function () {
|
||||
$("#split-right").attr("class", "col-lg-12");
|
||||
$("#toggle-icon").attr("class", "fa fa-angle-right fa-2x");
|
||||
show = 1;
|
||||
});
|
||||
} else {
|
||||
$("#split-right").attr("class", "col-lg-9");
|
||||
$("#toggle-icon").attr("class", "fa fa-angle-left fa-2x");
|
||||
$("#split-left").show(500);
|
||||
show = 0;
|
||||
}
|
||||
}
|
||||
|
||||
$(document).ready(function(){
|
||||
initTable();
|
||||
initTree();
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
{% block content %}
|
||||
<div class="wrapper wrapper-content">
|
||||
<div class="row">
|
||||
<div class="col-lg-3">
|
||||
<div class="col-lg-3" id="split-left">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-content mailbox-content" style="padding-top: 0">
|
||||
<div class="file-manager ">
|
||||
|
@ -46,14 +46,19 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-9 animated fadeInRight">
|
||||
<div class="col-lg-9 animated fadeInRight" id="split-right">
|
||||
<div class="tree-toggle">
|
||||
<div class="btn btn-sm btn-primary tree-toggle-btn" onclick="toggle()">
|
||||
<i class="fa fa-angle-left fa-2x" id="toggle-icon"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mail-box-header">
|
||||
<div class="uc pull-left m-r-5">
|
||||
<a class="btn btn-sm btn-primary btn-create-permission">
|
||||
{% trans "Create permission" %}
|
||||
</a>
|
||||
</div>
|
||||
<table class="table table-striped table-bordered table-hover" id="permission_list_table" >
|
||||
<table class="table table-striped table-bordered table-hover" id="permission_list_table" style="width: 100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center">
|
||||
|
@ -79,7 +84,7 @@
|
|||
{% block custom_foot_js %}
|
||||
|
||||
<script>
|
||||
var zTree, rMenu, table;
|
||||
var zTree, rMenu, table, show = 0;
|
||||
function initTable() {
|
||||
var options = {
|
||||
ele: $('#permission_list_table'),
|
||||
|
@ -191,6 +196,21 @@ function initTree() {
|
|||
});
|
||||
}
|
||||
|
||||
function toggle() {
|
||||
if (show === 0) {
|
||||
$("#split-left").hide(500, function () {
|
||||
$("#split-right").attr("class", "col-lg-12");
|
||||
$("#toggle-icon").attr("class", "fa fa-angle-right fa-2x");
|
||||
show = 1;
|
||||
});
|
||||
} else {
|
||||
$("#split-right").attr("class", "col-lg-9");
|
||||
$("#toggle-icon").attr("class", "fa fa-angle-left fa-2x");
|
||||
$("#split-left").show(500);
|
||||
show = 0;
|
||||
}
|
||||
}
|
||||
|
||||
$(document).ready(function(){
|
||||
initTable();
|
||||
initTree();
|
||||
|
|
|
@ -7,8 +7,9 @@
|
|||
color: red;
|
||||
}
|
||||
|
||||
.n-invalid {border: 1px solid #f00;}
|
||||
|
||||
.n-invalid {
|
||||
border: 1px solid #f00;
|
||||
}
|
||||
|
||||
.primary-panel .ibox-title {
|
||||
color: #ffffff;
|
||||
|
@ -28,7 +29,6 @@
|
|||
border: 1px solid #23c6c8;;
|
||||
}
|
||||
|
||||
|
||||
th a {
|
||||
color: #676a6c;
|
||||
}
|
||||
|
@ -81,118 +81,152 @@ th a {
|
|||
table.dataTable tbody > tr.selected, table.dataTable tbody > tr > .selected {
|
||||
background-color: #1ab394 !important;
|
||||
}
|
||||
|
||||
table.dataTable tbody tr.selected a,
|
||||
table.dataTable tbody th.selected a,
|
||||
table.dataTable tbody td.selected a,
|
||||
table.dataTable tbody tr.selected td i.text-navy,
|
||||
table.dataTable tbody th.selected td i.text-navy,
|
||||
table.dataTable tbody td.selected td i.text-navy
|
||||
{
|
||||
table.dataTable tbody td.selected td i.text-navy {
|
||||
color: white !important;
|
||||
}
|
||||
|
||||
.m-0 {
|
||||
margin: 0px !important;
|
||||
}
|
||||
|
||||
.m-t-0 {
|
||||
margin-top: 0px !important;
|
||||
}
|
||||
|
||||
.m-b-0 {
|
||||
margin-bottom: 0px !important;
|
||||
}
|
||||
|
||||
.m-l-0 {
|
||||
margin-left: 0px !important;
|
||||
}
|
||||
|
||||
.m-r-0 {
|
||||
margin-right: 0px !important;
|
||||
}
|
||||
|
||||
.m-5 {
|
||||
margin: 5px !important;
|
||||
}
|
||||
|
||||
.m-t-5 {
|
||||
margin-top: 5px !important;
|
||||
}
|
||||
|
||||
.m-b-5 {
|
||||
margin-bottom: 5px !important;
|
||||
}
|
||||
|
||||
.m-l-5 {
|
||||
margin-left: 5px !important;
|
||||
}
|
||||
|
||||
.m-r-5 {
|
||||
margin-right: 5px !important;
|
||||
}
|
||||
|
||||
.m-10 {
|
||||
margin: 10px !important;
|
||||
}
|
||||
|
||||
.m-t-10 {
|
||||
margin-top: 10px !important;
|
||||
}
|
||||
|
||||
.m-b-10 {
|
||||
margin-bottom: 10px !important;
|
||||
}
|
||||
|
||||
.m-l-10 {
|
||||
margin-left: 10px !important;
|
||||
}
|
||||
|
||||
.m-r-10 {
|
||||
margin-right: 10px !important;
|
||||
}
|
||||
|
||||
.m-15 {
|
||||
margin: 15px !important;
|
||||
}
|
||||
|
||||
.m-t-15 {
|
||||
margin-top: 15px !important;
|
||||
}
|
||||
|
||||
.m-b-15 {
|
||||
margin-bottom: 15px !important;
|
||||
}
|
||||
|
||||
.m-l-15 {
|
||||
margin-left: 15px !important;
|
||||
}
|
||||
|
||||
.m-r-15 {
|
||||
margin-right: 15px !important;
|
||||
}
|
||||
|
||||
.m-20 {
|
||||
margin: 20px !important;
|
||||
}
|
||||
|
||||
.m-t-20 {
|
||||
margin-top: 20px !important;
|
||||
}
|
||||
|
||||
.m-b-20 {
|
||||
margin-bottom: 20px !important;
|
||||
}
|
||||
|
||||
.m-l-20 {
|
||||
margin-left: 20px !important;
|
||||
}
|
||||
|
||||
.m-r-20 {
|
||||
margin-right: 20px !important;
|
||||
}
|
||||
|
||||
.m-25 {
|
||||
margin: 25px !important;
|
||||
}
|
||||
|
||||
.m-t-25 {
|
||||
margin-top: 25px !important;
|
||||
}
|
||||
|
||||
.m-b-25 {
|
||||
margin-bottom: 25px !important;
|
||||
}
|
||||
|
||||
.m-l-25 {
|
||||
margin-left: 25px !important;
|
||||
}
|
||||
|
||||
.m-r-25 {
|
||||
margin-right: 25px !important;
|
||||
}
|
||||
|
||||
.m-30 {
|
||||
margin: 30px !important;
|
||||
}
|
||||
|
||||
.m-t-30 {
|
||||
margin-top: 30px !important;
|
||||
}
|
||||
|
||||
.m-b-30 {
|
||||
margin-bottom: 30px !important;
|
||||
}
|
||||
|
||||
.m-l-30 {
|
||||
margin-left: 30px !important;
|
||||
}
|
||||
|
||||
.m-r-30 {
|
||||
margin-right: 30px !important;
|
||||
}
|
||||
|
@ -208,10 +242,12 @@ table.dataTable tbody td.selected td i.text-navy
|
|||
padding-left: 10px;
|
||||
padding-bottom: 15px;
|
||||
}
|
||||
|
||||
.mar {
|
||||
margin-left: 2px;
|
||||
line-height: 0px;
|
||||
}
|
||||
|
||||
.mar-j {
|
||||
margin-left: 3px;
|
||||
margin-right: 3px;
|
||||
|
@ -240,6 +276,7 @@ table.dataTable tbody td.selected td i.text-navy
|
|||
margin-left: 5px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.c02 {
|
||||
color: #999;
|
||||
}
|
||||
|
@ -378,3 +415,15 @@ div.dataTables_wrapper div.dataTables_filter {
|
|||
line-break: auto;
|
||||
}
|
||||
|
||||
.tree-toggle {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 1px;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.tree-toggle-btn {
|
||||
width: 12px;
|
||||
text-align: center;
|
||||
padding: 5px 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue