Files
app/frontend/src/routes/_layout/settings.tsx
T
stroblme 6c8a101d24 Rename Installation to Instance
Follows the portal: the noun is "instance" everywhere the app says it —
UI strings, CLI output, error details, docs and comments. The wire keys
(`instance_id`, `instance_token`) and the hub route this calls move with it.

An existing cloud.json is adopted rather than refused: without the key
alias the dataclass fails to parse, which the caller swallows and reads as
"never enrolled" instead of "reconnect".

`instance_key` on a node type becomes `target_key`. It means the outside
thing a node points at, which is a different sense of the word, and keeping
both would put two meanings of "instance" in one codebase.
2026-08-31 10:12:01 +02:00

64 lines
1.9 KiB
TypeScript

import { createFileRoute } from "@tanstack/react-router"
import { motion } from "motion/react"
import Appearance from "@/components/UserSettings/Appearance"
import RemoteAccess from "@/components/UserSettings/RemoteAccess"
import UserInformation from "@/components/UserSettings/UserInformation"
import useAuth from "@/hooks/useAuth"
import { listStagger, slideUp } from "@/lib/motion"
export const Route = createFileRoute("/_layout/settings")({
component: UserSettings,
head: () => ({
meta: [
{
title: "Settings - Fluksio",
},
],
}),
})
function UserSettings() {
const { user: currentUser } = useAuth()
if (!currentUser) {
return null
}
return (
<div className="flex flex-col gap-6">
<div>
<h1 className="font-display text-3xl font-semibold">Settings</h1>
<p className="max-w-2xl text-sm text-muted-foreground">
Manage your account settings and preferences
</p>
</div>
{/* Panels rather than tabs, the way the portal does it: there are few
enough of these to read at once, and hiding four behind a tab bar was
navigation over three cards. Changing a password and deleting an
account belong to the account, so they live in that card's footer. */}
<motion.div
className="grid items-start gap-6 lg:grid-cols-2"
variants={listStagger}
initial="hidden"
animate="visible"
>
<motion.div variants={slideUp}>
<UserInformation />
</motion.div>
<motion.div variants={slideUp}>
<Appearance />
</motion.div>
{/* Whether this whole instance can be reached from outside is not
a personal preference, so it only exists for an operator. */}
{currentUser.is_superuser && (
<motion.div variants={slideUp}>
<RemoteAccess />
</motion.div>
)}
</motion.div>
</div>
)
}