mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
Add external links for indexer history
This commit is contained in:
@@ -1,8 +1,10 @@
|
|||||||
import AppSectionState from 'App/State/AppSectionState';
|
import AppSectionState from 'App/State/AppSectionState';
|
||||||
|
import Column from 'Components/Table/Column';
|
||||||
import History from 'typings/History';
|
import History from 'typings/History';
|
||||||
|
|
||||||
interface HistoryAppState extends AppSectionState<History> {
|
interface HistoryAppState extends AppSectionState<History> {
|
||||||
pageSize: number;
|
pageSize: number;
|
||||||
|
columns: Column[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export default HistoryAppState;
|
export default HistoryAppState;
|
||||||
|
@@ -1,43 +0,0 @@
|
|||||||
import PropTypes from 'prop-types';
|
|
||||||
import React, { Component } from 'react';
|
|
||||||
import styles from './HistoryRowParameter.css';
|
|
||||||
|
|
||||||
class HistoryRowParameter extends Component {
|
|
||||||
|
|
||||||
//
|
|
||||||
// Render
|
|
||||||
|
|
||||||
render() {
|
|
||||||
const {
|
|
||||||
title,
|
|
||||||
value
|
|
||||||
} = this.props;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className={styles.parameter}>
|
|
||||||
<div className={styles.info}>
|
|
||||||
<span>
|
|
||||||
{
|
|
||||||
title
|
|
||||||
}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div
|
|
||||||
className={styles.value}
|
|
||||||
>
|
|
||||||
{
|
|
||||||
value
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
HistoryRowParameter.propTypes = {
|
|
||||||
title: PropTypes.string.isRequired,
|
|
||||||
value: PropTypes.string.isRequired
|
|
||||||
};
|
|
||||||
|
|
||||||
export default HistoryRowParameter;
|
|
44
frontend/src/History/HistoryRowParameter.tsx
Normal file
44
frontend/src/History/HistoryRowParameter.tsx
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import Link from 'Components/Link/Link';
|
||||||
|
import styles from './HistoryRowParameter.css';
|
||||||
|
|
||||||
|
interface HistoryRowParameterProps {
|
||||||
|
title: string;
|
||||||
|
value: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
function HistoryRowParameter(props: HistoryRowParameterProps) {
|
||||||
|
const { title, value } = props;
|
||||||
|
|
||||||
|
const type = title.toLowerCase();
|
||||||
|
|
||||||
|
let link = null;
|
||||||
|
|
||||||
|
if (type === 'imdb') {
|
||||||
|
link = <Link to={`https://imdb.com/title/${value}/`}>{value}</Link>;
|
||||||
|
} else if (type === 'tmdb') {
|
||||||
|
link = (
|
||||||
|
<Link to={`https://www.themoviedb.org/movie/${value}`}>{value}</Link>
|
||||||
|
);
|
||||||
|
} else if (type === 'tvdb') {
|
||||||
|
link = (
|
||||||
|
<Link to={`https://www.thetvdb.com/?tab=series&id=${value}`}>
|
||||||
|
{value}
|
||||||
|
</Link>
|
||||||
|
);
|
||||||
|
} else if (type === 'tvmaze') {
|
||||||
|
link = <Link to={`https://www.tvmaze.com/shows/${value}/_`}>{value}</Link>;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className={styles.parameter}>
|
||||||
|
<div className={styles.info}>
|
||||||
|
<span>{title}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className={styles.value}>{link ? link : value}</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default HistoryRowParameter;
|
@@ -67,7 +67,7 @@ function IndexerHistoryRow(props: IndexerHistoryRowProps) {
|
|||||||
<HistoryRowParameter
|
<HistoryRowParameter
|
||||||
key={parameter.key}
|
key={parameter.key}
|
||||||
title={parameter.title}
|
title={parameter.title}
|
||||||
value={data[parameter.key as keyof HistoryData]}
|
value={data[parameter.key as keyof HistoryData].toString()}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
|
Reference in New Issue
Block a user