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:
@@ -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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user