Skip to content

Commit d479130

Browse files
committed
feat: add source image to the image generation carousel
1 parent 4741950 commit d479130

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

custom/ImageGenerationCarousel.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
</button>
2121
</div>
2222
<!-- Modal body -->
23-
<div class="p-4 md:p-5 space-y-4">
23+
<div class="p-4 md:p-5">
2424
<!-- PROMPT TEXTAREA -->
2525
<!-- Textarea -->
2626
<textarea
@@ -47,7 +47,7 @@
4747
<!-- Fullscreen Modal -->
4848
<div
4949
v-if="zoomedImage"
50-
class="fixed inset-0 z-50 flex items-center justify-center bg-black bg-opacity-80"
50+
class="w-full h-full fixed inset-0 z-50 flex items-center justify-center bg-black bg-opacity-80"
5151
@click.self="closeZoom"
5252
>
5353
<img
@@ -143,7 +143,7 @@ const sliderRef = ref(null)
143143
144144
const prompt = ref('');
145145
const emit = defineEmits(['close', 'selectImage', 'error', 'updateCarouselIndex']);
146-
const props = defineProps(['meta', 'record', 'images', 'recordId', 'prompt', 'fieldName', 'isError', 'errorMessage', 'carouselImageIndex', 'regenerateImagesRefreshRate']);
146+
const props = defineProps(['meta', 'record', 'images', 'recordId', 'prompt', 'fieldName', 'isError', 'errorMessage', 'carouselImageIndex', 'regenerateImagesRefreshRate','sourceImage']);
147147
const images = ref([]);
148148
const loading = ref(false);
149149
const attachmentFiles = ref<string[]>([])
@@ -153,6 +153,7 @@ onMounted(async () => {
153153
images.value.push(img);
154154
}
155155
const temp = await getGenerationPrompt() || '';
156+
attachmentFiles.value = props.sourceImage || [];
156157
prompt.value = temp[props.fieldName];
157158
await nextTick();
158159
@@ -176,7 +177,6 @@ onMounted(async () => {
176177
});
177178
return;
178179
}
179-
180180
});
181181
182182

custom/VisionTable.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@
129129
:fieldName="n"
130130
:carouselImageIndex="carouselImageIndex[tableColumnsIndexes.findIndex(el => el[primaryKey] === item[primaryKey])][n]"
131131
:regenerateImagesRefreshRate="regenerateImagesRefreshRate"
132+
:sourceImage="item.images && item.images.length ? item.images : null"
132133
@error="handleError"
133134
@close="openGenerationCarousel[tableColumnsIndexes.findIndex(el => el[primaryKey] === item[primaryKey])][n] = false"
134135
@selectImage="updateSelectedImage"

0 commit comments

Comments
 (0)