From bdaf70f26b633f9028835292b4e69184f2a64700 Mon Sep 17 00:00:00 2001 From: ajnart Date: Fri, 3 Jun 2022 14:10:38 +0200 Subject: [PATCH 01/89] :ambulance: Hotfix errors --- src/components/layout/Footer.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/components/layout/Footer.tsx b/src/components/layout/Footer.tsx index ff47dc8110b..573c299978a 100644 --- a/src/components/layout/Footer.tsx +++ b/src/components/layout/Footer.tsx @@ -39,7 +39,7 @@ export function Footer({ links }: FooterCenteredProps) { // 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 >= CURRENT_VERSION) { + if (data.tag_name > CURRENT_VERSION) { showNotification({ color: 'yellow', autoClose: false, @@ -47,13 +47,12 @@ export function Footer({ links }: FooterCenteredProps) { icon: , message: `Version ${data.tag_name} is available, update now!`, }); - } else if (data.tag_name <= CURRENT_VERSION) { + } else if (data.tag_name < CURRENT_VERSION) { showNotification({ color: 'orange', autoClose: 5000, title: 'You are using a development version', icon: , - loading: true, message: 'This version of Homarr is still in development! Bugs are expected 🐛', }); } From 39674fc7694a8ba78000d3894420985e2fc9ee49 Mon Sep 17 00:00:00 2001 From: Thomas Camlong <49837342+ajnart@users.noreply.github.com> Date: Mon, 6 Jun 2022 12:22:32 +0200 Subject: [PATCH 02/89] Update docker_dev.yml --- .github/workflows/docker_dev.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker_dev.yml b/.github/workflows/docker_dev.yml index 46c00e799b7..cb332d82b05 100644 --- a/.github/workflows/docker_dev.yml +++ b/.github/workflows/docker_dev.yml @@ -16,7 +16,7 @@ on: workflow_dispatch: inputs: tags: - requierd: true + required: true description: 'Tags to deploy to' env: @@ -119,7 +119,6 @@ jobs: uses: docker/setup-buildx-action@v2 - name: Login to GHCR - if: github.event_name != 'pull_request' uses: docker/login-action@v2 with: registry: ghcr.io @@ -131,6 +130,6 @@ jobs: with: platforms: linux/amd64,linux/arm64,linux/arm/v7 context: . - push: ${{ github.event_name != 'pull_request' }} + push: ${{ github.event_name }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} From 5b165893600efcc3f547edc5349a2ca279eca413 Mon Sep 17 00:00:00 2001 From: VinnyVynce <19630511+VinnyVynce@users.noreply.github.com> Date: Mon, 6 Jun 2022 07:07:35 -0400 Subject: [PATCH 03/89] Change urls for href instead of origin --- src/pages/api/modules/downloads.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/api/modules/downloads.ts b/src/pages/api/modules/downloads.ts index 2322a481ba1..eaa0ece4ed2 100644 --- a/src/pages/api/modules/downloads.ts +++ b/src/pages/api/modules/downloads.ts @@ -17,14 +17,14 @@ async function Post(req: NextApiRequest, res: NextApiResponse) { switch (dlclient) { case 'qbit': client = new QBittorrent({ - baseUrl: new URL(url).origin, + baseUrl: new URL(url).href, username, password, }); break; case 'deluge': client = new Deluge({ - baseUrl: new URL(url).origin, + baseUrl: new URL(url).href, password, }); break; From bbb912479b2db21cf11d6375dd703609ee94d956 Mon Sep 17 00:00:00 2001 From: ajnart Date: Mon, 6 Jun 2022 15:02:41 +0200 Subject: [PATCH 04/89] =?UTF-8?q?=F0=9F=AA=9D=20AdduseSetSafeInterval=20ho?= =?UTF-8?q?ok?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/tools/hooks/useSetSafeInterval.tsx | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/tools/hooks/useSetSafeInterval.tsx diff --git a/src/tools/hooks/useSetSafeInterval.tsx b/src/tools/hooks/useSetSafeInterval.tsx new file mode 100644 index 00000000000..4bedbc15e36 --- /dev/null +++ b/src/tools/hooks/useSetSafeInterval.tsx @@ -0,0 +1,22 @@ +import { useEffect, useRef } from 'react'; + +export function useSetSafeInterval() { + const timers = useRef([]); + + function setSafeInterval(callback: () => void, delay: number) { + const newInterval = setInterval(callback, delay); + timers.current.push(newInterval); + return newInterval; + } + + useEffect( + () => () => { + timers.current.forEach((t) => { + clearInterval(t); + }); + }, + [] + ); + + return setSafeInterval; +} From 00928ae709beeac6a8a3016a6f103546e16c026d Mon Sep 17 00:00:00 2001 From: ajnart Date: Mon, 6 Jun 2022 15:20:46 +0200 Subject: [PATCH 05/89] :iphone: Make the design way more responsive for mobile --- src/components/layout/Aside.tsx | 38 +++++++--- src/components/layout/Header.tsx | 72 ++++++++++++++++++- src/components/layout/Layout.tsx | 25 ++++++- .../modules/calendar/CalendarModule.tsx | 10 ++- .../modules/common/MediaDisplay.tsx | 36 ++++++++-- src/components/modules/date/DateModule.tsx | 4 +- .../modules/downloads/DownloadsModule.tsx | 7 +- .../downloads/TotalDownloadsModule.tsx | 5 +- .../modules/system/SystemModule.tsx | 15 ++-- 9 files changed, 177 insertions(+), 35 deletions(-) diff --git a/src/components/layout/Aside.tsx b/src/components/layout/Aside.tsx index 9154fea10f5..9d05d196e00 100644 --- a/src/components/layout/Aside.tsx +++ b/src/components/layout/Aside.tsx @@ -1,4 +1,5 @@ -import { Aside as MantineAside, Group } from '@mantine/core'; +import { Aside as MantineAside, createStyles, Group } from '@mantine/core'; +import { useMediaQuery } from '@mantine/hooks'; import { WeatherModule, DateModule, @@ -8,12 +9,29 @@ import { } from '../modules'; import { ModuleWrapper } from '../modules/moduleWrapper'; +const useStyles = createStyles((theme) => ({ + hide: { + [theme.fn.smallerThan('xs')]: { + display: 'none', + }, + }, + burger: { + [theme.fn.largerThan('sm')]: { + display: 'none', + }, + }, +})); + export default function Aside(props: any) { + const { classes, cx } = useStyles(); + const matches = useMediaQuery('(min-width: 800px)'); + return ( ); } diff --git a/src/components/layout/Header.tsx b/src/components/layout/Header.tsx index 28ed95f4603..145e89e578e 100644 --- a/src/components/layout/Header.tsx +++ b/src/components/layout/Header.tsx @@ -1,9 +1,29 @@ import React from 'react'; -import { createStyles, Header as Head, Group, Box } from '@mantine/core'; +import { + createStyles, + Header as Head, + Group, + Box, + Burger, + Drawer, + Title, + ScrollArea, + ActionIcon, + Transition, +} from '@mantine/core'; +import { useBooleanToggle } from '@mantine/hooks'; import { Logo } from './Logo'; import SearchBar from '../modules/search/SearchModule'; import { AddItemShelfButton } from '../AppShelf/AddAppShelfItem'; import { SettingsMenuButton } from '../Settings/SettingsMenu'; +import { ModuleWrapper } from '../modules/moduleWrapper'; +import { + CalendarModule, + TotalDownloadsModule, + WeatherModule, + DateModule, + SystemModule, +} from '../modules'; const HEADER_HEIGHT = 60; @@ -13,10 +33,18 @@ const useStyles = createStyles((theme) => ({ display: 'none', }, }, + burger: { + [theme.fn.largerThan('sm')]: { + display: 'none', + }, + }, })); export function Header(props: any) { + const [opened, toggleOpened] = useBooleanToggle(false); const { classes, cx } = useStyles(); + const [hidden, toggleHidden] = useBooleanToggle(true); + const drawerModule = CalendarModule; return ( @@ -28,6 +56,48 @@ export function Header(props: any) { + + { + toggleHidden(); + toggleOpened(); + }} + /> + + diff --git a/src/components/layout/Layout.tsx b/src/components/layout/Layout.tsx index ac2c3c74296..116c6516fb5 100644 --- a/src/components/layout/Layout.tsx +++ b/src/components/layout/Layout.tsx @@ -1,16 +1,37 @@ -import { AppShell, createStyles } from '@mantine/core'; +import { AppShell, createStyles, Group } from '@mantine/core'; import { Header } from './Header'; import { Footer } from './Footer'; import Aside from './Aside'; +import { ModuleWrapper } from '../modules/moduleWrapper'; +import { + CalendarModule, + TotalDownloadsModule, + WeatherModule, + DateModule, + SystemModule, +} from '../modules'; const useStyles = createStyles((theme) => ({ main: {}, })); export default function Layout({ children, style }: any) { + const drawerContent = ( + + + + + + + + ); const { classes, cx } = useStyles(); return ( - } header={
} footer={