mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: support response.pjax
This commit is contained in:
1 parent
89fb04bfb3
commit
f08ac664da
6 files changed
+27
-48
No files matched your search
@@ -284,7 +284,7 @@ const allPriv = Math.sum(Object.values(Priv));
|
||||
|
||||
class SystemUserPrivHandler extends SystemHandler {
|
||||
@requireSudo
|
||||
async get({ pjax }) {
|
||||
async get() {
|
||||
const defaultPriv = system.get('default.priv');
|
||||
const udocs = await user.getMulti({ _id: { $gte: -1000, $ne: 1 }, priv: { $nin: [0, defaultPriv] } }).limit(1000).sort({ _id: 1 }).toArray();
|
||||
const banudocs = await user.getMulti({ _id: { $gte: -1000, $ne: 1 }, priv: 0 }).limit(1000).sort({ _id: 1 }).toArray();
|
||||
@@ -293,10 +293,8 @@ class SystemUserPrivHandler extends SystemHandler {
|
||||
defaultPriv,
|
||||
Priv,
|
||||
};
|
||||
if (pjax) {
|
||||
const html = await this.renderHTML('partials/manage_user_priv.html', this.response.body);
|
||||
this.response.body = { fragments: [{ html }] };
|
||||
} else this.response.template = 'manage_user_priv.html';
|
||||
this.response.pjax = 'partials/manage_user_priv.html';
|
||||
this.response.template = 'manage_user_priv.html';
|
||||
}
|
||||
|
||||
@requireSudo
|
||||
|
||||
Reference in new issue
Block a user