mirror of
https://github.com/open-webui/open-webui.git
synced 2026-08-13 01:02:25 -06:00
fix: open settings deep links on client-side navigation and open Add Terminal settings directly (#27552)
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { getContext } from 'svelte';
|
||||
import { goto } from '$app/navigation';
|
||||
|
||||
import { settings, showSettings, terminalServers, selectedTerminalId, user } from '$lib/stores';
|
||||
import { getToolServersData } from '$lib/apis';
|
||||
@@ -193,7 +192,7 @@
|
||||
class="p-0.5 rounded-md text-gray-400 hover:text-gray-600 dark:text-gray-500 dark:hover:text-gray-300 transition"
|
||||
on:click|stopPropagation={() => {
|
||||
show = false;
|
||||
goto('/admin/settings/integrations');
|
||||
showSettings.set('admin:integrations');
|
||||
}}
|
||||
>
|
||||
<svg
|
||||
|
||||
@@ -199,6 +199,9 @@
|
||||
const openSettingsFromUrl = async () => {
|
||||
const requestedSettings = $page.url.searchParams.get('settings');
|
||||
if (!requestedSettings) {
|
||||
// Param handled and stripped; allow the same deep link to be
|
||||
// handled again later in this session.
|
||||
handledSettingsUrl = '';
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -382,7 +385,10 @@
|
||||
loaded = true;
|
||||
});
|
||||
|
||||
$: if (loaded) {
|
||||
// `$page.url` must be referenced here: `$:` only tracks variables used in
|
||||
// the statement itself, and reads inside openSettingsFromUrl don't count —
|
||||
// without it, client-side navigations to `?settings=...` are never handled.
|
||||
$: if (loaded && $page.url) {
|
||||
void openSettingsFromUrl();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user