💄 Lint + Prettier

This commit is contained in:
ajnart
2023-01-06 01:11:02 +09:00
parent 6fb199105b
commit 2d320ff6e9
12 changed files with 27 additions and 25 deletions

View File

@@ -36,7 +36,9 @@ export const LoadConfigComponent = () => {
let newConfig: ConfigType = JSON.parse(fileText); let newConfig: ConfigType = JSON.parse(fileText);
if (!newConfig.schemaVersion) { if (!newConfig.schemaVersion) {
console.warn('a legacy configuration schema was deteced and migrated to the current schema'); console.warn(
'a legacy configuration schema was deteced and migrated to the current schema'
);
const oldConfig = JSON.parse(fileText) as Config; const oldConfig = JSON.parse(fileText) as Config;
newConfig = migrateConfig(oldConfig); newConfig = migrateConfig(oldConfig);
} }

View File

@@ -13,7 +13,7 @@ import {
Badge, Badge,
Tooltip, Tooltip,
} from '@mantine/core'; } from '@mantine/core';
import { IconLock, TablerIcon } from '@tabler/icons'; import { TablerIcon } from '@tabler/icons';
import { useTranslation } from 'next-i18next'; import { useTranslation } from 'next-i18next';
import { useState } from 'react'; import { useState } from 'react';
import { AppIntegrationPropertyAccessabilityType } from '../../../../../../../../types/app'; import { AppIntegrationPropertyAccessabilityType } from '../../../../../../../../types/app';
@@ -76,7 +76,7 @@ export const GenericSecretInput = ({
withArrow withArrow
> >
<Badge className={classes.textTransformUnset} color="orange" variant="dot"> <Badge className={classes.textTransformUnset} color="orange" variant="dot">
{t('integration.type.private')} {t('integration.type.private')}
</Badge> </Badge>
</Tooltip> </Tooltip>
) : ( ) : (
@@ -88,7 +88,7 @@ export const GenericSecretInput = ({
withArrow withArrow
> >
<Badge className={classes.textTransformUnset} color="red" variant="dot"> <Badge className={classes.textTransformUnset} color="red" variant="dot">
{t('integration.type.public')} {t('integration.type.public')}
</Badge> </Badge>
</Tooltip> </Tooltip>
)} )}

View File

