From fa03c190f88c2c6d79ee3c0ca52d9666d69f48f3 Mon Sep 17 00:00:00 2001 From: Johannes Kirschbauer Date: Wed, 6 Aug 2025 16:43:11 +0200 Subject: [PATCH] UI/install: split initial choice --- .../ui/src/workflows/Install/install.tsx | 10 +- .../src/workflows/Install/steps/Initial.tsx | 128 +++++++++++++----- 2 files changed, 104 insertions(+), 34 deletions(-) diff --git a/pkgs/clan-app/ui/src/workflows/Install/install.tsx b/pkgs/clan-app/ui/src/workflows/Install/install.tsx index 73c3637b2..ed25edc38 100644 --- a/pkgs/clan-app/ui/src/workflows/Install/install.tsx +++ b/pkgs/clan-app/ui/src/workflows/Install/install.tsx @@ -7,7 +7,7 @@ import { import { createForm, FieldValues, SubmitHandler } from "@modular-forms/solid"; import { Show } from "solid-js"; import { Dynamic } from "solid-js/web"; -import { InitialStep } from "./steps/Initial"; +import { initialSteps } from "./steps/Initial"; import { createInstallerSteps } from "./steps/createInstaller"; import { installSteps } from "./steps/installSteps"; @@ -40,10 +40,14 @@ const InstallStepper = () => { export interface InstallModalProps { machineName: string; - initialStep?: string; + initialStep?: InstallSteps[number]["id"]; } -const steps = [InitialStep, ...createInstallerSteps, ...installSteps] as const; +const steps = [ + ...initialSteps, + ...createInstallerSteps, + ...installSteps, +] as const; export type InstallSteps = typeof steps; diff --git a/pkgs/clan-app/ui/src/workflows/Install/steps/Initial.tsx b/pkgs/clan-app/ui/src/workflows/Install/steps/Initial.tsx index e12054206..ebf1d52c9 100644 --- a/pkgs/clan-app/ui/src/workflows/Install/steps/Initial.tsx +++ b/pkgs/clan-app/ui/src/workflows/Install/steps/Initial.tsx @@ -1,32 +1,24 @@ -import { useStepper } from "@/src/hooks/stepper"; +import { defineSteps, Step, StepBase, useStepper } from "@/src/hooks/stepper"; import { InstallSteps } from "../install"; import { Typography } from "@/src/components/Typography/Typography"; import { Button } from "@/src/components/Button/Button"; import { Divider } from "@/src/components/Divider/Divider"; +import { StepLayout } from "../../Steps"; -const InitialChoice = () => { +const ChoiceLocalOrRemote = () => { const stepSignal = useStepper(); return (
-
-
+
+
- Remote setup - - - Is your machine currently online? Does it have an IP-address, can - you SSH into it? And does it support Kexec? + I have physical access to the machine.
+ onClick={() => stepSignal.setActiveStep("local:choice")} + />
- - -
- - I don't have an installer, yet - +
+
+
+
+ + The Machine is remote and i have ssh access to it. + +
+ icon="CaretRight" + onClick={() => stepSignal.setActiveStep("install:address")} + />
); }; -export const InitialStep = { - id: "init", - content: InitialChoice, +const ChoiceLocalInstaller = () => { + const stepSignal = useStepper(); + return ( + +
+
+
+ + I have an installer + +
+
+
+
+
+
+ + I don't have an installer, yet + +
+
+
+
+ } + footer={ +
+
+ } + /> + ); }; + +export const initialSteps = defineSteps([ + { + id: "init", + content: ChoiceLocalOrRemote, + }, + { + id: "local:choice", + content: ChoiceLocalInstaller, + }, +] as const);