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