mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
Handle Cardigann "info" extra settings field
This commit is contained in:
@@ -12,6 +12,7 @@ import EnhancedSelectInput from './EnhancedSelectInput';
|
|||||||
import EnhancedSelectInputConnector from './EnhancedSelectInputConnector';
|
import EnhancedSelectInputConnector from './EnhancedSelectInputConnector';
|
||||||
import FormInputHelpText from './FormInputHelpText';
|
import FormInputHelpText from './FormInputHelpText';
|
||||||
import IndexerFlagsSelectInputConnector from './IndexerFlagsSelectInputConnector';
|
import IndexerFlagsSelectInputConnector from './IndexerFlagsSelectInputConnector';
|
||||||
|
import InfoInput from './InfoInput';
|
||||||
import KeyValueListInput from './KeyValueListInput';
|
import KeyValueListInput from './KeyValueListInput';
|
||||||
import MovieMonitoredSelectInput from './MovieMonitoredSelectInput';
|
import MovieMonitoredSelectInput from './MovieMonitoredSelectInput';
|
||||||
import NumberInput from './NumberInput';
|
import NumberInput from './NumberInput';
|
||||||
@@ -42,6 +43,9 @@ function getComponent(type) {
|
|||||||
case inputTypes.DEVICE:
|
case inputTypes.DEVICE:
|
||||||
return DeviceInputConnector;
|
return DeviceInputConnector;
|
||||||
|
|
||||||
|
case inputTypes.INFO:
|
||||||
|
return InfoInput;
|
||||||
|
|
||||||
case inputTypes.KEY_VALUE_LIST:
|
case inputTypes.KEY_VALUE_LIST:
|
||||||
return KeyValueListInput;
|
return KeyValueListInput;
|
||||||
|
|
||||||
|
42
frontend/src/Components/Form/InfoInput.js
Normal file
42
frontend/src/Components/Form/InfoInput.js
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
import PropTypes from 'prop-types';
|
||||||
|
import React, { Component } from 'react';
|
||||||
|
|
||||||
|
class InfoInput extends Component {
|
||||||
|
|
||||||
|
//
|
||||||
|
// Render
|
||||||
|
|
||||||
|
render() {
|
||||||
|
const {
|
||||||
|
value
|
||||||
|
} = this.props;
|
||||||
|
|
||||||
|
console.log(this.props);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<span dangerouslySetInnerHTML={{ __html: value }} />
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
InfoInput.propTypes = {
|
||||||
|
readOnly: PropTypes.bool,
|
||||||
|
autoFocus: PropTypes.bool,
|
||||||
|
placeholder: PropTypes.string,
|
||||||
|
name: PropTypes.string.isRequired,
|
||||||
|
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.array]).isRequired,
|
||||||
|
hasError: PropTypes.bool,
|
||||||
|
hasWarning: PropTypes.bool,
|
||||||
|
hasButton: PropTypes.bool,
|
||||||
|
onChange: PropTypes.func.isRequired,
|
||||||
|
onFocus: PropTypes.func,
|
||||||
|
onBlur: PropTypes.func,
|
||||||
|
onCopy: PropTypes.func,
|
||||||
|
onSelectionChange: PropTypes.func
|
||||||
|
};
|
||||||
|
|
||||||
|
InfoInput.defaultProps = {
|
||||||
|
value: ''
|
||||||
|
};
|
||||||
|
|
||||||
|
export default InfoInput;
|
@@ -35,6 +35,8 @@ function getType({ type, selectOptionsProviderAction }) {
|
|||||||
return inputTypes.TEXT;
|
return inputTypes.TEXT;
|
||||||
case 'oAuth':
|
case 'oAuth':
|
||||||
return inputTypes.OAUTH;
|
return inputTypes.OAUTH;
|
||||||
|
case 'info':
|
||||||
|
return inputTypes.INFO;
|
||||||
default:
|
default:
|
||||||
return inputTypes.TEXT;
|
return inputTypes.TEXT;
|
||||||
}
|
}
|
||||||
|
@@ -3,6 +3,7 @@ export const AVAILABILITY_SELECT = 'availabilitySelect';
|
|||||||
export const CAPTCHA = 'captcha';
|
export const CAPTCHA = 'captcha';
|
||||||
export const CHECK = 'check';
|
export const CHECK = 'check';
|
||||||
export const DEVICE = 'device';
|
export const DEVICE = 'device';
|
||||||
|
export const INFO = 'info';
|
||||||
export const MOVIE_MONITORED_SELECT = 'movieMonitoredSelect';
|
export const MOVIE_MONITORED_SELECT = 'movieMonitoredSelect';
|
||||||
export const NUMBER = 'number';
|
export const NUMBER = 'number';
|
||||||
export const OAUTH = 'oauth';
|
export const OAUTH = 'oauth';
|
||||||
@@ -22,6 +23,7 @@ export const all = [
|
|||||||
CAPTCHA,
|
CAPTCHA,
|
||||||
CHECK,
|
CHECK,
|
||||||
DEVICE,
|
DEVICE,
|
||||||
|
INFO,
|
||||||
MOVIE_MONITORED_SELECT,
|
MOVIE_MONITORED_SELECT,
|
||||||
NUMBER,
|
NUMBER,
|
||||||
OAUTH,
|
OAUTH,
|
||||||
|
@@ -240,6 +240,10 @@ namespace NzbDrone.Core.Indexers.Cardigann
|
|||||||
|
|
||||||
variables[name] = selected.Value;
|
variables[name] = selected.Value;
|
||||||
}
|
}
|
||||||
|
else if (setting.Type == "info")
|
||||||
|
{
|
||||||
|
variables[name] = value;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
throw new NotSupportedException();
|
throw new NotSupportedException();
|
||||||
|
Reference in New Issue
Block a user