From e0179ea332350bd6a7f373b6f1db05f94c9825df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=B3=E4=B9=A6=E5=83=AE?= Date: Fri, 24 Mar 2017 11:13:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E8=B5=84=E4=BA=A7HTML?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E4=B8=ADSystemUser=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E5=86=85=E5=AE=B9(=E8=A7=86=E5=9B=BE=E4=B8=AD=E7=9A=84?= =?UTF-8?q?=E7=9B=B8=E5=85=B3API=E6=9A=82=E6=97=B6=E6=9C=AA=E5=8A=A8)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../assets/templates/assets/asset_detail.html | 121 ++++++------------ .../templates/assets/system_user_list.html | 102 +++++++-------- 2 files changed, 90 insertions(+), 133 deletions(-) diff --git a/apps/assets/templates/assets/asset_detail.html b/apps/assets/templates/assets/asset_detail.html index f52c50dc0..81c4f7a69 100644 --- a/apps/assets/templates/assets/asset_detail.html +++ b/apps/assets/templates/assets/asset_detail.html @@ -173,21 +173,13 @@ - {% trans 'Test system users' %}: + {% trans 'Test system pingpong' %}: - - {% trans 'Repush system users' %}: - - - - - - @@ -230,41 +222,6 @@ -
-
- {% trans 'System users' %} -
-
- - - - - - - - - - - {% for system_user in system_users %} - - - - - {% endfor %} - -
- -
- -
{{ system_user.name }} - -
-
-
@@ -343,9 +300,9 @@ $(document).ready(function () { delete jumpserver.groups_selected[data.id] }) }) - .on('click', '#is_active', function () { - var the_url = '{% url "api-assets:asset-detail" pk=asset.id %}'; - var checked = $(this).prop('checked'); + .on('click', '#is_active', function () { + var the_url = '{% url "api-assets:asset-detail" pk=asset.id %}'; + var checked = $(this).prop('checked'); var body = { 'is_active': checked }; @@ -357,23 +314,23 @@ $(document).ready(function () { success_message: success }); if (status == "False") { - $(".ibox-content > table > tbody > tr:nth-child(13) > td:last >b").html('True'); + $(".ibox-content > table > tbody > tr:nth-child(13) > td:last >b").html('True'); }else{ - $(".ibox-content > table > tbody > tr:nth-child(13) > td:last >b").html('False'); + $(".ibox-content > table > tbody > tr:nth-child(13) > td:last >b").html('False'); } }) - .on('click', '#btn_add_user_group', function () { - if (Object.keys(jumpserver.groups_selected).length === 0) { + .on('click', '#btn_add_user_group', function () { + if (Object.keys(jumpserver.groups_selected).length === 0) { return false; } - var groups = $('.bdg_group').map(function() { - return $(this).data('gid'); - }).get(); - $.map(jumpserver.groups_selected, function(value, index) { - groups.push(parseInt(index)); - $('#opt_' + index).remove(); - }); - updateAssetGroups(groups) + var groups = $('.bdg_group').map(function() { + return $(this).data('gid'); + }).get(); + $.map(jumpserver.groups_selected, function(value, index) { + groups.push(parseInt(index)); + $('#opt_' + index).remove(); + }); + updateAssetGroups(groups) }) .on('click', '.btn_leave_group', function() { var $this = $(this); @@ -391,33 +348,33 @@ $(document).ready(function () { updateAssetGroups(groups) }) .on('click', '.btn-system-user', function () { - if (Object.keys(jumpserver.groups_selected).length === 0) { + if (Object.keys(jumpserver.groups_selected).length === 0) { return false; } - var system_users = $('.bdg_group').map(function() { - return $(this).data('sid'); - }).get(); - $.map(jumpserver.groups_selected, function(value, index) { - system_users.push(parseInt(index)); - $('#opt_' + index).remove(); - }); - updateAssetSystem(system_users) + var system_users = $('.bdg_group').map(function() { + return $(this).data('sid'); + }).get(); + $.map(jumpserver.groups_selected, function(value, index) { + system_users.push(parseInt(index)); + $('#opt_' + index).remove(); + }); + updateAssetSystem(system_users) }) - .on('click', '.btn_leave_system', function () { - var $this = $(this); - var $tr = $this.closest('tr'); - var $badge = $tr.find('.bdg_group'); - var sid = $badge.data('sid'); - var name = $badge.html() || $badge.text(); - $('#groups_selected').append( - '' - ); - $tr.remove(); - var system_users = $('.bdg_group').map(function () { - return $(this).data('sid'); - }).get(); - updateAssetSystem(system_users) + .on('click', '.btn_leave_system', function () { + var $this = $(this); + var $tr = $this.closest('tr'); + var $badge = $tr.find('.bdg_group'); + var sid = $badge.data('sid'); + var name = $badge.html() || $badge.text(); + $('#groups_selected').append( + '' + ); + $tr.remove(); + var system_users = $('.bdg_group').map(function () { + return $(this).data('sid'); + }).get(); + updateAssetSystem(system_users) }) diff --git a/apps/assets/templates/assets/system_user_list.html b/apps/assets/templates/assets/system_user_list.html index 6a1a85884..e000779dd 100644 --- a/apps/assets/templates/assets/system_user_list.html +++ b/apps/assets/templates/assets/system_user_list.html @@ -26,62 +26,62 @@
-
- -
- -
-
+
+ +
+ +
+
{% endblock %} {% block custom_foot_js %}