mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-10 15:35:55 +01:00
🚛 Move BitTorrent > Torrent + Lint
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
{
|
||||
"descriptor": {
|
||||
"name": "BitTorrent",
|
||||
"name": "Torrent",
|
||||
"description": "Displays a list of the torrent which are currently downloading",
|
||||
"settings": {
|
||||
"title": "Settings for BitTorrent integration",
|
||||
"title": "Settings for Torrent integration",
|
||||
"refreshInterval": {
|
||||
"label": "Refresh interval (in seconds)"
|
||||
},
|
||||
|
||||
@@ -52,7 +52,10 @@ export const IntegrationOptionsRenderer = ({ form }: IntegrationOptionsRendererP
|
||||
<GenericSecretInput
|
||||
onClickUpdateButton={(value) => {
|
||||
form.setFieldValue(`integration.properties.${index}.value`, value);
|
||||
form.setFieldValue(`integration.properties.${index}.isDefined`, value !== undefined);
|
||||
form.setFieldValue(
|
||||
`integration.properties.${index}.isDefined`,
|
||||
value !== undefined
|
||||
);
|
||||
}}
|
||||
key={`input-${property}`}
|
||||
label={`${property} (potentionally unmapped)`}
|
||||
|
||||
@@ -5,7 +5,7 @@ import { AreaType } from '../../types/area';
|
||||
import { CategoryType } from '../../types/category';
|
||||
import { ConfigType } from '../../types/config';
|
||||
import { SearchEngineCommonSettingsType } from '../../types/settings';
|
||||
import { IBitTorrent } from '../../widgets/bitTorrent/BitTorrentTile';
|
||||
import { ITorrent } from '../../widgets/torrent/TorrentTile';
|
||||
import { ICalendarWidget } from '../../widgets/calendar/CalendarTile';
|
||||
import { IDashDotTile } from '../../widgets/dashDot/DashDotTile';
|
||||
import { IDateWidget } from '../../widgets/date/DateTile';
|
||||
@@ -194,7 +194,7 @@ const migrateModules = (config: Config): IWidget<string, any>[] => {
|
||||
},
|
||||
},
|
||||
shape: {},
|
||||
} as IBitTorrent;
|
||||
} as ITorrent;
|
||||
case 'weather':
|
||||
return {
|
||||
id: 'weather',
|
||||
|
||||
@@ -3,7 +3,7 @@ import calendar from './calendar/CalendarTile';
|
||||
import dashdot from './dashDot/DashDotTile';
|
||||
import usenet from './useNet/UseNetTile';
|
||||
import weather from './weather/WeatherTile';
|
||||
import bitTorrent from './bitTorrent/BitTorrentTile';
|
||||
import torrent from './torrent/TorrentTile';
|
||||
import torrentNetworkTraffic from './torrentNetworkTraffic/TorrentNetworkTrafficTile';
|
||||
|
||||
export default {
|
||||
@@ -11,7 +11,7 @@ export default {
|
||||
dashdot,
|
||||
usenet,
|
||||
weather,
|
||||
'torrents-status': bitTorrent,
|
||||
'torrents-status': torrent,
|
||||
dlspeed: torrentNetworkTraffic,
|
||||
date,
|
||||
};
|
||||
|
||||
@@ -4,11 +4,11 @@ import { useElementSize } from '@mantine/hooks';
|
||||
import { calculateETA } from '../../tools/calculateEta';
|
||||
import { humanFileSize } from '../../tools/humanFileSize';
|
||||
|
||||
interface BitTorrentQueueItemProps {
|
||||
interface TorrentQueueItemProps {
|
||||
torrent: NormalizedTorrent;
|
||||
}
|
||||
|
||||
export const BitTorrrentQueueItem = ({ torrent }: BitTorrentQueueItemProps) => {
|
||||
export const BitTorrrentQueueItem = ({ torrent }: TorrentQueueItemProps) => {
|
||||
const MIN_WIDTH_MOBILE = useMantineTheme().breakpoints.xs;
|
||||
const { width } = useElementSize();
|
||||
|
||||
@@ -23,7 +23,7 @@ import { useGetTorrentData } from '../../hooks/widgets/torrents/useGetTorrentDat
|
||||
import { AppIntegrationType } from '../../types/app';
|
||||
import { defineWidget } from '../helper';
|
||||
import { IWidget } from '../widgets';
|
||||
import { BitTorrrentQueueItem } from './BitTorrentQueueItem';
|
||||
import { BitTorrrentQueueItem } from './TorrentQueueItem';
|
||||
|
||||
dayjs.extend(duration);
|
||||
dayjs.extend(relativeTime);
|
||||
@@ -56,16 +56,16 @@ const definition = defineWidget({
|
||||
maxWidth: 12,
|
||||
maxHeight: 14,
|
||||
},
|
||||
component: BitTorrentTile,
|
||||
component: TorrentTile,
|
||||
});
|
||||
|
||||
export type IBitTorrent = IWidget<typeof definition['id'], typeof definition>;
|
||||
export type ITorrent = IWidget<typeof definition['id'], typeof definition>;
|
||||
|
||||
interface BitTorrentTileProps {
|
||||
widget: IBitTorrent;
|
||||
interface TorrentTileProps {
|
||||
widget: ITorrent;
|
||||
}
|
||||
|
||||
function BitTorrentTile({ widget }: BitTorrentTileProps) {
|
||||
function TorrentTile({ widget }: TorrentTileProps) {
|
||||
const { t } = useTranslation('modules/torrents-status');
|
||||
const MIN_WIDTH_MOBILE = useMantineTheme().breakpoints.xs;
|
||||
const { width } = useElementSize();
|
||||
@@ -39,8 +39,8 @@ export type IWidgetOptionValue =
|
||||
|
||||
// Interface for data type
|
||||
interface DataType {
|
||||
label: string
|
||||
value: string
|
||||
label: string;
|
||||
value: string;
|
||||
}
|
||||
|
||||
// will show a multi-select with specified data
|
||||
|
||||
Reference in New Issue
Block a user