-
-
- {gettext('Status')}{': '}{this.translateStatus(this.props.isActive)}
-
-
-
- { onStatusChange(''); }}>
- {gettext('All')}{this.props.isActive === '' && this.renderCheck()}
-
- { onStatusChange('1'); }}>
- {gettext('Active')}{this.props.isActive === '1' && this.renderCheck()}
-
- { onStatusChange('0'); }}>
- {gettext('Inactive')}{this.props.isActive === '0' && this.renderCheck()}
-
-
-
-
-
- {gettext('Role')}{': '}{this.translateRole(this.props.role)}
-
-
-
- { onRoleChange(''); }}>
- {gettext('All')}
- {this.props.role === '' && this.renderCheck()}
-
- {availableRoles.map((item, index) => {
- return (
- { onRoleChange(item); }}>
- {this.translateRole(item)}
- {this.props.role === item && this.renderCheck()}
-
- );
- })}
-
-
+
+ {`${gettext('Status')}:`}
+
+
+ {`${gettext('Role')}:`}
+
);
}
}
UsersFilterBar.propTypes = {
- loading: PropTypes.bool,
- curPerPage: PropTypes.number,
- sortBy: PropTypes.string,
- currentPage: PropTypes.number,
- sortOrder: PropTypes.string,
onStatusChange: PropTypes.func,
onRoleChange: PropTypes.func,
role: PropTypes.string,
diff --git a/frontend/src/pages/sys-admin/users/users.js b/frontend/src/pages/sys-admin/users/users.js
index 0560ef5ac9..b63bef46e1 100644
--- a/frontend/src/pages/sys-admin/users/users.js
+++ b/frontend/src/pages/sys-admin/users/users.js
@@ -16,6 +16,7 @@ import SysAdminAdminUser from '../../../models/sysadmin-admin-user';
import MainPanelTopbar from '../main-panel-topbar';
import Search from '../search';
import UsersNav from './users-nav';
+import UsersFilterBar from './users-filter-bar';
import Content from './users-content';
const { availableRoles } = window.sysadmin.pageOptions;
@@ -44,8 +45,8 @@ class Users extends Component {
isBatchSetQuotaDialogOpen: false,
isBatchDeleteUserDialogOpen: false,
isBatchAddAdminDialogOpen: false,
- is_active: null,
- role: null,
+ is_active: '',
+ role: ''
};
}
@@ -59,15 +60,17 @@ class Users extends Component {
sortBy = '',
sortOrder = 'asc',
is_active,
- role,
+ role
} = this.state;
this.setState({
perPage: parseInt(urlParams.get('per_page') || perPage),
currentPage: parseInt(urlParams.get('page') || currentPage),
sortBy: urlParams.get('order_by') || sortBy,
sortOrder: urlParams.get('direction') || sortOrder,
+ is_active: urlParams.get('is_active') || is_active,
+ role: urlParams.get('role') || role
}, () => {
- this.getUsersListByPage(this.state.currentPage, is_active, role);
+ this.getUsersListByPage(this.state.currentPage);
});
}
}
@@ -164,8 +167,8 @@ class Users extends Component {
});
};
- getUsersListByPage = (page, is_active, role) => {
- const { perPage, sortBy, sortOrder } = this.state;
+ getUsersListByPage = (page) => {
+ const { perPage, sortBy, sortOrder, is_active, role } = this.state;
const { isLDAPImported } = this.props;
systemAdminAPI.sysAdminListUsers(page, perPage, isLDAPImported, sortBy, sortOrder, is_active, role).then(res => {
let users = res.data.data.map(user => {return new SysAdminUser(user);});
@@ -183,11 +186,12 @@ class Users extends Component {
});
};
- updateURL = (page, perPage) => {
+ updateURLSearchParams = (obj) => {
let url = new URL(location.href);
let searchParams = new URLSearchParams(url.search);
- searchParams.set('page', page);
- searchParams.set('per_page', perPage);
+ for (const key in obj) {
+ searchParams.set(key, obj[key]);
+ }
url.search = searchParams.toString();
navigate(url.toString());
};
@@ -198,21 +202,28 @@ class Users extends Component {
is_active: is_active,
currentPage: 1
}, () => {
- const { currentPage, perPage, is_active, role } = this.state;
- this.updateURL(currentPage, perPage);
- this.getUsersListByPage(currentPage, is_active, role);
+ const { currentPage, perPage } = this.state;
+ this.updateURLSearchParams({
+ 'page': currentPage,
+ 'per_page': perPage,
+ 'is_active': is_active
+ });
+ this.getUsersListByPage(currentPage);
});
};
- // role: 'default', 'guest', ''
onRoleChange = (role) => {
this.setState({
role: role,
currentPage: 1
}, () => {
- const { currentPage, perPage, is_active, role } = this.state;
- this.updateURL(currentPage, perPage);
- this.getUsersListByPage(currentPage, is_active, role);
+ const { currentPage, perPage } = this.state;
+ this.updateURLSearchParams({
+ 'page': currentPage,
+ 'per_page': perPage,
+ 'role': role
+ });
+ this.getUsersListByPage(currentPage);
});
};
@@ -222,15 +233,14 @@ class Users extends Component {
sortOrder: this.state.sortOrder == 'asc' ? 'desc' : 'asc',
currentPage: 1
}, () => {
- let url = new URL(location.href);
- let searchParams = new URLSearchParams(url.search);
- const { currentPage, sortBy, sortOrder, is_active, role } = this.state;
- searchParams.set('page', currentPage);
- searchParams.set('order_by', sortBy);
- searchParams.set('direction', sortOrder);
- url.search = searchParams.toString();
- navigate(url.toString());
- this.getUsersListByPage(currentPage, is_active, role);
+ const { currentPage, perPage, sortBy, sortOrder } = this.state;
+ this.updateURLSearchParams({
+ 'page': currentPage,
+ 'per_page': perPage,
+ 'order_by': sortBy,
+ 'direction': sortOrder
+ });
+ this.getUsersListByPage(currentPage);
});
};
@@ -346,7 +356,7 @@ class Users extends Component {
this.setState({
perPage: perPage
}, () => {
- this.getUsersListByPage(1, this.state.is_active, this.state.role);
+ this.getUsersListByPage(1);
});
};
@@ -471,6 +481,8 @@ class Users extends Component {
render() {
const { isAdmin, isLDAPImported } = this.props;
const {
+ is_active,
+ role,
hasUserSelected,
isImportUserDialogOpen,
isAddUserDialogOpen,
@@ -478,6 +490,7 @@ class Users extends Component {
isBatchSetQuotaDialogOpen,
isBatchAddAdminDialogOpen
} = this.state;
+ const curTab = this.getCurrentNavItem();
return (
@@ -491,8 +504,16 @@ class Users extends Component {
-
+
+ {curTab == 'database' &&
+
+ }
diff --git a/scripts/setup-seafile-mysql.py b/scripts/setup-seafile-mysql.py
index d956dafb0e..858a28a7b6 100644
--- a/scripts/setup-seafile-mysql.py
+++ b/scripts/setup-seafile-mysql.py
@@ -1259,6 +1259,9 @@ pidfile = os.path.join(pids_dir, 'seahub.pid')
timeout = 1200
limit_request_line = 8190
+
+# for forwarder headers
+forwarder_headers = 'SCRIPT_NAME,PATH_INFO,REMOTE_USER'
'''
text = template % dict(pids_dir=env_mgr.central_pids_dir,