-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStepper.vue
More file actions
144 lines (133 loc) · 4.82 KB
/
Copy pathStepper.vue
File metadata and controls
144 lines (133 loc) · 4.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
<script setup lang="ts">
const colors = ['primary', 'secondary', 'success', 'info', 'warning', 'error', 'neutral'] as const
const sizes = ['xs', 'sm', 'md', 'lg', 'xl'] as const
const jobSteps = [
{ value: 'queue', title: 'Queued', description: 'Job accepted by runtime', icon: 'i-material-symbols-inbox-outline' },
{ value: 'schedule', title: 'Scheduled', description: 'Agent assigned a lease', icon: 'i-material-symbols-schedule-outline' },
{ value: 'run', title: 'Running', description: 'Executing agent logic', icon: 'i-material-symbols-play-circle-outline' },
{ value: 'done', title: 'Complete', description: 'Trace emitted & sealed', icon: 'i-material-symbols-check-circle-outline' },
]
const sessionSteps = [
{ value: 'init', title: 'Init', description: 'Session context created' },
{ value: 'auth', title: 'Auth', description: 'Identity verified' },
{ value: 'connect', title: 'Connect', description: 'Agent channel open' },
{ value: 'active', title: 'Active', description: 'Events streaming' },
{ value: 'close', title: 'Closed', description: 'Session sealed' },
]
const deploySteps = [
{ value: 'validate', title: 'Validate', description: 'Schema & config checks', icon: 'i-material-symbols-fact-check-outline' },
{ value: 'build', title: 'Build', description: 'Runtime image assembled', icon: 'i-material-symbols-build-outline' },
{ value: 'publish', title: 'Publish', description: 'Pushed to registry', icon: 'i-material-symbols-cloud-upload-outline' },
{ value: 'activate', title: 'Activate', description: 'Lease granted & live', icon: 'i-material-symbols-rocket-launch-outline' },
]
const activeJobStep = ref('run')
const activeDeployStep = ref('validate')
</script>
<template>
<div class="flex flex-col gap-8">
<GallerySection title="Default (horizontal)">
<UStepper :items="jobSteps" default-value="run" class="w-full max-w-2xl" />
</GallerySection>
<GallerySection title="Colors">
<div class="flex w-full max-w-2xl flex-col gap-6">
<UStepper
v-for="c in colors"
:key="c"
:color="c"
:items="jobSteps"
default-value="schedule"
size="sm"
class="w-full"
/>
</div>
</GallerySection>
<GallerySection title="Sizes">
<div class="flex w-full max-w-2xl flex-col gap-6">
<UStepper
v-for="s in sizes"
:key="s"
:size="s"
:items="sessionSteps"
default-value="auth"
class="w-full"
/>
</div>
</GallerySection>
<GallerySection title="Vertical orientation">
<UStepper
:items="deploySteps"
orientation="vertical"
default-value="build"
color="success"
class="max-w-xs"
/>
</GallerySection>
<GallerySection title="Linear flow — job lifecycle">
<div class="flex w-full max-w-2xl flex-col gap-4">
<UStepper
v-model="activeJobStep"
:items="jobSteps"
linear
color="primary"
class="w-full"
/>
<div class="flex gap-2">
<UButton
variant="outline"
color="neutral"
icon="i-material-symbols-arrow-back"
:disabled="activeJobStep === 'queue'"
@click="() => {
const idx = jobSteps.findIndex(s => s.value === activeJobStep)
if (idx > 0) activeJobStep = jobSteps[idx - 1].value
}"
>
Previous
</UButton>
<UButton
icon="i-material-symbols-arrow-forward"
trailing-icon="i-material-symbols-arrow-forward"
:disabled="activeJobStep === 'done'"
@click="() => {
const idx = jobSteps.findIndex(s => s.value === activeJobStep)
if (idx < jobSteps.length - 1) activeJobStep = jobSteps[idx + 1].value
}"
>
Advance
</UButton>
</div>
</div>
</GallerySection>
<GallerySection title="Deploy pipeline (controlled)">
<div class="flex w-full max-w-2xl flex-col gap-4">
<UStepper
v-model="activeDeployStep"
:items="deploySteps"
color="info"
class="w-full"
/>
<div class="flex gap-2 flex-wrap">
<UButton
v-for="step in deploySteps"
:key="step.value"
size="sm"
:variant="activeDeployStep === step.value ? 'solid' : 'outline'"
color="info"
@click="activeDeployStep = step.value"
>
{{ step.title }}
</UButton>
</div>
</div>
</GallerySection>
<GallerySection title="Disabled">
<UStepper
:items="jobSteps"
default-value="queue"
disabled
color="neutral"
class="w-full max-w-2xl"
/>
</GallerySection>
</div>
</template>