mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-14 17:26:26 +01:00
Make simple qbittorrent switch
This will be used later to ping services
This commit is contained in:
@@ -11,12 +11,13 @@ import {
|
|||||||
createStyles,
|
createStyles,
|
||||||
Center,
|
Center,
|
||||||
} from '@mantine/core';
|
} from '@mantine/core';
|
||||||
|
import { showNotification } from '@mantine/notifications';
|
||||||
|
import { AlertCircle, Cross, X } from 'tabler-icons-react';
|
||||||
import { serviceItem } from './AppShelf.d';
|
import { serviceItem } from './AppShelf.d';
|
||||||
import AppShelfMenu from './AppShelfMenu';
|
import AppShelfMenu from './AppShelfMenu';
|
||||||
import AddItemShelfItem from './AddAppShelfItem';
|
import AddItemShelfItem from './AddAppShelfItem';
|
||||||
import { showNotification } from '@mantine/notifications';
|
|
||||||
import { AlertCircle, Cross, X } from 'tabler-icons-react';
|
|
||||||
import { useServices } from '../../tools/state';
|
import { useServices } from '../../tools/state';
|
||||||
|
import { pingQbittorrent } from '../../tools/api';
|
||||||
|
|
||||||
const useStyles = createStyles((theme) => ({
|
const useStyles = createStyles((theme) => ({
|
||||||
main: {
|
main: {
|
||||||
@@ -42,9 +43,14 @@ const AppShelf = (props: any) => {
|
|||||||
setServicesState(JSON.parse(localServices));
|
setServicesState(JSON.parse(localServices));
|
||||||
}
|
}
|
||||||
}, []);
|
}, []);
|
||||||
|
services.forEach((service) => {
|
||||||
|
if (service.type === 'qBittorrent') {
|
||||||
|
pingQbittorrent(service);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Grid m={'xl'} gutter={'xl'}>
|
<Grid m="xl" gutter="xl">
|
||||||
{services.map((service, i) => (
|
{services.map((service, i) => (
|
||||||
<Grid.Col lg={2} sm={3} key={i}>
|
<Grid.Col lg={2} sm={3} key={i}>
|
||||||
<motion.div
|
<motion.div
|
||||||
|
|||||||
Reference in New Issue
Block a user