diff --git a/src/lib/components/icons/Keyboard.svelte b/src/lib/components/icons/Keyboard.svelte new file mode 100644 index 000000000..baf633c0d --- /dev/null +++ b/src/lib/components/icons/Keyboard.svelte @@ -0,0 +1,19 @@ + + + diff --git a/src/lib/components/icons/Lifebuoy.svelte b/src/lib/components/icons/Lifebuoy.svelte new file mode 100644 index 000000000..d8c49b0ae --- /dev/null +++ b/src/lib/components/icons/Lifebuoy.svelte @@ -0,0 +1,19 @@ + + + + + diff --git a/src/lib/components/icons/QuestionMarkCircle.svelte b/src/lib/components/icons/QuestionMarkCircle.svelte new file mode 100644 index 000000000..79c2e7d84 --- /dev/null +++ b/src/lib/components/icons/QuestionMarkCircle.svelte @@ -0,0 +1,19 @@ + + + + + diff --git a/src/lib/components/layout/Help.svelte b/src/lib/components/layout/Help.svelte new file mode 100644 index 000000000..2dbc26d98 --- /dev/null +++ b/src/lib/components/layout/Help.svelte @@ -0,0 +1,40 @@ + + + + + diff --git a/src/lib/components/layout/Help/HelpMenu.svelte b/src/lib/components/layout/Help/HelpMenu.svelte new file mode 100644 index 000000000..7371f629c --- /dev/null +++ b/src/lib/components/layout/Help/HelpMenu.svelte @@ -0,0 +1,60 @@ + + + { + if (e.detail === false) { + onClose(); + } + }} +> + + +
+ + { + window.open('https://docs.openwebui.com', '_blank'); + }} + > + +
{$i18n.t('Documentation')}
+
+ + { + showShortcutsHandler(); + }} + > + +
{$i18n.t('Keyboard shortcuts')}
+
+
+
+
diff --git a/src/routes/(app)/+layout.svelte b/src/routes/(app)/+layout.svelte index fe960f44f..8f0efe95e 100644 --- a/src/routes/(app)/+layout.svelte +++ b/src/routes/(app)/+layout.svelte @@ -36,6 +36,7 @@ import Tooltip from '$lib/components/common/Tooltip.svelte'; import { getBanners } from '$lib/apis/configs'; import { getUserSettings } from '$lib/apis/users'; + import Help from '$lib/components/layout/Help.svelte'; const i18n = getContext('i18n'); @@ -160,7 +161,7 @@ if (isCtrlPressed && event.key === '/') { event.preventDefault(); console.log('showShortcuts'); - showShortcutsButtonElement.click(); + document.getElementById('show-shortcuts-button')?.click(); } }); @@ -175,22 +176,7 @@ }); - - - +