mirror of https://github.com/jumpserver/jumpserver
parent
00e986a64e
commit
9c55450a9e
|
@ -63,7 +63,8 @@
|
||||||
{% block content_bottom_left %}{% endblock %}
|
{% block content_bottom_left %}{% endblock %}
|
||||||
{% block custom_foot_js %}
|
{% block custom_foot_js %}
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function(){
|
var admin_user_table = 0;
|
||||||
|
function initTable() {
|
||||||
var options = {
|
var options = {
|
||||||
ele: $('#admin_user_list_table'),
|
ele: $('#admin_user_list_table'),
|
||||||
columnDefs: [
|
columnDefs: [
|
||||||
|
@ -116,7 +117,12 @@ $(document).ready(function(){
|
||||||
columns: [{data: function(){return ""}}, {data: "name"}, {data: "username" }, {data: "assets_amount" },
|
columns: [{data: function(){return ""}}, {data: "name"}, {data: "username" }, {data: "assets_amount" },
|
||||||
{data: "reachable_amount"}, {data: "unreachable_amount"}, {data: "id"}, {data: "comment"}, {data: "id"}]
|
{data: "reachable_amount"}, {data: "unreachable_amount"}, {data: "id"}, {data: "comment"}, {data: "id"}]
|
||||||
};
|
};
|
||||||
jumpserver.initServerSideDataTable(options)
|
admin_user_table = jumpserver.initServerSideDataTable(options);
|
||||||
|
return admin_user_table
|
||||||
|
}
|
||||||
|
|
||||||
|
$(document).ready(function(){
|
||||||
|
initTable()
|
||||||
})
|
})
|
||||||
|
|
||||||
.on('click', '.btn_admin_user_delete', function () {
|
.on('click', '.btn_admin_user_delete', function () {
|
||||||
|
@ -132,12 +138,7 @@ $(document).ready(function(){
|
||||||
|
|
||||||
})
|
})
|
||||||
.on('click', '.btn_export', function(){
|
.on('click', '.btn_export', function(){
|
||||||
var data_table = $('#admin_user_list_table').DataTable();
|
var admin_users = admin_user_table.selected;
|
||||||
var rows = data_table.rows('.selected').data();
|
|
||||||
var admin_users = [];
|
|
||||||
$.each(rows, function (index, obj) {
|
|
||||||
admin_users.push(obj.id)
|
|
||||||
});
|
|
||||||
var data = {
|
var data = {
|
||||||
'resources': admin_users
|
'resources': admin_users
|
||||||
};
|
};
|
||||||
|
@ -168,14 +169,7 @@ $(document).ready(function(){
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.on('click', '#download_update_template', function () {
|
.on('click', '#download_update_template', function () {
|
||||||
var $data_table = $('#admin_user_list_table').DataTable();
|
var admin_users = admin_user_table.selected;
|
||||||
var rows = $data_table.rows('.selected').data();
|
|
||||||
|
|
||||||
var admin_users = [];
|
|
||||||
$.each(rows, function (index, obj) {
|
|
||||||
admin_users.push(obj.id)
|
|
||||||
});
|
|
||||||
|
|
||||||
var data = {
|
var data = {
|
||||||
'resources': admin_users
|
'resources': admin_users
|
||||||
};
|
};
|
||||||
|
|
|
@ -469,14 +469,7 @@ $(document).ready(function(){
|
||||||
asset_table.search(val).draw();
|
asset_table.search(val).draw();
|
||||||
})
|
})
|
||||||
.on('click', '.btn_export', function () {
|
.on('click', '.btn_export', function () {
|
||||||
var $data_table = $('#asset_list_table').DataTable();
|
var assets = asset_table.selected;
|
||||||
var rows = $data_table.rows('.selected').data();
|
|
||||||
|
|
||||||
var assets = [];
|
|
||||||
$.each(rows, function (index, obj) {
|
|
||||||
assets.push(obj.id)
|
|
||||||
});
|
|
||||||
|
|
||||||
var data = {
|
var data = {
|
||||||
'resources': assets
|
'resources': assets
|
||||||
};
|
};
|
||||||
|
@ -513,14 +506,7 @@ $(document).ready(function(){
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.on('click', '#download_update_template', function () {
|
.on('click', '#download_update_template', function () {
|
||||||
var $data_table = $('#asset_list_table').DataTable();
|
var assets = asset_table.selected;
|
||||||
var rows = $data_table.rows('.selected').data();
|
|
||||||
|
|
||||||
var assets = [];
|
|
||||||
$.each(rows, function (index, obj) {
|
|
||||||
assets.push(obj.id)
|
|
||||||
});
|
|
||||||
|
|
||||||
var data = {
|
var data = {
|
||||||
'resources': assets
|
'resources': assets
|
||||||
};
|
};
|
||||||
|
@ -639,11 +625,7 @@ $(document).ready(function(){
|
||||||
})
|
})
|
||||||
.on('click', '#btn_bulk_update', function () {
|
.on('click', '#btn_bulk_update', function () {
|
||||||
var action = $('#slct_bulk_update').val();
|
var action = $('#slct_bulk_update').val();
|
||||||
var $data_table = $('#asset_list_table').DataTable();
|
var id_list = asset_table.selected;
|
||||||
var id_list = [];
|
|
||||||
$data_table.rows({selected: true}).every(function(){
|
|
||||||
id_list.push(this.data().id);
|
|
||||||
});
|
|
||||||
if (id_list.length === 0) {
|
if (id_list.length === 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,6 +68,7 @@
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block custom_foot_js %}
|
{% block custom_foot_js %}
|
||||||
<script>
|
<script>
|
||||||
|
var system_user_table = 0;
|
||||||
function initTable() {
|
function initTable() {
|
||||||
var options = {
|
var options = {
|
||||||
ele: $('#system_user_list_table'),
|
ele: $('#system_user_list_table'),
|
||||||
|
@ -125,7 +126,8 @@ function initTable() {
|
||||||
],
|
],
|
||||||
op_html: $('#actions').html()
|
op_html: $('#actions').html()
|
||||||
};
|
};
|
||||||
jumpserver.initServerSideDataTable(options);
|
system_user_table = jumpserver.initServerSideDataTable(options);
|
||||||
|
return system_user_table
|
||||||
}
|
}
|
||||||
|
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
|
@ -198,12 +200,7 @@ $(document).ready(function(){
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.on('click', '.btn_export', function () {
|
.on('click', '.btn_export', function () {
|
||||||
var data_table = $('#system_user_list_table').DataTable();
|
var system_users = system_user_table.selected;
|
||||||
var rows = data_table.rows('.selected').data();
|
|
||||||
var system_users = [];
|
|
||||||
$.each(rows, function (index, obj) {
|
|
||||||
system_users.push(obj.id)
|
|
||||||
});
|
|
||||||
var data = {
|
var data = {
|
||||||
'resources': system_users
|
'resources': system_users
|
||||||
};
|
};
|
||||||
|
@ -235,12 +232,7 @@ $(document).ready(function(){
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.on('click', '#download_update_template', function () {
|
.on('click', '#download_update_template', function () {
|
||||||
var data_table = $('#system_user_list_table').DataTable();
|
var system_users = system_user_table.selected;
|
||||||
var rows = data_table.rows('.selected').data();
|
|
||||||
var system_users = [];
|
|
||||||
$.each(rows, function (index, obj) {
|
|
||||||
system_users.push(obj.id)
|
|
||||||
});
|
|
||||||
var data = {
|
var data = {
|
||||||
'resources': system_users
|
'resources': system_users
|
||||||
};
|
};
|
||||||
|
|
|
@ -46,7 +46,8 @@
|
||||||
{% block content_bottom_left %}{% endblock %}
|
{% block content_bottom_left %}{% endblock %}
|
||||||
{% block custom_foot_js %}
|
{% block custom_foot_js %}
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function() {
|
var groups_table = 0;
|
||||||
|
function initTable() {
|
||||||
var options = {
|
var options = {
|
||||||
ele: $('#group_list_table'),
|
ele: $('#group_list_table'),
|
||||||
buttons: [],
|
buttons: [],
|
||||||
|
@ -84,7 +85,11 @@ $(document).ready(function() {
|
||||||
order: [],
|
order: [],
|
||||||
op_html: $('#actions').html()
|
op_html: $('#actions').html()
|
||||||
};
|
};
|
||||||
jumpserver.initServerSideDataTable(options);
|
groups_table = jumpserver.initServerSideDataTable(options);
|
||||||
|
return groups_table
|
||||||
|
}
|
||||||
|
$(document).ready(function() {
|
||||||
|
initTable()
|
||||||
|
|
||||||
}).on('click', '.btn_delete_user_group', function(){
|
}).on('click', '.btn_delete_user_group', function(){
|
||||||
var $this = $(this);
|
var $this = $(this);
|
||||||
|
@ -136,12 +141,7 @@ $(document).ready(function() {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}).on('click', '.btn_export', function(){
|
}).on('click', '.btn_export', function(){
|
||||||
var data_table = $('#group_list_table').DataTable();
|
var groups = groups_table.selected;
|
||||||
var rows = data_table.rows('.selected').data();
|
|
||||||
var groups = [];
|
|
||||||
$.each(rows, function (index, obj) {
|
|
||||||
groups.push(obj.id)
|
|
||||||
});
|
|
||||||
var data = {
|
var data = {
|
||||||
'resources': groups
|
'resources': groups
|
||||||
};
|
};
|
||||||
|
@ -172,12 +172,7 @@ $(document).ready(function() {
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.on('click', '#download_update_template', function(){
|
.on('click', '#download_update_template', function(){
|
||||||
var data_table = $('#group_list_table').DataTable();
|
var groups = groups_table.selected;
|
||||||
var rows = data_table.rows('.selected').data();
|
|
||||||
var groups = [];
|
|
||||||
$.each(rows, function (index, obj) {
|
|
||||||
groups.push(obj.id)
|
|
||||||
});
|
|
||||||
var data = {
|
var data = {
|
||||||
'resources': groups
|
'resources': groups
|
||||||
};
|
};
|
||||||
|
|
|
@ -66,7 +66,7 @@
|
||||||
{% block custom_foot_js %}
|
{% block custom_foot_js %}
|
||||||
<script src="{% static 'js/jquery.form.min.js' %}"></script>
|
<script src="{% static 'js/jquery.form.min.js' %}"></script>
|
||||||
<script>
|
<script>
|
||||||
|
var users_table = 0;
|
||||||
function initTable() {
|
function initTable() {
|
||||||
var options = {
|
var options = {
|
||||||
ele: $('#user_list_table'),
|
ele: $('#user_list_table'),
|
||||||
|
@ -122,23 +122,19 @@ function initTable() {
|
||||||
],
|
],
|
||||||
op_html: $('#actions').html()
|
op_html: $('#actions').html()
|
||||||
};
|
};
|
||||||
var table = jumpserver.initServerSideDataTable(options);
|
users_table = jumpserver.initServerSideDataTable(options);
|
||||||
return table
|
return users_table
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
var table = initTable();
|
initTable();
|
||||||
var fields = $('#fm_user_bulk_update .form-group');
|
var fields = $('#fm_user_bulk_update .form-group');
|
||||||
$.each(fields, function (index, value) {
|
$.each(fields, function (index, value) {
|
||||||
console.log(value)
|
console.log(value)
|
||||||
});
|
});
|
||||||
$('.btn_export').click(function () {
|
$('.btn_export').click(function () {
|
||||||
var rows = table.rows('.selected').data();
|
var users = users_table.selected;
|
||||||
var users = [];
|
|
||||||
$.each(rows, function (index, obj) {
|
|
||||||
users.push(obj.id)
|
|
||||||
});
|
|
||||||
var data = {
|
var data = {
|
||||||
'resources': users
|
'resources': users
|
||||||
};
|
};
|
||||||
|
@ -171,11 +167,7 @@ $(document).ready(function(){
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
$('#download_update_template').click(function () {
|
$('#download_update_template').click(function () {
|
||||||
var rows = table.rows('.selected').data();
|
var users = users_table.selected;
|
||||||
var users = [];
|
|
||||||
$.each(rows, function (index, obj) {
|
|
||||||
users.push(obj.id)
|
|
||||||
});
|
|
||||||
var data = {
|
var data = {
|
||||||
'resources': users
|
'resources': users
|
||||||
};
|
};
|
||||||
|
@ -209,11 +201,7 @@ $(document).ready(function(){
|
||||||
|
|
||||||
}).on('click', '#btn_bulk_update', function(){
|
}).on('click', '#btn_bulk_update', function(){
|
||||||
var action = $('#slct_bulk_update').val();
|
var action = $('#slct_bulk_update').val();
|
||||||
var $data_table = $('#user_list_table').DataTable();
|
var id_list = users_table.selected;
|
||||||
var id_list = [];
|
|
||||||
$data_table.rows({selected: true}).every(function(){
|
|
||||||
id_list.push(this.data().id);
|
|
||||||
});
|
|
||||||
if (id_list.length === 0) {
|
if (id_list.length === 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue