1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-20 19:08:21 +00:00

admin search repo by id (#5221)

* admin search repo by id

* id => ID

Co-authored-by: lian <lian@seafile.com>
This commit is contained in:
lian
2022-08-04 15:19:27 +08:00
committed by GitHub
parent 9c7f0fb149
commit dec935d0a3
4 changed files with 9 additions and 8 deletions

View File

@@ -114,13 +114,13 @@ class AllRepos extends Component {
getSearch = () => {
return <Search
placeholder={gettext('Search libraries by name')}
placeholder={gettext('Search libraries by name or ID')}
submit={this.searchRepos}
/>;
}
searchRepos = (repoName) => {
navigate(`${siteRoot}sys/search-libraries/?name=${encodeURIComponent(repoName)}`);
searchRepos = (repoNameOrID) => {
navigate(`${siteRoot}sys/search-libraries/?name_or_id=${encodeURIComponent(repoNameOrID)}`);
}
render() {

View File

@@ -23,7 +23,7 @@ class SearchRepos extends Component {
componentDidMount() {
let params = (new URL(document.location)).searchParams;
this.setState({
name: params.get('name') || ''
name: params.get('name_or_id') || ''
}, this.getRepos);
}
@@ -90,10 +90,10 @@ class SearchRepos extends Component {
<div className="cur-view-content">
<div className="mt-4 mb-6">
<h4 className="border-bottom font-weight-normal mb-2 pb-1">{gettext('Search Libraries')}</h4>
<p className="text-secondary small">{gettext('Tip: you can search by keyword in name.')}</p>
<p className="text-secondary small">{gettext('Tip: you can search by keyword in name or ID.')}</p>
<Form>
<FormGroup row>
<Label for="name" sm={1}>{gettext('Name')}</Label>
<Label for="name" sm={1}>{gettext('Name or ID')}</Label>
<Col sm={5}>
<Input type="text" name="name" id="name" value={name} onChange={this.handleNameInputChange} />
</Col>

View File

@@ -43,7 +43,7 @@ class Search extends React.Component {
<input
type="text"
className="form-control search-input h-6 mr-1"
style={{width: '15rem'}}
style={{width: '17rem'}}
placeholder={this.props.placeholder}
value={this.state.value}
onChange={this.handleInputChange}