-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSelect.vue
More file actions
183 lines (172 loc) · 5.4 KB
/
Copy pathSelect.vue
File metadata and controls
183 lines (172 loc) · 5.4 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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
<script setup lang="ts">
const colors = ['primary', 'secondary', 'success', 'info', 'warning', 'error', 'neutral'] as const
const variants = ['outline', 'soft', 'subtle', 'ghost', 'none'] as const
const sizes = ['xs', 'sm', 'md', 'lg', 'xl'] as const
const runtimeItems = [
{ label: 'us-east-1 (active)', value: 'us-east-1', icon: 'i-material-symbols-cloud-outline' },
{ label: 'eu-west-1 (standby)', value: 'eu-west-1', icon: 'i-material-symbols-cloud-outline' },
{ label: 'ap-southeast-1 (idle)', value: 'ap-southeast-1', icon: 'i-material-symbols-cloud-outline' },
]
const agentItems = [
{ label: 'Collector', value: 'collector', description: 'Gathers trace events', icon: 'i-material-symbols-sensors' },
{ label: 'Scheduler', value: 'scheduler', description: 'Manages job leases', icon: 'i-material-symbols-schedule-outline' },
{ label: 'Executor', value: 'executor', description: 'Runs ARCP jobs', icon: 'i-material-symbols-play-circle-outline' },
{ label: 'Observer', value: 'observer', description: 'Monitors sessions', icon: 'i-material-symbols-visibility-outline' },
]
const statusItems = [
{ type: 'label' as const, label: 'Active' },
{ label: 'Running', value: 'running' },
{ label: 'Pending', value: 'pending' },
{ type: 'separator' as const },
{ type: 'label' as const, label: 'Terminal' },
{ label: 'Completed', value: 'completed' },
{ label: 'Failed', value: 'failed' },
{ label: 'Cancelled', value: 'cancelled' },
]
const selectedRuntime = ref('us-east-1')
const selectedAgent = ref('')
const selectedStatus = ref('')
const colorSelected = ref('us-east-1')
const variantSelected = ref('us-east-1')
const sizeSelected: Record<string, string> = {}
const sizeRefs = ref<Record<string, string>>(
Object.fromEntries(sizes.map(s => [s, '']))
)
</script>
<template>
<div class="flex flex-col gap-8">
<GallerySection title="Variants">
<div class="flex flex-wrap gap-4">
<USelect
v-for="v in variants"
:key="v"
v-model="variantSelected"
:variant="v"
:items="runtimeItems"
value-key="value"
:placeholder="v"
class="w-40"
/>
</div>
</GallerySection>
<GallerySection title="Colors">
<div class="flex flex-wrap gap-4">
<USelect
v-for="c in colors"
:key="c"
v-model="colorSelected"
:color="c"
:items="runtimeItems"
value-key="value"
:placeholder="c"
class="w-40"
highlight
/>
</div>
</GallerySection>
<GallerySection title="Sizes">
<div class="flex flex-wrap items-center gap-4">
<USelect
v-for="s in sizes"
:key="s"
v-model="sizeRefs[s]"
:size="s"
:items="runtimeItems"
value-key="value"
:placeholder="s"
class="w-36"
/>
</div>
</GallerySection>
<GallerySection title="With icons">
<div class="flex flex-wrap gap-4">
<USelect
v-model="selectedRuntime"
:items="runtimeItems"
value-key="value"
placeholder="Select runtime"
icon="i-material-symbols-cloud-outline"
class="w-52"
/>
<USelect
v-model="selectedAgent"
:items="agentItems"
value-key="value"
placeholder="Select agent"
icon="i-material-symbols-smart-toy-outline"
class="w-52"
/>
</div>
</GallerySection>
<GallerySection title="Grouped items">
<USelect
v-model="selectedStatus"
:items="statusItems"
value-key="value"
placeholder="Filter by job status"
icon="i-material-symbols-filter-list"
class="w-56"
/>
</GallerySection>
<GallerySection title="States">
<div class="flex flex-wrap gap-4">
<USelect
placeholder="Disabled"
:items="runtimeItems"
value-key="value"
disabled
class="w-44"
/>
<USelect
placeholder="Highlighted"
:items="runtimeItems"
value-key="value"
highlight
color="primary"
class="w-44"
/>
<USelect
placeholder="Error state"
:items="runtimeItems"
value-key="value"
color="error"
highlight
class="w-44"
/>
</div>
</GallerySection>
<GallerySection title="Realistic usage — dispatch job">
<div class="w-full max-w-sm space-y-3">
<USelect
v-model="selectedRuntime"
:items="runtimeItems"
value-key="value"
label="Runtime region"
placeholder="Choose a runtime region"
icon="i-material-symbols-cloud-outline"
/>
<USelect
v-model="selectedAgent"
:items="agentItems"
value-key="value"
placeholder="Assign an agent"
icon="i-material-symbols-smart-toy-outline"
/>
<USelect
v-model="selectedStatus"
:items="statusItems"
value-key="value"
placeholder="Filter by status"
icon="i-material-symbols-filter-list"
/>
<UButton
block
icon="i-material-symbols-rocket-launch-outline"
:disabled="!selectedRuntime || !selectedAgent"
>
Dispatch job
</UButton>
</div>
</GallerySection>
</div>
</template>