feat: add keyboard shortcut tooltips
This commit is contained in:
@@ -12,6 +12,7 @@ const { addShortcut } = useKeyboardShortcuts();
|
||||
|
||||
const props = defineProps<{
|
||||
providers: ProviderWithModels[];
|
||||
addHotkey?: boolean;
|
||||
}>();
|
||||
|
||||
const selectedModel = defineModel<ModelWithProvider | null>();
|
||||
@@ -182,11 +183,15 @@ const handleSearchKeyDown = (event: KeyboardEvent) => {
|
||||
}
|
||||
};
|
||||
|
||||
const unbindShortcut = addShortcut(['ctrl', 'shift', 'm'], (event) => {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
toggleDropdown();
|
||||
});
|
||||
let unbindShortcut: () => void = () => { };
|
||||
|
||||
if (props.addHotkey) {
|
||||
unbindShortcut = addShortcut(['ctrl', 'shift', 'm'], (event) => {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
toggleDropdown();
|
||||
});
|
||||
}
|
||||
|
||||
onUnmounted(() => {
|
||||
unbindShortcut();
|
||||
@@ -240,7 +245,7 @@ onUnmounted(() => {
|
||||
|
||||
<div v-for="provider in filteredProviders" :key="provider.id" class="mb-2">
|
||||
<div v-if="provider.models.filter(m => m.enabled).length > 0"
|
||||
class="px-4 py-1.5 text-[13px] font-medium text-[var(--text-secondary)] capitalize tracking-wider flex justify-between">
|
||||
class="px-4 py-1.5 text-[13px] font-medium text-[var(--text-secondary)] case-capital tracking-wider flex justify-between">
|
||||
{{ provider.name }}
|
||||
<button
|
||||
@click="closeDropdown(); openDialog(DialogType.Settings, undefined, { page: 'providers', params: provider.id })"
|
||||
|
||||
Reference in New Issue
Block a user