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
9c55450a
Commit
9c55450a
authored
May 29, 2019
by
八千流
Committed by
老广
May 29, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Bugfix] 修复资源表可以选择多页的资源数据 (#2744)
* [Bugfix] 修复资源表可以选择多页的资源数据 * [Bugfix]修改小问题
parent
00e986a6
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
34 additions
and
83 deletions
+34
-83
admin_user_list.html
apps/assets/templates/assets/admin_user_list.html
+10
-16
asset_list.html
apps/assets/templates/assets/asset_list.html
+3
-21
system_user_list.html
apps/assets/templates/assets/system_user_list.html
+5
-13
user_group_list.html
apps/users/templates/users/user_group_list.html
+9
-14
user_list.html
apps/users/templates/users/user_list.html
+7
-19
No files found.
apps/assets/templates/assets/admin_user_list.html
View file @
9c55450a
...
...
@@ -63,7 +63,8 @@
{% block content_bottom_left %}{% endblock %}
{% block custom_foot_js %}
<script>
$
(
document
).
ready
(
function
(){
var
admin_user_table
=
0
;
function
initTable
()
{
var
options
=
{
ele
:
$
(
'#admin_user_list_table'
),
columnDefs
:
[
...
...
@@ -116,7 +117,12 @@ $(document).ready(function(){
columns
:
[{
data
:
function
(){
return
""
}},
{
data
:
"name"
},
{
data
:
"username"
},
{
data
:
"assets_amount"
},
{
data
:
"reachable_amount"
},
{
data
:
"unreachable_amount"
},
{
data
:
"id"
},
{
data
:
"comment"
},
{
data
:
"id"
}]
};
jumpserver
.
initServerSideDataTable
(
options
)
admin_user_table
=
jumpserver
.
initServerSideDataTable
(
options
);
return
admin_user_table
}
$
(
document
).
ready
(
function
(){
initTable
()
})
.
on
(
'click'
,
'.btn_admin_user_delete'
,
function
()
{
...
...
@@ -132,12 +138,7 @@ $(document).ready(function(){
})
.
on
(
'click'
,
'.btn_export'
,
function
(){
var
data_table
=
$
(
'#admin_user_list_table'
).
DataTable
();
var
rows
=
data_table
.
rows
(
'.selected'
).
data
();
var
admin_users
=
[];
$
.
each
(
rows
,
function
(
index
,
obj
)
{
admin_users
.
push
(
obj
.
id
)
});
var
admin_users
=
admin_user_table
.
selected
;
var
data
=
{
'resources'
:
admin_users
};
...
...
@@ -168,14 +169,7 @@ $(document).ready(function(){
});
})
.
on
(
'click'
,
'#download_update_template'
,
function
()
{
var
$data_table
=
$
(
'#admin_user_list_table'
).
DataTable
();
var
rows
=
$data_table
.
rows
(
'.selected'
).
data
();
var
admin_users
=
[];
$
.
each
(
rows
,
function
(
index
,
obj
)
{
admin_users
.
push
(
obj
.
id
)
});
var
admin_users
=
admin_user_table
.
selected
;
var
data
=
{
'resources'
:
admin_users
};
...
...
apps/assets/templates/assets/asset_list.html
View file @
9c55450a
...
...
@@ -469,14 +469,7 @@ $(document).ready(function(){
asset_table
.
search
(
val
).
draw
();
})
.
on
(
'click'
,
'.btn_export'
,
function
()
{
var
$data_table
=
$
(
'#asset_list_table'
).
DataTable
();
var
rows
=
$data_table
.
rows
(
'.selected'
).
data
();
var
assets
=
[];
$
.
each
(
rows
,
function
(
index
,
obj
)
{
assets
.
push
(
obj
.
id
)
});
var
assets
=
asset_table
.
selected
;
var
data
=
{
'resources'
:
assets
};
...
...
@@ -513,14 +506,7 @@ $(document).ready(function(){
});
})
.
on
(
'click'
,
'#download_update_template'
,
function
()
{
var
$data_table
=
$
(
'#asset_list_table'
).
DataTable
();
var
rows
=
$data_table
.
rows
(
'.selected'
).
data
();
var
assets
=
[];
$
.
each
(
rows
,
function
(
index
,
obj
)
{
assets
.
push
(
obj
.
id
)
});
var
assets
=
asset_table
.
selected
;
var
data
=
{
'resources'
:
assets
};
...
...
@@ -639,11 +625,7 @@ $(document).ready(function(){
})
.
on
(
'click'
,
'#btn_bulk_update'
,
function
()
{
var
action
=
$
(
'#slct_bulk_update'
).
val
();
var
$data_table
=
$
(
'#asset_list_table'
).
DataTable
();
var
id_list
=
[];
$data_table
.
rows
({
selected
:
true
}).
every
(
function
(){
id_list
.
push
(
this
.
data
().
id
);
});
var
id_list
=
asset_table
.
selected
;
if
(
id_list
.
length
===
0
)
{
return
false
;
}
...
...
apps/assets/templates/assets/system_user_list.html
View file @
9c55450a
...
...
@@ -68,6 +68,7 @@
{% endblock %}
{% block custom_foot_js %}
<script>
var
system_user_table
=
0
;
function
initTable
()
{
var
options
=
{
ele
:
$
(
'#system_user_list_table'
),
...
...
@@ -125,7 +126,8 @@ function initTable() {
],
op_html
:
$
(
'#actions'
).
html
()
};
jumpserver
.
initServerSideDataTable
(
options
);
system_user_table
=
jumpserver
.
initServerSideDataTable
(
options
);
return
system_user_table
}
$
(
document
).
ready
(
function
(){
...
...
@@ -198,12 +200,7 @@ $(document).ready(function(){
}
})
.
on
(
'click'
,
'.btn_export'
,
function
()
{
var
data_table
=
$
(
'#system_user_list_table'
).
DataTable
();
var
rows
=
data_table
.
rows
(
'.selected'
).
data
();
var
system_users
=
[];
$
.
each
(
rows
,
function
(
index
,
obj
)
{
system_users
.
push
(
obj
.
id
)
});
var
system_users
=
system_user_table
.
selected
;
var
data
=
{
'resources'
:
system_users
};
...
...
@@ -235,12 +232,7 @@ $(document).ready(function(){
});
})
.
on
(
'click'
,
'#download_update_template'
,
function
()
{
var
data_table
=
$
(
'#system_user_list_table'
).
DataTable
();
var
rows
=
data_table
.
rows
(
'.selected'
).
data
();
var
system_users
=
[];
$
.
each
(
rows
,
function
(
index
,
obj
)
{
system_users
.
push
(
obj
.
id
)
});
var
system_users
=
system_user_table
.
selected
;
var
data
=
{
'resources'
:
system_users
};
...
...
apps/users/templates/users/user_group_list.html
View file @
9c55450a
...
...
@@ -46,7 +46,8 @@
{% block content_bottom_left %}{% endblock %}
{% block custom_foot_js %}
<script>
$
(
document
).
ready
(
function
()
{
var
groups_table
=
0
;
function
initTable
()
{
var
options
=
{
ele
:
$
(
'#group_list_table'
),
buttons
:
[],
...
...
@@ -84,7 +85,11 @@ $(document).ready(function() {
order
:
[],
op_html
:
$
(
'#actions'
).
html
()
};
jumpserver
.
initServerSideDataTable
(
options
);
groups_table
=
jumpserver
.
initServerSideDataTable
(
options
);
return
groups_table
}
$
(
document
).
ready
(
function
()
{
initTable
()
}).
on
(
'click'
,
'.btn_delete_user_group'
,
function
(){
var
$this
=
$
(
this
);
...
...
@@ -136,12 +141,7 @@ $(document).ready(function() {
break
;
}
}).
on
(
'click'
,
'.btn_export'
,
function
(){
var
data_table
=
$
(
'#group_list_table'
).
DataTable
();
var
rows
=
data_table
.
rows
(
'.selected'
).
data
();
var
groups
=
[];
$
.
each
(
rows
,
function
(
index
,
obj
)
{
groups
.
push
(
obj
.
id
)
});
var
groups
=
groups_table
.
selected
;
var
data
=
{
'resources'
:
groups
};
...
...
@@ -172,12 +172,7 @@ $(document).ready(function() {
});
})
.
on
(
'click'
,
'#download_update_template'
,
function
(){
var
data_table
=
$
(
'#group_list_table'
).
DataTable
();
var
rows
=
data_table
.
rows
(
'.selected'
).
data
();
var
groups
=
[];
$
.
each
(
rows
,
function
(
index
,
obj
)
{
groups
.
push
(
obj
.
id
)
});
var
groups
=
groups_table
.
selected
;
var
data
=
{
'resources'
:
groups
};
...
...
apps/users/templates/users/user_list.html
View file @
9c55450a
...
...
@@ -66,7 +66,7 @@
{% block custom_foot_js %}
<script
src=
"{% static 'js/jquery.form.min.js' %}"
></script>
<script>
var
users_table
=
0
;
function
initTable
()
{
var
options
=
{
ele
:
$
(
'#user_list_table'
),
...
...
@@ -122,23 +122,19 @@ function initTable() {
],
op_html
:
$
(
'#actions'
).
html
()
};
var
table
=
jumpserver
.
initServerSideDataTable
(
options
);
return
table
users_
table
=
jumpserver
.
initServerSideDataTable
(
options
);
return
users_
table
}
$
(
document
).
ready
(
function
(){
var
table
=
initTable
();
initTable
();
var
fields
=
$
(
'#fm_user_bulk_update .form-group'
);
$
.
each
(
fields
,
function
(
index
,
value
)
{
console
.
log
(
value
)
});
$
(
'.btn_export'
).
click
(
function
()
{
var
rows
=
table
.
rows
(
'.selected'
).
data
();
var
users
=
[];
$
.
each
(
rows
,
function
(
index
,
obj
)
{
users
.
push
(
obj
.
id
)
});
var
users
=
users_table
.
selected
;
var
data
=
{
'resources'
:
users
};
...
...
@@ -171,11 +167,7 @@ $(document).ready(function(){
});
});
$
(
'#download_update_template'
).
click
(
function
()
{
var
rows
=
table
.
rows
(
'.selected'
).
data
();
var
users
=
[];
$
.
each
(
rows
,
function
(
index
,
obj
)
{
users
.
push
(
obj
.
id
)
});
var
users
=
users_table
.
selected
;
var
data
=
{
'resources'
:
users
};
...
...
@@ -209,11 +201,7 @@ $(document).ready(function(){
}).
on
(
'click'
,
'#btn_bulk_update'
,
function
(){
var
action
=
$
(
'#slct_bulk_update'
).
val
();
var
$data_table
=
$
(
'#user_list_table'
).
DataTable
();
var
id_list
=
[];
$data_table
.
rows
({
selected
:
true
}).
every
(
function
(){
id_list
.
push
(
this
.
data
().
id
);
});
var
id_list
=
users_table
.
selected
;
if
(
id_list
.
length
===
0
)
{
return
false
;
}
...
...
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