Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
J
jumpserver
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ops
jumpserver
Commits
8b98c20d
Commit
8b98c20d
authored
Apr 25, 2019
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] xss
parent
40d48cdf
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
8 deletions
+18
-8
admin_user_list.html
apps/assets/templates/assets/admin_user_list.html
+5
-5
jumpserver.js
apps/static/js/jumpserver.js
+13
-1
_base_list.html
apps/templates/_base_list.html
+0
-2
No files found.
apps/assets/templates/assets/admin_user_list.html
View file @
8b98c20d
...
...
@@ -44,9 +44,10 @@ $(document).ready(function(){
var
options
=
{
ele
:
$
(
'#admin_user_list_table'
),
columnDefs
:
[
{
targets
:
1
,
createdCell
:
function
(
td
,
cellData
,
rowData
)
{
{
targets
:
1
,
render
:
function
(
cellData
,
tp
,
rowData
,
meta
)
{
cellData
=
htmlEscape
(
cellData
);
var
detail_btn
=
'<a href="{% url "assets:admin-user-detail" pk=DEFAULT_PK %}">'
+
cellData
+
'</a>'
;
$
(
td
).
html
(
detail_btn
.
replace
(
'{{ DEFAULT_PK }}'
,
rowData
.
id
)
);
return
detail_btn
.
replace
(
'{{ DEFAULT_PK }}'
,
rowData
.
id
);
}},
{
targets
:
4
,
createdCell
:
function
(
td
,
cellData
)
{
var
innerHtml
=
""
;
...
...
@@ -82,7 +83,6 @@ $(document).ready(function(){
innerHtml
=
"<span class='text-danger'>"
+
num
.
toFixed
(
1
)
+
"% </span>"
;
}
$
(
td
).
html
(
'<span href="javascript:void(0);" data-toggle="tooltip" title="'
+
cellData
+
'">'
+
innerHtml
+
'</span>'
);
}},
{
targets
:
8
,
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
);
...
...
@@ -90,8 +90,8 @@ $(document).ready(function(){
$
(
td
).
html
(
update_btn
+
del_btn
)
}}],
ajax_url
:
'{% url "api-assets:admin-user-list" %}'
,
columns
:
[{
data
:
function
(){
return
""
}},
{
data
:
"name"
},
{
data
:
"username"
},
{
data
:
"assets_amount"
},
{
data
:
"reachable_amount"
},
{
data
:
"unreachable_amount"
},
{
data
:
"id"
},
{
data
:
"comment"
},
{
data
:
"id"
}]
columns
:
[{
data
:
function
(){
return
""
}},
{
data
:
"name"
},
{
data
:
"username"
},
{
data
:
"assets_amount"
},
{
data
:
"reachable_amount"
},
{
data
:
"unreachable_amount"
},
{
data
:
"id"
},
{
data
:
"comment"
,
render
:
$
.
fn
.
dataTable
.
render
.
text
()
},
{
data
:
"id"
}]
};
jumpserver
.
initServerSideDataTable
(
options
)
})
...
...
apps/static/js/jumpserver.js
View file @
8b98c20d
...
...
@@ -538,7 +538,11 @@ jumpserver.initServerSideDataTable = function (options) {
$
(
td
).
html
(
'<input type="checkbox" class="text-center ipt_check" id=99991937>'
.
replace
(
'99991937'
,
cellData
));
}
},
{
className
:
'text-center'
,
targets
:
'_all'
}
{
targets
:
'_all'
,
className
:
'text-center'
,
render
:
$
.
fn
.
dataTable
.
render
.
text
()
}
];
columnDefs
=
options
.
columnDefs
?
options
.
columnDefs
.
concat
(
columnDefs
)
:
columnDefs
;
var
select
=
{
...
...
@@ -945,4 +949,11 @@ function rootNodeAddDom(ztree, callback) {
ztree
.
destroy
();
callback
()
})
}
function
htmlEscape
(
d
)
{
return
typeof
d
===
'string'
?
d
.
replace
(
/</g
,
'<'
).
replace
(
/>/g
,
'>'
).
replace
(
/"/g
,
'"'
)
:
d
;
}
\ No newline at end of file
apps/templates/_base_list.html
View file @
8b98c20d
...
...
@@ -2,10 +2,8 @@
{% load static %}
{% load i18n %}
{% block custom_head_css_js %}
<link
href=
"{% static "
css
/
plugins
/
datatables
/
datatables
.
min
.
css
"
%}"
rel=
"stylesheet"
>
<link
href=
"{% static 'css/plugins/select2/select2.min.css' %}"
rel=
"stylesheet"
>
<script
src=
"{% static 'js/plugins/select2/select2.full.min.js' %}"
></script>
<script
src=
"{% static "
js
/
plugins
/
datatables
/
datatables
.
min
.
js
"
%}"
></script>
{% endblock %}
{% block content %}
<div
class=
"wrapper wrapper-content animated fadeInRight"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment