mirror of
https://github.com/unraid/api.git
synced 2025-12-31 13:39:52 -06:00
fix: stepper fixes (#1240)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Refactor** - Streamlined the activation steps display with improved conditional rendering and enhanced interactive button styling. - **New Features** - Introduced a new welcome page featuring a dummy server switcher and refreshed welcome modal. - Expanded the activation interface with a new activation code section for clearer navigation. - **Chores** - Removed the welcome modal from the home page to simplify the layout. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Zack Spear <hi@zackspear.com>
This commit is contained in:
@@ -30,7 +30,7 @@ const description = computed<string>(() =>
|
|||||||
const docsButtons = computed<BrandButtonProps[]>(() => {
|
const docsButtons = computed<BrandButtonProps[]>(() => {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
btnStyle: 'underline',
|
variant: 'underline',
|
||||||
external: true,
|
external: true,
|
||||||
href: 'https://docs.unraid.net/unraid-os/faq/licensing-faq/',
|
href: 'https://docs.unraid.net/unraid-os/faq/licensing-faq/',
|
||||||
iconRight: ArrowTopRightOnSquareIcon,
|
iconRight: ArrowTopRightOnSquareIcon,
|
||||||
@@ -38,7 +38,7 @@ const docsButtons = computed<BrandButtonProps[]>(() => {
|
|||||||
text: props.t('More about Licensing'),
|
text: props.t('More about Licensing'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
btnStyle: 'underline',
|
variant: 'underline',
|
||||||
external: true,
|
external: true,
|
||||||
href: 'https://docs.unraid.net/account/',
|
href: 'https://docs.unraid.net/account/',
|
||||||
iconRight: ArrowTopRightOnSquareIcon,
|
iconRight: ArrowTopRightOnSquareIcon,
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ type StepState = 'inactive' | 'active' | 'completed';
|
|||||||
|
|
||||||
withDefaults(
|
withDefaults(
|
||||||
defineProps<{
|
defineProps<{
|
||||||
activeStep: number;
|
activeStep?: number;
|
||||||
}>(),
|
}>(),
|
||||||
{
|
{
|
||||||
activeStep: 1,
|
activeStep: 1,
|
||||||
@@ -75,44 +75,43 @@ const steps: readonly Step[] = [
|
|||||||
<template>
|
<template>
|
||||||
<Stepper :default-value="activeStep" class="text-foreground flex w-full items-start gap-2 text-16px">
|
<Stepper :default-value="activeStep" class="text-foreground flex w-full items-start gap-2 text-16px">
|
||||||
<StepperItem
|
<StepperItem
|
||||||
v-for="step in steps"
|
v-for="(step, index) in steps"
|
||||||
:key="step.step"
|
:key="step.step"
|
||||||
v-slot="{ state }: { state: StepState }"
|
v-slot="{ state }: { state: StepState }"
|
||||||
class="relative flex w-full flex-col items-center justify-center"
|
class="relative flex w-full flex-col items-center justify-center data-[disabled]:opacity-100"
|
||||||
:step="step.step"
|
:step="step.step"
|
||||||
:disabled="true"
|
:disabled="true"
|
||||||
>
|
>
|
||||||
<StepperSeparator
|
<StepperTrigger>
|
||||||
v-if="step.step !== steps[steps.length - 1].step"
|
<div class="flex items-center justify-center">
|
||||||
class="absolute left-[calc(50%+20px)] right-[calc(-50%+10px)] top-[1.5rem] &block h-0.5 shrink-0 rounded-full bg-muted group-data-[state=completed]:bg-primary"
|
<Button
|
||||||
/>
|
:variant="state === 'completed' ? 'primary' : state === 'active' ? 'primary' : 'outline'"
|
||||||
|
size="md"
|
||||||
|
:class="`z-10 rounded-full ${
|
||||||
|
state !== 'inactive'
|
||||||
|
? 'ring-2 ring-offset-2 ring-offset-background *:cursor-default ' +
|
||||||
|
(state === 'completed' ? 'ring-success' : 'ring-primary')
|
||||||
|
: ''
|
||||||
|
}`"
|
||||||
|
:disabled="state === 'inactive'"
|
||||||
|
>
|
||||||
|
<component :is="step.icon[state]" class="size-4" />
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
|
||||||
<StepperTrigger as-child>
|
<div class="mt-2 flex flex-col items-center text-center">
|
||||||
<Button
|
<StepperTitle
|
||||||
:variant="state === 'completed' || state === 'active' ? 'primary' : 'outline'"
|
:class="[state === 'active' && 'text-primary']"
|
||||||
size="md"
|
class="text-2xs font-semibold transition"
|
||||||
:class="`z-10 rounded-full shrink-0 opacity-100 ${
|
>
|
||||||
state !== 'inactive'
|
{{ step.title }}
|
||||||
? 'ring-2 ring-primary ring-offset-2 ring-offset-background *:cursor-default'
|
</StepperTitle>
|
||||||
: ''
|
<StepperDescription class="text-2xs font-normal">
|
||||||
}`"
|
{{ step.description }}
|
||||||
:disabled="state === 'inactive'"
|
</StepperDescription>
|
||||||
>
|
</div>
|
||||||
<component :is="step.icon[state]" class="size-4" />
|
|
||||||
</Button>
|
|
||||||
</StepperTrigger>
|
</StepperTrigger>
|
||||||
|
<StepperSeparator v-if="index < steps.length - 1" class="w-[50px] bg-black h-[30px]" />
|
||||||
<div class="mt-2 flex flex-col items-center text-center">
|
|
||||||
<StepperTitle
|
|
||||||
:class="[state === 'active' && 'text-primary']"
|
|
||||||
class="text-2xs font-semibold transition"
|
|
||||||
>
|
|
||||||
{{ step.title }}
|
|
||||||
</StepperTitle>
|
|
||||||
<StepperDescription class="text-2xs font-normal">
|
|
||||||
{{ step.description }}
|
|
||||||
</StepperDescription>
|
|
||||||
</div>
|
|
||||||
</StepperItem>
|
</StepperItem>
|
||||||
</Stepper>
|
</Stepper>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -146,8 +146,6 @@ const bannerImage = watch(theme, () => {
|
|||||||
<ModalsCe />
|
<ModalsCe />
|
||||||
<hr class="border-black dark:border-white" />
|
<hr class="border-black dark:border-white" />
|
||||||
<h3 class="text-lg font-semibold font-mono">WelcomeModalCe</h3>
|
<h3 class="text-lg font-semibold font-mono">WelcomeModalCe</h3>
|
||||||
<!-- <WelcomeModalCe :server="serverState ?? undefined" /> -->
|
|
||||||
Uncomment the WelcomeModalCe component to test it.
|
|
||||||
<hr class="border-black dark:border-white" />
|
<hr class="border-black dark:border-white" />
|
||||||
<h3 class="text-lg font-semibold font-mono">Test Callback Builder</h3>
|
<h3 class="text-lg font-semibold font-mono">Test Callback Builder</h3>
|
||||||
<div class="flex flex-col justify-end gap-8px">
|
<div class="flex flex-col justify-end gap-8px">
|
||||||
|
|||||||
@@ -57,6 +57,9 @@ onBeforeMount(() => {
|
|||||||
<hr class="border-black dark:border-white" />
|
<hr class="border-black dark:border-white" />
|
||||||
<h3 class="text-lg font-semibold font-mono">SSOSignInButtonCe</h3>
|
<h3 class="text-lg font-semibold font-mono">SSOSignInButtonCe</h3>
|
||||||
<unraid-sso-button :ssoenabled="serverState.ssoEnabled" />
|
<unraid-sso-button :ssoenabled="serverState.ssoEnabled" />
|
||||||
|
<hr class="border-black dark:border-white" />
|
||||||
|
<h3 class="text-lg font-semibold font-mono">ActivationCodeCe</h3>
|
||||||
|
<unraid-welcome-modal />
|
||||||
</unraid-i18n-host>
|
</unraid-i18n-host>
|
||||||
<Toaster rich-colors close-button />
|
<Toaster rich-colors close-button />
|
||||||
</client-only>
|
</client-only>
|
||||||
|
|||||||
14
web/pages/welcome.vue
Normal file
14
web/pages/welcome.vue
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { useDummyServerStore } from '~/_data/serverState';
|
||||||
|
|
||||||
|
import DummyServerSwitcher from '~/components/DummyServerSwitcher.vue';
|
||||||
|
const serverStore = useDummyServerStore();
|
||||||
|
const { serverState } = storeToRefs(serverStore);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="flex flex-col gap-6 p-6">
|
||||||
|
<DummyServerSwitcher />
|
||||||
|
<WelcomeModalCe :server="serverState ?? undefined" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
Reference in New Issue
Block a user