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
cb570026
Commit
cb570026
authored
Dec 12, 2017
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Change] 去掉前端html中的hardcode 99991937
parent
72286342
Show whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
91 additions
and
91 deletions
+91
-91
admin_user_assets.html
apps/assets/templates/assets/admin_user_assets.html
+3
-3
admin_user_detail.html
apps/assets/templates/assets/admin_user_detail.html
+1
-1
admin_user_list.html
apps/assets/templates/assets/admin_user_list.html
+6
-6
asset_detail.html
apps/assets/templates/assets/asset_detail.html
+1
-1
asset_group_detail.html
apps/assets/templates/assets/asset_group_detail.html
+4
-4
asset_group_list.html
apps/assets/templates/assets/asset_group_list.html
+5
-5
asset_list.html
apps/assets/templates/assets/asset_list.html
+2
-2
cluster_assets.html
apps/assets/templates/assets/cluster_assets.html
+2
-2
cluster_detail.html
apps/assets/templates/assets/cluster_detail.html
+1
-1
cluster_list.html
apps/assets/templates/assets/cluster_list.html
+5
-5
system_user_asset.html
apps/assets/templates/assets/system_user_asset.html
+2
-2
system_user_list.html
apps/assets/templates/assets/system_user_list.html
+6
-6
user_asset_list.html
apps/assets/templates/assets/user_asset_list.html
+3
-3
task_adhoc.html
apps/ops/templates/ops/task_adhoc.html
+1
-1
task_history.html
apps/ops/templates/ops/task_history.html
+1
-1
task_list.html
apps/ops/templates/ops/task_list.html
+1
-1
asset_permission_detail.html
apps/perms/templates/perms/asset_permission_detail.html
+1
-1
asset_permission_list.html
apps/perms/templates/perms/asset_permission_list.html
+2
-2
terminal_list.html
apps/terminal/templates/terminal/terminal_list.html
+14
-14
terminal_modal_accept.html
apps/terminal/templates/terminal/terminal_modal_accept.html
+1
-1
user_asset_permission.html
apps/users/templates/users/user_asset_permission.html
+4
-4
user_detail.html
apps/users/templates/users/user_detail.html
+1
-1
user_granted_asset.html
apps/users/templates/users/user_granted_asset.html
+4
-4
user_group_asset_permission.html
apps/users/templates/users/user_group_asset_permission.html
+4
-4
user_group_detail.html
apps/users/templates/users/user_group_detail.html
+1
-1
user_group_granted_asset.html
apps/users/templates/users/user_group_granted_asset.html
+4
-4
user_group_list.html
apps/users/templates/users/user_group_list.html
+7
-7
user_list.html
apps/users/templates/users/user_list.html
+4
-4
No files found.
apps/assets/templates/assets/admin_user_assets.html
View file @
cb570026
...
...
@@ -156,8 +156,8 @@ function initTable() {
order
:
[],
columnDefs
:
[
{
targets
:
1
,
createdCell
:
function
(
td
,
cellData
,
rowData
)
{
var
detail_btn
=
'<a href="{% url "assets:asset-detail" pk=
99991937
%}" data-aid="'
+
rowData
.
id
+
'">'
+
cellData
+
'</a>'
;
$
(
td
).
html
(
detail_btn
.
replace
(
'
99991937
'
,
rowData
.
id
));
var
detail_btn
=
'<a href="{% url "assets:asset-detail" pk=
DEFAULT_PK
%}" data-aid="'
+
rowData
.
id
+
'">'
+
cellData
+
'</a>'
;
$
(
td
).
html
(
detail_btn
.
replace
(
'
{{ DEFAULT_PK }}
'
,
rowData
.
id
));
}},
{
targets
:
5
,
createdCell
:
function
(
td
,
cellData
)
{
if
(
!
cellData
)
{
...
...
@@ -224,7 +224,7 @@ $(document).ready(function () {
var
$this
=
$
(
this
);
var
name
=
"{{ admin_user.name }}"
;
var
uid
=
"{{ admin_user.id }}"
;
var
the_url
=
'{% url "api-assets:admin-user-detail" pk=
99991937 %}'
.
replace
(
'99991937
'
,
uid
);
var
the_url
=
'{% url "api-assets:admin-user-detail" pk=
DEFAULT_PK %}'
.
replace
(
'{{ DEFAULT_PK }}
'
,
uid
);
var
redirect_url
=
"{% url 'assets:admin-user-list' %}"
;
objectDelete
(
$this
,
name
,
the_url
,
redirect_url
);
})
...
...
apps/assets/templates/assets/admin_user_detail.html
View file @
cb570026
...
...
@@ -197,7 +197,7 @@ $(document).ready(function () {
var
$this
=
$
(
this
);
var
name
=
"{{ admin_user.name }}"
;
var
uid
=
"{{ admin_user.id }}"
;
var
the_url
=
'{% url "api-assets:admin-user-detail" pk=
99991937 %}'
.
replace
(
'99991937
'
,
uid
);
var
the_url
=
'{% url "api-assets:admin-user-detail" pk=
DEFAULT_PK %}'
.
replace
(
'{{ DEFAULT_PK }}
'
,
uid
);
var
redirect_url
=
"{% url 'assets:admin-user-list' %}"
;
objectDelete
(
$this
,
name
,
the_url
,
redirect_url
);
})
...
...
apps/assets/templates/assets/admin_user_list.html
View file @
cb570026
...
...
@@ -39,13 +39,13 @@ $(document).ready(function(){
ele
:
$
(
'#admin_user_list_table'
),
columnDefs
:
[
{
targets
:
1
,
createdCell
:
function
(
td
,
cellData
,
rowData
)
{
var
detail_btn
=
'<a href="{% url "assets:admin-user-detail" pk=
99991937
%}">'
+
cellData
+
'</a>'
;
$
(
td
).
html
(
detail_btn
.
replace
(
'
99991937
'
,
rowData
.
id
));
var
detail_btn
=
'<a href="{% url "assets:admin-user-detail" pk=
DEFAULT_PK
%}">'
+
cellData
+
'</a>'
;
$
(
td
).
html
(
detail_btn
.
replace
(
'
{{ DEFAULT_PK }}
'
,
rowData
.
id
));
}},
{
targets
:
6
,
createdCell
:
function
(
td
,
cellData
,
rowData
)
{
{
#
var
script_btn
=
'<a href="{% url "assets:admin-user-update" pk=
99991937 %}" class="btn btn-xs btn-primary">{% trans "Script" %}</a>'
.
replace
(
'99991937
'
,
cellData
);
#
}
var
update_btn
=
'<a href="{% url "assets:admin-user-update" pk=
99991937 %}" class="btn btn-xs m-l-xs btn-info">{% trans "Update" %}</a>'
.
replace
(
'99991937
'
,
cellData
);
var
del_btn
=
'<a class="btn btn-xs btn-danger m-l-xs btn_admin_user_delete" data-uid="
99991937">{% trans "Delete" %}</a>'
.
replace
(
'99991937
'
,
cellData
);
{
#
var
script_btn
=
'<a href="{% url "assets:admin-user-update" pk=
DEFAULT_PK %}" class="btn btn-xs btn-primary">{% trans "Script" %}</a>'
.
replace
(
'{{ DEFAULT_PK }}
'
,
cellData
);
#
}
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
);
{
#
$
(
td
).
html
(
script_btn
+
update_btn
+
del_btn
)
#
}
$
(
td
).
html
(
update_btn
+
del_btn
)
}}],
...
...
@@ -61,7 +61,7 @@ $(document).ready(function(){
var
$data_table
=
$
(
"#admin_user_list_table"
).
DataTable
();
var
name
=
$
(
this
).
closest
(
"tr"
).
find
(
":nth-child(2)"
).
children
(
'a'
).
html
();
var
uid
=
$this
.
data
(
'uid'
);
var
the_url
=
'{% url "api-assets:admin-user-detail" pk=
99991937 %}'
.
replace
(
'99991937
'
,
uid
);
var
the_url
=
'{% url "api-assets:admin-user-detail" pk=
DEFAULT_PK %}'
.
replace
(
'{{ DEFAULT_PK }}
'
,
uid
);
objectDelete
(
$this
,
name
,
the_url
);
setTimeout
(
function
()
{
$data_table
.
ajax
.
reload
();
...
...
apps/assets/templates/assets/asset_detail.html
View file @
cb570026
...
...
@@ -350,7 +350,7 @@ $(document).ready(function () {
var
$this
=
$
(
this
);
var
name
=
"{{ asset.hostname }}"
;
var
uid
=
"{{ asset.id }}"
;
var
the_url
=
'{% url "api-assets:asset-detail" pk=
99991937 %}'
.
replace
(
'99991937
'
,
uid
);
var
the_url
=
'{% url "api-assets:asset-detail" pk=
DEFAULT_PK %}'
.
replace
(
'{{ DEFAULT_PK }}
'
,
uid
);
var
redirect_url
=
"{% url 'assets:asset-list' %}"
;
objectDelete
(
$this
,
name
,
the_url
,
redirect_url
);
}).
on
(
'click'
,
'#btn_refresh_asset'
,
function
()
{
...
...
apps/assets/templates/assets/asset_group_detail.html
View file @
cb570026
...
...
@@ -176,8 +176,8 @@ function initTable() {
order
:
[],
columnDefs
:
[
{
targets
:
0
,
createdCell
:
function
(
td
,
cellData
,
rowData
)
{
var
detail_btn
=
'<a href="{% url "assets:asset-detail" pk=
99991937
%}" data-aid="'
+
rowData
.
id
+
'">'
+
cellData
+
'</a>'
;
$
(
td
).
html
(
detail_btn
.
replace
(
'
99991937
'
,
rowData
.
id
));
var
detail_btn
=
'<a href="{% url "assets:asset-detail" pk=
DEFAULT_PK
%}" data-aid="'
+
rowData
.
id
+
'">'
+
cellData
+
'</a>'
;
$
(
td
).
html
(
detail_btn
.
replace
(
'
{{ DEFAULT_PK }}
'
,
rowData
.
id
));
}},
{
targets
:
4
,
createdCell
:
function
(
td
,
cellData
)
{
if
(
!
cellData
)
{
...
...
@@ -187,8 +187,8 @@ function initTable() {
}
}},
{
targets
:
5
,
createdCell
:
function
(
td
,
cellData
,
rowData
)
{
var
update_btn
=
'<a href="{% url "assets:asset-update" pk=
99991937 %}" class="btn btn-xs btn-info">{% trans "Update" %}</a>'
.
replace
(
'99991937
'
,
rowData
.
id
);
var
del_btn
=
'<a class="btn btn-xs btn-danger m-l-xs btn_asset_delete" data-aid="
99991937">{% trans "Remove" %}</a>'
.
replace
(
'99991937
'
,
rowData
.
id
);
var
update_btn
=
'<a href="{% url "assets:asset-update" pk=
DEFAULT_PK %}" class="btn btn-xs btn-info">{% trans "Update" %}</a>'
.
replace
(
'{{ DEFAULT_PK }}
'
,
rowData
.
id
);
var
del_btn
=
'<a class="btn btn-xs btn-danger m-l-xs btn_asset_delete" data-aid="
{{ DEFAULT_PK }}">{% trans "Remove" %}</a>'
.
replace
(
'{{ DEFAULT_PK }}
'
,
rowData
.
id
);
$
(
td
).
html
(
update_btn
+
del_btn
)
}}
],
...
...
apps/assets/templates/assets/asset_group_list.html
View file @
cb570026
...
...
@@ -44,16 +44,16 @@ $(document).ready(function(){
ele
:
$
(
'#asset_groups_list_table'
),
columnDefs
:
[
{
targets
:
1
,
createdCell
:
function
(
td
,
cellData
,
rowData
)
{
var
detail_btn
=
'<a href="{% url "assets:asset-group-detail" pk=
99991937
%}">'
+
cellData
+
'</a>'
;
$
(
td
).
html
(
detail_btn
.
replace
(
'
99991937
'
,
rowData
.
id
));
var
detail_btn
=
'<a href="{% url "assets:asset-group-detail" pk=
DEFAULT_PK
%}">'
+
cellData
+
'</a>'
;
$
(
td
).
html
(
detail_btn
.
replace
(
'
{{ DEFAULT_PK }}
'
,
rowData
.
id
));
}},
{
targets
:
3
,
createdCell
:
function
(
td
,
cellData
)
{
var
innerHtml
=
cellData
.
length
>
30
?
cellData
.
substring
(
0
,
30
)
+
'...'
:
cellData
;
$
(
td
).
html
(
'<a href="javascript:void(0);" data-toggle="tooltip" title="'
+
cellData
+
'">'
+
innerHtml
+
'</a>'
);
}},
{
targets
:
4
,
createdCell
:
function
(
td
,
cellData
,
rowData
)
{
var
update_btn
=
'<a href="{% url "assets:asset-group-update" pk=
99991937 %}" class="btn btn-xs m-l-xs btn-info">{% trans "Update" %}</a>'
.
replace
(
'99991937
'
,
cellData
);
var
del_btn
=
'<a class="btn btn-xs btn-danger m-l-xs btn_asset_group_delete" data-uid="
99991937">{% trans "Delete" %}</a>'
.
replace
(
'99991937
'
,
cellData
);
var
update_btn
=
'<a href="{% url "assets:asset-group-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_asset_group_delete" data-uid="
{{ DEFAULT_PK }}">{% trans "Delete" %}</a>'
.
replace
(
'{{ DEFAULT_PK }}
'
,
cellData
);
$
(
td
).
html
(
update_btn
+
del_btn
)
}}],
ajax_url
:
'{% url "api-assets:asset-group-list" %}'
,
...
...
@@ -68,7 +68,7 @@ $(document).ready(function(){
var
$data_table
=
$
(
'#asset_groups_list_table'
).
DataTable
();
var
name
=
$
(
this
).
closest
(
"tr"
).
find
(
":nth-child(2)"
).
children
(
'a'
).
html
();
var
uid
=
$this
.
data
(
'uid'
);
var
the_url
=
'{% url "api-assets:asset-group-detail" pk=
99991937 %}'
.
replace
(
'99991937
'
,
uid
);
var
the_url
=
'{% url "api-assets:asset-group-detail" pk=
DEFAULT_PK %}'
.
replace
(
'{{ DEFAULT_PK }}
'
,
uid
);
objectDelete
(
$this
,
name
,
the_url
);
setTimeout
(
function
()
{
$data_table
.
ajax
.
reload
();
...
...
apps/assets/templates/assets/asset_list.html
View file @
cb570026
...
...
@@ -93,7 +93,7 @@ $(document).ready(function(){
}},
{
targets
:
9
,
createdCell
:
function
(
td
,
cellData
,
rowData
)
{
var
update_btn
=
'<a href="{% url "assets:asset-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_asset_delete" data-uid="{{ DEFAULT_PK }}">{% trans "Delete" %}</a>'
.
replace
(
'
99991937
'
,
cellData
);
var
del_btn
=
'<a class="btn btn-xs btn-danger m-l-xs btn_asset_delete" data-uid="{{ DEFAULT_PK }}">{% trans "Delete" %}</a>'
.
replace
(
'
{{ DEFAULT_PK }}
'
,
cellData
);
$
(
td
).
html
(
update_btn
+
del_btn
)
}}
],
...
...
@@ -151,7 +151,7 @@ $(document).ready(function(){
var
$data_table
=
$
(
"#asset_list_table"
).
DataTable
();
var
name
=
$
(
this
).
closest
(
"tr"
).
find
(
":nth-child(2)"
).
children
(
'a'
).
html
();
var
uid
=
$this
.
data
(
'uid'
);
var
the_url
=
'{% url "api-assets:asset-detail" pk=
99991937
%}'
.
replace
(
"{{ DEFAULT_PK }}"
,
uid
);
var
the_url
=
'{% url "api-assets:asset-detail" pk=
DEFAULT_PK
%}'
.
replace
(
"{{ DEFAULT_PK }}"
,
uid
);
objectDelete
(
$this
,
name
,
the_url
);
setTimeout
(
function
()
{
$data_table
.
ajax
.
reload
();
...
...
apps/assets/templates/assets/cluster_assets.html
View file @
cb570026
...
...
@@ -158,8 +158,8 @@ function initTable() {
order
:
[],
columnDefs
:
[
{
targets
:
1
,
createdCell
:
function
(
td
,
cellData
,
rowData
)
{
var
detail_btn
=
'<a href="{% url "assets:asset-detail" pk=
99991937
%}" data-aid="'
+
rowData
.
id
+
'">'
+
cellData
+
'</a>'
;
$
(
td
).
html
(
detail_btn
.
replace
(
'
99991937
'
,
rowData
.
id
));
var
detail_btn
=
'<a href="{% url "assets:asset-detail" pk=
DEFAULT_PK
%}" data-aid="'
+
rowData
.
id
+
'">'
+
cellData
+
'</a>'
;
$
(
td
).
html
(
detail_btn
.
replace
(
'
{{ DEFAULT_PK }}
'
,
rowData
.
id
));
}},
{
targets
:
5
,
createdCell
:
function
(
td
,
cellData
)
{
if
(
!
cellData
)
{
...
...
apps/assets/templates/assets/cluster_detail.html
View file @
cb570026
...
...
@@ -149,7 +149,7 @@ $(document).ready(function () {
.
on
(
'click'
,
'.btn-delete-cluster'
,
function
()
{
var
name
=
$
(
'.cluster-details > tbody > tr'
).
attr
(
"data-name"
);
var
id
=
{{
cluster
.
id
}};
var
the_url
=
'{% url "api-assets:cluster-detail" pk=
99991937 %}'
.
replace
(
99991937
,
id
);
var
the_url
=
'{% url "api-assets:cluster-detail" pk=
DEFAULT_PK %}'
.
replace
(
"{{ DEFAULT_PK }}"
,
id
);
clusterDelete
(
name
,
the_url
);
});
</script>
...
...
apps/assets/templates/assets/cluster_list.html
View file @
cb570026
...
...
@@ -48,13 +48,13 @@ $(document).ready(function(){
ele
:
$
(
'#cluster_list_table'
),
columnDefs
:
[
{
targets
:
1
,
createdCell
:
function
(
td
,
cellData
,
rowData
)
{
var
detail_btn
=
'<a href="{% url "assets:cluster-detail" pk=
99991937
%}">'
+
cellData
+
'</a>'
;
$
(
td
).
html
(
detail_btn
.
replace
(
'
99991937
'
,
rowData
.
id
));
var
detail_btn
=
'<a href="{% url "assets:cluster-detail" pk=
DEFAULT_PK
%}">'
+
cellData
+
'</a>'
;
$
(
td
).
html
(
detail_btn
.
replace
(
'
{{ DEFAULT_PK }}
'
,
rowData
.
id
));
}},
{
targets
:
7
,
createdCell
:
function
(
td
,
cellData
,
rowData
)
{
var
update_btn
=
'<a href="{% url "assets:cluster-update" pk=
99991937 %}" class="btn btn-xs btn-info">{% trans "Update" %}</a>'
.
replace
(
'99991937
'
,
cellData
);
var
del_btn
=
'<a class="btn btn-xs btn-danger m-l-xs btn_cluster_delete" data-uid="
99991937">{% trans "Delete" %}</a>'
.
replace
(
'99991937
'
,
cellData
);
var
update_btn
=
'<a href="{% url "assets:cluster-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_cluster_delete" data-uid="
{{ DEFAULT_PK }}">{% trans "Delete" %}</a>'
.
replace
(
'{{ DEFAULT_PK }}
'
,
cellData
);
$
(
td
).
html
(
update_btn
+
del_btn
)
}}],
ajax_url
:
'{% url "api-assets:cluster-list" %}'
,
...
...
@@ -70,7 +70,7 @@ $(document).ready(function(){
var
$data_table
=
$
(
'#cluster_list_table'
).
DataTable
();
var
name
=
$
(
this
).
closest
(
"tr"
).
find
(
":nth-child(2)"
).
children
(
'a'
).
html
();
var
uid
=
$this
.
data
(
'uid'
);
var
the_url
=
'{% url "api-assets:cluster-detail" pk=
99991937 %}'
.
replace
(
'99991937
'
,
uid
);
var
the_url
=
'{% url "api-assets:cluster-detail" pk=
DEFAULT_PK %}'
.
replace
(
'{{ DEFAULT_PK }}
'
,
uid
);
objectDelete
(
$this
,
name
,
the_url
);
setTimeout
(
function
()
{
$data_table
.
ajax
.
reload
();
...
...
apps/assets/templates/assets/system_user_asset.html
View file @
cb570026
...
...
@@ -119,8 +119,8 @@ function initAssetsTable() {
order
:
[],
columnDefs
:
[
{
targets
:
0
,
createdCell
:
function
(
td
,
cellData
,
rowData
)
{
var
detail_btn
=
'<a href="{% url "assets:asset-detail" pk=
99991937
%}" data-aid="'
+
rowData
.
id
+
'">'
+
cellData
+
'</a>'
;
$
(
td
).
html
(
detail_btn
.
replace
(
'
99991937
'
,
rowData
.
id
));
var
detail_btn
=
'<a href="{% url "assets:asset-detail" pk=
DEFAULT_PK
%}" data-aid="'
+
rowData
.
id
+
'">'
+
cellData
+
'</a>'
;
$
(
td
).
html
(
detail_btn
.
replace
(
'
{{ DEFAULT_PK }}
'
,
rowData
.
id
));
}},
{
targets
:
3
,
createdCell
:
function
(
td
,
cellData
)
{
if
(
!
cellData
)
{
...
...
apps/assets/templates/assets/system_user_list.html
View file @
cb570026
...
...
@@ -46,17 +46,17 @@ $(document).ready(function(){
ele
:
$
(
'#system_user_list_table'
),
columnDefs
:
[
{
targets
:
1
,
createdCell
:
function
(
td
,
cellData
,
rowData
)
{
var
detail_btn
=
'<a href="{% url "assets:system-user-detail" pk=
99991937
%}">'
+
cellData
+
'</a>'
;
$
(
td
).
html
(
detail_btn
.
replace
(
'
99991937
'
,
rowData
.
id
));
var
detail_btn
=
'<a href="{% url "assets:system-user-detail" pk=
DEFAULT_PK
%}">'
+
cellData
+
'</a>'
;
$
(
td
).
html
(
detail_btn
.
replace
(
'
{{ DEFAULT_PK }}
'
,
rowData
.
id
));
}},
{
targets
:
5
,
createdCell
:
function
(
td
,
cellData
)
{
var
innerHtml
=
cellData
.
length
>
30
?
cellData
.
substring
(
0
,
30
)
+
'...'
:
cellData
;
$
(
td
).
html
(
'<span href="javascript:void(0);" data-toggle="tooltip" title="'
+
cellData
+
'">'
+
innerHtml
+
'</span>'
);
}},
{
targets
:
6
,
createdCell
:
function
(
td
,
cellData
,
rowData
)
{
{
#
var
script_btn
=
'<a href="{% url "assets:system-user-update" pk=
99991937 %}" class="btn btn-xs btn-primary">{% trans "Script" %}</a>'
.
replace
(
'99991937
'
,
cellData
);
#
}
var
update_btn
=
'<a href="{% url "assets:system-user-update" pk=
99991937 %}" class="btn btn-xs m-l-xs btn-info">{% trans "Update" %}</a>'
.
replace
(
'99991937
'
,
cellData
);
var
del_btn
=
'<a class="btn btn-xs btn-danger m-l-xs btn_admin_user_delete" data-uid="
99991937">{% trans "Delete" %}</a>'
.
replace
(
'99991937
'
,
cellData
);
{
#
var
script_btn
=
'<a href="{% url "assets:system-user-update" pk=
DEFAULT_PK %}" class="btn btn-xs btn-primary">{% trans "Script" %}</a>'
.
replace
(
'{{ DEFAULT_PK }}
'
,
cellData
);
#
}
var
update_btn
=
'<a href="{% url "assets:system-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
);
$
(
td
).
html
(
update_btn
+
del_btn
)
}}],
ajax_url
:
'{% url "api-assets:system-user-list" %}'
,
...
...
@@ -72,7 +72,7 @@ $(document).ready(function(){
var
$data_table
=
$
(
'#cluster_list_table'
).
DataTable
();
var
name
=
$
(
this
).
closest
(
"tr"
).
find
(
":nth-child(2)"
).
children
(
'a'
).
html
();
var
uid
=
$this
.
data
(
'uid'
);
var
the_url
=
'{% url "api-assets:system-user-detail" pk=
99991937 %}'
.
replace
(
'99991937
'
,
uid
);
var
the_url
=
'{% url "api-assets:system-user-detail" pk=
DEFAULT_PK %}'
.
replace
(
'{{ DEFAULT_PK }}
'
,
uid
);
objectDelete
(
$this
,
name
,
the_url
);
setTimeout
(
function
()
{
$data_table
.
ajax
.
reload
();
...
...
apps/assets/templates/assets/user_asset_list.html
View file @
cb570026
...
...
@@ -53,8 +53,8 @@ $(document).ready(function(){
ele
:
$
(
'#asset_list_table'
),
columnDefs
:
[
{
targets
:
1
,
createdCell
:
function
(
td
,
cellData
,
rowData
)
{
var
detail_btn
=
'<a href="{% url "assets:asset-detail" pk=
99991937
%}">'
+
cellData
+
'</a>'
;
$
(
td
).
html
(
detail_btn
.
replace
(
'
99991937
'
,
rowData
.
id
));
var
detail_btn
=
'<a href="{% url "assets:asset-detail" pk=
DEFAULT_PK
%}">'
+
cellData
+
'</a>'
;
$
(
td
).
html
(
detail_btn
.
replace
(
'
{{ DEFAULT_PK }}
'
,
rowData
.
id
));
}},
{
targets
:
7
,
createdCell
:
function
(
td
,
cellData
)
{
if
(
!
cellData
)
{
...
...
@@ -122,7 +122,7 @@ $(document).ready(function(){
var
$this
=
$
(
this
);
var
name
=
$
(
this
).
closest
(
"tr"
).
find
(
":nth-child(2)"
).
children
(
'a'
).
html
();
var
uid
=
$this
.
data
(
'uid'
);
var
the_url
=
'{% url "api-assets:asset-detail" pk=
99991937 %}'
.
replace
(
'99991937
'
,
uid
);
var
the_url
=
'{% url "api-assets:asset-detail" pk=
DEFAULT_PK %}'
.
replace
(
'{{ DEFAULT_PK }}
'
,
uid
);
objectDelete
(
$this
,
name
,
the_url
);
})
...
...
apps/ops/templates/ops/task_adhoc.html
View file @
cb570026
...
...
@@ -106,7 +106,7 @@
}
}},
{
targets
:
7
,
createdCell
:
function
(
td
,
cellData
,
rowData
)
{
var
detail_btn
=
'<a class="btn btn-xs btn-primary m-l-xs btn-run" data-uid="
99991937">{% trans "Detail" %}</a>'
.
replace
(
'99991937
'
,
cellData
);
var
detail_btn
=
'<a class="btn btn-xs btn-primary m-l-xs btn-run" data-uid="
{{ DEFAULT_PK }}">{% trans "Detail" %}</a>'
.
replace
(
'{{ DEFAULT_PK }}
'
,
cellData
);
if
(
cellData
)
{
$
(
td
).
html
(
detail_btn
);
}
...
...
apps/ops/templates/ops/task_history.html
View file @
cb570026
...
...
@@ -115,7 +115,7 @@
}
}},
{
targets
:
7
,
createdCell
:
function
(
td
,
cellData
)
{
var
run_btn
=
'<a class="btn btn-xs btn-primary m-l-xs btn-run" data-uid="
99991937">{% trans "Detail" %}</a>'
.
replace
(
'99991937
'
,
cellData
);
var
run_btn
=
'<a class="btn btn-xs btn-primary m-l-xs btn-run" data-uid="
{{ DEFAULT_PK }}">{% trans "Detail" %}</a>'
.
replace
(
'{{ DEFAULT_PK }}
'
,
cellData
);
if
(
cellData
)
{
$
(
td
).
html
(
run_btn
);
}
...
...
apps/ops/templates/ops/task_list.html
View file @
cb570026
...
...
@@ -96,7 +96,7 @@
var
$this
=
$
(
this
);
var
name
=
$
(
this
).
closest
(
"tr"
).
find
(
":nth-child(2)"
).
children
(
'a'
).
html
();
var
uid
=
$this
.
data
(
'uid'
);
var
the_url
=
'{% url "api-ops:task-detail" pk=
99991937 %}'
.
replace
(
'99991937
'
,
uid
);
var
the_url
=
'{% url "api-ops:task-detail" pk=
DEFAULT_PK %}'
.
replace
(
'{{ DEFAULT_PK }}
'
,
uid
);
objectDelete
(
$this
,
name
,
the_url
);
})
</script>
...
...
apps/perms/templates/perms/asset_permission_detail.html
View file @
cb570026
...
...
@@ -239,7 +239,7 @@
var
$this
=
$
(
this
);
var
name
=
"{{ asset_permission.name }}"
;
var
uid
=
"{{ asset_permission.id }}"
;
var
the_url
=
'{% url "api-perms:asset-permission-detail" pk=
99991937 %}'
.
replace
(
'99991937
'
,
uid
);
var
the_url
=
'{% url "api-perms:asset-permission-detail" pk=
DEFAULT_PK %}'
.
replace
(
'{{ DEFAULT_PK }}
'
,
uid
);
var
redirect_url
=
"{% url 'perms:asset-permission-list' %}"
;
objectDelete
(
$this
,
name
,
the_url
,
redirect_url
);
}).
on
(
'click'
,
'#btn_add_system_user'
,
function
()
{
...
...
apps/perms/templates/perms/asset_permission_list.html
View file @
cb570026
...
...
@@ -61,8 +61,8 @@
var
$this
=
$
(
this
);
var
name
=
$this
.
data
(
'name'
);
var
uid
=
$this
.
data
(
'uid'
);
var
the_url
=
'{% url "api-perms:asset-permission-detail" pk=
99991937
%}'
.
replace
(
'
99991937
'
,
uid
);
var
the_url
=
'{% url "api-perms:asset-permission-detail" pk=
DEFAULT_PK
%}'
.
replace
(
'
{{ DEFAULT_PK }}
'
,
uid
);
objectDelete
(
$this
,
name
,
the_url
);
})
</script>
...
...
apps/terminal/templates/terminal/terminal_list.html
View file @
cb570026
...
...
@@ -51,8 +51,8 @@ $(document).ready(function(){
buttons
:
[],
columnDefs
:
[
{
targets
:
1
,
createdCell
:
function
(
td
,
cellData
,
rowData
)
{
var
detail_btn
=
'<a href="{% url "terminal:terminal-detail" pk=
99991937
%}">'
+
cellData
+
'</a>'
;
$
(
td
).
html
(
detail_btn
.
replace
(
'
99991937
'
,
rowData
.
id
));
var
detail_btn
=
'<a href="{% url "terminal:terminal-detail" pk=
DEFAULT_PK
%}">'
+
cellData
+
'</a>'
;
$
(
td
).
html
(
detail_btn
.
replace
(
'
{{ DEFAULT_PK }}
'
,
rowData
.
id
));
}},
{
targets
:
6
,
createdCell
:
function
(
td
,
cellData
)
{
if
(
!
cellData
)
{
...
...
@@ -69,18 +69,18 @@ $(document).ready(function(){
}
}},
{
targets
:
8
,
createdCell
:
function
(
td
,
cellData
,
rowData
)
{
var
update_btn
=
'<a href="{% url "terminal:terminal-update" pk=
99991937
%}" class="btn btn-xs btn-info">{% trans "Update" %}</a>'
.
replace
(
'
99991937
'
,
cellData
);
var
delete_btn
=
'<a class="btn btn-xs btn-danger m-l-xs btn-del" data-id="
99991937
" data-name="99991938">{% trans "Delete" %}</a>'
.
replace
(
'
99991937
'
,
cellData
)
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
);
var
accept_btn
=
'<a class="btn btn-xs btn-primary btn-accept" data-id="
99991937
">{% trans "Accept" %}</a> '
.
replace
(
'
99991937
'
,
cellData
);
var
reject_btn
=
'<a class="btn btn-xs btn-danger m-l-xs btn-del" data-id="
99991937
" data-name="99991938">{% trans "Reject" %}</a>'
.
replace
(
'
99991937
'
,
cellData
)
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
);
var
connect_btn
=
'<a href="" class="btn btn-xs btn-warning btn-connect" >{% trans "Connect" %}</a> '
.
replace
(
'
99991937
'
,
cellData
);
.
replace
(
'
{{ DEFAULT_PK }}
'
,
cellData
);
if
(
rowData
.
is_accepted
)
{
{
%
if
user
.
is_superuser
%
}
$
(
td
).
html
(
connect_btn
+
update_btn
+
delete_btn
);
...
...
@@ -117,14 +117,14 @@ $(document).ready(function(){
var
$this
=
$
(
this
);
var
id
=
$this
.
data
(
'id'
);
var
name
=
$
(
this
).
data
(
'name'
);
var
the_url
=
'{% url "api-terminal:terminal-detail" pk=
99991937 %}'
.
replace
(
'99991937
'
,
id
);
var
the_url
=
'{% url "api-terminal:terminal-detail" pk=
DEFAULT_PK %}'
.
replace
(
'{{ DEFAULT_PK }}
'
,
id
);
objectDelete
(
$this
,
name
,
the_url
)
}).
on
(
'click'
,
'.btn-accept'
,
function
()
{
var
$this
=
$
(
this
);
var
terminal_id
=
$this
.
data
(
'id'
);
var
the_url
=
"{% url 'api-terminal:terminal-detail' pk=
99991937 %}"
.
replace
(
'99991937
'
,
terminal_id
);
var
post_url
=
$
(
'#form_terminal_accept'
).
attr
(
'action'
).
replace
(
'
99991937
'
,
terminal_id
);
var
the_url
=
"{% url 'api-terminal:terminal-detail' pk=
DEFAULT_PK %}"
.
replace
(
'{{ DEFAULT_PK }}
'
,
terminal_id
);
var
post_url
=
$
(
'#form_terminal_accept'
).
attr
(
'action'
).
replace
(
'
{{ DEFAULT_PK }}
'
,
terminal_id
);
console
.
log
(
post_url
);
$
.
ajax
({
url
:
the_url
,
...
...
apps/terminal/templates/terminal/terminal_modal_accept.html
View file @
cb570026
...
...
@@ -5,7 +5,7 @@
{% block modal_title%}{% trans "Accept terminal registration" %}{% endblock %}
{% block modal_body %}
{% load bootstrap3 %}
<form
action=
"{% url 'terminal:terminal-accept' pk="
99991937
"
%}"
method=
"post"
class=
"form-horizontal"
id=
"form_terminal_accept"
enctype=
"multipart/form-data"
>
<form
action=
"{% url 'terminal:terminal-accept' pk="
{{
DEFAULT_PK
}}
"
%}"
method=
"post"
class=
"form-horizontal"
id=
"form_terminal_accept"
enctype=
"multipart/form-data"
>
{% csrf_token %}
<p
class=
"alert alert-danger"
id=
"modal-error"
style=
"display: none"
></p>
{% bootstrap_field form.name layout="horizontal" %}
...
...
apps/users/templates/users/user_asset_permission.html
View file @
cb570026
...
...
@@ -123,8 +123,8 @@
select
:
[],
columnDefs
:
[
{
targets
:
1
,
createdCell
:
function
(
td
,
cellData
,
rowData
)
{
var
detail_btn
=
'<a href="{% url "perms:asset-permission-detail" pk=
99991937
%}">'
+
cellData
+
'</a>'
;
$
(
td
).
html
(
detail_btn
.
replace
(
'
99991937
'
,
rowData
.
id
));
var
detail_btn
=
'<a href="{% url "perms:asset-permission-detail" pk=
DEFAULT_PK
%}">'
+
cellData
+
'</a>'
;
$
(
td
).
html
(
detail_btn
.
replace
(
'
{{ DEFAULT_PK }}
'
,
rowData
.
id
));
}},
{
targets
:
2
,
createdCell
:
function
(
td
,
cellData
,
rowData
)
{
var
dataLength
=
cellData
.
length
;
...
...
@@ -146,11 +146,11 @@
}
}},
{
targets
:
6
,
createdCell
:
function
(
td
,
cellData
,
rowData
)
{
var
btn
=
'<button class="btn btn-danger btn-xs btn_del_permission disabled" id=
99991937
type="button" style="float: right;"><i class="fa fa-minus"></i></button>'
;
var
btn
=
'<button class="btn btn-danger btn-xs btn_del_permission disabled" id=
"{{ DEFAULT_PK }}"
type="button" style="float: right;"><i class="fa fa-minus"></i></button>'
;
if
(
rowData
.
is_inherited
)
{
$
(
td
).
html
(
btn
)
}
else
{
btn
=
btn
.
replace
(
'
99991937
'
,
cellData
);
btn
=
btn
.
replace
(
'
{{ DEFAULT_PK }}
'
,
cellData
);
$
(
td
).
html
(
btn
.
replace
(
'disabled'
,
''
));
}
}}
...
...
apps/users/templates/users/user_detail.html
View file @
cb570026
...
...
@@ -398,7 +398,7 @@ $(document).ready(function() {
var $this = $(this);
var name = "
{{
user
.
name
}}
";
var uid = "
{{
user
.
id
}}
";
var the_url = '{% url "
api
-
users
:
user
-
detail
" pk=
99991937 %}'.replace('99991937
', uid);
var the_url = '{% url "
api
-
users
:
user
-
detail
" pk=
DEFAULT_PK %}'.replace('{{ DEFAULT_PK }}
', uid);
var redirect_url = "
{
%
url
'users:user-list'
%
}
";
objectDelete($this, name, the_url, redirect_url);
})
...
...
apps/users/templates/users/user_granted_asset.html
View file @
cb570026
...
...
@@ -113,8 +113,8 @@
select
:
[],
columnDefs
:
[
{
targets
:
1
,
createdCell
:
function
(
td
,
cellData
,
rowData
)
{
var
detail_btn
=
'<a href="{% url "assets:asset-detail" pk=
99991937
%}">'
+
cellData
+
'</a>'
;
$
(
td
).
html
(
detail_btn
.
replace
(
'
99991937
'
,
rowData
.
id
));
var
detail_btn
=
'<a href="{% url "assets:asset-detail" pk=
DEFAULT_PK
%}">'
+
cellData
+
'</a>'
;
$
(
td
).
html
(
detail_btn
.
replace
(
'
{{ DEFAULT_PK }}
'
,
rowData
.
id
));
}},
{
targets
:
4
,
createdCell
:
function
(
td
,
cellData
,
rowData
)
{
if
(
cellData
.
length
>
10
){
...
...
@@ -142,8 +142,8 @@
select
:
[],
columnDefs
:
[
{
targets
:
1
,
createdCell
:
function
(
td
,
cellData
,
rowData
)
{
var
detail_btn
=
'<a href="{% url "assets:asset-group-detail" pk=
99991937
%}">'
+
cellData
+
'</a>'
;
$
(
td
).
html
(
detail_btn
.
replace
(
'
99991937
'
,
rowData
.
id
));
var
detail_btn
=
'<a href="{% url "assets:asset-group-detail" pk=
DEFAULT_PK
%}">'
+
cellData
+
'</a>'
;
$
(
td
).
html
(
detail_btn
.
replace
(
'
{{ DEFAULT_PK }}
'
,
rowData
.
id
));
}}
],
ajax_url
:
'{% url "api-perms:user-asset-groups" pk=user.id %}'
,
...
...
apps/users/templates/users/user_group_asset_permission.html
View file @
cb570026
...
...
@@ -124,8 +124,8 @@
select
:
[],
columnDefs
:
[
{
targets
:
1
,
createdCell
:
function
(
td
,
cellData
,
rowData
)
{
var
detail_btn
=
'<a href="{% url "perms:asset-permission-detail" pk=
99991937
%}">'
+
cellData
+
'</a>'
;
$
(
td
).
html
(
detail_btn
.
replace
(
'
99991937
'
,
rowData
.
id
));
var
detail_btn
=
'<a href="{% url "perms:asset-permission-detail" pk=
DEFAULT_PK
%}">'
+
cellData
+
'</a>'
;
$
(
td
).
html
(
detail_btn
.
replace
(
'
{{ DEFAULT_PK }}
'
,
rowData
.
id
));
}},
{
targets
:
2
,
createdCell
:
function
(
td
,
cellData
,
rowData
)
{
var
dataLength
=
cellData
.
length
;
...
...
@@ -147,8 +147,8 @@
}
}},
{
targets
:
6
,
createdCell
:
function
(
td
,
cellData
,
rowData
)
{
var
btn
=
'<button class="btn btn-danger btn-xs btn_del_permission" id=
99991937
type="button" style="float: right;"><i class="fa fa-minus"></i></button>'
;
btn
=
btn
.
replace
(
'
99991937
'
,
cellData
);
var
btn
=
'<button class="btn btn-danger btn-xs btn_del_permission" id=
"{{ DEFAULT_PK }}"
type="button" style="float: right;"><i class="fa fa-minus"></i></button>'
;
btn
=
btn
.
replace
(
'
{{ DEFAULT_PK }}
'
,
cellData
);
$
(
td
).
html
(
btn
)
}}
],
...
...
apps/users/templates/users/user_group_detail.html
View file @
cb570026
...
...
@@ -193,7 +193,7 @@ $(document).ready(function () {
var
$this
=
$
(
this
);
var
name
=
"{{ user_group.name }}"
;
var
uid
=
"{{ user_group.id }}"
;
var
the_url
=
'{% url "api-users:user-group-detail" pk=
99991937 %}'
.
replace
(
'99991937
'
,
uid
);
var
the_url
=
'{% url "api-users:user-group-detail" pk=
DEFAULT_PK %}'
.
replace
(
'{{ DEFAULT_PK }}
'
,
uid
);
var
redirect_url
=
"{% url 'users:user-group-list' %}"
;
objectDelete
(
$this
,
name
,
the_url
,
redirect_url
);
})
...
...
apps/users/templates/users/user_group_granted_asset.html
View file @
cb570026
...
...
@@ -113,8 +113,8 @@
select
:
[],
columnDefs
:
[
{
targets
:
1
,
createdCell
:
function
(
td
,
cellData
,
rowData
)
{
var
detail_btn
=
'<a href="{% url "assets:asset-detail" pk=
99991937
%}">'
+
cellData
+
'</a>'
;
$
(
td
).
html
(
detail_btn
.
replace
(
'
99991937
'
,
rowData
.
id
));
var
detail_btn
=
'<a href="{% url "assets:asset-detail" pk=
DEFAULT_PK
%}">'
+
cellData
+
'</a>'
;
$
(
td
).
html
(
detail_btn
.
replace
(
'
{{ DEFAULT_PK }}
'
,
rowData
.
id
));
}},
{
targets
:
4
,
createdCell
:
function
(
td
,
cellData
,
rowData
)
{
if
(
cellData
.
length
>
10
){
...
...
@@ -142,8 +142,8 @@
select
:
[],
columnDefs
:
[
{
targets
:
1
,
createdCell
:
function
(
td
,
cellData
,
rowData
)
{
var
detail_btn
=
'<a href="{% url "assets:asset-group-detail" pk=
99991937
%}">'
+
cellData
+
'</a>'
;
$
(
td
).
html
(
detail_btn
.
replace
(
'
99991937
'
,
rowData
.
id
));
var
detail_btn
=
'<a href="{% url "assets:asset-group-detail" pk=
DEFAULT_PK
%}">'
+
cellData
+
'</a>'
;
$
(
td
).
html
(
detail_btn
.
replace
(
'
{{ DEFAULT_PK }}
'
,
rowData
.
id
));
}}
],
ajax_url
:
'{% url "api-perms:user-group-asset-groups" pk=user_group.id %}'
,
...
...
apps/users/templates/users/user_group_list.html
View file @
cb570026
...
...
@@ -39,18 +39,18 @@ $(document).ready(function() {
buttons
:
[],
columnDefs
:
[
{
targets
:
1
,
createdCell
:
function
(
td
,
cellData
,
rowData
)
{
var
detail_btn
=
'<a href="{% url "users:user-group-detail" pk=
99991937
%}">'
+
cellData
+
'</a>'
;
$
(
td
).
html
(
detail_btn
.
replace
(
'
99991937
'
,
rowData
.
id
));
var
detail_btn
=
'<a href="{% url "users:user-group-detail" pk=
DEFAULT_PK
%}">'
+
cellData
+
'</a>'
;
$
(
td
).
html
(
detail_btn
.
replace
(
'
{{ DEFAULT_PK }}
'
,
rowData
.
id
));
}},
{
targets
:
3
,
createdCell
:
function
(
td
,
cellData
)
{
var
innerHtml
=
cellData
.
length
>
30
?
cellData
.
substring
(
0
,
30
)
+
'...'
:
cellData
;
$
(
td
).
html
(
'<span href="javascript:void(0);" data-toggle="tooltip" title="'
+
cellData
+
'">'
+
innerHtml
+
'</span>'
);
}},
{
targets
:
4
,
createdCell
:
function
(
td
,
cellData
,
rowData
)
{
var
update_btn
=
'<a href="{% url "users:user-group-update" pk=
99991937
%}" class="btn btn-xs btn-info">{% trans "Update" %}</a>'
.
replace
(
'
99991937
'
,
cellData
);
var
del_btn
=
'<a class="btn btn-xs btn-danger m-l-xs btn_delete_user_group" data-gid="
99991937
" data-name="99991938">{% trans "Delete" %}</a>'
.
replace
(
'
99991937
'
,
cellData
)
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
);
if
(
rowData
.
id
===
1
)
{
$
(
td
).
html
(
update_btn
)
...
...
@@ -69,7 +69,7 @@ $(document).ready(function() {
var
$this
=
$
(
this
);
var
group_id
=
$this
.
data
(
'gid'
);
var
name
=
$this
.
data
(
'name'
);
var
the_url
=
"{% url 'api-users:user-group-detail' pk=
99991937 %}"
.
replace
(
'99991937
'
,
group_id
);
var
the_url
=
"{% url 'api-users:user-group-detail' pk=
DEFAULT_PK %}"
.
replace
(
'{{ DEFAULT_PK }}
'
,
group_id
);
objectDelete
(
$this
,
name
,
the_url
)
}).
on
(
'click'
,
'#btn_bulk_update'
,
function
(){
var
action
=
$
(
'#slct_bulk_update'
).
val
();
...
...
apps/users/templates/users/user_list.html
View file @
cb570026
...
...
@@ -74,8 +74,8 @@ function renderTable() {
ele
:
$
(
'#user_list_table'
),
columnDefs
:
[
{
targets
:
1
,
createdCell
:
function
(
td
,
cellData
,
rowData
)
{
var
detail_btn
=
'<a href="{% url "users:user-detail" pk=
'
00000000
-
0000
-
0000
-
0000
-
000000000000
'
%}">'
+
cellData
+
'</a>'
;
$
(
td
).
html
(
detail_btn
.
replace
(
'00000000-0000-0000-0000-000000000000'
,
rowData
.
id
));
var
detail_btn
=
'<a href="{% url "users:user-detail" pk=
DEFAULT_PK
%}">'
+
cellData
+
'</a>'
;
$
(
td
).
html
(
detail_btn
.
replace
(
"{{ DEFAULT_PK }}"
,
rowData
.
id
));
}},
{
targets
:
4
,
createdCell
:
function
(
td
,
cellData
)
{
var
innerHtml
=
cellData
.
length
>
20
?
cellData
.
substring
(
0
,
20
)
+
'...'
:
cellData
;
...
...
@@ -90,8 +90,8 @@ function renderTable() {
}},
{
targets
:
6
,
createdCell
:
function
(
td
,
cellData
,
rowData
)
{
var
update_btn
=
'<a href="{% url "users:user-update" pk='
00000000
-
0000
-
0000
-
0000
-
000000000000
' %}" class="btn btn-xs btn-info">{% trans "Update" %}</a>'
.
replace
(
'00000000-0000-0000-0000-000000000000'
,
cellData
);
var
del_btn
=
'<a class="btn btn-xs btn-danger m-l-xs btn_user_delete" data-uid="
00000000-0000-0000-0000-000000000000
" data-name="99991938">{% trans "Delete" %}</a>'
.
replace
(
'
00000000-0000-0000-0000-000000000000
'
,
cellData
)
var
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
);
if
(
rowData
.
id
===
1
||
rowData
.
username
==
"admin"
)
{
$
(
td
).
html
(
update_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