mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
Newznab Responses for Caps and Movie Search (rough)
This commit is contained in:
6
frontend/src/Search/NoSearchResults.css
Normal file
6
frontend/src/Search/NoSearchResults.css
Normal file
@@ -0,0 +1,6 @@
|
||||
.message {
|
||||
margin-top: 10px;
|
||||
margin-bottom: 30px;
|
||||
text-align: center;
|
||||
font-size: 20px;
|
||||
}
|
32
frontend/src/Search/NoSearchResults.js
Normal file
32
frontend/src/Search/NoSearchResults.js
Normal file
@@ -0,0 +1,32 @@
|
||||
import PropTypes from 'prop-types';
|
||||
import React from 'react';
|
||||
import translate from 'Utilities/String/translate';
|
||||
import styles from './NoSearchResults.css';
|
||||
|
||||
function NoSearchResults(props) {
|
||||
const { totalItems } = props;
|
||||
|
||||
if (totalItems > 0) {
|
||||
return (
|
||||
<div>
|
||||
<div className={styles.message}>
|
||||
{translate('AllIndexersHiddenDueToFilter')}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div className={styles.message}>
|
||||
No search results found, try performing a new search below.
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
NoSearchResults.propTypes = {
|
||||
totalItems: PropTypes.number.isRequired
|
||||
};
|
||||
|
||||
export default NoSearchResults;
|
@@ -3,6 +3,11 @@
|
||||
min-width: 150px;
|
||||
}
|
||||
|
||||
.indexerContainer {
|
||||
margin-right: 20px;
|
||||
min-width: 250px;
|
||||
}
|
||||
|
||||
.buttonContainer {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
|
@@ -1,5 +1,6 @@
|
||||
import PropTypes from 'prop-types';
|
||||
import React, { Component } from 'react';
|
||||
import IndexersSelectInputConnector from 'Components/Form/IndexersSelectInputConnector';
|
||||
import TextInput from 'Components/Form/TextInput';
|
||||
import SpinnerButton from 'Components/Link/SpinnerButton';
|
||||
import PageContentFooter from 'Components/Page/PageContentFooter';
|
||||
@@ -15,7 +16,8 @@ class SearchFooter extends Component {
|
||||
|
||||
this.state = {
|
||||
searchingReleases: false,
|
||||
searchQuery: ''
|
||||
searchQuery: '',
|
||||
indexerIds: []
|
||||
};
|
||||
}
|
||||
|
||||
@@ -40,7 +42,7 @@ class SearchFooter extends Component {
|
||||
}
|
||||
|
||||
onSearchPress = () => {
|
||||
this.props.onSearchPress(this.state.searchQuery);
|
||||
this.props.onSearchPress(this.state.searchQuery, this.state.indexerIds);
|
||||
}
|
||||
|
||||
//
|
||||
@@ -52,7 +54,8 @@ class SearchFooter extends Component {
|
||||
} = this.props;
|
||||
|
||||
const {
|
||||
searchQuery
|
||||
searchQuery,
|
||||
indexerIds
|
||||
} = this.state;
|
||||
|
||||
return (
|
||||
@@ -67,6 +70,16 @@ class SearchFooter extends Component {
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className={styles.indexerContainer}>
|
||||
<IndexersSelectInputConnector
|
||||
name='indexerIds'
|
||||
placeholder='Indexers'
|
||||
value={indexerIds}
|
||||
isDisabled={isFetching}
|
||||
onChange={this.onInputChange}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className={styles.buttonContainer}>
|
||||
<div className={styles.buttonContainerContent}>
|
||||
<div className={styles.buttons}>
|
||||
|
@@ -11,13 +11,13 @@ import PageToolbarSection from 'Components/Page/Toolbar/PageToolbarSection';
|
||||
import PageToolbarSeparator from 'Components/Page/Toolbar/PageToolbarSeparator';
|
||||
import TableOptionsModalWrapper from 'Components/Table/TableOptions/TableOptionsModalWrapper';
|
||||
import { align, icons, sortDirections } from 'Helpers/Props';
|
||||
import NoIndexer from 'Indexer/NoIndexer';
|
||||
import * as keyCodes from 'Utilities/Constants/keyCodes';
|
||||
import getErrorMessage from 'Utilities/Object/getErrorMessage';
|
||||
import hasDifferentItemsOrOrder from 'Utilities/Object/hasDifferentItemsOrOrder';
|
||||
import translate from 'Utilities/String/translate';
|
||||
import SearchIndexFilterMenu from './Menus/SearchIndexFilterMenu';
|
||||
import SearchIndexSortMenu from './Menus/SearchIndexSortMenu';
|
||||
import NoSearchResults from './NoSearchResults';
|
||||
import SearchFooter from './SearchFooter.js';
|
||||
import SearchIndexTableConnector from './Table/SearchIndexTableConnector';
|
||||
import styles from './SearchIndex.css';
|
||||
@@ -126,9 +126,8 @@ class SearchIndex extends Component {
|
||||
this.setState({ jumpToCharacter });
|
||||
}
|
||||
|
||||
onSearchPress = (query) => {
|
||||
console.log('index', query);
|
||||
this.props.onSearchPress({ query });
|
||||
onSearchPress = (query, indexerIds) => {
|
||||
this.props.onSearchPress({ query, indexerIds });
|
||||
}
|
||||
|
||||
onKeyUp = (event) => {
|
||||
@@ -175,6 +174,8 @@ class SearchIndex extends Component {
|
||||
const isLoaded = !!(!error && isPopulated && items.length && scroller);
|
||||
const hasNoIndexer = !totalItems;
|
||||
|
||||
console.log(hasNoIndexer);
|
||||
|
||||
return (
|
||||
<PageContent>
|
||||
<PageToolbar>
|
||||
@@ -246,8 +247,8 @@ class SearchIndex extends Component {
|
||||
}
|
||||
|
||||
{
|
||||
!error && isPopulated && !items.length &&
|
||||
<NoIndexer totalItems={totalItems} />
|
||||
!error && !isFetching && !items.length &&
|
||||
<NoSearchResults totalItems={totalItems} />
|
||||
}
|
||||
</PageContentBody>
|
||||
|
||||
|
Reference in New Issue
Block a user