@@ -20,7 +20,8 @@ export const initializeGridstack = (
) => { ) => {
if (!wrapperRef.current) return; if (!wrapperRef.current) return;
// calculates the currently available count of columns // calculates the currently available count of columns
const columnCount = areaType === 'sidebar' ? 1 : isLargerThanSm || typeof isLargerThanSm === 'undefined' ? 12 : 6; const columnCount =
areaType === 'sidebar' ? 1 : isLargerThanSm || typeof isLargerThanSm === 'undefined' ? 12 : 6;
const minRow = areaType !== 'sidebar' ? 1 : Math.floor(wrapperRef.current.offsetHeight / 64); const minRow = areaType !== 'sidebar' ? 1 : Math.floor(wrapperRef.current.offsetHeight / 64);
// initialize gridstack // initialize gridstack
const newGrid = gridRef; const newGrid = gridRef;

View File

@@ -1,5 +1,5 @@
import { ScrollArea, Space, Stack, Text } from '@mantine/core'; import { ScrollArea, Space, Stack, Text } from '@mantine/core';
import { useElementSize, useViewportSize } from '@mantine/hooks'; import { useViewportSize } from '@mantine/hooks';
import { useConfigContext } from '../../../config/provider'; import { useConfigContext } from '../../../config/provider';
import ConfigChanger from '../../Config/ConfigChanger'; import ConfigChanger from '../../Config/ConfigChanger';
import ConfigActions from './Config/ConfigActions'; import ConfigActions from './Config/ConfigActions';

View File

@@ -1,9 +1,6 @@
import { Group, ActionIcon, Anchor, Text } from '@mantine/core'; import { Group, Anchor, Text } from '@mantine/core';
import { IconBrandDiscord, IconBrandGithub } from '@tabler/icons';
import { useTranslation } from 'next-i18next'; import { useTranslation } from 'next-i18next';
import { CURRENT_VERSION } from '../../../../data/constants';
export default function Credits() { export default function Credits() {
const { t } = useTranslation('settings/common'); const { t } = useTranslation('settings/common');
@@ -22,8 +19,8 @@ export default function Credits() {
style={{ color: 'inherit', fontStyle: 'inherit', fontSize: 'inherit' }} style={{ color: 'inherit', fontStyle: 'inherit', fontSize: 'inherit' }}
> >
ajnart ajnart
</Anchor> </Anchor>{' '}
{' '}and you ! and you !
</Text> </Text>
</Group> </Group>
); );

View File

@@ -1,4 +1,4 @@
import { Button, ScrollArea, Stack } from '@mantine/core'; import { ScrollArea, Stack } from '@mantine/core';
import { useViewportSize } from '@mantine/hooks'; import { useViewportSize } from '@mantine/hooks';
import { useTranslation } from 'next-i18next'; import { useTranslation } from 'next-i18next';
import { useConfigContext } from '../../../config/provider'; import { useConfigContext } from '../../../config/provider';

View File

@@ -1,4 +1,4 @@
import { Drawer, ScrollArea, Tabs, Title } from '@mantine/core'; import { Drawer, Tabs, Title } from '@mantine/core';
import { useTranslation } from 'next-i18next'; import { useTranslation } from 'next-i18next';
import { useConfigContext } from '../../config/provider'; import { useConfigContext } from '../../config/provider';
import { useConfigStore } from '../../config/store'; import { useConfigStore } from '../../config/store';

View File

@@ -70,7 +70,7 @@ interface UseConfigStoreType {
addConfig: ( addConfig: (
name: string, name: string,
config: ConfigType, config: ConfigType,
shouldSaveConfigToFileSystem: boolean, shouldSaveConfigToFileSystem: boolean
) => Promise<void>; ) => Promise<void>;
updateConfig: ( updateConfig: (
name: string, name: string,

View File

@@ -1,7 +1,10 @@
import { useMutation, useQuery } from '@tanstack/react-query'; import { useMutation, useQuery } from '@tanstack/react-query';
import axios from 'axios'; import axios from 'axios';
import { Results } from 'sabnzbd-api'; import { Results } from 'sabnzbd-api';
import { UsenetQueueRequestParams, UsenetQueueResponse } from '../../../pages/api/modules/usenet/queue'; import {
UsenetQueueRequestParams,
UsenetQueueResponse,
} from '../../../pages/api/modules/usenet/queue';
import { import {
UsenetHistoryRequestParams, UsenetHistoryRequestParams,
UsenetHistoryResponse, UsenetHistoryResponse,

View File

@@ -40,7 +40,8 @@ async function Post(req: NextApiRequest, res: NextApiResponse) {
); );
await Promise.all( await Promise.all(
delugeApp.map((app) => { delugeApp.map((app) => {
const password = app.integration?.properties.find((x) => x.field === 'password')?.value ?? undefined; const password =
app.integration?.properties.find((x) => x.field === 'password')?.value ?? undefined;
const test = new Deluge({ const test = new Deluge({
baseUrl: app.url, baseUrl: app.url,
password, password,

View File

@@ -11,8 +11,8 @@ interface WidgetWrapperProps {
} }
export const WidgetWrapper = ({ widgetId, widget, className, children }: WidgetWrapperProps) => ( export const WidgetWrapper = ({ widgetId, widget, className, children }: WidgetWrapperProps) => (
<HomarrCardWrapper className={className}> <HomarrCardWrapper className={className}>
<WidgetsMenu integration={widgetId} widget={widget} /> <WidgetsMenu integration={widgetId} widget={widget} />
{children} {children}
</HomarrCardWrapper> </HomarrCardWrapper>
); );

View File

@@ -5,6 +5,4 @@ import { IWidgetDefinition } from './widgets';
// The options of IWidgetDefinition are so heavily typed that it even used 'true' as type // The options of IWidgetDefinition are so heavily typed that it even used 'true' as type
export const defineWidget = <TKey extends string, TOptions extends IWidgetDefinition<TKey>>( export const defineWidget = <TKey extends string, TOptions extends IWidgetDefinition<TKey>>(
options: TOptions options: TOptions
) => { ) => options;
return options;
};