mirror of
https://github.com/open-webui/open-webui.git
synced 2026-08-28 05:27:35 +00:00
fix: open settings deep links on client-side navigation and open Add Terminal settings directly (#27552)
This commit is contained in:
parent
d1aa812d80
commit
ef197de0d7
2 changed files with 8 additions and 3 deletions
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue