mirror of
https://github.com/haiwen/seahub.git
synced 2025-08-30 21:50:59 +00:00
optimize lint
This commit is contained in:
parent
6ec51afa43
commit
d1b4bd1903
@ -5,7 +5,6 @@ import { gettext } from '../../utils/constants';
|
||||
import '../../css/log-filter.css';
|
||||
import { Utils } from '../../utils/utils';
|
||||
import toaster from '../../components/toast';
|
||||
import { systemAdminAPI } from '../../utils/system-admin-api';
|
||||
|
||||
const propTypes = {
|
||||
items: PropTypes.array.isRequired,
|
||||
|
@ -3,7 +3,6 @@ import PropTypes from 'prop-types';
|
||||
import { Input } from 'reactstrap';
|
||||
import { gettext } from '../../utils/constants';
|
||||
import '../../css/log-filter.css';
|
||||
import { systemAdminAPI } from '../../utils/system-admin-api';
|
||||
import { Utils } from '../../utils/utils';
|
||||
import toaster from '../../components/toast';
|
||||
|
||||
@ -14,7 +13,7 @@ const propTypes = {
|
||||
onSelect: PropTypes.func.isRequired,
|
||||
isOpen: PropTypes.bool.isRequired,
|
||||
onToggle: PropTypes.func.isRequired,
|
||||
searchUsersFunc: PropTypes.func,
|
||||
searchUsersFunc: PropTypes.func.isRequired,
|
||||
};
|
||||
|
||||
class LogUserSelector extends Component {
|
||||
@ -67,9 +66,6 @@ class LogUserSelector extends Component {
|
||||
isLoading: true
|
||||
});
|
||||
|
||||
// const searchFunc = this.props.searchUsersFunc ||
|
||||
// ((value) => systemAdminAPI.sysAdminSearchUsers(value));
|
||||
|
||||
this.props.searchUsersFunc(value).then((res) => {
|
||||
const users = res.data.user_list || res.data.users || [];
|
||||
this.setState({
|
||||
@ -100,7 +96,7 @@ class LogUserSelector extends Component {
|
||||
<span className="cur-activity-modifiers d-inline-block p-2 rounded" onClick={this.onToggleClick}>
|
||||
{selectedItems.length > 0 ? (
|
||||
<>
|
||||
<span>{gettext(this.props.componentName + ":")}</span>
|
||||
<span>{gettext(this.props.componentName + ':')}</span>
|
||||
<span className="d-inline-block ml-1">{selectedItems.map(item => item.name).join(', ')}</span>
|
||||
</>
|
||||
) : gettext(this.props.componentName)}
|
||||
|
@ -48,7 +48,6 @@ class Content extends Component {
|
||||
loading, errorMsg, items,
|
||||
perPage, currentPage, hasNextPage
|
||||
} = this.props;
|
||||
console.log(currentPage)
|
||||
if (loading) {
|
||||
return <Loading />;
|
||||
} else if (errorMsg) {
|
||||
@ -339,7 +338,7 @@ class FileAccessLogs extends Component {
|
||||
};
|
||||
|
||||
searchRepos = (value) => {
|
||||
return systemAdminAPI.sysAdminSearchRepos(value)
|
||||
return systemAdminAPI.sysAdminSearchRepos(value);
|
||||
};
|
||||
|
||||
render() {
|
||||
@ -369,7 +368,7 @@ class FileAccessLogs extends Component {
|
||||
items={availableUsers}
|
||||
selectedItems={selectedUsers}
|
||||
onSelect={this.handleUserFilter}
|
||||
isOpen={this.state.openSelector === 'user'}
|
||||
isOpen={openSelector === 'user'}
|
||||
onToggle={() => this.handleSelectorToggle('user')}
|
||||
searchUsersFunc={this.searchUsers}
|
||||
/>
|
||||
@ -378,7 +377,7 @@ class FileAccessLogs extends Component {
|
||||
items={availableRepos}
|
||||
selectedItems={selectedRepos}
|
||||
onSelect={this.handleRepoFilter}
|
||||
isOpen={this.state.openSelector === 'repo'}
|
||||
isOpen={openSelector === 'repo'}
|
||||
onToggle={() => this.handleSelectorToggle('repo')}
|
||||
searchReposFunc={this.searchRepos}
|
||||
/>
|
||||
|
@ -195,8 +195,8 @@ class FIleTransferLogs extends Component {
|
||||
};
|
||||
|
||||
systemAdminAPI.sysAdminListFileTransferLogs(
|
||||
page,
|
||||
perPage,
|
||||
page,
|
||||
perPage,
|
||||
emails,
|
||||
selectedRepos
|
||||
).then((res) => {
|
||||
@ -355,11 +355,11 @@ class FIleTransferLogs extends Component {
|
||||
};
|
||||
|
||||
render() {
|
||||
let {
|
||||
let {
|
||||
logList, currentPage, perPage, hasNextPage,
|
||||
availableUsers, selectedFromUsers, selectedToUsers, selectedOperators,
|
||||
availableRepos, selectedRepos,
|
||||
openSelector
|
||||
openSelector
|
||||
} = this.state;
|
||||
|
||||
return (
|
||||
|
@ -185,11 +185,10 @@ class SharePermissionLogs extends Component {
|
||||
const emails = {
|
||||
from_emails: fromEmails,
|
||||
to_emails: toEmails
|
||||
}
|
||||
console.log(emails)
|
||||
};
|
||||
systemAdminAPI.sysAdminListSharePermissionLogs(
|
||||
page,
|
||||
perPage,
|
||||
page,
|
||||
perPage,
|
||||
emails,
|
||||
selectedRepos
|
||||
).then((res) => {
|
||||
@ -334,10 +333,10 @@ class SharePermissionLogs extends Component {
|
||||
};
|
||||
|
||||
render() {
|
||||
let {
|
||||
logList, currentPage, perPage, hasNextPage, isExportExcelDialogOpen,
|
||||
let {
|
||||
logList, currentPage, perPage, hasNextPage, isExportExcelDialogOpen,
|
||||
availableUsers, selectedFromUsers, selectedToUsers,
|
||||
availableRepos, selectedRepos, openSelector
|
||||
availableRepos, selectedRepos, openSelector
|
||||
} = this.state;
|
||||
return (
|
||||
<Fragment>
|
||||
|
@ -729,10 +729,10 @@ class SystemAdminAPI {
|
||||
per_page: perPage
|
||||
};
|
||||
if (emails.from_emails && emails.from_emails.length) {
|
||||
params.from_emails = emails.from_emails.join(',')
|
||||
params.from_emails = emails.from_emails.join(',');
|
||||
}
|
||||
if (emails.to_emails && emails.to_emails.length) {
|
||||
params.to_emails = emails.to_emails.join(',')
|
||||
params.to_emails = emails.to_emails.join(',');
|
||||
}
|
||||
if (repos && repos.length) {
|
||||
params.repos = repos.map(repo => repo.id).join(',');
|
||||
|
Loading…
Reference in New Issue
Block a user