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