-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFileUpload.vue
More file actions
141 lines (132 loc) · 4.41 KB
/
Copy pathFileUpload.vue
File metadata and controls
141 lines (132 loc) · 4.41 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
<script setup lang="ts">
const sizes = ['xs', 'sm', 'md', 'lg', 'xl'] as const
const colors = ['primary', 'success', 'warning', 'error', 'neutral'] as const
const singleFile = ref<File | null>(null)
const multiFiles = ref<File[] | null>(null)
const gridFiles = ref<File[] | null>(null)
const buttonFile = ref<File | null>(null)
const disabledFile = ref<File | null>(null)
</script>
<template>
<div class="flex flex-col gap-8">
<GallerySection title="Variant — Area (default)">
<div class="w-full max-w-md">
<UFileUpload
v-model="singleFile"
icon="i-material-symbols-upload-file-outline"
label="Upload agent trace"
description="Drag & drop a .jsonl trace file here, or click to browse."
accept=".jsonl,.json"
/>
</div>
</GallerySection>
<GallerySection title="Variant — Button">
<div class="flex flex-col gap-3 w-full max-w-md">
<UFileUpload
v-model="buttonFile"
variant="button"
icon="i-material-symbols-attach-file"
label="Attach runtime config"
accept=".yaml,.yml,.json"
/>
</div>
</GallerySection>
<GallerySection title="Multiple files — list layout">
<div class="w-full max-w-md">
<UFileUpload
v-model="multiFiles"
:multiple="true"
layout="list"
icon="i-material-symbols-folder-open-outline"
label="Upload session bundles"
description="Select one or more .tar.gz session archives."
accept=".tar.gz,.tgz"
color="secondary"
/>
</div>
</GallerySection>
<GallerySection title="Multiple files — grid layout">
<div class="w-full max-w-md">
<UFileUpload
v-model="gridFiles"
:multiple="true"
layout="grid"
icon="i-material-symbols-image-outline"
label="Upload agent screenshots"
description="Drop PNG or JPEG screenshots from a runtime session."
accept="image/png,image/jpeg"
color="info"
:file-image="true"
/>
</div>
</GallerySection>
<GallerySection title="Colors">
<div class="flex flex-col gap-4 w-full max-w-md">
<UFileUpload
v-for="c in colors"
:key="c"
:color="c"
:highlight="true"
icon="i-material-symbols-cloud-upload-outline"
:label="`${c} — drop event payload`"
description="Accepts .json event files."
accept=".json"
/>
</div>
</GallerySection>
<GallerySection title="Sizes">
<div class="flex flex-col gap-4 w-full max-w-md">
<UFileUpload
v-for="s in sizes"
:key="s"
:size="s"
icon="i-material-symbols-upload-outline"
:label="`Size ${s}`"
description="Lease renewal certificate."
accept=".pem,.crt"
/>
</div>
</GallerySection>
<GallerySection title="States">
<div class="flex flex-col gap-4 w-full max-w-md">
<UFileUpload
icon="i-material-symbols-lock-outline"
label="Disabled — runtime locked"
description="Uploads are disabled while the runtime is in a locked state."
disabled
/>
<UFileUpload
icon="i-material-symbols-check-circle-outline"
label="Highlighted — active dropzone"
description="The job scheduler is waiting for your input manifest."
color="success"
:highlight="true"
/>
<UFileUpload
icon="i-material-symbols-warning-outline"
label="No dropzone"
description="Click to open file picker — drag-and-drop disabled."
:dropzone="false"
color="warning"
/>
</div>
</GallerySection>
<GallerySection title="Realistic usage — job input manifest">
<div class="w-full max-w-lg">
<UFileUpload
v-model="multiFiles"
:multiple="true"
layout="list"
position="outside"
icon="i-material-symbols-terminal-outline"
label="Job input manifest"
description="Upload one or more JSONL files. Each line must be a valid ARCP job descriptor."
accept=".jsonl,.ndjson"
color="primary"
:file-delete="true"
file-delete-icon="i-material-symbols-delete-outline"
/>
</div>
</GallerySection>
</div>
</template>