/** * Identification Settings Page * Server name, description, and basic settings */ import { Alert, Button, Card, Container, Divider, Group, Loader, Stack, Switch, Text, TextInput, Textarea, ThemeIcon, Title, } from '@mantine/core'; import { useForm } from '@mantine/form'; import { notifications } from '@mantine/notifications'; import { IconServer, IconAlertCircle, IconCheck, IconDeviceFloppy, } from '@tabler/icons-react'; import { GetServerSidePropsContext } from 'next'; import { UnraidLayout } from '~/components/Unraid/Layout'; import { getServerAuthSession } from '~/server/auth'; import { getServerSideTranslations } from '~/tools/server/getServerSideTranslations'; import { checkForSessionOrAskForLogin } from '~/tools/server/loginBuilder'; import { api } from '~/utils/api'; export default function IdentificationSettingsPage() { const { data: vars, isLoading, error, } = api.unraid.vars.useQuery(); const { data: info, } = api.unraid.info.useQuery(); const form = useForm({ initialValues: { name: '', description: '', model: '', timezone: '', }, }); // Update form when data loads if (vars && !form.isTouched()) { form.setValues({ name: vars.name || '', description: vars.description || '', model: vars.model || '', timezone: vars.timezone || '', }); } if (isLoading) { return ( Loading settings... ); } if (error) { return ( } title="Error" color="red"> {error.message} ); } return ( {/* Header */}
Identification Server name and basic settings
{/* Server Identity */} Server Identity