diff --git a/ee/tabby-ui/app/auth/signup/components/admin-register.css b/ee/tabby-ui/app/auth/signup/components/admin-register.css
new file mode 100644
index 000000000000..bca4cfdfa394
--- /dev/null
+++ b/ee/tabby-ui/app/auth/signup/components/admin-register.css
@@ -0,0 +1,39 @@
+.admin-register-wrap {
+ transition: transform 0.35s ease-out;
+ padding-top: 20vh;
+ padding-bottom: 20vh;
+}
+
+.step-mask {
+ position: relative;
+ pointer-events: none;
+ user-select: none;
+ border-color: hsl(var(--muted-foreground) / 0.1);
+
+}
+.step-mask:before {
+ content: "";
+ position: absolute;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ left: 0;
+ background: linear-gradient(
+ 0deg,
+ hsl(var(--background) / 1) 0%,
+ hsl(var(--background) / 1) 30%,
+ hsl(var(--background) / 0.5) 100%
+ );
+ pointer-events: none;
+ user-select: none;
+ z-index: 10;
+ width: 110%;
+}
+.step-mask.remote:before {
+ background: linear-gradient(
+ 0deg,
+ hsl(var(--background) / 1) 0%,
+ hsl(var(--background) / 1) 30%,
+ hsl(var(--background) / 0.9) 100%
+ );
+}
\ No newline at end of file
diff --git a/ee/tabby-ui/app/auth/signup/components/admin-register.tsx b/ee/tabby-ui/app/auth/signup/components/admin-register.tsx
new file mode 100644
index 000000000000..ef6a7e0f7e31
--- /dev/null
+++ b/ee/tabby-ui/app/auth/signup/components/admin-register.tsx
@@ -0,0 +1,96 @@
+'use client'
+
+import { useEffect, useState } from 'react'
+import { useRouter } from 'next/navigation'
+
+import { cn } from '@/lib/utils'
+import { Button } from '@/components/ui/button'
+
+import { UserAuthForm } from './user-register-form'
+
+import './admin-register.css'
+
+function AdminRegisterStep({
+ step,
+ currentStep,
+ children
+}: {
+ step: number
+ currentStep: number
+ children: React.ReactNode
+}) {
+ return (
+
1
+ })}
+ >
+ {children}
+
+ )
+}
+
+export default function AdminRegister() {
+ const router = useRouter()
+ const [currentStep, setCurrentStep] = useState(1)
+
+ useEffect(() => {
+ if (currentStep === 1) return
+ document
+ .getElementById(`step-${currentStep}`)
+ ?.scrollIntoView({ behavior: 'smooth' })
+ }, [currentStep])
+
+ return (
+
+
+
+ Welcome!
+
+
+ Your tabby server is live and ready to use. This step by step guide
+ will help you set up your admin account.
+
+
+ Admin account is the highest level of access in your server. Once
+ created, you can invite other members to join your server.
+
+
+
+
+
+
+ Create Admin Account
+
+
+ Please store your password in a safe place. We do not store your
+ password and cannot recover it for you.
+
+ setCurrentStep(3)}
+ buttonClass="self-start w-48"
+ />
+
+
+
+
+ Congratulations!
+
+
+ You have successfully created an admin account.
+
+
+ To start, navigate to the dashboard and invite other members to join
+ your server.
+
+
+
+
+ )
+}
diff --git a/ee/tabby-ui/app/auth/signup/components/signup.tsx b/ee/tabby-ui/app/auth/signup/components/signup.tsx
index d7539d38b5db..52a486b743b6 100644
--- a/ee/tabby-ui/app/auth/signup/components/signup.tsx
+++ b/ee/tabby-ui/app/auth/signup/components/signup.tsx
@@ -2,6 +2,7 @@
import { useSearchParams } from 'next/navigation'
+import AdminRegister from './admin-register'
import { UserAuthForm } from './user-register-form'
export default function Signup() {
@@ -9,22 +10,22 @@ export default function Signup() {
const invitationCode = searchParams.get('invitationCode') || undefined
const isAdmin = searchParams.get('isAdmin') || false
- const title = isAdmin ? 'Create an admin account' : 'Create an account'
-
- const description = isAdmin
- ? 'Your instance will be secured, only registered users can access it.'
- : 'Fill form below to create your account'
-
- if (isAdmin || invitationCode) {
- return
- } else {
+ if (isAdmin) return
+ if (invitationCode) {
return (
)
}
+ return (
+
+ )
}
function Content({
diff --git a/ee/tabby-ui/app/auth/signup/components/user-register-form.tsx b/ee/tabby-ui/app/auth/signup/components/user-register-form.tsx
index d90be3355458..8589c8c3aaef 100644
--- a/ee/tabby-ui/app/auth/signup/components/user-register-form.tsx
+++ b/ee/tabby-ui/app/auth/signup/components/user-register-form.tsx
@@ -51,11 +51,15 @@ const formSchema = z.object({
interface UserAuthFormProps extends React.HTMLAttributes {
invitationCode?: string
+ onSuccess?: () => void
+ buttonClass?: string
}
export function UserAuthForm({
className,
invitationCode,
+ onSuccess,
+ buttonClass,
...props
}: UserAuthFormProps) {
const form = useForm>({
@@ -71,7 +75,11 @@ export function UserAuthForm({
const onSubmit = useMutation(registerUser, {
async onCompleted(values) {
if (await signIn(values?.register)) {
- router.replace('/')
+ if (onSuccess) {
+ onSuccess()
+ } else {
+ router.replace('/')
+ }
}
},
form
@@ -95,6 +103,7 @@ export function UserAuthForm({
autoComplete="email"
autoCorrect="off"
{...field}
+ value={field.value ?? ''}
/>
@@ -108,7 +117,7 @@ export function UserAuthForm({
Password
-
+
@@ -121,7 +130,7 @@ export function UserAuthForm({
Confirm Password
-
+
@@ -138,7 +147,11 @@ export function UserAuthForm({
)}
/>
-