diff --git a/data/constants.ts b/data/constants.ts index db44a4c1e..8ca22cd0b 100644 --- a/data/constants.ts +++ b/data/constants.ts @@ -1,2 +1,2 @@ export const REPO_URL = 'ajnart/homarr'; -export const CURRENT_VERSION = 'v0.10.6'; +export const CURRENT_VERSION = 'v0.10.7'; diff --git a/package.json b/package.json index b81ca8858..bef8a0f18 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "homarr", - "version": "0.10.6", + "version": "0.10.7", "description": "Homarr - A homepage for your server.", "license": "MIT", "repository": { diff --git a/public/locales/da/settings/common.json b/public/locales/da/settings/common.json index fe544f3ff..bf0186826 100644 --- a/public/locales/da/settings/common.json +++ b/public/locales/da/settings/common.json @@ -10,5 +10,6 @@ }, "credits": { "madeWithLove": "Lavet med ❤️ af @" - } + }, + "grow": "" } \ No newline at end of file diff --git a/public/locales/de/settings/common.json b/public/locales/de/settings/common.json index e9eefcd25..273b28efc 100644 --- a/public/locales/de/settings/common.json +++ b/public/locales/de/settings/common.json @@ -10,5 +10,6 @@ }, "credits": { "madeWithLove": "Gemacht mit ❤️ von @" - } + }, + "grow": "" } \ No newline at end of file diff --git a/public/locales/en/settings/common.json b/public/locales/en/settings/common.json index 776816b2a..4ff9b984e 100644 --- a/public/locales/en/settings/common.json +++ b/public/locales/en/settings/common.json @@ -10,5 +10,6 @@ }, "credits": { "madeWithLove": "Made with ❤️ by @" - } + }, + "grow": "Grow grid (take all space)" } \ No newline at end of file diff --git a/public/locales/es/settings/common.json b/public/locales/es/settings/common.json index 80a465d81..4fb995e74 100644 --- a/public/locales/es/settings/common.json +++ b/public/locales/es/settings/common.json @@ -10,5 +10,6 @@ }, "credits": { "madeWithLove": "Hecho con ❤️ por @" - } + }, + "grow": "Aumentar cuadrícula (toma todo el espacio)" } \ No newline at end of file diff --git a/public/locales/fr/settings/common.json b/public/locales/fr/settings/common.json index 5e1a84e55..43759b7b5 100644 --- a/public/locales/fr/settings/common.json +++ b/public/locales/fr/settings/common.json @@ -10,5 +10,6 @@ }, "credits": { "madeWithLove": "Fait avec ❤️ par @" - } + }, + "grow": "" } \ No newline at end of file diff --git a/public/locales/he/settings/common.json b/public/locales/he/settings/common.json index c983228bf..b3b4b0c68 100644 --- a/public/locales/he/settings/common.json +++ b/public/locales/he/settings/common.json @@ -10,5 +10,6 @@ }, "credits": { "madeWithLove": "נעשה ב- ❤️ ע״י @" - } + }, + "grow": "" } \ No newline at end of file diff --git a/public/locales/it/settings/common.json b/public/locales/it/settings/common.json index 5ad515356..31e06d5ec 100644 --- a/public/locales/it/settings/common.json +++ b/public/locales/it/settings/common.json @@ -10,5 +10,6 @@ }, "credits": { "madeWithLove": "Realizzato con ❤️ da @" - } + }, + "grow": "" } \ No newline at end of file diff --git a/public/locales/ja/settings/common.json b/public/locales/ja/settings/common.json index fdf4200b3..d17465f6b 100644 --- a/public/locales/ja/settings/common.json +++ b/public/locales/ja/settings/common.json @@ -10,5 +10,6 @@ }, "credits": { "madeWithLove": "で作った❤️ by @さん" - } + }, + "grow": "" } \ No newline at end of file diff --git a/public/locales/ko/settings/common.json b/public/locales/ko/settings/common.json index a98a3bdba..5b38bc24b 100644 --- a/public/locales/ko/settings/common.json +++ b/public/locales/ko/settings/common.json @@ -10,5 +10,6 @@ }, "credits": { "madeWithLove": "Made with ❤️ by @" - } + }, + "grow": "" } \ No newline at end of file diff --git a/public/locales/lol/settings/common.json b/public/locales/lol/settings/common.json index d06b3bed1..74687468a 100644 --- a/public/locales/lol/settings/common.json +++ b/public/locales/lol/settings/common.json @@ -10,5 +10,6 @@ }, "credits": { "madeWithLove": "Maded wif ❤️ by @" - } + }, + "grow": "" } \ No newline at end of file diff --git a/public/locales/nl/settings/common.json b/public/locales/nl/settings/common.json index 7379dd0dc..535908947 100644 --- a/public/locales/nl/settings/common.json +++ b/public/locales/nl/settings/common.json @@ -10,5 +10,6 @@ }, "credits": { "madeWithLove": "Gemaakt met ❤️ door @" - } + }, + "grow": "" } \ No newline at end of file diff --git a/public/locales/pl/settings/common.json b/public/locales/pl/settings/common.json index c104935ab..7e9c62714 100644 --- a/public/locales/pl/settings/common.json +++ b/public/locales/pl/settings/common.json @@ -10,5 +10,6 @@ }, "credits": { "madeWithLove": "Wykonane z ❤️ przez @" - } + }, + "grow": "" } \ No newline at end of file diff --git a/public/locales/pt/settings/common.json b/public/locales/pt/settings/common.json index 15d3f6372..09f60b792 100644 --- a/public/locales/pt/settings/common.json +++ b/public/locales/pt/settings/common.json @@ -10,5 +10,6 @@ }, "credits": { "madeWithLove": "Feito com ❤️ por @" - } + }, + "grow": "" } \ No newline at end of file diff --git a/public/locales/ru/settings/common.json b/public/locales/ru/settings/common.json index 32405be02..c6fd9f5b5 100644 --- a/public/locales/ru/settings/common.json +++ b/public/locales/ru/settings/common.json @@ -10,5 +10,6 @@ }, "credits": { "madeWithLove": "Сделано с ❤️ по @." - } + }, + "grow": "" } \ No newline at end of file diff --git a/public/locales/sl/settings/common.json b/public/locales/sl/settings/common.json index 89a1a9afa..dac1a8a69 100644 --- a/public/locales/sl/settings/common.json +++ b/public/locales/sl/settings/common.json @@ -10,5 +10,6 @@ }, "credits": { "madeWithLove": "Narejeno s ❤️ od @" - } + }, + "grow": "" } \ No newline at end of file diff --git a/public/locales/sv/modules/search.json b/public/locales/sv/modules/search.json index cc0a37ebb..0eaff0b7d 100644 --- a/public/locales/sv/modules/search.json +++ b/public/locales/sv/modules/search.json @@ -6,25 +6,25 @@ "input": { "placeholder": "Sök på webben..." }, - "switched-to": "", + "switched-to": "Växlade till", "searchEngines": { "search": { - "name": "", - "description": "" + "name": "Webb", + "description": "Sök med din sökmotor (definierad i inställningar)" }, "youtube": { - "name": "", - "description": "" + "name": "YouTube", + "description": "Sök på YouTube" }, "torrents": { - "name": "", - "description": "" + "name": "Torrents", + "description": "Sök torrents" }, "overseerr": { "name": "Overseerr", - "description": "" + "description": "Sök efter filmer och TV-program med Overseerr (modulen måste vara aktiverad)" } }, - "tip": "", - "switchedSearchEngine": "" + "tip": "Du kan välja sökfältet med kortkommandot ", + "switchedSearchEngine": "Växlade till att söka med {{searchEngine}}" } \ No newline at end of file diff --git a/public/locales/sv/settings/common.json b/public/locales/sv/settings/common.json index b3b84b44b..e1aeac17f 100644 --- a/public/locales/sv/settings/common.json +++ b/public/locales/sv/settings/common.json @@ -10,5 +10,6 @@ }, "credits": { "madeWithLove": "Gjort med ❤️ av @" - } + }, + "grow": "Växande rutnät (ta allt utrymme)" } \ No newline at end of file diff --git a/public/locales/uk/settings/common.json b/public/locales/uk/settings/common.json index 659efab4f..cc6add962 100644 --- a/public/locales/uk/settings/common.json +++ b/public/locales/uk/settings/common.json @@ -10,5 +10,6 @@ }, "credits": { "madeWithLove": "Зроблено з ❤️ by @" - } + }, + "grow": "" } \ No newline at end of file diff --git a/public/locales/vi/settings/common.json b/public/locales/vi/settings/common.json index edd9e3eb9..7f26fc342 100644 --- a/public/locales/vi/settings/common.json +++ b/public/locales/vi/settings/common.json @@ -10,5 +10,6 @@ }, "credits": { "madeWithLove": "From @ with ❤️" - } + }, + "grow": "" } \ No newline at end of file diff --git a/public/locales/zh/settings/common.json b/public/locales/zh/settings/common.json index 859615d04..b35c3ca9b 100644 --- a/public/locales/zh/settings/common.json +++ b/public/locales/zh/settings/common.json @@ -10,5 +10,6 @@ }, "credits": { "madeWithLove": "用❤️创造,出品于" - } + }, + "grow": "" } \ No newline at end of file diff --git a/src/components/AppShelf/AppShelf.tsx b/src/components/AppShelf/AppShelf.tsx index 61587b8bf..ff2d118c8 100644 --- a/src/components/AppShelf/AppShelf.tsx +++ b/src/components/AppShelf/AppShelf.tsx @@ -95,7 +95,7 @@ const AppShelf = (props: any) => { onDragEnd={handleDragEnd} > - + {filtered.map((service) => ( @@ -143,7 +143,14 @@ const AppShelf = (props: any) => { value={idx.toString()} > - {category} + + {category} + {getItems(category)} diff --git a/src/components/Settings/AdvancedSettings.tsx b/src/components/Settings/AdvancedSettings.tsx index a3b54cd77..3d5b7bd96 100644 --- a/src/components/Settings/AdvancedSettings.tsx +++ b/src/components/Settings/AdvancedSettings.tsx @@ -6,6 +6,7 @@ import { ColorSelector } from './ColorSelector'; import { OpacitySelector } from './OpacitySelector'; import { AppCardWidthSelector } from './AppCardWidthSelector'; import { ShadeSelector } from './ShadeSelector'; +import { GrowthSelector } from './GrowthSelector'; export default function TitleChanger() { const { config, setConfig } = useConfig(); @@ -74,6 +75,7 @@ export default function TitleChanger() { + diff --git a/src/components/Settings/GrowthSelector.tsx b/src/components/Settings/GrowthSelector.tsx new file mode 100644 index 000000000..4eb5af861 --- /dev/null +++ b/src/components/Settings/GrowthSelector.tsx @@ -0,0 +1,30 @@ +import { Switch } from '@mantine/core'; +import { useTranslation } from 'next-i18next'; +import { useState } from 'react'; +import { useConfig } from '../../tools/state'; + +export function GrowthSelector() { + const { config, setConfig } = useConfig(); + const defaultPosition = config?.settings?.grow || false; + const [growState, setGrowState] = useState(defaultPosition); + const { t } = useTranslation('settings/common.json'); + const toggleGrowState = () => { + setGrowState(!growState); + setConfig({ + ...config, + settings: { + ...config.settings, + grow: !growState, + }, + }); + }; + + return ( + toggleGrowState()} + size="md" + /> + ); +} diff --git a/src/components/WidgetsPositionSwitch/WidgetsPositionSwitch.tsx b/src/components/WidgetsPositionSwitch/WidgetsPositionSwitch.tsx index e7ccdc2a2..beee55b52 100644 --- a/src/components/WidgetsPositionSwitch/WidgetsPositionSwitch.tsx +++ b/src/components/WidgetsPositionSwitch/WidgetsPositionSwitch.tsx @@ -48,15 +48,11 @@ export function WidgetsPositionSwitch() { }; return ( - -
- toggleWidgetPosition()} - size="md" - /> -
- {t('label')} -
+ toggleWidgetPosition()} + size="md" + /> ); } diff --git a/src/modules/search/SearchModule.tsx b/src/modules/search/SearchModule.tsx index 2af962eed..5c12b9672 100644 --- a/src/modules/search/SearchModule.tsx +++ b/src/modules/search/SearchModule.tsx @@ -1,5 +1,6 @@ import { ActionIcon, + Autocomplete, Box, createStyles, Divider, @@ -11,7 +12,7 @@ import { Tooltip, } from '@mantine/core'; import { IconSearch, IconBrandYoutube, IconDownload, IconMovie } from '@tabler/icons'; -import React, { useEffect, useRef, useState } from 'react'; +import React, { forwardRef, useEffect, useRef, useState } from 'react'; import { useDebouncedValue, useHotkeys } from '@mantine/hooks'; import { showNotification } from '@mantine/notifications'; import { useTranslation } from 'next-i18next'; @@ -21,6 +22,7 @@ import { useConfig } from '../../tools/state'; import { OverseerrModule } from '../overseerr'; import Tip from '../../components/layout/Tip'; import { OverseerrMediaDisplay } from '../common'; +import SmallServiceItem from '../../components/AppShelf/SmallServiceItem'; export const SearchModule: IModule = { title: 'Search', @@ -97,6 +99,25 @@ export function SearchModuleComponent() { }, ]; const [selectedSearchEngine, setSearchEngine] = useState(searchEnginesList[0]); + const matchingServices = config.services.filter((service) => { + if (searchQuery === '' || searchQuery === undefined) { + return false; + } + return service.name.toLowerCase().includes(searchQuery.toLowerCase()); + }); + const autocompleteData = matchingServices.map((service) => ({ + label: service.name, + value: service.name, + icon: service.icon, + url: service.openedUrl ?? service.url, + })); + const AutoCompleteItem = forwardRef( + ({ label, value, icon, url, ...others }: any, ref) => ( +
+ +
+ ) + ); useEffect(() => { // Refresh the default search engine every time the config for it changes #521 setSearchEngine(searchEnginesList[0]); @@ -123,7 +144,7 @@ export function SearchModuleComponent() { //TODO: Fix the bug where clicking anything inside the Modal to ask for a movie // will close it (Because it closes the underlying Popover) return ( - + 0 && opened && searchQuery.length > 3} position="bottom" @@ -134,17 +155,30 @@ export function SearchModuleComponent() { transition="pop-top-right" > - setOpened(true)} autoFocus rightSection={} placeholder={t(`searchEngines.${selectedSearchEngine.value}.description`)} value={searchQuery} - onChange={(event) => tryMatchSearchEngine(event.currentTarget.value, setSearchQuery)} + onChange={(currentString) => tryMatchSearchEngine(currentString, setSearchQuery)} + itemComponent={AutoCompleteItem} + data={autocompleteData} + onItemSubmit={(item) => { + setOpened(false); + if (item.url) { + setSearchQuery(''); + window.open(item.openedUrl ? item.openedUrl : item.url, openInNewTab); + } + }} // Replace %s if it is in selectedSearchEngine.url with searchQuery, otherwise append searchQuery at the end of it onKeyDown={(event) => { - if (event.key === 'Enter' && searchQuery.length > 0) { + if ( + event.key === 'Enter' && + searchQuery.length > 0 && + autocompleteData.length === 0 + ) { if (selectedSearchEngine.url.includes('%s')) { window.open(selectedSearchEngine.url.replace('%s', searchQuery), openInNewTab); } else { @@ -152,6 +186,8 @@ export function SearchModuleComponent() { } } }} + radius="md" + size="md" /> diff --git a/src/tools/types.ts b/src/tools/types.ts index 7e2220110..68d8d75e7 100644 --- a/src/tools/types.ts +++ b/src/tools/types.ts @@ -14,6 +14,7 @@ export interface Settings { customCSS?: string; appOpacity?: number; widgetPosition?: string; + grow?: boolean; appCardWidth?: number; }