"use client"; import type { ReactNode } from "react"; import { ActionIcon, Accordion, Alert, Anchor, Box, Button, getDefaultZIndex, Group, Paper, SimpleGrid, Stack, Text, ThemeIcon, Title, } from "@mantine/core"; import { IconArrowsMove, IconBook2, IconBrandCss3, IconBrandDiscord, IconBrandGithub, IconDatabaseExport, IconExternalLink, IconHeartHandshake, IconRobot, IconRocket, IconTerminal2, IconWand, IconX, } from "@tabler/icons-react"; import { setClientCookie } from "@homarr/common"; import { createModal, useModalAction } from "@homarr/modals"; import { BackupExportButton } from "~/components/backup"; import { discordInviteUrl, v2BetaBlogUrl, v2BetaDiscussionUrl, v2BetaDocsUrl, v2BetaFeedbackUrl, v2BetaPreviewUrl, v2BetaWorkshopUrl, } from "./constants"; import classes from "./v2-beta-announcement.module.css"; const diffLineClassNames = { added: classes.diffLine_added, context: classes.diffLine_context, removed: classes.diffLine_removed, } as const; const composeDiffLines = [ { kind: "context", value: " services:" }, { kind: "context", value: " homarr:" }, { kind: "added", value: "+ image: ghcr.io/homarr-labs/homarr-test:v2" }, { kind: "removed", value: "- image: ghcr.io/homarr-labs/homarr:latest" }, { kind: "context", value: " ports:" }, { kind: "context", value: ' - "7575:7575"' }, { kind: "context", value: " volumes:" }, { kind: "context", value: " - homarr-v2:/appdata" }, { kind: "context", value: " environment:" }, { kind: "context", value: " SECRET_ENCRYPTION_KEY: " }, { kind: "added", value: "+ WORKSHOP_API_URL: https://v2.preview.homarr.dev/ # Only during the beta" }, { kind: "context", value: "" }, { kind: "context", value: " volumes:" }, { kind: "context", value: " homarr-v2:" }, ] as const; interface V2BetaAnnouncementProps { canExportBackup: boolean; dismissalCookieName: string; onDismiss: () => void; } export const V2BetaAnnouncement = ({ canExportBackup, dismissalCookieName, onDismiss }: V2BetaAnnouncementProps) => { const { openModal } = useModalAction(V2BetaAnnouncementModal); const dismiss = () => { setClientCookie(dismissalCookieName, "dismissed", { maxAge: 60 * 60 * 24 * 7, path: "/", sameSite: "lax", secure: window.location.protocol === "https:", }); onDismiss(); }; return ( We've been cooking, Homarr v2 beta is here Custom Widgets & CSS workshop, new drag-and-drop, new container system, side-bars are back, new widgets and so much more, come check it out and help us make v2 ready for everyone ); }; interface V2BetaAnnouncementModalProps { canExportBackup: boolean; } const V2BetaAnnouncementModal = createModal(({ innerProps }) => { return ( Help us get Homarr v2 ready We've been working on Homarr's v2 update for a while now. There is no fixed release date yet, it will be ready when it's ready. We{" "} need your help {" "} and feedback to help us become confident enough to release it for everyone. } title="Workshop"> Share and discover Custom Widgets and CSS made by the Homarr community. } title="Complete drag-and-drop rewrite"> Move, resize, multi-select, and arrange your dashboard with a board editor rebuilt from the ground up. } title="Custom Widgets v2"> We think you can make almost any widget with live previews, API requests, options, actions, and validation. } title="Assistant"> Assistant can directly make a Custom Widget for you. Try giving it the API docs for your latest selfhosted tool and asking it to build a custom widget for it. } aria-label="Test Homarr v2 on your server" > Test Homarr v2 on your server Back up this instance, then update your Docker Compose file. } title="Your testing is essential"> Everyone uses Homarr in a different way. If anything breaks or does not feel right, the easiest way to get it fixed as soon as possible is to{" "} tell us about it on Discord {" "} in our dedicated v2 channel. You can also{" "} open a dedicated GitHub issue {"."} Every report matters. ); }).withOptions({ defaultTitle: "Homarr v2 beta", size: 1000, yOffset: 128, zIndex: getDefaultZIndex("modal") + 2, }); interface V2BetaInstallInstructionsProps { canExportBackup: boolean; } const V2BetaInstallInstructions = ({ canExportBackup }: V2BetaInstallInstructionsProps) => ( {canExportBackup ? ( Back up this Homarr instance Download a full backup before testing v2. The archive contains sensitive data, so keep it somewhere safe. ) : ( Direct backup downloads are available here to Homarr administrators using SQLite. If you use MySQL or PostgreSQL, back up the database with its own tools before testing v2. )} Update your Docker Compose file Replace the current image and add the beta-only Workshop URL. Use the example below as a starting point. docker-compose.yml {composeDiffLines.map((line, index) => ( {line.value || " "} ))} Replace <SECRET_KEY> with your existing encryption key. The Workshop URL is only required while the beta uses the preview Workshop. ); interface FeatureCardProps { icon: ReactNode; title: string; children: ReactNode; } const FeatureCard = ({ icon, title, children }: FeatureCardProps) => ( {icon} {title} {children} );