UI/install: add machine progress
This commit is contained in:
@@ -17,6 +17,8 @@ import { Divider } from "@/src/components/Divider/Divider";
|
|||||||
import { Orienter } from "@/src/components/Form/Orienter";
|
import { Orienter } from "@/src/components/Form/Orienter";
|
||||||
import { Button } from "@/src/components/Button/Button";
|
import { Button } from "@/src/components/Button/Button";
|
||||||
import { Select } from "@/src/components/Select/Select";
|
import { Select } from "@/src/components/Select/Select";
|
||||||
|
import { LoadingBar } from "@/src/components/LoadingBar/LoadingBar";
|
||||||
|
import Icon from "@/src/components/Icon/Icon";
|
||||||
|
|
||||||
export const InstallHeader = (props: { machineName: string }) => {
|
export const InstallHeader = (props: { machineName: string }) => {
|
||||||
return (
|
return (
|
||||||
@@ -103,10 +105,10 @@ const CheckHardware = () => {
|
|||||||
<Fieldset>
|
<Fieldset>
|
||||||
<Orienter orientation="horizontal">
|
<Orienter orientation="horizontal">
|
||||||
<Typography hierarchy="label" size="xs" weight="bold">
|
<Typography hierarchy="label" size="xs" weight="bold">
|
||||||
Check hardware
|
Hardware Report
|
||||||
</Typography>
|
</Typography>
|
||||||
<Button hierarchy="secondary" startIcon="Report">
|
<Button hierarchy="secondary" startIcon="Report">
|
||||||
Run hardware report
|
Update hardware report
|
||||||
</Button>
|
</Button>
|
||||||
</Orienter>
|
</Orienter>
|
||||||
<Divider orientation="horizontal" />
|
<Divider orientation="horizontal" />
|
||||||
@@ -123,7 +125,9 @@ const CheckHardware = () => {
|
|||||||
footer={
|
footer={
|
||||||
<div class="flex justify-between">
|
<div class="flex justify-between">
|
||||||
<BackButton />
|
<BackButton />
|
||||||
<NextButton onClick={handleNext}>Next</NextButton>
|
<NextButton type="button" onClick={handleNext}>
|
||||||
|
Next
|
||||||
|
</NextButton>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
@@ -214,7 +218,7 @@ const ConfigureData = () => {
|
|||||||
<TextInput
|
<TextInput
|
||||||
{...field}
|
{...field}
|
||||||
label="Root password"
|
label="Root password"
|
||||||
description="Set the root password for the machine"
|
description="Leave empty to generate automatically"
|
||||||
value={field.value}
|
value={field.value}
|
||||||
required
|
required
|
||||||
orientation="horizontal"
|
orientation="horizontal"
|
||||||
@@ -340,6 +344,58 @@ const InstallSummary = () => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const InstallProgress = () => {
|
||||||
|
return (
|
||||||
|
<div class="flex h-60 w-full flex-col items-center justify-end bg-inv-4">
|
||||||
|
<div class="mb-6 flex w-full max-w-md flex-col items-center gap-3 fg-inv-1">
|
||||||
|
<Typography
|
||||||
|
hierarchy="title"
|
||||||
|
size="default"
|
||||||
|
weight="bold"
|
||||||
|
color="inherit"
|
||||||
|
>
|
||||||
|
Machine is beeing installed
|
||||||
|
</Typography>
|
||||||
|
<LoadingBar />
|
||||||
|
<Button hierarchy="primary" class="w-fit" size="s">
|
||||||
|
Cancel
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const FlashDone = () => {
|
||||||
|
const stepSignal = useStepper<InstallSteps>();
|
||||||
|
return (
|
||||||
|
<div class="flex w-full flex-col items-center bg-inv-4">
|
||||||
|
<div class="flex w-full max-w-md flex-col items-center gap-3 py-6 fg-inv-1">
|
||||||
|
<div class="rounded-full bg-semantic-success-4">
|
||||||
|
<Icon icon="Checkmark" class="size-9" />
|
||||||
|
</div>
|
||||||
|
<Typography
|
||||||
|
hierarchy="title"
|
||||||
|
size="default"
|
||||||
|
weight="bold"
|
||||||
|
color="inherit"
|
||||||
|
>
|
||||||
|
Machine installation finished!
|
||||||
|
</Typography>
|
||||||
|
<div class="mt-3 flex w-full justify-center">
|
||||||
|
<Button
|
||||||
|
hierarchy="primary"
|
||||||
|
endIcon="Close"
|
||||||
|
size="s"
|
||||||
|
onClick={() => stepSignal.next()}
|
||||||
|
>
|
||||||
|
Close
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
export const installSteps = [
|
export const installSteps = [
|
||||||
{
|
{
|
||||||
id: "install:address",
|
id: "install:address",
|
||||||
@@ -351,11 +407,6 @@ export const installSteps = [
|
|||||||
title: InstallHeader,
|
title: InstallHeader,
|
||||||
content: CheckHardware,
|
content: CheckHardware,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
id: "install:check-hardware",
|
|
||||||
title: InstallHeader,
|
|
||||||
content: CheckHardware,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
id: "install:disk",
|
id: "install:disk",
|
||||||
title: InstallHeader,
|
title: InstallHeader,
|
||||||
@@ -377,17 +428,12 @@ export const installSteps = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "install:progress",
|
id: "install:progress",
|
||||||
title: InstallHeader,
|
content: InstallProgress,
|
||||||
content: () => (
|
isSplash: true,
|
||||||
<div>
|
|
||||||
<p>Installation in progress...</p>
|
|
||||||
<p>Please wait while we set up your machine.</p>
|
|
||||||
</div>
|
|
||||||
),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "install:done",
|
id: "install:done",
|
||||||
title: InstallHeader,
|
content: FlashDone,
|
||||||
content: () => <div>Done</div>,
|
isSplash: true,
|
||||||
},
|
},
|
||||||
] as const;
|
] as const;
|
||||||
|
|||||||
Reference in New Issue
Block a user