mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-27 20:44:00 +02:00
New: (UI) Show indexer id as hint in IndexerSelect
This commit is contained in:
@@ -37,7 +37,7 @@ function HintedSelectInputOption(props) {
|
|||||||
|
|
||||||
{
|
{
|
||||||
hint != null &&
|
hint != null &&
|
||||||
<div className={styles.hintText}>
|
<div className={styles.hintText} title={hint}>
|
||||||
{hint}
|
{hint}
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import _ from 'lodash';
|
import { groupBy, map } from 'lodash';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
@@ -12,7 +12,7 @@ function createMapStateToProps() {
|
|||||||
(state) => state.indexers,
|
(state) => state.indexers,
|
||||||
(value, indexers) => {
|
(value, indexers) => {
|
||||||
const values = [];
|
const values = [];
|
||||||
const groupedIndexers = _.map(_.groupBy(indexers.items, 'protocol'), (val, key) => ({ protocol: key, indexers: val }));
|
const groupedIndexers = map(groupBy(indexers.items, 'protocol'), (val, key) => ({ protocol: key, indexers: val }));
|
||||||
|
|
||||||
groupedIndexers.forEach((element) => {
|
groupedIndexers.forEach((element) => {
|
||||||
values.push({
|
values.push({
|
||||||
@@ -25,6 +25,7 @@ function createMapStateToProps() {
|
|||||||
values.push({
|
values.push({
|
||||||
key: indexer.id,
|
key: indexer.id,
|
||||||
value: indexer.name,
|
value: indexer.name,
|
||||||
|
hint: `(${indexer.id})`,
|
||||||
isDisabled: !indexer.enable,
|
isDisabled: !indexer.enable,
|
||||||
parentKey: element.protocol === 'usenet' ? -1 : -2
|
parentKey: element.protocol === 'usenet' ? -1 : -2
|
||||||
});
|
});
|
||||||
@@ -50,7 +51,6 @@ class IndexersSelectInputConnector extends Component {
|
|||||||
// Render
|
// Render
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<EnhancedSelectInput
|
<EnhancedSelectInput
|
||||||
{...this.props}
|
{...this.props}
|
||||||
|
Reference in New Issue
Block a user