forked from open-webui/open-webui
		
	feat: dall-e integration
This commit is contained in:
		
							parent
							
								
									dd3a4b3889
								
							
						
					
					
						commit
						0221acd163
					
				
					 6 changed files with 296 additions and 64 deletions
				
			
		| 
						 | 
				
			
			@ -1,18 +1,23 @@
 | 
			
		|||
<script lang="ts">
 | 
			
		||||
	import { WEBUI_BASE_URL } from '$lib/constants';
 | 
			
		||||
	import ImagePreview from './ImagePreview.svelte';
 | 
			
		||||
 | 
			
		||||
	export let src = '';
 | 
			
		||||
	export let alt = '';
 | 
			
		||||
 | 
			
		||||
	let _src = '';
 | 
			
		||||
 | 
			
		||||
	$: _src = src.startsWith('/') ? `${WEBUI_BASE_URL}${src}` : src;
 | 
			
		||||
 | 
			
		||||
	let showImagePreview = false;
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<ImagePreview bind:show={showImagePreview} {src} {alt} />
 | 
			
		||||
<ImagePreview bind:show={showImagePreview} src={_src} {alt} />
 | 
			
		||||
<button
 | 
			
		||||
	on:click={() => {
 | 
			
		||||
		console.log('image preview');
 | 
			
		||||
		showImagePreview = true;
 | 
			
		||||
	}}
 | 
			
		||||
>
 | 
			
		||||
	<img {src} {alt} class=" max-h-96 rounded-lg" draggable="false" />
 | 
			
		||||
	<img src={_src} {alt} class=" max-h-96 rounded-lg" draggable="false" />
 | 
			
		||||
</button>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue