diff --git a/beszel/site/src/components/add-system.tsx b/beszel/site/src/components/add-system.tsx index 9faab67..c0892ec 100644 --- a/beszel/site/src/components/add-system.tsx +++ b/beszel/site/src/components/add-system.tsx @@ -9,12 +9,7 @@ import { DialogTrigger, } from '@/components/ui/dialog' import { TooltipProvider, Tooltip, TooltipTrigger, TooltipContent } from '@/components/ui/tooltip' -import { - Tabs, - TabsContent, - TabsList, - TabsTrigger, -} from "@/components/ui/tabs" +import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs' import { Input } from '@/components/ui/input' import { Label } from '@/components/ui/label' @@ -51,7 +46,9 @@ export function AddSystemButton({ className }: { className?: string }) { } function copyInstallCommand(port: string) { - copyToClipboard(`curl -sL https://raw.githubusercontent.com/henrygd/beszel/main/supplemental/scripts/install-agent.sh -o install-agent.sh && chmod +x install-agent.sh && ./install-agent.sh -p ${port} -k "${publicKey}"`) + copyToClipboard( + `curl -sL https://raw.githubusercontent.com/henrygd/beszel/main/supplemental/scripts/install-agent.sh -o install-agent.sh && chmod +x install-agent.sh && ./install-agent.sh -p ${port} -k "${publicKey}"` + ) } async function handleSubmit(e: SubmitEvent) { @@ -77,10 +74,11 @@ export function AddSystemButton({ className }: { className?: string }) { className={cn('flex gap-1 max-xs:h-[2.4rem]', className, isReadOnlyUser() && 'hidden')} > - {t('add')}{t('system')} + {t('add')} + {t('system')} - + {t('add_system.add_new_system')} @@ -93,14 +91,16 @@ export function AddSystemButton({ className }: { className?: string }) { {t('add_system.dialog_des_1')}{' '} - docker-compose.yml {t('add_system.dialog_des_2')} + docker-compose.yml{' '} + {t('add_system.dialog_des_2')} {/* Binary */} {t('add_system.dialog_des_1')}{' '} - install command {t('add_system.dialog_des_2')} + install command{' '} + {t('add_system.dialog_des_2')}
@@ -161,7 +161,7 @@ export function AddSystemButton({ className }: { className?: string }) { {/* Docker */} - + @@ -30,7 +31,7 @@ export function LangToggle() { {languages.map(({ lang, label }) => ( i18n.changeLanguage(lang)} > {label} diff --git a/beszel/site/src/components/routes/home.tsx b/beszel/site/src/components/routes/home.tsx index 8bcca40..5bb9e11 100644 --- a/beszel/site/src/components/routes/home.tsx +++ b/beszel/site/src/components/routes/home.tsx @@ -13,7 +13,7 @@ import { useTranslation } from 'react-i18next' const SystemsTable = lazy(() => import('../systems-table/systems-table')) -const isMac = navigator.platform.toUpperCase().indexOf('MAC') >= 0; +const isMac = navigator.platform.toUpperCase().indexOf('MAC') >= 0 export default function () { const { t } = useTranslation() @@ -78,13 +78,13 @@ export default function () { > - {alert.sysname} {info.name} + {alert.sysname} {t(info.name)} - {t('active_des', { + {t('home.active_des', { value: alert.value, unit: info.unit, - minutes: alert.min + minutes: alert.min, })} {t('home.subtitle_1')}{' '} - {isMac ? '⌘' : "Ctrl"}K + {isMac ? '⌘' : 'Ctrl'}K {' '} {t('home.subtitle_2')} diff --git a/beszel/site/src/components/routes/settings/general.tsx b/beszel/site/src/components/routes/settings/general.tsx index 1e31bbd..fc0eb37 100644 --- a/beszel/site/src/components/routes/settings/general.tsx +++ b/beszel/site/src/components/routes/settings/general.tsx @@ -9,7 +9,7 @@ import { } from '@/components/ui/select' import { chartTimeData } from '@/lib/utils' import { Separator } from '@/components/ui/separator' -import { LoaderCircleIcon, SaveIcon } from 'lucide-react' +import { LanguagesIcon, LoaderCircleIcon, SaveIcon } from 'lucide-react' import { UserSettings } from '@/types' import { saveSettings } from './layout' import { useState, useEffect } from 'react' @@ -21,8 +21,8 @@ export default function SettingsProfilePage({ userSettings }: { userSettings: Us const { t, i18n } = useTranslation() useEffect(() => { - document.documentElement.lang = i18n.language; - }, [i18n.language]); + document.documentElement.lang = i18n.language + }, [i18n.language]) const [isLoading, setIsLoading] = useState(false) @@ -47,7 +47,10 @@ export default function SettingsProfilePage({ userSettings }: { userSettings: Us
+
-

{t('settings.general.chart_options.title')}

+

+ {t('settings.general.chart_options.title')} +

{t('settings.general.chart_options.subtitle')}

diff --git a/beszel/site/src/locales/en/translation.json b/beszel/site/src/locales/en/translation.json index 3c5e822..59fccd5 100644 --- a/beszel/site/src/locales/en/translation.json +++ b/beszel/site/src/locales/en/translation.json @@ -9,7 +9,7 @@ "continue": "Continue", "home": { "active_alerts": "Active Alerts", - "active_des": "Exceeds {{value}}{{unit}} average in last {{minutes}} minutes", + "active_des": "Exceeds {{value}}{{unit}} average in last {{minutes}} min", "subtitle_1": "Updated in real time. Press", "subtitle_2": "to open the command palette." }, diff --git a/beszel/site/src/main.tsx b/beszel/site/src/main.tsx index 91d4efd..5dfb2fb 100644 --- a/beszel/site/src/main.tsx +++ b/beszel/site/src/main.tsx @@ -51,6 +51,7 @@ import { AddSystemButton } from './components/add-system.tsx' import './lib/i18n.ts' import { useTranslation } from 'react-i18next' +import { TFunction } from 'i18next' // const ServerDetail = lazy(() => import('./components/routes/system.tsx')) const CommandPalette = lazy(() => import('./components/command-palette.tsx')) @@ -114,6 +115,84 @@ const App = () => { } } +const Navbar = (t: TFunction<'translation', undefined>) => { + return ( +
+ ) +} + const Layout = () => { const { t } = useTranslation() @@ -130,81 +209,7 @@ const Layout = () => { return ( <> -
-
- - - - -
- - - - - - - - - - - {pb.authStore.model?.email} - - - {isAdmin() && ( - <> - - - - {t('user_dm.users')} - - - - - - {t('systems')} - - - - - - {t('user_dm.logs')} - - - - - - {t('user_dm.backups')} - - - - - - {t('user_dm.auth_providers')} - - - - - )} - - pb.authStore.clear()}> - - {t('user_dm.log_out')} - - - - -
-
-
+
{Navbar(t)}
diff --git a/beszel/site/tailwind.config.js b/beszel/site/tailwind.config.js index 91935a5..f1cd6df 100644 --- a/beszel/site/tailwind.config.js +++ b/beszel/site/tailwind.config.js @@ -24,6 +24,7 @@ module.exports = { }, screens: { xs: '425px', + 450: '450px', }, colors: { green: {