@christianriedl/media 1.0.14 → 1.0.15
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.
- package/package.json +1 -1
- package/src/components/FileUpload.vue +23 -21
- package/src/views/PhotosPage.vue +11 -6
package/package.json
CHANGED
|
@@ -5,34 +5,36 @@
|
|
|
5
5
|
|
|
6
6
|
const getMediaService = inject<() => MediaService>('get-media')!;
|
|
7
7
|
const mediaService = getMediaService();
|
|
8
|
-
const
|
|
9
|
-
const
|
|
8
|
+
const feedBack = ref("");
|
|
9
|
+
const name = ref("");
|
|
10
10
|
|
|
11
11
|
async function onFileInput(event: any) {
|
|
12
|
-
const files = event.target.files
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const reader = new FileReader();
|
|
23
|
-
loadResult.value = "start upload ...";
|
|
24
|
-
reader.onload = async (e) => {
|
|
25
|
-
var text = reader.result;
|
|
26
|
-
var res = await stocks.upload(text as string);
|
|
27
|
-
loadResult.value = res;
|
|
12
|
+
const files = event.target.files as string[];
|
|
13
|
+
feedBack.value = "Start Upload";
|
|
14
|
+
let count = 0;
|
|
15
|
+
for (let i = 0; i < files.length; i++) {
|
|
16
|
+
const formData = new FormData()
|
|
17
|
+
formData.append(name.value, files[i]);
|
|
18
|
+
const rc = await mediaService.upload(formData);
|
|
19
|
+
if (rc)
|
|
20
|
+
count++;
|
|
21
|
+
feedBack.value = `${files[i]} : ${rc ? "OK" : "FAILED" }`;
|
|
28
22
|
}
|
|
29
|
-
|
|
23
|
+
feedBack.value = `${count} von ${files.length} erfolgreich hochgeladen ! (Close : Upload Icon)`;
|
|
30
24
|
}
|
|
31
|
-
*/
|
|
32
25
|
</script>
|
|
33
26
|
|
|
34
27
|
<template>
|
|
35
|
-
<
|
|
28
|
+
<v-row>
|
|
29
|
+
<v-col cols="2">
|
|
30
|
+
<v-text-field name="directory" label="Name (Directory)" type="text" v-model="name" density="compact" hide-details></v-text-field>
|
|
31
|
+
</v-col>
|
|
32
|
+
<v-col cols="4">
|
|
33
|
+
<input type="file" multiple @change="onFileInput">
|
|
34
|
+
</v-col>
|
|
35
|
+
<v-col cols="6">{{feedBack}}
|
|
36
|
+
</v-col>
|
|
37
|
+
</v-row>
|
|
36
38
|
<!--
|
|
37
39
|
<v-col cols="2">
|
|
38
40
|
<v-btn @click="onUpload">
|
package/src/views/PhotosPage.vue
CHANGED
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
const selected = reactive<IPhotoSelection>(mediaService.photoSelection);
|
|
19
19
|
const listHeight = ref(0);
|
|
20
20
|
const listhead = ref<any>(null);
|
|
21
|
+
const uploadVisible = ref(true);
|
|
21
22
|
|
|
22
23
|
const roots: string[] = ['Jahr', 'Orte', 'Ereignisse', 'Personen'];
|
|
23
24
|
const criterias: string[] = ['ye', 'lo', 'ev', 'pe'];
|
|
@@ -161,15 +162,19 @@
|
|
|
161
162
|
<v-icon large>{{$vuetify.icons.values.back}}</v-icon>Back
|
|
162
163
|
</v-btn>
|
|
163
164
|
<v-rating clearable length="2" v-model="selected.rating" @update:modelValue="onRating" />
|
|
164
|
-
<v-select v-model="selected.root"
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
165
|
+
<v-select v-model="selected.root"
|
|
166
|
+
:items="roots"
|
|
167
|
+
persistent-hint
|
|
168
|
+
@update:modelValue="onRootChange"
|
|
169
|
+
dense solo hide-details single-line>
|
|
169
170
|
</v-select>
|
|
170
|
-
<
|
|
171
|
+
<v-btn v-if="!isMobile" @click="uploadVisible.value = !uploadVisible.value">
|
|
172
|
+
UPLOAD
|
|
173
|
+
<v-icon>{{$vuetify.icons.values.upload}}</v-icon>
|
|
174
|
+
</v-btn>
|
|
171
175
|
</v-card-actions>
|
|
172
176
|
</v-card>
|
|
177
|
+
<file-upload v-if="uploadVisible"></file-upload>
|
|
173
178
|
<v-card :max-height="listHeight" class="overflow-y-auto">
|
|
174
179
|
<v-list v-if="!grouped" class="bg-media" >
|
|
175
180
|
<v-list-item-group v-model="itemIndex" color="primary">
|