🎨 Format codebase

This commit is contained in:
ajnart
2023-03-03 12:40:49 +09:00
parent 68cea4b6a8
commit 457e9cf2bd
14 changed files with 86 additions and 53 deletions

View File

@@ -36,7 +36,13 @@ export const AppTile = ({ className, app }: AppTileProps) => {
className="dashboard-tile-app"
>
<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}
</Title>
</Box>

View File

@@ -10,9 +10,7 @@ export default function CustomizationSettings() {
return (
<ScrollArea style={{ height: height - 100 }} offsetScrollbars>
<Stack mt="xs" mb="md" spacing="xs">
<Text color="dimmed">
{t('text')}
</Text>
<Text color="dimmed">{t('text')}</Text>
<CustomizationSettingsAccordeon />
</Stack>
</ScrollArea>

View File

@@ -8,7 +8,9 @@ export const LogoImageChanger = () => {
const { t } = useTranslation('settings/customization/page-appearance');
const updateConfig = useConfigStore((x) => x.updateConfig);
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;

View File

@@ -1,11 +1,12 @@
import { useQuery } from '@tanstack/react-query';
import { NormalizedDownloadQueueResponse } from '../../../types/api/downloads/queue/NormalizedDownloadQueueResponse';
export const useGetDownloadClientsQueue = () => useQuery({
queryKey: ['network-speed'],
queryFn: async (): Promise<NormalizedDownloadQueueResponse> => {
const response = await fetch('/api/modules/downloads');
return response.json();
},
refetchInterval: 3000,
});
export const useGetDownloadClientsQueue = () =>
useQuery({
queryKey: ['network-speed'],
queryFn: async (): Promise<NormalizedDownloadQueueResponse> => {
const response = await fetch('/api/modules/downloads');
return response.json();
},
refetchInterval: 3000,
});

View File

@@ -6,10 +6,26 @@ import { UnpkgIconsRepository } from '../../../tools/server/images/unpkg-icons-r
const Get = async (request: NextApiRequest, response: NextApiResponse) => {
const respositories = [
new LocalIconsRepository(),
new JsdelivrIconsRepository(JsdelivrIconsRepository.tablerRepository, 'Walkxcode Dashboard Icons', '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)'),
new JsdelivrIconsRepository(
JsdelivrIconsRepository.tablerRepository,
'Walkxcode Dashboard Icons',
'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 data = await Promise.all(fetches);

View File

@@ -53,7 +53,7 @@ async function Get(req: NextApiRequest, res: NextApiResponse) {
);
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'],
['lidarr', '/api/v1/calendar'],
['readarr', '/api/v1/calendar'],

View File

@@ -61,7 +61,9 @@ const Get = async (request: NextApiRequest, response: NextApiResponse) => {
const responseBody = { apps: data, failedApps: failedClients } as NormalizedDownloadQueueResponse;
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);

View File

@@ -23,7 +23,7 @@ export class JsdelivrIconsRepository extends AbstractIconRepository {
constructor(
private readonly repository: JsdelivrRepositoryUrl,
private readonly displayName: string,
copyright: string,
copyright: string
) {
super(copyright);
}

View File

@@ -14,33 +14,39 @@ export type GenericCurrentlyPlaying = {
episodeCount: number | undefined;
type: 'audio' | 'video' | 'tv' | 'movie' | undefined;
metadata: {
video: {
videoCodec: string | undefined;
videoFrameRate: string | undefined;
height: number | undefined;
width: number | undefined;
bitrate: number | undefined;
} | undefined;
audio: {
audioCodec: string | undefined;
audioChannels: number | undefined;
} | undefined;
transcoding: {
context: string | undefined;
sourceVideoCodec: string | undefined;
sourceAudioCodec: string | undefined;
videoDecision: string | undefined;
audioDecision: string | undefined;
container: string | undefined;
videoCodec: string | undefined;
audioCodec: string | undefined;
error: boolean | undefined;
duration: number | undefined;
audioChannels: number | undefined;
width: number | undefined;
height: number | undefined;
transcodeHwRequested: boolean | undefined;
timeStamp: number | undefined;
} | undefined;
video:
| {
videoCodec: string | undefined;
videoFrameRate: string | undefined;
height: number | undefined;
width: number | undefined;
bitrate: number | undefined;
}
| undefined;
audio:
| {
audioCodec: string | undefined;
audioChannels: number | undefined;
}
| undefined;
transcoding:
| {
context: string | undefined;
sourceVideoCodec: string | undefined;
sourceAudioCodec: string | undefined;
videoDecision: string | undefined;
audioDecision: string | undefined;
container: string | undefined;
videoCodec: string | undefined;
audioCodec: string | undefined;
error: boolean | undefined;
duration: number | undefined;
audioChannels: number | undefined;
width: number | undefined;
height: number | undefined;
transcodeHwRequested: boolean | undefined;
timeStamp: number | undefined;
}
| undefined;
};
};

View File

@@ -25,7 +25,7 @@ const definition = defineWidget({
component: DateTile,
});
export type IDateWidget = IWidget<typeof definition['id'], typeof definition>;
export type IDateWidget = IWidget<(typeof definition)['id'], typeof definition>;
interface DateTileProps {
widget: IDateWidget;

View File

@@ -43,7 +43,7 @@ function IFrameTile({ widget }: IFrameTileProps) {
<IconUnlink size={36} strokeWidth={1.2} />
<Stack align="center" spacing={0}>
<Title order={6} align="center">
{t('card.errors.noUrl.title')}
{t('card.errors.noUrl.title')}
</Title>
<Text align="center" maw={200}>
{t('card.errors.noUrl.text')}

View File

@@ -107,7 +107,9 @@ export const DetailCollapseable = ({ session }: { session: GenericSessionInfo })
</Group>
<Text>{session.sessionName}</Text>
</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>
{details.map((detail, index) => (
<Grid.Col xs={12} sm={6} key={index}>

View File

@@ -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 {
widget: IUsenetWidget;

View File

@@ -28,7 +28,7 @@ const definition = defineWidget({
component: WeatherTile,
});
export type IWeatherWidget = IWidget<typeof definition['id'], typeof definition>;
export type IWeatherWidget = IWidget<(typeof definition)['id'], typeof definition>;
interface WeatherTileProps {
widget: IWeatherWidget;