mirror of https://github.com/jumpserver/jumpserver
[Update] 优化提交api报错时滚动到,优化table页面某些列宽度
parent
f984acf1b2
commit
86522627d3
|
@ -70,43 +70,6 @@ function initTable() {
|
|||
var detail_btn = '<a href="{% url "assets:admin-user-detail" pk=DEFAULT_PK %}">' + cellData + '</a>';
|
||||
return detail_btn.replace('{{ DEFAULT_PK }}', rowData.id);
|
||||
}},
|
||||
{#{targets: 4, createdCell: function (td, cellData) {#}
|
||||
{# var innerHtml = "";#}
|
||||
{# var data = cellData.reachable;#}
|
||||
{# if (data !== 0) {#}
|
||||
{# innerHtml = "<span class='text-navy'>" + data + "</span>";#}
|
||||
{# } else {#}
|
||||
{# innerHtml = "<span>" + data + "</span>";#}
|
||||
{# }#}
|
||||
{# $(td).html(innerHtml)#}
|
||||
{#}},#}
|
||||
{#{targets: 5, createdCell: function (td, cellData) {#}
|
||||
{# var data = cellData.unreachable;#}
|
||||
{# var innerHtml = "";#}
|
||||
{# if (data !== 0) {#}
|
||||
{# innerHtml = "<span class='text-danger'>" + data + "</span>";#}
|
||||
{# } else {#}
|
||||
{# innerHtml = "<span>" + data + "</span>";#}
|
||||
{# }#}
|
||||
{# $(td).html('<span href="javascript:void(0);" data-toggle="tooltip" title="' + data + '">' + innerHtml + '</span>');#}
|
||||
{#}},#}
|
||||
{#{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 = "<span class='text-navy'>" + val + "% </span>";#}
|
||||
{# } else {#}
|
||||
{# var num = new Number(val);#}
|
||||
{# innerHtml = "<span class='text-danger'>" + num.toFixed(1) + "% </span>";#}
|
||||
{# }#}
|
||||
{# $(td).html('<span href="javascript:void(0);" data-toggle="tooltip" title="' + cellData + '">' + innerHtml + '</span>');#}
|
||||
{#}},#}
|
||||
{targets: 5, createdCell: function (td, cellData, rowData) {
|
||||
var update_btn = '<a href="{% url "assets:admin-user-update" pk=DEFAULT_PK %}" class="btn btn-xs m-l-xs btn-info">{% trans "Update" %}</a>'.replace('{{ DEFAULT_PK }}', cellData);
|
||||
var del_btn = '<a class="btn btn-xs btn-danger m-l-xs btn_admin_user_delete" data-uid="{{ DEFAULT_PK }}">{% trans "Delete" %}</a>'.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);
|
||||
|
|
|
@ -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()
|
||||
};
|
||||
|
|
|
@ -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()
|
||||
};
|
||||
|
|
|
@ -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()
|
||||
};
|
||||
|
|
|
@ -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()
|
||||
};
|
||||
|
|
|
@ -3,10 +3,6 @@
|
|||
|
||||
{% block help_message %}
|
||||
<div class="alert alert-info 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()
|
||||
};
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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('<div class="alert alert-danger" style="display: none"></div>');
|
||||
props.form.prepend('<div class="alert alert-danger has-error" style="display: none"></div>');
|
||||
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('<input type="checkbox" class="text-center ipt_check" id=99991937>'.replace('99991937', cellData));
|
||||
}
|
||||
|
@ -550,6 +552,7 @@ jumpserver.initServerSideDataTable = function (options) {
|
|||
{
|
||||
targets: 0,
|
||||
orderable: false,
|
||||
width: "20px",
|
||||
createdCell: function (td, cellData) {
|
||||
$(td).html('<input type="checkbox" class="text-center ipt_check" id=99991937>'.replace('99991937', cellData));
|
||||
}
|
||||
|
|
|
@ -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()
|
||||
};
|
||||
|
|
|
@ -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()
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue