mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-05 02:41:34 +00:00
fix: actions in a model's menu in the model selector do nothing (#31503)
Picking Edit, Keep in Sidebar, Copy Link or Delete from the menu next to a model in the model selector did nothing: the selector closed and the action never ran. These actions work again. Edit and Delete now also close the selector, so the first click in the settings window or the delete confirmation that opens is not lost.
This commit is contained in:
parent
c8a3e10e13
commit
8667dd7121
3 changed files with 9 additions and 0 deletions
|
|
@ -33,6 +33,7 @@
|
|||
export let selectionOnly = false;
|
||||
|
||||
export let onClick: () => void = () => {};
|
||||
export let onEdit: () => void = () => {};
|
||||
|
||||
$: localizedDescription = resolveLocalizedModelDescription(item.model, $i18n.language);
|
||||
|
||||
|
|
@ -304,6 +305,7 @@
|
|||
model={item.model}
|
||||
{pinModelHandler}
|
||||
{deleteModelHandler}
|
||||
{onEdit}
|
||||
copyLinkHandler={() => {
|
||||
copyLinkHandler(item.model);
|
||||
}}
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@
|
|||
export let pinModelHandler: (modelId: string) => void = () => {};
|
||||
export let copyLinkHandler: Function = () => {};
|
||||
export let deleteModelHandler: Function = () => {};
|
||||
export let onEdit: () => void = () => {};
|
||||
|
||||
export let onClose: Function = () => {};
|
||||
|
||||
|
|
@ -30,6 +31,7 @@
|
|||
bind:show
|
||||
align="end"
|
||||
sideOffset={-2}
|
||||
contentClass="model-selector-child-menu"
|
||||
onOpenChange={(state) => {
|
||||
if (state === false) {
|
||||
onClose();
|
||||
|
|
@ -61,6 +63,7 @@
|
|||
showSettings.set({ tab: 'admin:models', state: { id: model?.id ?? null } });
|
||||
}
|
||||
show = false;
|
||||
onEdit();
|
||||
}}
|
||||
>
|
||||
<Pencil className="size-3.5" />
|
||||
|
|
|
|||
|
|
@ -810,6 +810,7 @@
|
|||
let deleteModelTarget: any = null;
|
||||
|
||||
const deleteModelHandler = async (model: any) => {
|
||||
show = false;
|
||||
deleteModelTarget = model;
|
||||
showDeleteConfirm = true;
|
||||
};
|
||||
|
|
@ -1108,6 +1109,9 @@
|
|||
onClick={() => {
|
||||
selectItem(item, index);
|
||||
}}
|
||||
onEdit={() => {
|
||||
show = false;
|
||||
}}
|
||||
/>
|
||||
{/each}
|
||||
<div style="height: {(filteredItems.length - visibleEnd) * ITEM_HEIGHT}px;" />
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue