webui: fix custom headers persistence in UI
This commit is contained in:
parent
cffc3b46ae
commit
3360f60b94
|
|
@ -1,5 +1,5 @@
|
|||
<script lang="ts">
|
||||
import { onMount } from 'svelte';
|
||||
import { onMount, tick } from 'svelte';
|
||||
import * as Card from '$lib/components/ui/card';
|
||||
import type { MCPServerSettingsEntry, HealthCheckState } from '$lib/types';
|
||||
import { HealthCheckStatus } from '$lib/enums';
|
||||
|
|
@ -74,9 +74,10 @@
|
|||
mcpClient.runHealthCheck(server);
|
||||
}
|
||||
|
||||
function startEditing() {
|
||||
editFormRef?.setInitialValues(server.url, server.headers || '');
|
||||
async function startEditing() {
|
||||
isEditing = true;
|
||||
await tick();
|
||||
editFormRef?.setInitialValues(server.url, server.headers || '');
|
||||
}
|
||||
|
||||
function cancelEditing() {
|
||||
|
|
|
|||
|
|
@ -25,6 +25,10 @@
|
|||
// Local state for header pairs
|
||||
let headerPairs = $state<KeyValuePair[]>(parseHeadersToArray(headers));
|
||||
|
||||
$effect(() => {
|
||||
headerPairs = parseHeadersToArray(headers);
|
||||
});
|
||||
|
||||
// Sync header pairs to parent when they change
|
||||
function updateHeaderPairs(newPairs: KeyValuePair[]) {
|
||||
headerPairs = newPairs;
|
||||
|
|
|
|||
Loading…
Reference in New Issue