Skip to content

Commit e5edab8

Browse files
committed
Style FileUpload
1 parent fb9869f commit e5edab8

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

AiServer/wwwroot/mjs/components/FileUpload.mjs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,17 @@ export default {
1515
>
1616
<slot v-if="$slots.default"></slot>
1717
<div v-else class="flex flex-col items-center justify-center">
18-
<svg class="w-10 h-10 mb-3 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
18+
<slot v-if="$slots.icon" name="icon"></slot>
19+
<svg v-else class="w-12 h-12 mb-3 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
1920
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"></path>
2021
</svg>
21-
<p class="mb-2 text-sm text-gray-500">
22-
<span v-if="instructions">{{instructions}}</span>
22+
<p class="mb-2 text-gray-500">
23+
<slot v-if="$slots.title" name="title"></slot>
2324
<template v-else>
2425
<span class="font-semibold">Click to upload</span> or drag and drop
2526
</template>
2627
</p>
27-
<p class="text-xs text-gray-500">{{ acceptLabel ?? grammarList(accept?.split(',').map(x => x.replace('.','').toUpperCase())) }}</p>
28+
<p class="text-sm text-gray-500">{{ acceptLabel ?? grammarList(accept?.split(',').map(x => x.replace('.','').toUpperCase())) }}</p>
2829
</div>
2930
<input ref="input" type="file" :multiple="multiple"
3031
:name="id"
@@ -96,7 +97,6 @@ export default {
9697
values:Array, //string[]
9798
/** @type {UploadedFile[]} status */
9899
files:Array, //UploadedFile[]
99-
instructions: String,
100100
accept: String,
101101
acceptLabel: String,
102102
},

AiServer/wwwroot/mjs/components/ImageToText.mjs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,21 @@ export default {
2424
<div class="grid grid-cols-6 gap-4">
2525
<div class="col-span-6">
2626
<FileUpload ref="refImage" id="image" v-model="request.image" required
27-
accept=".webp,.jpg,.jpeg,.png,.gif"
28-
@change="renderKey++">
27+
accept=".webp,.jpg,.jpeg,.png,.gif" @change="renderKey++">
28+
<template #title>
29+
<span class="font-semibold text-green-600">Click to upload</span> or drag and drop
30+
</template>
31+
<template #icon>
32+
<svg class="mb-2 h-12 w-12 text-green-500 inline" stroke="currentColor" fill="none" viewBox="0 0 48 48" aria-hidden="true" data-phx-id="m9-phx-F_34be7KYfTF66Xh">
33+
<path d="M28 8H12a4 4 0 00-4 4v20m32-12v8m0 0v8a4 4 0 01-4 4H12a4 4 0 01-4-4v-4m32-4l-3.172-3.172a4 4 0 00-5.656 0L28 28M8 32l9.172-9.172a4 4 0 015.656 0L28 28m0 0l4 4m4-24h8m-4-4v8m-12 4h.02" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
34+
</svg>
35+
</template>
2936
</FileUpload>
3037
</div>
3138
</div>
3239
</fieldset>
3340
</div>
34-
<div class="mt-4 flex justify-center">
41+
<div class="mt-4 mb-8 flex justify-center">
3542
<PrimaryButton :key="renderKey" type="submit" :disabled="!validPrompt()">
3643
<svg class="-ml-0.5 h-6 w-6 mr-1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M11 16V7.85l-2.6 2.6L7 9l5-5l5 5l-1.4 1.45l-2.6-2.6V16zm-5 4q-.825 0-1.412-.587T4 18v-3h2v3h12v-3h2v3q0 .825-.587 1.413T18 20z"/></svg>
3744
<span class="text-base font-semibold">Upload</span>

0 commit comments

Comments
 (0)