mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-10 15:35:55 +01:00
🎨 Format codebase
This commit is contained in:
@@ -36,7 +36,13 @@ export const AppTile = ({ className, app }: AppTileProps) => {
|
|||||||
className="dashboard-tile-app"
|
className="dashboard-tile-app"
|
||||||
>
|
>
|
||||||
<Box hidden={false}>
|
<Box hidden={false}>
|
||||||
<Title order={5} size="md" ta="center" lineClamp={1} className={cx(classes.appName, 'dashboard-tile-app-title')}>
|
<Title
|
||||||
|
order={5}
|
||||||
|
size="md"
|
||||||
|
ta="center"
|
||||||
|
lineClamp={1}
|
||||||
|
className={cx(classes.appName, 'dashboard-tile-app-title')}
|
||||||
|
>
|
||||||
{app.name}
|
{app.name}
|
||||||
</Title>
|
</Title>
|
||||||
</Box>
|
</Box>
|
||||||
|
|||||||
@@ -10,9 +10,7 @@ export default function CustomizationSettings() {
|
|||||||
return (
|
return (
|
||||||
<ScrollArea style={{ height: height - 100 }} offsetScrollbars>
|
<ScrollArea style={{ height: height - 100 }} offsetScrollbars>
|
||||||
<Stack mt="xs" mb="md" spacing="xs">
|
<Stack mt="xs" mb="md" spacing="xs">
|
||||||
<Text color="dimmed">
|
<Text color="dimmed">{t('text')}</Text>
|
||||||
{t('text')}
|
|
||||||
</Text>
|
|
||||||
<CustomizationSettingsAccordeon />
|
<CustomizationSettingsAccordeon />
|
||||||
</Stack>
|
</Stack>
|
||||||
</ScrollArea>
|
</ScrollArea>
|
||||||
|
|||||||
@@ -8,7 +8,9 @@ export const LogoImageChanger = () => {
|
|||||||
const { t } = useTranslation('settings/customization/page-appearance');
|
const { t } = useTranslation('settings/customization/page-appearance');
|
||||||
const updateConfig = useConfigStore((x) => x.updateConfig);
|
const updateConfig = useConfigStore((x) => x.updateConfig);
|
||||||
const { config, name: configName } = useConfigContext();
|
const { config, name: configName } = useConfigContext();
|
||||||
const [logoImageSrc, setLogoImageSrc] = useState(config?.settings.customization.logoImageUrl ?? '/imgs/logo/logo.png');
|
const [logoImageSrc, setLogoImageSrc] = useState(
|
||||||
|
config?.settings.customization.logoImageUrl ?? '/imgs/logo/logo.png'
|
||||||
|
);
|
||||||
|
|
||||||
if (!configName) return null;
|
if (!configName) return null;
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
import { useQuery } from '@tanstack/react-query';
|
import { useQuery } from '@tanstack/react-query';
|
||||||
import { NormalizedDownloadQueueResponse } from '../../../types/api/downloads/queue/NormalizedDownloadQueueResponse';
|
import { NormalizedDownloadQueueResponse } from '../../../types/api/downloads/queue/NormalizedDownloadQueueResponse';
|
||||||
|
|
||||||
export const useGetDownloadClientsQueue = () => useQuery({
|
export const useGetDownloadClientsQueue = () =>
|
||||||
queryKey: ['network-speed'],
|
useQuery({
|
||||||
queryFn: async (): Promise<NormalizedDownloadQueueResponse> => {
|
queryKey: ['network-speed'],
|
||||||
const response = await fetch('/api/modules/downloads');
|
queryFn: async (): Promise<NormalizedDownloadQueueResponse> => {
|
||||||
return response.json();
|
const response = await fetch('/api/modules/downloads');
|
||||||
},
|
return response.json();
|
||||||
refetchInterval: 3000,
|
},
|
||||||
});
|
refetchInterval: 3000,
|
||||||
|
});
|
||||||
|
|||||||
@@ -6,10 +6,26 @@ import { UnpkgIconsRepository } from '../../../tools/server/images/unpkg-icons-r
|
|||||||
const Get = async (request: NextApiRequest, response: NextApiResponse) => {
|
const Get = async (request: NextApiRequest, response: NextApiResponse) => {
|
||||||
const respositories = [
|
const respositories = [
|
||||||
new LocalIconsRepository(),
|
new LocalIconsRepository(),
|
||||||
new JsdelivrIconsRepository(JsdelivrIconsRepository.tablerRepository, 'Walkxcode Dashboard Icons', 'Walkxcode on Github'),
|
new JsdelivrIconsRepository(
|
||||||
new UnpkgIconsRepository(UnpkgIconsRepository.tablerRepository, 'Tabler Icons', 'Tabler Icons - GitHub (MIT)'),
|
JsdelivrIconsRepository.tablerRepository,
|
||||||
new JsdelivrIconsRepository(JsdelivrIconsRepository.papirusRepository, 'Papirus Icons', 'Papirus Development Team on GitHub (Apache 2.0)'),
|
'Walkxcode Dashboard Icons',
|
||||||
new JsdelivrIconsRepository(JsdelivrIconsRepository.homelabSvgAssetsRepository, 'Homelab Svg Assets', 'loganmarchione on GitHub (MIT)'),
|
'Walkxcode on Github'
|
||||||
|
),
|
||||||
|
new UnpkgIconsRepository(
|
||||||
|
UnpkgIconsRepository.tablerRepository,
|
||||||
|
'Tabler Icons',
|
||||||
|
'Tabler Icons - GitHub (MIT)'
|
||||||
|
),
|
||||||
|
new JsdelivrIconsRepository(
|
||||||
|
JsdelivrIconsRepository.papirusRepository,
|
||||||
|
'Papirus Icons',
|
||||||
|
'Papirus Development Team on GitHub (Apache 2.0)'
|
||||||
|
),
|
||||||
|
new JsdelivrIconsRepository(
|
||||||
|
JsdelivrIconsRepository.homelabSvgAssetsRepository,
|
||||||
|
'Homelab Svg Assets',
|
||||||
|
'loganmarchione on GitHub (MIT)'
|
||||||
|
),
|
||||||
];
|
];
|
||||||
const fetches = respositories.map((rep) => rep.fetch());
|
const fetches = respositories.map((rep) => rep.fetch());
|
||||||
const data = await Promise.all(fetches);
|
const data = await Promise.all(fetches);
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ async function Get(req: NextApiRequest, res: NextApiResponse) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const IntegrationTypeEndpointMap = new Map<AppIntegrationType['type'], string>([
|
const IntegrationTypeEndpointMap = new Map<AppIntegrationType['type'], string>([
|
||||||
['sonarr', useSonarrv4 ? '/api/v3/calendar' : '/api/calendar'],
|
['sonarr', useSonarrv4 ? '/api/v3/calendar' : '/api/calendar'],
|
||||||
['radarr', '/api/v3/calendar'],
|
['radarr', '/api/v3/calendar'],
|
||||||
['lidarr', '/api/v1/calendar'],
|
['lidarr', '/api/v1/calendar'],
|
||||||
['readarr', '/api/v1/calendar'],
|
['readarr', '/api/v1/calendar'],
|
||||||
|
|||||||
@@ -61,7 +61,9 @@ const Get = async (request: NextApiRequest, response: NextApiResponse) => {
|
|||||||
const responseBody = { apps: data, failedApps: failedClients } as NormalizedDownloadQueueResponse;
|
const responseBody = { apps: data, failedApps: failedClients } as NormalizedDownloadQueueResponse;
|
||||||
|
|
||||||
if (failedClients.length > 0) {
|
if (failedClients.length > 0) {
|
||||||
Consola.warn(`${failedClients.length} download clients failed. Please check your configuration and the above log`);
|
Consola.warn(
|
||||||
|
`${failedClients.length} download clients failed. Please check your configuration and the above log`
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return response.status(200).json(responseBody);
|
return response.status(200).json(responseBody);
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ export class JsdelivrIconsRepository extends AbstractIconRepository {
|
|||||||
constructor(
|
constructor(
|
||||||
private readonly repository: JsdelivrRepositoryUrl,
|
private readonly repository: JsdelivrRepositoryUrl,
|
||||||
private readonly displayName: string,
|
private readonly displayName: string,
|
||||||
copyright: string,
|
copyright: string
|
||||||
) {
|
) {
|
||||||
super(copyright);
|
super(copyright);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,33 +14,39 @@ export type GenericCurrentlyPlaying = {
|
|||||||
episodeCount: number | undefined;
|
episodeCount: number | undefined;
|
||||||
type: 'audio' | 'video' | 'tv' | 'movie' | undefined;
|
type: 'audio' | 'video' | 'tv' | 'movie' | undefined;
|
||||||
metadata: {
|
metadata: {
|
||||||
video: {
|
video:
|
||||||
videoCodec: string | undefined;
|
| {
|
||||||
videoFrameRate: string | undefined;
|
videoCodec: string | undefined;
|
||||||
height: number | undefined;
|
videoFrameRate: string | undefined;
|
||||||
width: number | undefined;
|
height: number | undefined;
|
||||||
bitrate: number | undefined;
|
width: number | undefined;
|
||||||
} | undefined;
|
bitrate: number | undefined;
|
||||||
audio: {
|
}
|
||||||
audioCodec: string | undefined;
|
| undefined;
|
||||||
audioChannels: number | undefined;
|
audio:
|
||||||
} | undefined;
|
| {
|
||||||
transcoding: {
|
audioCodec: string | undefined;
|
||||||
context: string | undefined;
|
audioChannels: number | undefined;
|
||||||
sourceVideoCodec: string | undefined;
|
}
|
||||||
sourceAudioCodec: string | undefined;
|
| undefined;
|
||||||
videoDecision: string | undefined;
|
transcoding:
|
||||||
audioDecision: string | undefined;
|
| {
|
||||||
container: string | undefined;
|
context: string | undefined;
|
||||||
videoCodec: string | undefined;
|
sourceVideoCodec: string | undefined;
|
||||||
audioCodec: string | undefined;
|
sourceAudioCodec: string | undefined;
|
||||||
error: boolean | undefined;
|
videoDecision: string | undefined;
|
||||||
duration: number | undefined;
|
audioDecision: string | undefined;
|
||||||
audioChannels: number | undefined;
|
container: string | undefined;
|
||||||
width: number | undefined;
|
videoCodec: string | undefined;
|
||||||
height: number | undefined;
|
audioCodec: string | undefined;
|
||||||
transcodeHwRequested: boolean | undefined;
|
error: boolean | undefined;
|
||||||
timeStamp: number | undefined;
|
duration: number | undefined;
|
||||||
} | undefined;
|
audioChannels: number | undefined;
|
||||||
|
width: number | undefined;
|
||||||
|
height: number | undefined;
|
||||||
|
transcodeHwRequested: boolean | undefined;
|
||||||
|
timeStamp: number | undefined;
|
||||||
|
}
|
||||||
|
| undefined;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ const definition = defineWidget({
|
|||||||
component: DateTile,
|
component: DateTile,
|
||||||
});
|
});
|
||||||
|
|
||||||
export type IDateWidget = IWidget<typeof definition['id'], typeof definition>;
|
export type IDateWidget = IWidget<(typeof definition)['id'], typeof definition>;
|
||||||
|
|
||||||
interface DateTileProps {
|
interface DateTileProps {
|
||||||
widget: IDateWidget;
|
widget: IDateWidget;
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ function IFrameTile({ widget }: IFrameTileProps) {
|
|||||||
<IconUnlink size={36} strokeWidth={1.2} />
|
<IconUnlink size={36} strokeWidth={1.2} />
|
||||||
<Stack align="center" spacing={0}>
|
<Stack align="center" spacing={0}>
|
||||||
<Title order={6} align="center">
|
<Title order={6} align="center">
|
||||||
{t('card.errors.noUrl.title')}
|
{t('card.errors.noUrl.title')}
|
||||||
</Title>
|
</Title>
|
||||||
<Text align="center" maw={200}>
|
<Text align="center" maw={200}>
|
||||||
{t('card.errors.noUrl.text')}
|
{t('card.errors.noUrl.text')}
|
||||||
|
|||||||
@@ -107,7 +107,9 @@ export const DetailCollapseable = ({ session }: { session: GenericSessionInfo })
|
|||||||
</Group>
|
</Group>
|
||||||
<Text>{session.sessionName}</Text>
|
<Text>{session.sessionName}</Text>
|
||||||
</Flex>
|
</Flex>
|
||||||
{details.length > 0 && <Divider label="Stats for nerds" labelPosition="center" mt="lg" mb="sm" />}
|
{details.length > 0 && (
|
||||||
|
<Divider label="Stats for nerds" labelPosition="center" mt="lg" mb="sm" />
|
||||||
|
)}
|
||||||
<Grid>
|
<Grid>
|
||||||
{details.map((detail, index) => (
|
{details.map((detail, index) => (
|
||||||
<Grid.Col xs={12} sm={6} key={index}>
|
<Grid.Col xs={12} sm={6} key={index}>
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ const definition = defineWidget({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export type IUsenetWidget = IWidget<typeof definition['id'], typeof definition>;
|
export type IUsenetWidget = IWidget<(typeof definition)['id'], typeof definition>;
|
||||||
|
|
||||||
interface UseNetTileProps {
|
interface UseNetTileProps {
|
||||||
widget: IUsenetWidget;
|
widget: IUsenetWidget;
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ const definition = defineWidget({
|
|||||||
component: WeatherTile,
|
component: WeatherTile,
|
||||||
});
|
});
|
||||||
|
|
||||||
export type IWeatherWidget = IWidget<typeof definition['id'], typeof definition>;
|
export type IWeatherWidget = IWidget<(typeof definition)['id'], typeof definition>;
|
||||||
|
|
||||||
interface WeatherTileProps {
|
interface WeatherTileProps {
|
||||||
widget: IWeatherWidget;
|
widget: IWeatherWidget;
|
||||||
|
|||||||
Reference in New Issue
Block a user