mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-13 17:05:47 +01:00
🔧 fix lint errors and bumb version
This commit is contained in:
@@ -1,2 +1,2 @@
|
||||
export const REPO_URL = 'ajnart/homarr';
|
||||
export const CURRENT_VERSION = 'v0.10.3';
|
||||
export const CURRENT_VERSION = 'v0.10.4';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "homarr",
|
||||
"version": "0.10.3",
|
||||
"version": "0.10.4",
|
||||
"description": "Homarr - A homepage for your server.",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
|
||||
@@ -308,7 +308,9 @@ export function AddAppShelfItemForm(props: AddAppShelfItemFormProps) {
|
||||
target="_blank"
|
||||
weight="bold"
|
||||
style={{ fontStyle: 'inherit', fontSize: 'inherit' }}
|
||||
href={`${hostname}/${apiKeyPaths[form.values.type as keyof typeof apiKeyPaths]}`}
|
||||
href={`${hostname}/${
|
||||
apiKeyPaths[form.values.type as keyof typeof apiKeyPaths]
|
||||
}`}
|
||||
>
|
||||
{t('modal.tabs.options.form.integrations.apiKey.tip.link')}
|
||||
</Anchor>
|
||||
|
||||
@@ -1,14 +1,5 @@
|
||||
import React, { useState } from 'react';
|
||||
import {
|
||||
Accordion,
|
||||
Divider,
|
||||
Grid,
|
||||
Paper,
|
||||
Stack,
|
||||
Text,
|
||||
Title,
|
||||
useMantineColorScheme,
|
||||
} from '@mantine/core';
|
||||
import { Accordion, Grid, Paper, Stack, Text, useMantineColorScheme } from '@mantine/core';
|
||||
import {
|
||||
closestCenter,
|
||||
DndContext,
|
||||
@@ -202,7 +193,7 @@ const AppShelf = (props: any) => {
|
||||
<Accordion.Control>{t('accordions.downloads.text')}</Accordion.Control>
|
||||
<Accordion.Panel>
|
||||
<Paper radius="lg" style={{ position: 'relative' }}>
|
||||
{torrentEnabled && (
|
||||
{torrentEnabled && (
|
||||
<>
|
||||
<Text>{t('accordions.downloads.torrents')}</Text>
|
||||
<ModuleMenu module={TorrentsModule} hovered />
|
||||
|
||||
@@ -49,11 +49,7 @@ export function SearchNewTabSwitch() {
|
||||
return (
|
||||
<Group>
|
||||
<div className={classes.root}>
|
||||
<Switch
|
||||
checked={openInNewTab}
|
||||
onChange={() => toggleOpenInNewTab()}
|
||||
size="md"
|
||||
/>
|
||||
<Switch checked={openInNewTab} onChange={() => toggleOpenInNewTab()} size="md" />
|
||||
</div>
|
||||
{t('searchNewTab.label')}
|
||||
</Group>
|
||||
|
||||
@@ -47,22 +47,22 @@ export default function TitleChanger() {
|
||||
<Stack>
|
||||
<TextInput
|
||||
label={t('pageTitle.label')}
|
||||
placeholder={'Homarr 🦞'}
|
||||
placeholder="Homarr 🦞"
|
||||
{...form.getInputProps('title')}
|
||||
/>
|
||||
<TextInput
|
||||
label={t('logo.label')}
|
||||
placeholder={'/imgs/logo.png}
|
||||
placeholder="/imgs/logo.png"
|
||||
{...form.getInputProps('logo')}
|
||||
/>
|
||||
<TextInput
|
||||
label={t('favicon.label')}
|
||||
placeholder={'/imgs/favicon/favicon.png'}
|
||||
placeholder="/imgs/favicon/favicon.png"
|
||||
{...form.getInputProps('favicon')}
|
||||
/>
|
||||
<TextInput
|
||||
label={t('background.label')}
|
||||
placeholder={'/img/background.png'}
|
||||
placeholder="/img/background.png"
|
||||
{...form.getInputProps('background')}
|
||||
/>
|
||||
<Textarea
|
||||
|
||||
@@ -42,9 +42,7 @@ export default function Layout({ children, style }: any) {
|
||||
>
|
||||
{children}
|
||||
</main>
|
||||
<style>
|
||||
{cx(config.settings.customCSS)}
|
||||
</style>
|
||||
<style>{cx(config.settings.customCSS)}</style>
|
||||
</AppShell>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -4,19 +4,15 @@ import { NextFetchEvent, NextRequest, NextResponse } from 'next/server';
|
||||
export function middleware(req: NextRequest, ev: NextFetchEvent) {
|
||||
const isCorrectPassword = req.cookies.get('password') === process.env.PASSWORD;
|
||||
const url = req.nextUrl.clone();
|
||||
const skipURL = url.pathname && (
|
||||
url.pathname.includes('login') || url.pathname === ('/api/configs/tryPassword') || (
|
||||
url.pathname.includes('/_next/') && !url.pathname.includes('/pages/')
|
||||
) ||
|
||||
const skipURL =
|
||||
url.pathname &&
|
||||
(url.pathname.includes('login') ||
|
||||
url.pathname === '/api/configs/tryPassword' ||
|
||||
(url.pathname.includes('/_next/') && !url.pathname.includes('/pages/')) ||
|
||||
url.pathname === '/favicon.ico' ||
|
||||
url.pathname === '/404' ||
|
||||
url.pathname.includes('pages/_app')
|
||||
);
|
||||
if (
|
||||
!skipURL &&
|
||||
!isCorrectPassword &&
|
||||
process.env.PASSWORD
|
||||
) {
|
||||
url.pathname.includes('pages/_app'));
|
||||
if (!skipURL && !isCorrectPassword && process.env.PASSWORD) {
|
||||
url.pathname = '/login';
|
||||
return NextResponse.rewrite(url);
|
||||
}
|
||||
|
||||
2
src/modules/ModuleTypes.d.ts
vendored
2
src/modules/ModuleTypes.d.ts
vendored
@@ -14,7 +14,7 @@ export interface IModule {
|
||||
padding?: PaddingOptions = {
|
||||
right: 15,
|
||||
top: 15,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
interface PaddingOptions {
|
||||
|
||||
@@ -136,12 +136,12 @@ export default function CalendarComponent(props: any) {
|
||||
date.getDay() === today.getDay() && date.getDate() === today.getDate()
|
||||
? {
|
||||
backgroundColor:
|
||||
theme.colorScheme === 'dark' ? theme.colors.dark[5] : theme.colors.gray[0],
|
||||
theme.colorScheme === 'dark' ? theme.colors.dark[5] : theme.colors.gray[0],
|
||||
margin: 1,
|
||||
}
|
||||
: {
|
||||
margin: 1,
|
||||
}
|
||||
margin: 1,
|
||||
}
|
||||
}
|
||||
styles={{
|
||||
calendarHeader: {
|
||||
|
||||
@@ -98,7 +98,7 @@ const useJson = (targetUrl: string, url: string) => {
|
||||
|
||||
const doRequest = async () => {
|
||||
try {
|
||||
const resp = await axios.get('/api/modules/dashdot',{ params: { url, base: targetUrl } });
|
||||
const resp = await axios.get('/api/modules/dashdot', { params: { url, base: targetUrl } });
|
||||
|
||||
setData(resp.data);
|
||||
// eslint-disable-next-line no-empty
|
||||
|
||||
@@ -1,12 +1,4 @@
|
||||
import {
|
||||
Table,
|
||||
Checkbox,
|
||||
Group,
|
||||
Badge,
|
||||
createStyles,
|
||||
ScrollArea,
|
||||
TextInput,
|
||||
} from '@mantine/core';
|
||||
import { Table, Checkbox, Group, Badge, createStyles, ScrollArea, TextInput } from '@mantine/core';
|
||||
import { IconSearch } from '@tabler/icons';
|
||||
import Dockerode from 'dockerode';
|
||||
import { useTranslation } from 'next-i18next';
|
||||
|
||||
@@ -158,16 +158,24 @@ export default function SearchBar(props: any) {
|
||||
form.setValues({ query: '' });
|
||||
switch (query.substring(0, 3)) {
|
||||
case '!yt':
|
||||
window.open(`https://www.youtube.com/results?search_query=${query.substring(3)}`, open_in);
|
||||
window.open(
|
||||
`https://www.youtube.com/results?search_query=${query.substring(3)}`,
|
||||
open_in
|
||||
);
|
||||
break;
|
||||
case '!t ':
|
||||
window.open(`https://www.torrentdownloads.me/search/?search=${query.substring(3)}`, open_in);
|
||||
window.open(
|
||||
`https://www.torrentdownloads.me/search/?search=${query.substring(3)}`,
|
||||
open_in
|
||||
);
|
||||
break;
|
||||
case '!os':
|
||||
break;
|
||||
default:
|
||||
window.open(
|
||||
`${queryUrl.includes('%s') ? queryUrl.replace('%s', query) : `${queryUrl}${query}`}`,
|
||||
`${
|
||||
queryUrl.includes('%s') ? queryUrl.replace('%s', query) : `${queryUrl}${query}`
|
||||
}`,
|
||||
open_in
|
||||
);
|
||||
break;
|
||||
|
||||
@@ -48,7 +48,7 @@ async function Get(req: NextApiRequest, res: NextApiResponse) {
|
||||
|
||||
const nzbGet = NzbgetClient(options);
|
||||
|
||||
const nzbgetHistory:NzbgetHistoryItem[] = await new Promise((resolve, reject) => {
|
||||
const nzbgetHistory: NzbgetHistoryItem[] = await new Promise((resolve, reject) => {
|
||||
nzbGet.history(false, (err: any, result: NzbgetHistoryItem[]) => {
|
||||
if (!err) {
|
||||
resolve(result);
|
||||
|
||||
@@ -47,7 +47,7 @@ async function Get(req: NextApiRequest, res: NextApiResponse) {
|
||||
|
||||
const nzbGet = NzbgetClient(options);
|
||||
|
||||
const nzbgetStatus:NzbgetStatus = await new Promise((resolve, reject) => {
|
||||
const nzbgetStatus: NzbgetStatus = await new Promise((resolve, reject) => {
|
||||
nzbGet.status((err: any, result: NzbgetStatus) => {
|
||||
if (!err) {
|
||||
resolve(result);
|
||||
|
||||
@@ -2,21 +2,21 @@ import NZBGet from 'nzbget-api';
|
||||
import { NzbgetClientOptions } from './types';
|
||||
|
||||
export function NzbgetClient(options: NzbgetClientOptions) {
|
||||
if (!options?.host) {
|
||||
throw new Error('Cannot connect to NZBGet. Missing host in service config.');
|
||||
}
|
||||
if (!options?.host) {
|
||||
throw new Error('Cannot connect to NZBGet. Missing host in service config.');
|
||||
}
|
||||
|
||||
if (!options?.port) {
|
||||
throw new Error('Cannot connect to NZBGet. Missing port in service config.');
|
||||
}
|
||||
if (!options?.port) {
|
||||
throw new Error('Cannot connect to NZBGet. Missing port in service config.');
|
||||
}
|
||||
|
||||
if (!options?.login) {
|
||||
throw new Error('Cannot connect to NZBGet. Missing username in service config.');
|
||||
}
|
||||
if (!options?.login) {
|
||||
throw new Error('Cannot connect to NZBGet. Missing username in service config.');
|
||||
}
|
||||
|
||||
if (!options?.hash) {
|
||||
throw new Error('Cannot connect to NZBGet. Missing password in service config.');
|
||||
}
|
||||
if (!options?.hash) {
|
||||
throw new Error('Cannot connect to NZBGet. Missing password in service config.');
|
||||
}
|
||||
|
||||
return new NZBGet(options);
|
||||
return new NZBGet(options);
|
||||
}
|
||||
|
||||
@@ -25,9 +25,9 @@ export interface NzbgetHistoryItem {
|
||||
DownloadTimeSec: number;
|
||||
PostTotalTimeSec: number;
|
||||
ParTimeSec: number;
|
||||
RepairTimeSec: number
|
||||
RepairTimeSec: number;
|
||||
UnpackTimeSec: number;
|
||||
MessageCount:number;
|
||||
MessageCount: number;
|
||||
DupeKey: string;
|
||||
DupeScore: number;
|
||||
DupeMode: 'SCORE' | 'ALL' | 'FORCE';
|
||||
@@ -71,7 +71,21 @@ export interface NzbgetQueueItem {
|
||||
MaxPostTime: number;
|
||||
MaxPriority: number;
|
||||
ActiveDownloads: number;
|
||||
Status: 'QUEUED' | 'PAUSED' | 'DOWNLOADING' | 'FETCHING' | 'PP_QUEUED' | 'LOADING_PARS' | 'VERIFYING_SOURCES' | 'REPAIRING' | 'VERIFYING_REPAIRED' | 'RENAMING' | 'UNPACKING' | 'MOVING' | 'EXECUTING_SCRIPT' | 'PP_FINISHED';
|
||||
Status:
|
||||
| 'QUEUED'
|
||||
| 'PAUSED'
|
||||
| 'DOWNLOADING'
|
||||
| 'FETCHING'
|
||||
| 'PP_QUEUED'
|
||||
| 'LOADING_PARS'
|
||||
| 'VERIFYING_SOURCES'
|
||||
| 'REPAIRING'
|
||||
| 'VERIFYING_REPAIRED'
|
||||
| 'RENAMING'
|
||||
| 'UNPACKING'
|
||||
| 'MOVING'
|
||||
| 'EXECUTING_SCRIPT'
|
||||
| 'PP_FINISHED';
|
||||
TotalArticles: number;
|
||||
SuccessArticles: number;
|
||||
FailedArticles: number;
|
||||
@@ -128,8 +142,8 @@ export interface NzbgetStatus {
|
||||
}
|
||||
|
||||
export interface NzbgetClientOptions {
|
||||
host: string,
|
||||
port: string,
|
||||
login: string | undefined,
|
||||
hash: string | undefined,
|
||||
host: string;
|
||||
port: string;
|
||||
login: string | undefined;
|
||||
hash: string | undefined;
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ async function Get(req: NextApiRequest, res: NextApiResponse) {
|
||||
|
||||
const nzbGet = NzbgetClient(options);
|
||||
|
||||
const nzbgetQueue:NzbgetQueueItem[] = await new Promise((resolve, reject) => {
|
||||
const nzbgetQueue: NzbgetQueueItem[] = await new Promise((resolve, reject) => {
|
||||
nzbGet.listGroups((err: any, result: NzbgetQueueItem[]) => {
|
||||
if (!err) {
|
||||
resolve(result);
|
||||
@@ -62,7 +62,7 @@ async function Get(req: NextApiRequest, res: NextApiResponse) {
|
||||
throw new Error('Error while getting NZBGet queue');
|
||||
}
|
||||
|
||||
const nzbgetStatus:NzbgetStatus = await new Promise((resolve, reject) => {
|
||||
const nzbgetStatus: NzbgetStatus = await new Promise((resolve, reject) => {
|
||||
nzbGet.status((err: any, result: NzbgetStatus) => {
|
||||
if (!err) {
|
||||
resolve(result);
|
||||
@@ -139,7 +139,7 @@ function getNzbgetState(status: string) {
|
||||
case 'QUEUED':
|
||||
return 'queued';
|
||||
case 'PAUSED ':
|
||||
return 'paused';
|
||||
return 'paused';
|
||||
default:
|
||||
return 'downloading';
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import React from 'react';
|
||||
import { PasswordInput, Anchor, Paper, Title, Text, Container, Group, Button } from '@mantine/core';
|
||||
import { PasswordInput, Paper, Title, Text, Container, Group, Button } from '@mantine/core';
|
||||
import { setCookie } from 'cookies-next';
|
||||
import { showNotification, updateNotification } from '@mantine/notifications';
|
||||
import axios from 'axios';
|
||||
import { IconCheck, IconX } from '@tabler/icons';
|
||||
import { useRouter } from 'next/router';
|
||||
import { Trans, useTranslation } from 'next-i18next';
|
||||
import { useTranslation } from 'next-i18next';
|
||||
import { useForm } from '@mantine/form';
|
||||
import { serverSideTranslations } from 'next-i18next/serverSideTranslations';
|
||||
import { loginNamespaces } from '../tools/translation-namespaces';
|
||||
|
||||
@@ -30,6 +30,4 @@ export const dashboardNamespaces = [
|
||||
'modules/common-media-cards',
|
||||
];
|
||||
|
||||
export const loginNamespaces = [
|
||||
'authentication/login',
|
||||
];
|
||||
export const loginNamespaces = ['authentication/login'];
|
||||
|
||||
@@ -11,7 +11,7 @@ export interface Settings {
|
||||
secondaryColor?: MantineTheme['primaryColor'];
|
||||
primaryShade?: MantineTheme['primaryShade'];
|
||||
background?: string;
|
||||
customCSS?: string,
|
||||
customCSS?: string;
|
||||
appOpacity?: number;
|
||||
widgetPosition?: string;
|
||||
appCardWidth?: number;
|
||||
@@ -76,7 +76,7 @@ export const ServiceTypeList = [
|
||||
'Overseerr',
|
||||
'Jellyseerr',
|
||||
'Sabnzbd',
|
||||
'NZBGet'
|
||||
'NZBGet',
|
||||
];
|
||||
export type ServiceType =
|
||||
| 'Other'
|
||||
@@ -120,7 +120,7 @@ export const portmap = [
|
||||
{ name: 'overseerr', value: '5055' },
|
||||
{ name: 'dash.', value: '3001' },
|
||||
{ name: 'sabnzbd', value: '8080' },
|
||||
{ name: 'nzbget', value: '6789' }
|
||||
{ name: 'nzbget', value: '6789' },
|
||||
];
|
||||
|
||||
export const MatchingImages: {
|
||||
|
||||
Reference in New Issue
Block a user