mirror of
				https://github.com/open-webui/open-webui
				synced 2025-06-26 18:26:48 +00:00 
			
		
		
		
	feat: toggle settings shortcut added
This commit is contained in:
		
							parent
							
								
									b916f1b07d
								
							
						
					
					
						commit
						7ffc1902a9
					
				@ -6,8 +6,8 @@
 | 
			
		||||
	export let disabled = false;
 | 
			
		||||
 | 
			
		||||
	const saveDefaultModel = () => {
 | 
			
		||||
		const hasEmptyModel = selectedModels.filter(it => it === '');
 | 
			
		||||
		if(hasEmptyModel.length){
 | 
			
		||||
		const hasEmptyModel = selectedModels.filter((it) => it === '');
 | 
			
		||||
		if (hasEmptyModel.length) {
 | 
			
		||||
			toast.error('Choose a model before saving...');
 | 
			
		||||
			return;
 | 
			
		||||
		}
 | 
			
		||||
@ -88,8 +88,9 @@
 | 
			
		||||
			{#if selectedModelIdx === 0}
 | 
			
		||||
				<button
 | 
			
		||||
					class=" self-center dark:hover:text-gray-300"
 | 
			
		||||
					id="open-settings-button"
 | 
			
		||||
					on:click={async () => {
 | 
			
		||||
						await showSettings.set(true);
 | 
			
		||||
						await showSettings.set(!$showSettings);
 | 
			
		||||
					}}
 | 
			
		||||
				>
 | 
			
		||||
					<svg
 | 
			
		||||
 | 
			
		||||
@ -123,6 +123,23 @@
 | 
			
		||||
				</div>
 | 
			
		||||
 | 
			
		||||
				<div class="flex flex-col space-y-3 w-full self-start">
 | 
			
		||||
					<div class="w-full flex justify-between items-center">
 | 
			
		||||
						<div class=" text-sm">Toggle settings</div>
 | 
			
		||||
 | 
			
		||||
						<div class="flex space-x-1 text-xs">
 | 
			
		||||
							<div
 | 
			
		||||
								class=" h-fit py-1 px-2 flex items-center justify-center rounded border border-black/10 capitalize text-gray-600 dark:border-white/10 dark:text-gray-300"
 | 
			
		||||
							>
 | 
			
		||||
								Ctrl/⌘
 | 
			
		||||
							</div>
 | 
			
		||||
							<div
 | 
			
		||||
								class=" h-fit py-1 px-2 flex items-center justify-center rounded border border-black/10 capitalize text-gray-600 dark:border-white/10 dark:text-gray-300"
 | 
			
		||||
							>
 | 
			
		||||
								S
 | 
			
		||||
							</div>
 | 
			
		||||
						</div>
 | 
			
		||||
					</div>
 | 
			
		||||
 | 
			
		||||
					<div class="w-full flex justify-between items-center">
 | 
			
		||||
						<div class=" text-sm">Toggle sidebar</div>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -160,6 +160,13 @@
 | 
			
		||||
					document.getElementById('delete-chat-button')?.click();
 | 
			
		||||
				}
 | 
			
		||||
 | 
			
		||||
				// Check if Ctrl + S is pressed
 | 
			
		||||
				if (isCtrlPressed && event.key.toLowerCase() === 's') {
 | 
			
		||||
					event.preventDefault();
 | 
			
		||||
					console.log('openSettings');
 | 
			
		||||
					document.getElementById('open-settings-button')?.click();
 | 
			
		||||
				}
 | 
			
		||||
 | 
			
		||||
				// Check if Ctrl + / is pressed
 | 
			
		||||
				if (isCtrlPressed && event.key === '/') {
 | 
			
		||||
					event.preventDefault();
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user