mirror of
https://github.com/open-webui/open-webui.git
synced 2026-11-16 09:41:23 +00:00
fix: New File, New Terminal and Browser tabs do nothing over plain HTTP (#33847)
Opening a file, terminal or browser tab from the + menu in the side panel silently did nothing when Open WebUI was reached over plain HTTP on a LAN or Docker host address. The browser only offers its built-in id generator on HTTPS or localhost, so the click failed before the tab was created. Tab and split ids now use the same uuid helper as the rest of the app, which works on every connection. Fixes #33845
This commit is contained in:
parent
86b49034b7
commit
b31ae40d2e
2 changed files with 9 additions and 7 deletions
|
|
@ -5,6 +5,7 @@
|
|||
let fileGitDiffModes: Record<string, 'unified' | 'split'> = {};
|
||||
let fileGitHideWhitespace: Record<string, boolean> = {};
|
||||
import { onMount, onDestroy, tick, getContext } from 'svelte';
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
import Sortable from 'sortablejs';
|
||||
import { beforeNavigate, goto } from '$app/navigation';
|
||||
import {
|
||||
|
|
@ -276,7 +277,7 @@
|
|||
let number = 1;
|
||||
while (tabs.tabs.some((tab) => tab.untitled && tab.label === `Untitled-${number}`)) number++;
|
||||
openPanel({
|
||||
id: crypto.randomUUID(),
|
||||
id: uuidv4(),
|
||||
kind: 'file',
|
||||
label: `Untitled-${number}`,
|
||||
terminalId: selectedConnection.selector,
|
||||
|
|
@ -296,7 +297,7 @@
|
|||
const initialPrompt = pending?.parentId === chatId ? pending.prompt : '';
|
||||
if (pending?.parentId === chatId) sideChatRequest.set(null);
|
||||
openPanel({
|
||||
id: crypto.randomUUID(),
|
||||
id: uuidv4(),
|
||||
kind,
|
||||
label: `${view.label} ${sideChatNumber}`,
|
||||
sideChatNumber,
|
||||
|
|
@ -418,7 +419,7 @@
|
|||
let id = existing;
|
||||
if (!id) {
|
||||
focusGroup(groupId);
|
||||
id = crypto.randomUUID();
|
||||
id = uuidv4();
|
||||
tabs = openTab(tabs, { id, kind: 'side', label: $i18n.t('Chat'), chatId: savedId });
|
||||
}
|
||||
tabs = bounds.edge
|
||||
|
|
@ -466,7 +467,7 @@
|
|||
terminalNumber++;
|
||||
}
|
||||
openPanel({
|
||||
id: crypto.randomUUID(),
|
||||
id: uuidv4(),
|
||||
kind: 'terminal',
|
||||
label: `${$i18n.t('Terminal')} ${terminalNumber}`,
|
||||
terminalNumber,
|
||||
|
|
@ -518,7 +519,7 @@
|
|||
? `${connection.baseUrl}/chats/${encodeURIComponent(chatId)}`
|
||||
: connection?.baseUrl);
|
||||
openPanel({
|
||||
id: crypto.randomUUID(),
|
||||
id: uuidv4(),
|
||||
kind: 'browser',
|
||||
label: port ? `localhost:${port}` : $i18n.t('Browser'),
|
||||
path: url,
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import { v4 as uuidv4 } from 'uuid';
|
||||
import type { TerminalContext } from '$lib/types';
|
||||
import type { TerminalConnection } from '$lib/apis/terminal';
|
||||
|
||||
|
|
@ -221,7 +222,7 @@ export function splitTab(
|
|||
if (!source || !state.groups.some((group) => group.id === groupId)) return state;
|
||||
if (source.id === groupId && source.tabIds.length === 1) return state;
|
||||
const next = removeFromGroup(state, id);
|
||||
const newGroup: PanelGroup = { id: crypto.randomUUID(), tabIds: [id], activeId: id };
|
||||
const newGroup: PanelGroup = { id: uuidv4(), tabIds: [id], activeId: id };
|
||||
const replace = (layout: PanelLayout): PanelLayout => {
|
||||
if (layout.type === 'group') {
|
||||
if (layout.groupId !== groupId) return layout;
|
||||
|
|
@ -229,7 +230,7 @@ export function splitTab(
|
|||
const before = edge === 'left' || edge === 'top';
|
||||
return {
|
||||
type: 'split',
|
||||
id: crypto.randomUUID(),
|
||||
id: uuidv4(),
|
||||
direction: edge === 'left' || edge === 'right' ? 'horizontal' : 'vertical',
|
||||
ratio: 0.5,
|
||||
first: before ? leaf : layout,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue