1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-25 14:50:29 +00:00

improve sys admin search repos (#5793)

This commit is contained in:
WJH
2023-11-28 13:55:04 +08:00
committed by GitHub
parent fe94d6997c
commit 2e7177ccba

View File

@@ -38,6 +38,10 @@ class SearchRepos extends Component {
getRepos = (page) => { getRepos = (page) => {
const { name, perPage } = this.state; const { name, perPage } = this.state;
if (this.getValueLength(name) < 3) {
toaster.notify(gettext('Required at least three letters.'));
return;
}
seafileAPI.sysAdminSearchRepos(name, page, perPage).then((res) => { seafileAPI.sysAdminSearchRepos(name, page, perPage).then((res) => {
this.setState({ this.setState({
loading: false, loading: false,
@@ -92,12 +96,8 @@ class SearchRepos extends Component {
handleKeyDown = (e) => { handleKeyDown = (e) => {
if (e.keyCode === 13) { if (e.keyCode === 13) {
const { isSubmitBtnActive, name } = this.state; const { isSubmitBtnActive } = this.state;
if (isSubmitBtnActive) { if (isSubmitBtnActive) {
if (this.getValueLength(name) < 3) {
toaster.notify(gettext('Required at least three letters.'));
return;
}
this.searchRepos(); this.searchRepos();
} }
} }