@adminforth/upload 1.0.24 → 1.0.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
<!-- Modal body -->
|
|
23
23
|
<div class="p-4 md:p-5 space-y-4">
|
|
24
24
|
<textarea id="message" rows="3" class="block p-2.5 w-full text-sm text-gray-900 bg-gray-50 rounded-lg border border-gray-300 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
|
|
25
|
-
placeholder="Prompt which will be passed to AI network" v-model="prompt"
|
|
26
|
-
title="Prompt which will be passed to AI network"
|
|
25
|
+
:placeholder="$t('Prompt which will be passed to AI network')" v-model="prompt"
|
|
26
|
+
:title="$t('Prompt which will be passed to AI network')"
|
|
27
27
|
></textarea>
|
|
28
28
|
|
|
29
29
|
<div class="flex items-center justify-center w-full relative">
|
package/custom/uploader.vue
CHANGED
|
@@ -166,7 +166,9 @@ function humanifySize(size) {
|
|
|
166
166
|
|
|
167
167
|
const onFileChange = async (e) => {
|
|
168
168
|
// if empty then return
|
|
169
|
-
|
|
169
|
+
const files = e.target?.files || e.dataTransfer.files
|
|
170
|
+
|
|
171
|
+
if (!files || files.length === 0) {
|
|
170
172
|
return;
|
|
171
173
|
}
|
|
172
174
|
|
|
@@ -174,14 +176,14 @@ const onFileChange = async (e) => {
|
|
|
174
176
|
progress.value = 0;
|
|
175
177
|
uploaded.value = false;
|
|
176
178
|
|
|
177
|
-
const file =
|
|
179
|
+
const file = files[0];
|
|
178
180
|
|
|
179
181
|
// get filename, extension, size, mimeType
|
|
180
182
|
const { name, size, type } = file;
|
|
181
183
|
|
|
182
184
|
uploadedSize.value = size;
|
|
183
185
|
|
|
184
|
-
|
|
186
|
+
|
|
185
187
|
const extension = name.split('.').pop();
|
|
186
188
|
const nameNoExtension = name.replace(`.${extension}`, '');
|
|
187
189
|
console.log('File details:', { name, extension, size, type });
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
<!-- Modal body -->
|
|
23
23
|
<div class="p-4 md:p-5 space-y-4">
|
|
24
24
|
<textarea id="message" rows="3" class="block p-2.5 w-full text-sm text-gray-900 bg-gray-50 rounded-lg border border-gray-300 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
|
|
25
|
-
placeholder="Prompt which will be passed to AI network" v-model="prompt"
|
|
26
|
-
title="Prompt which will be passed to AI network"
|
|
25
|
+
:placeholder="$t('Prompt which will be passed to AI network')" v-model="prompt"
|
|
26
|
+
:title="$t('Prompt which will be passed to AI network')"
|
|
27
27
|
></textarea>
|
|
28
28
|
|
|
29
29
|
<div class="flex items-center justify-center w-full relative">
|
package/dist/custom/uploader.vue
CHANGED
|
@@ -166,7 +166,9 @@ function humanifySize(size) {
|
|
|
166
166
|
|
|
167
167
|
const onFileChange = async (e) => {
|
|
168
168
|
// if empty then return
|
|
169
|
-
|
|
169
|
+
const files = e.target?.files || e.dataTransfer.files
|
|
170
|
+
|
|
171
|
+
if (!files || files.length === 0) {
|
|
170
172
|
return;
|
|
171
173
|
}
|
|
172
174
|
|
|
@@ -174,14 +176,14 @@ const onFileChange = async (e) => {
|
|
|
174
176
|
progress.value = 0;
|
|
175
177
|
uploaded.value = false;
|
|
176
178
|
|
|
177
|
-
const file =
|
|
179
|
+
const file = files[0];
|
|
178
180
|
|
|
179
181
|
// get filename, extension, size, mimeType
|
|
180
182
|
const { name, size, type } = file;
|
|
181
183
|
|
|
182
184
|
uploadedSize.value = size;
|
|
183
185
|
|
|
184
|
-
|
|
186
|
+
|
|
185
187
|
const extension = name.split('.').pop();
|
|
186
188
|
const nameNoExtension = name.replace(`.${extension}`, '');
|
|
187
189
|
console.log('File details:', { name, extension, size, type });
|