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
a7066a5c
Commit
a7066a5c
authored
Jul 30, 2019
by
BaiJiangJie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] htmlEscape
parent
4fe74e9e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
6 deletions
+10
-6
asset_permission_list.html
apps/perms/templates/perms/asset_permission_list.html
+2
-1
terminal_list.html
apps/terminal/templates/terminal/terminal_list.html
+3
-2
user_group_list.html
apps/users/templates/users/user_group_list.html
+2
-1
user_list.html
apps/users/templates/users/user_list.html
+3
-2
No files found.
apps/perms/templates/perms/asset_permission_list.html
View file @
a7066a5c
...
...
@@ -174,10 +174,11 @@ function initTable() {
}
}},
{
targets
:
8
,
createdCell
:
function
(
td
,
cellData
,
rowData
)
{
var
name
=
htmlEscape
(
rowData
.
name
);
var
update_btn
=
'<a href="{% url "perms:asset-permission-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-del" data-uid="{{ DEFAULT_PK }}" mark=1 data-name="99991938">{% trans "Delete" %}</a>'
.
replace
(
'{{ DEFAULT_PK }}'
,
cellData
)
.
replace
(
'99991938'
,
rowData
.
name
);
.
replace
(
'99991938'
,
name
);
if
(
rowData
.
inherit
)
{
del_btn
=
del_btn
.
replace
(
"mark"
,
"disabled"
)
}
...
...
apps/terminal/templates/terminal/terminal_list.html
View file @
a7066a5c
...
...
@@ -69,16 +69,17 @@ function initTable() {
}
}},
{
targets
:
6
,
createdCell
:
function
(
td
,
cellData
,
rowData
)
{
var
name
=
htmlEscape
(
rowData
.
name
);
var
update_btn
=
'<a href="{% url "terminal:terminal-update" pk=DEFAULT_PK %}" class="btn btn-xs btn-info">{% trans "Update" %}</a>'
.
replace
(
'{{ DEFAULT_PK }}'
,
cellData
);
var
delete_btn
=
'<a class="btn btn-xs btn-danger m-l-xs btn-del" data-id="{{ DEFAULT_PK }}" data-name="99991938">{% trans "Delete" %}</a>'
.
replace
(
'{{ DEFAULT_PK }}'
,
cellData
)
.
replace
(
'99991938'
,
rowData
.
name
);
.
replace
(
'99991938'
,
name
);
var
accept_btn
=
'<a class="btn btn-xs btn-primary btn-accept" data-id="{{ DEFAULT_PK }}">{% trans "Accept" %}</a> '
.
replace
(
'{{ DEFAULT_PK }}'
,
cellData
);
var
reject_btn
=
'<a class="btn btn-xs btn-danger m-l-xs btn-del" data-id="{{ DEFAULT_PK }}" data-name="99991938">{% trans "Reject" %}</a>'
.
replace
(
'{{ DEFAULT_PK }}'
,
cellData
)
.
replace
(
'99991938'
,
rowData
.
name
);
.
replace
(
'99991938'
,
name
);
if
(
rowData
.
is_accepted
)
{
$
(
td
).
html
(
update_btn
+
delete_btn
);
}
else
{
...
...
apps/users/templates/users/user_group_list.html
View file @
a7066a5c
...
...
@@ -67,11 +67,12 @@ function initTable() {
$
(
td
).
html
(
'<span href="javascript:void(0);" data-toggle="tooltip" title="'
+
cellData
+
'">'
+
innerHtml
+
'</span>'
);
}},
{
targets
:
4
,
createdCell
:
function
(
td
,
cellData
,
rowData
)
{
var
name
=
htmlEscape
(
rowData
.
name
);
var
update_btn
=
'<a href="{% url "users:user-group-update" pk=DEFAULT_PK %}" class="btn btn-xs btn-info">{% trans "Update" %}</a>'
.
replace
(
'{{ DEFAULT_PK }}'
,
cellData
);
var
del_btn
=
'<a class="btn btn-xs btn-danger m-l-xs btn_delete_user_group" data-gid="{{ DEFAULT_PK }}" data-name="99991938">{% trans "Delete" %}</a>'
.
replace
(
'{{ DEFAULT_PK }}'
,
cellData
)
.
replace
(
'99991938'
,
rowData
.
name
);
.
replace
(
'99991938'
,
name
);
if
(
rowData
.
id
===
1
)
{
$
(
td
).
html
(
update_btn
)
}
else
{
...
...
apps/users/templates/users/user_list.html
View file @
a7066a5c
...
...
@@ -97,6 +97,7 @@ function initTable() {
}
}},
{
targets
:
7
,
createdCell
:
function
(
td
,
cellData
,
rowData
)
{
var
name
=
htmlEscape
(
rowData
.
name
);
var
update_btn
=
""
;
if
(
rowData
.
role
===
'Admin'
&&
(
'{{ request.user.role }}'
!==
'Admin'
))
{
update_btn
=
'<a class="btn btn-xs disabled btn-info">{% trans "Update" %}</a>'
;
...
...
@@ -109,11 +110,11 @@ function initTable() {
if
(
rowData
.
id
===
1
||
rowData
.
username
===
"admin"
||
rowData
.
username
===
"{{ request.user.username }}"
||
(
rowData
.
role
===
'Admin'
&&
(
'{{ request.user.role }}'
!==
'Admin'
)))
{
del_btn
=
'<a class="btn btn-xs btn-danger m-l-xs" disabled>{% trans "Delete" %}</a>'
.
replace
(
'{{ DEFAULT_PK }}'
,
cellData
)
.
replace
(
'99991938'
,
rowData
.
name
);
.
replace
(
'99991938'
,
name
);
}
else
{
del_btn
=
'<a class="btn btn-xs btn-danger m-l-xs btn_user_delete" data-uid="{{ DEFAULT_PK }}" data-name="99991938">{% trans "Delete" %}</a>'
.
replace
(
'{{ DEFAULT_PK }}'
,
cellData
)
.
replace
(
'99991938'
,
rowData
.
name
);
.
replace
(
'99991938'
,
name
);
}
$
(
td
).
html
(
update_btn
+
del_btn
)
}}],
...
...
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