mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-10 15:35:55 +01:00
🐛 Fix compilation issues
This commit is contained in:
@@ -50,7 +50,6 @@
|
|||||||
"axios": "^0.27.2",
|
"axios": "^0.27.2",
|
||||||
"consola": "^2.15.3",
|
"consola": "^2.15.3",
|
||||||
"cookies-next": "^2.1.1",
|
"cookies-next": "^2.1.1",
|
||||||
"country-flag-icons": "^1.5.5",
|
|
||||||
"dayjs": "^1.11.5",
|
"dayjs": "^1.11.5",
|
||||||
"dockerode": "^3.3.2",
|
"dockerode": "^3.3.2",
|
||||||
"embla-carousel-react": "^7.0.0",
|
"embla-carousel-react": "^7.0.0",
|
||||||
|
|||||||
@@ -210,7 +210,6 @@ export function AddAppShelfItemForm(props: AddAppShelfItemFormProps) {
|
|||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
console.log(newForm);
|
|
||||||
setConfig({
|
setConfig({
|
||||||
...config,
|
...config,
|
||||||
services: [...config.services, newForm],
|
services: [...config.services, newForm],
|
||||||
|
|||||||
@@ -23,7 +23,13 @@ export default function AppShelfMenu(props: any) {
|
|||||||
onClose={() => setOpened(false)}
|
onClose={() => setOpened(false)}
|
||||||
title={t('modal.title')}
|
title={t('modal.title')}
|
||||||
>
|
>
|
||||||
<AddAppShelfItemForm setOpened={setOpened} {...service} message={t('modal.buttons.save')} />
|
<AddAppShelfItemForm
|
||||||
|
config={config}
|
||||||
|
setConfig={setConfig}
|
||||||
|
setOpened={setOpened}
|
||||||
|
{...service}
|
||||||
|
message={t('modal.buttons.save')}
|
||||||
|
/>
|
||||||
</Modal>
|
</Modal>
|
||||||
<Menu
|
<Menu
|
||||||
withinPortal
|
withinPortal
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
import { Group, Select, Stack, Text } from '@mantine/core';
|
import { Group, Select, Stack, Text } from '@mantine/core';
|
||||||
import { showNotification } from '@mantine/notifications';
|
import { showNotification } from '@mantine/notifications';
|
||||||
import getUnicodeFlagIcon from 'country-flag-icons/unicode';
|
|
||||||
|
|
||||||
import { forwardRef, useState } from 'react';
|
import { forwardRef, useState } from 'react';
|
||||||
import { useTranslation } from 'next-i18next';
|
import { useTranslation } from 'next-i18next';
|
||||||
import { useRouter } from 'next/router';
|
import { useRouter } from 'next/router';
|
||||||
import { getCookie, setCookie } from 'cookies-next';
|
import { getCookie, setCookie } from 'cookies-next';
|
||||||
import { getLanguageByCode, Language } from '../../languages/language';
|
import { getLanguageByCode, Language } from '../../tools/language';
|
||||||
|
|
||||||
export default function LanguageSwitch() {
|
export default function LanguageSwitch() {
|
||||||
const { t, i18n } = useTranslation('settings/general/internationalization');
|
const { t, i18n } = useTranslation('settings/general/internationalization');
|
||||||
@@ -21,7 +20,7 @@ export default function LanguageSwitch() {
|
|||||||
? locales.map((localeItem) => ({
|
? locales.map((localeItem) => ({
|
||||||
value: localeItem,
|
value: localeItem,
|
||||||
label: getLanguageByCode(localeItem).originalName,
|
label: getLanguageByCode(localeItem).originalName,
|
||||||
icon: getUnicodeFlagIcon(localeItem),
|
icon: getLanguageByCode(localeItem).emoji,
|
||||||
language: getLanguageByCode(localeItem),
|
language: getLanguageByCode(localeItem),
|
||||||
}))
|
}))
|
||||||
: [];
|
: [];
|
||||||
@@ -59,7 +58,7 @@ export default function LanguageSwitch() {
|
|||||||
return (
|
return (
|
||||||
<Stack>
|
<Stack>
|
||||||
<Select
|
<Select
|
||||||
icon={<Text>{getUnicodeFlagIcon(getLanguageByCode(selectedLanguage).shortName)}</Text>}
|
icon={<Text>{getLanguageByCode(selectedLanguage).emoji}</Text>}
|
||||||
label={t('label')}
|
label={t('label')}
|
||||||
data={data}
|
data={data}
|
||||||
itemComponent={SelectItem}
|
itemComponent={SelectItem}
|
||||||
@@ -69,7 +68,7 @@ export default function LanguageSwitch() {
|
|||||||
defaultValue={locale}
|
defaultValue={locale}
|
||||||
searchable
|
searchable
|
||||||
filter={(value, item) => {
|
filter={(value, item) => {
|
||||||
const selectItems = item as unknown as { value: string, language: Language };
|
const selectItems = item as unknown as { value: string; language: Language };
|
||||||
return (
|
return (
|
||||||
selectItems.language.originalName.trim().includes(value.trim()) ||
|
selectItems.language.originalName.trim().includes(value.trim()) ||
|
||||||
selectItems.language.translatedName.trim().includes(value.trim())
|
selectItems.language.translatedName.trim().includes(value.trim())
|
||||||
@@ -97,7 +96,7 @@ const SelectItem = forwardRef<HTMLDivElement, ItemProps>(
|
|||||||
({ language, image, ...others }: ItemProps, ref) => (
|
({ language, image, ...others }: ItemProps, ref) => (
|
||||||
<div ref={ref} {...others}>
|
<div ref={ref} {...others}>
|
||||||
<Group noWrap>
|
<Group noWrap>
|
||||||
<Text>{getUnicodeFlagIcon(language.shortName)}</Text>
|
<Text>{language.emoji}</Text>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<Text size="sm">
|
<Text size="sm">
|
||||||
|
|||||||
@@ -6,14 +6,11 @@ import {
|
|||||||
createStyles,
|
createStyles,
|
||||||
ScrollArea,
|
ScrollArea,
|
||||||
TextInput,
|
TextInput,
|
||||||
Modal,
|
|
||||||
} from '@mantine/core';
|
} from '@mantine/core';
|
||||||
import { IconSearch } from '@tabler/icons';
|
import { IconSearch } from '@tabler/icons';
|
||||||
import Dockerode from 'dockerode';
|
import Dockerode from 'dockerode';
|
||||||
import { useTranslation } from 'next-i18next';
|
import { useTranslation } from 'next-i18next';
|
||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
import { AddAppShelfItemForm } from '../../components/AppShelf/AddAppShelfItem';
|
|
||||||
import { tryMatchService } from '../../tools/addToHomarr';
|
|
||||||
import ContainerState from './ContainerState';
|
import ContainerState from './ContainerState';
|
||||||
|
|
||||||
const useStyles = createStyles((theme) => ({
|
const useStyles = createStyles((theme) => ({
|
||||||
|
|||||||
@@ -2,64 +2,76 @@ export class Language {
|
|||||||
shortName: string;
|
shortName: string;
|
||||||
originalName: string;
|
originalName: string;
|
||||||
translatedName: string;
|
translatedName: string;
|
||||||
|
emoji: string;
|
||||||
|
|
||||||
constructor(shortName: string, originalName: string, translatedName: string) {
|
constructor(shortName: string, originalName: string, translatedName: string, emoji: string) {
|
||||||
this.shortName = shortName;
|
this.shortName = shortName;
|
||||||
this.originalName = originalName;
|
this.originalName = originalName;
|
||||||
this.translatedName = translatedName;
|
this.translatedName = translatedName;
|
||||||
|
this.emoji = emoji;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const languages: Language[] = [
|
export const languages: Language[] = [
|
||||||
{
|
{
|
||||||
shortName: 'de',
|
shortName: 'de',
|
||||||
originalName: 'Deutsch',
|
originalName: 'Deutsch',
|
||||||
translatedName: 'German',
|
translatedName: 'German',
|
||||||
|
emoji: '🇩🇪',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
shortName: 'en',
|
shortName: 'en',
|
||||||
originalName: 'English',
|
originalName: 'English',
|
||||||
translatedName: 'English',
|
translatedName: 'English',
|
||||||
|
emoji: '🇬🇧',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
shortName: 'es',
|
shortName: 'es',
|
||||||
originalName: 'Español',
|
originalName: 'Español',
|
||||||
translatedName: 'Spanish',
|
translatedName: 'Spanish',
|
||||||
|
emoji: '🇪🇸',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
shortName: 'fr',
|
shortName: 'fr',
|
||||||
originalName: 'Français',
|
originalName: 'Français',
|
||||||
translatedName: 'French',
|
translatedName: 'French',
|
||||||
|
emoji: '🇫🇷',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
shortName: 'it',
|
shortName: 'it',
|
||||||
originalName: 'Italiano',
|
originalName: 'Italiano',
|
||||||
translatedName: 'Italian',
|
translatedName: 'Italian',
|
||||||
|
emoji: '🇮🇹',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
shortName: 'ja',
|
shortName: 'ja',
|
||||||
originalName: '日本語',
|
originalName: '日本語',
|
||||||
translatedName: 'Japanese',
|
translatedName: 'Japanese',
|
||||||
|
emoji: '🇯🇵',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
shortName: 'nl',
|
shortName: 'nl',
|
||||||
originalName: 'Nederlands',
|
originalName: 'Nederlands',
|
||||||
translatedName: 'Dutch',
|
translatedName: 'Dutch',
|
||||||
|
emoji: '🇳🇱',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
shortName: 'ru',
|
shortName: 'ru',
|
||||||
originalName: 'Русский',
|
originalName: 'Русский',
|
||||||
translatedName: 'Russian',
|
translatedName: 'Russian',
|
||||||
|
emoji: '🇷🇺',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
shortName: 'sv',
|
shortName: 'sv',
|
||||||
originalName: 'Svenska',
|
originalName: 'Svenska',
|
||||||
translatedName: 'Swedish',
|
translatedName: 'Swedish',
|
||||||
|
emoji: '🇸🇪',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
shortName: 'zh',
|
shortName: 'zh',
|
||||||
originalName: '中文',
|
originalName: '中文',
|
||||||
translatedName: 'Chinese',
|
translatedName: 'Chinese',
|
||||||
|
emoji: '🇨🇳',
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -3195,13 +3195,6 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"country-flag-icons@npm:^1.5.5":
|
|
||||||
version: 1.5.5
|
|
||||||
resolution: "country-flag-icons@npm:1.5.5"
|
|
||||||
checksum: 367f38330a7f0f94836c7859575e1ae75655a04e2104ba060de75827d82bd84413fd7752c9166efa93123eb0d1dd1db1658ef22683511dcfa1c16f2caffe892d
|
|
||||||
languageName: node
|
|
||||||
linkType: hard
|
|
||||||
|
|
||||||
"cpu-features@npm:~0.0.4":
|
"cpu-features@npm:~0.0.4":
|
||||||
version: 0.0.4
|
version: 0.0.4
|
||||||
resolution: "cpu-features@npm:0.0.4"
|
resolution: "cpu-features@npm:0.0.4"
|
||||||
@@ -4820,7 +4813,6 @@ __metadata:
|
|||||||
axios: ^0.27.2
|
axios: ^0.27.2
|
||||||
consola: ^2.15.3
|
consola: ^2.15.3
|
||||||
cookies-next: ^2.1.1
|
cookies-next: ^2.1.1
|
||||||
country-flag-icons: ^1.5.5
|
|
||||||
dayjs: ^1.11.5
|
dayjs: ^1.11.5
|
||||||
dockerode: ^3.3.2
|
dockerode: ^3.3.2
|
||||||
embla-carousel-react: ^7.0.0
|
embla-carousel-react: ^7.0.0
|
||||||
|
|||||||
Reference in New Issue
Block a user