diff --git a/apps/assets/templates/assets/admin_user_list.html b/apps/assets/templates/assets/admin_user_list.html index 9568ceb30..7a4b2a2dc 100644 --- a/apps/assets/templates/assets/admin_user_list.html +++ b/apps/assets/templates/assets/admin_user_list.html @@ -70,43 +70,6 @@ function initTable() { var detail_btn = '' + cellData + ''; return detail_btn.replace('{{ DEFAULT_PK }}', rowData.id); }}, - {#{targets: 4, createdCell: function (td, cellData) {#} - {# var innerHtml = "";#} - {# var data = cellData.reachable;#} - {# if (data !== 0) {#} - {# innerHtml = "" + data + "";#} - {# } else {#} - {# innerHtml = "" + data + "";#} - {# }#} - {# $(td).html(innerHtml)#} - {#}},#} - {#{targets: 5, createdCell: function (td, cellData) {#} - {# var data = cellData.unreachable;#} - {# var innerHtml = "";#} - {# if (data !== 0) {#} - {# innerHtml = "" + data + "";#} - {# } else {#} - {# innerHtml = "" + data + "";#} - {# }#} - {# $(td).html('' + innerHtml + '');#} - {#}},#} - {#{targets: 6, createdCell: function (td, cellData, rowData) {#} - {# var val = 0;#} - {# var innerHtml = "";#} - {# var total = rowData.assets_amount;#} - {# var reachable = cellData.reachable;#} - {# if (total !== 0) {#} - {# val = reachable/total * 100;#} - {# }#} - {##} - {# if (val === 100) {#} - {# innerHtml = "" + val + "% ";#} - {# } else {#} - {# var num = new Number(val);#} - {# innerHtml = "" + num.toFixed(1) + "% ";#} - {# }#} - {# $(td).html('' + innerHtml + '');#} - {#}},#} {targets: 5, createdCell: function (td, cellData, rowData) { var update_btn = '{% trans "Update" %}'.replace('{{ DEFAULT_PK }}', cellData); var del_btn = '{% trans "Delete" %}'.replace('{{ DEFAULT_PK }}', cellData); @@ -116,7 +79,7 @@ function initTable() { columns: [ {data: function(){return ""}}, {data: "name"}, {data: "username" }, {data: "assets_amount", orderable: false}, {#{data: "connectivity_amount"}, {data: "connectivity_amount"}, {data: "connectivity_amount"},#} - {data: "comment"}, {data: "id", orderable: false} + {data: "comment"}, {data: "id", orderable: false, width: "100px"} ] }; admin_user_table = jumpserver.initServerSideDataTable(options); diff --git a/apps/assets/templates/assets/asset_list.html b/apps/assets/templates/assets/asset_list.html index b9892790d..63f31a0c6 100644 --- a/apps/assets/templates/assets/asset_list.html +++ b/apps/assets/templates/assets/asset_list.html @@ -177,7 +177,7 @@ function initTable() { data: "connectivity", orderable: false, width: '60px' - }, {data: "id", orderable: false} + }, {data: "id", orderable: false, width: "100px"} ], op_html: $('#actions').html() }; diff --git a/apps/assets/templates/assets/cmd_filter_list.html b/apps/assets/templates/assets/cmd_filter_list.html index b6d46a2c8..0582363c4 100644 --- a/apps/assets/templates/assets/cmd_filter_list.html +++ b/apps/assets/templates/assets/cmd_filter_list.html @@ -63,7 +63,8 @@ function initTable() { ajax_url: '{% url "api-assets:cmd-filter-list" %}', columns: [ {data: "id"}, {data: "name" }, {data: "rules", orderable: false}, - {data: "system_users", orderable: false}, {data: "comment"}, {data: "id", orderable: false} + {data: "system_users", orderable: false}, {data: "comment"}, + {data: "id", orderable: false, width: "100px"} ], op_html: $('#actions').html() }; diff --git a/apps/assets/templates/assets/domain_list.html b/apps/assets/templates/assets/domain_list.html index 6a0f36f40..2b82826a0 100644 --- a/apps/assets/templates/assets/domain_list.html +++ b/apps/assets/templates/assets/domain_list.html @@ -59,7 +59,7 @@ function initTable() { ajax_url: '{% url "api-assets:domain-list" %}', columns: [ {data: "id"}, {data: "name" }, {data: "asset_count", orderable: false }, - {data: "gateway_count", orderable: false }, {data: "comment" }, {data: "id", orderable: false} + {data: "gateway_count", orderable: false }, {data: "comment" }, {data: "id", orderable: false, width: "100px"} ], op_html: $('#actions').html() }; diff --git a/apps/assets/templates/assets/label_list.html b/apps/assets/templates/assets/label_list.html index 7d780deed..9ab735f7a 100644 --- a/apps/assets/templates/assets/label_list.html +++ b/apps/assets/templates/assets/label_list.html @@ -44,7 +44,8 @@ function initTable() { ajax_url: '{% url "api-assets:label-list" %}?sort=name', columns: [ {data: "id"}, {data: "name" }, {data: "value" }, - {data: "asset_count", orderable: false}, {data: "id", orderable: false} + {data: "asset_count", orderable: false}, + {data: "id", orderable: false, width: "100px"} ], op_html: $('#actions').html() }; diff --git a/apps/assets/templates/assets/system_user_list.html b/apps/assets/templates/assets/system_user_list.html index dcfaac8cc..e6b259585 100644 --- a/apps/assets/templates/assets/system_user_list.html +++ b/apps/assets/templates/assets/system_user_list.html @@ -3,10 +3,6 @@ {% block help_message %}
-{# 系统用户是 Jumpserver跳转登录资产时使用的用户,可以理解为登录资产用户,如 web, sa, dba(`ssh web@some-host`), 而不是使用某个用户的用户名跳转登录服务器(`ssh xiaoming@some-host`);#} -{# 简单来说是 用户使用自己的用户名登录Jumpserver, Jumpserver使用系统用户登录资产。#} -{# 系统用户创建时,如果选择了自动推送 Jumpserver会使用ansible自动推送系统用户到资产中,如果资产(交换机、windows)不支持ansible, 请手动填写账号密码。#} -{# 目前还不支持Windows的自动推送#} {% trans 'System user is Jumpserver jump login assets used by the users, can be understood as the user login assets, such as web, sa, the dba (` ssh web@some-host `), rather than using a user the username login server jump (` ssh xiaoming@some-host `); '%} {% trans 'In simple terms, users log into Jumpserver using their own username, and Jumpserver uses system users to log into assets. '%} {% trans 'When system users are created, if you choose auto push Jumpserver to use Ansible push system users into the asset, if the asset (Switch) does not support ansible, please manually fill in the account password.' %} @@ -91,7 +87,7 @@ function initTable() { columns: [ {data: "id" }, {data: "name" }, {data: "username" }, {data: "protocol"}, {data: "login_mode"}, {data: "assets_amount", orderable: false }, - {data: "comment" }, {data: "id", orderable: false } + {data: "comment" }, {data: "id", orderable: false, width: "100px"} ], op_html: $('#actions').html() }; diff --git a/apps/perms/templates/perms/asset_permission_list.html b/apps/perms/templates/perms/asset_permission_list.html index 2a493e16b..18e30bde8 100644 --- a/apps/perms/templates/perms/asset_permission_list.html +++ b/apps/perms/templates/perms/asset_permission_list.html @@ -190,7 +190,7 @@ function initTable() { {data: "id"}, {data: "name"}, {data: "users", orderable: false}, {data: "user_groups", orderable: false}, {data: "assets", orderable: false}, {data: "nodes", orderable: false}, {data: "system_users", orderable: false}, - {data: "is_valid", orderable: false}, {data: "id", orderable: false} + {data: "is_valid", orderable: false}, {data: "id", orderable: false, width: "100px"} ], select: {}, op_html: $('#actions').html() diff --git a/apps/static/js/jumpserver.js b/apps/static/js/jumpserver.js index 4f55cfb4f..4dceb01bf 100644 --- a/apps/static/js/jumpserver.js +++ b/apps/static/js/jumpserver.js @@ -201,7 +201,7 @@ function formSubmit(props) { var errors = jqXHR.responseJSON; var noneFieldErrorRef = props.form.children('.alert-danger'); if (noneFieldErrorRef.length !== 1) { - props.form.prepend(''); + props.form.prepend(''); noneFieldErrorRef = props.form.children('.alert-danger'); } var noneFieldErrorMsg = ""; @@ -247,6 +247,7 @@ function formSubmit(props) { noneFieldErrorRef.css('display', 'block'); noneFieldErrorRef.html(noneFieldErrorMsg); } + $('.has-error').get(0).scrollIntoView(); } }) @@ -453,6 +454,7 @@ jumpserver.initDataTable = function (options) { { targets: 0, orderable: false, + width: "20px", createdCell: function (td, cellData) { $(td).html(''.replace('99991937', cellData)); } @@ -550,6 +552,7 @@ jumpserver.initServerSideDataTable = function (options) { { targets: 0, orderable: false, + width: "20px", createdCell: function (td, cellData) { $(td).html(''.replace('99991937', cellData)); } diff --git a/apps/users/templates/users/user_group_list.html b/apps/users/templates/users/user_group_list.html index c2fa87357..3eb70e319 100644 --- a/apps/users/templates/users/user_group_list.html +++ b/apps/users/templates/users/user_group_list.html @@ -82,7 +82,7 @@ function initTable() { ], ajax_url: '{% url "api-users:user-group-list" %}?display=1', columns: [{data: function(){return ""}}, {data: "name" }, {data: "users", orderable: false}, - {data: "comment"}, {data: "id", orderable: false }], + {data: "comment"}, {data: "id", orderable: false, width:"100px"}], order: [], op_html: $('#actions').html() }; diff --git a/apps/users/templates/users/user_list.html b/apps/users/templates/users/user_list.html index d992416d1..cd9273681 100644 --- a/apps/users/templates/users/user_list.html +++ b/apps/users/templates/users/user_list.html @@ -125,7 +125,7 @@ function initTable() { {data: "groups_display", orderable: false}, {data: "source"}, {data: "is_valid", orderable: false}, - {data: "id", orderable: false} + {data: "id", orderable: false, width: "100px"} ], op_html: $('#actions').html() };