mirror of
https://github.com/open-webui/open-webui.git
synced 2026-09-25 08:50:22 -04:00
refac
This commit is contained in:
@@ -72,7 +72,10 @@
|
||||
|
||||
$: showControlsTab = $user?.role === 'admin' || ($user?.permissions?.chat?.controls ?? true);
|
||||
$: showFilesTab =
|
||||
!!$selectedTerminalId ||
|
||||
($selectedTerminalId &&
|
||||
(($terminalServers ?? []).some((t) => t.id && t.id === $selectedTerminalId) ||
|
||||
$user?.role === 'admin' ||
|
||||
($user?.permissions?.features?.direct_tool_servers ?? true))) ||
|
||||
(codeInterpreterEnabled && $config?.code?.interpreter_engine !== 'jupyter');
|
||||
$: showOverviewTab = hasMessages;
|
||||
|
||||
@@ -96,13 +99,22 @@
|
||||
}
|
||||
|
||||
// Auto-open Files tab when a terminal is selected (suppress panel open when full-screen)
|
||||
$: if ($selectedTerminalId) {
|
||||
$: if ($selectedTerminalId && showFilesTab) {
|
||||
activeTab = 'files';
|
||||
if (largeScreen) {
|
||||
showControls.set(true);
|
||||
}
|
||||
}
|
||||
|
||||
// Clear selected direct terminal if user lost permission
|
||||
$: if (
|
||||
$selectedTerminalId &&
|
||||
!($terminalServers ?? []).some((t) => t.id && t.id === $selectedTerminalId) &&
|
||||
!($user?.role === 'admin' || ($user?.permissions?.features?.direct_tool_servers ?? true))
|
||||
) {
|
||||
selectedTerminalId.set(null);
|
||||
}
|
||||
|
||||
// Attach a terminal file to the chat input
|
||||
const handleTerminalAttach = async (blob: Blob, name: string, contentType: string) => {
|
||||
const tempItemId = uuidv4();
|
||||
|
||||
Reference in New Issue
Block a user