Merge branch 'dev' into next-13
This commit is contained in:
@@ -5,6 +5,7 @@ import {
|
||||
Button,
|
||||
createStyles,
|
||||
Divider,
|
||||
Grid,
|
||||
Group,
|
||||
HoverCard,
|
||||
Modal,
|
||||
@@ -94,35 +95,45 @@ export const AboutModal = ({ opened, closeModal, newVersionAvailable }: AboutMod
|
||||
{t('layout/modals/about:contact')}
|
||||
</Title>
|
||||
|
||||
<Group grow>
|
||||
<Button
|
||||
component="a"
|
||||
href="https://github.com/ajnart/homarr"
|
||||
target="_blank"
|
||||
leftIcon={<IconBrandGithub size={20} />}
|
||||
variant="default"
|
||||
>
|
||||
GitHub
|
||||
</Button>
|
||||
<Button
|
||||
component="a"
|
||||
href="https://homarr.dev/"
|
||||
target="_blank"
|
||||
leftIcon={<IconWorldWww size={20} />}
|
||||
variant="default"
|
||||
>
|
||||
Documentation
|
||||
</Button>
|
||||
<Button
|
||||
component="a"
|
||||
href="https://discord.gg/aCsmEV5RgA"
|
||||
target="_blank"
|
||||
leftIcon={<IconBrandDiscord size={20} />}
|
||||
variant="default"
|
||||
>
|
||||
Discord
|
||||
</Button>
|
||||
</Group>
|
||||
<Grid grow>
|
||||
<Grid.Col md={4} xs={12}>
|
||||
<Button
|
||||
component="a"
|
||||
href="https://github.com/ajnart/homarr"
|
||||
target="_blank"
|
||||
leftIcon={<IconBrandGithub size={20} />}
|
||||
variant="default"
|
||||
fullWidth
|
||||
>
|
||||
GitHub
|
||||
</Button>
|
||||
</Grid.Col>
|
||||
<Grid.Col md={4} xs={12}>
|
||||
<Button
|
||||
component="a"
|
||||
href="https://homarr.dev/"
|
||||
target="_blank"
|
||||
leftIcon={<IconWorldWww size={20} />}
|
||||
variant="default"
|
||||
fullWidth
|
||||
>
|
||||
Documentation
|
||||
</Button>
|
||||
</Grid.Col>
|
||||
|
||||
<Grid.Col md={4} xs={12}>
|
||||
<Button
|
||||
component="a"
|
||||
href="https://discord.gg/aCsmEV5RgA"
|
||||
target="_blank"
|
||||
leftIcon={<IconBrandDiscord size={20} />}
|
||||
variant="default"
|
||||
fullWidth
|
||||
>
|
||||
Discord
|
||||
</Button>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
<Credits />
|
||||
</Modal>
|
||||
);
|
||||
@@ -16,7 +16,7 @@ export const AppPing = ({ app }: AppPingProps) => {
|
||||
(config?.settings.customization.layout.enabledPing && app.network.enabledStatusChecker) ??
|
||||
false;
|
||||
const { data, isLoading } = useQuery({
|
||||
queryKey: [`ping/${app.id}`],
|
||||
queryKey: ['ping', { id: app.id, name: app.name }],
|
||||
queryFn: async () => {
|
||||
const response = await fetch(`/api/modules/ping?url=${encodeURI(app.url)}`);
|
||||
const isOk = app.network.okStatus.includes(response.status);
|
||||
|
||||
@@ -16,17 +16,15 @@ export function Header(props: any) {
|
||||
const { classes: cardClasses } = useCardStyles(false);
|
||||
const { attributes } = usePackageAttributesStore();
|
||||
|
||||
const [newVersionAvailable, setNewVersionAvailable] = useState<string>('');
|
||||
useEffect(() => {
|
||||
// Fetch Data here when component first mounted
|
||||
fetch(`https://api.github.com/repos/${REPO_URL}/releases/latest`).then((res) => {
|
||||
res.json().then((data) => {
|
||||
if (data.tag_name > `v${attributes.packageVersion}`) {
|
||||
setNewVersionAvailable(data.tag_name);
|
||||
}
|
||||
});
|
||||
});
|
||||
}, []);
|
||||
const { isLoading, error, data } = useQuery({
|
||||
queryKey: ['github/latest'],
|
||||
cacheTime: 1000 * 60 * 60 * 24,
|
||||
staleTime: 1000 * 60 * 60 * 5,
|
||||
queryFn: () =>
|
||||
fetch(`https://api.github.com/repos/${REPO_URL}/releases/latest`).then((res) => res.json()),
|
||||
});
|
||||
const newVersionAvailable =
|
||||
data?.tag_name > `v${attributes.packageVersion}` ? data?.tag_name : undefined;
|
||||
|
||||
return (
|
||||
<MantineHeader height="auto" className={cardClasses.card}>
|
||||
@@ -38,7 +36,13 @@ export function Header(props: any) {
|
||||
<Search />
|
||||
<ToggleEditModeAction />
|
||||
<DockerMenuButton />
|
||||
<Indicator size={15} color="blue" withBorder processing disabled={!newVersionAvailable}>
|
||||
<Indicator
|
||||
size={15}
|
||||
color="blue"
|
||||
withBorder
|
||||
processing
|
||||
disabled={newVersionAvailable === undefined}
|
||||
>
|
||||
<SettingsMenu newVersionAvailable={newVersionAvailable} />
|
||||
</Indicator>
|
||||
</Group>
|
||||
|
||||
@@ -148,13 +148,14 @@ export function Search() {
|
||||
} = useQuery(
|
||||
['overseerr', debounced],
|
||||
async () => {
|
||||
if (debounced !== '' && selectedSearchEngine.value === 'overseerr' && debounced.length > 3) {
|
||||
const res = await axios.get(`/api/modules/overseerr?query=${debounced}`);
|
||||
return res.data.results ?? [];
|
||||
}
|
||||
return [];
|
||||
const res = await axios.get(`/api/modules/overseerr?query=${debounced}`);
|
||||
return res.data.results ?? [];
|
||||
},
|
||||
{
|
||||
enabled:
|
||||
isOverseerrEnabled === true &&
|
||||
selectedSearchEngine.value === 'overseerr' &&
|
||||
debounced.length > 3,
|
||||
refetchOnWindowFocus: false,
|
||||
refetchOnMount: false,
|
||||
refetchInterval: false,
|
||||
|
||||
@@ -2,7 +2,7 @@ import { Badge, Button, Menu } from '@mantine/core';
|
||||
import { useDisclosure } from '@mantine/hooks';
|
||||
import { IconInfoCircle, IconMenu2, IconSettings } from '@tabler/icons';
|
||||
import { useTranslation } from 'next-i18next';
|
||||
import { AboutModal } from '../../About/AboutModal';
|
||||
import { AboutModal } from '../../Dashboard/Modals/AboutModal/AboutModal';
|
||||
import { SettingsDrawer } from '../../Settings/SettingsDrawer';
|
||||
import { useCardStyles } from '../useCardStyles';
|
||||
import { ColorSchemeSwitch } from './SettingsMenu/ColorSchemeSwitch';
|
||||
|
||||
Reference in New Issue
Block a user