|
@@ -3,7 +3,7 @@
|
|
import fileSaver from 'file-saver';
|
|
import fileSaver from 'file-saver';
|
|
const { saveAs } = fileSaver;
|
|
const { saveAs } = fileSaver;
|
|
|
|
|
|
- import { WEBUI_NAME, config, functions, models } from '$lib/stores';
|
|
|
|
|
|
+ import { WEBUI_NAME, config, functions, models, settings } from '$lib/stores';
|
|
import { onMount, getContext, tick } from 'svelte';
|
|
import { onMount, getContext, tick } from 'svelte';
|
|
|
|
|
|
import { goto } from '$app/navigation';
|
|
import { goto } from '$app/navigation';
|
|
@@ -126,7 +126,7 @@
|
|
toast.success($i18n.t('Function deleted successfully'));
|
|
toast.success($i18n.t('Function deleted successfully'));
|
|
|
|
|
|
functions.set(await getFunctions(localStorage.token));
|
|
functions.set(await getFunctions(localStorage.token));
|
|
- models.set(await getModels(localStorage.token));
|
|
|
|
|
|
+ models.set(await getModels(localStorage.token, $settings?.directConnections ?? null));
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
|
|
@@ -147,7 +147,7 @@
|
|
}
|
|
}
|
|
|
|
|
|
functions.set(await getFunctions(localStorage.token));
|
|
functions.set(await getFunctions(localStorage.token));
|
|
- models.set(await getModels(localStorage.token));
|
|
|
|
|
|
+ models.set(await getModels(localStorage.token, $settings?.directConnections ?? null));
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
|
|
@@ -359,7 +359,9 @@
|
|
bind:state={func.is_active}
|
|
bind:state={func.is_active}
|
|
on:change={async (e) => {
|
|
on:change={async (e) => {
|
|
toggleFunctionById(localStorage.token, func.id);
|
|
toggleFunctionById(localStorage.token, func.id);
|
|
- models.set(await getModels(localStorage.token));
|
|
|
|
|
|
+ models.set(
|
|
|
|
+ await getModels(localStorage.token, $settings?.directConnections ?? null)
|
|
|
|
+ );
|
|
}}
|
|
}}
|
|
/>
|
|
/>
|
|
</Tooltip>
|
|
</Tooltip>
|
|
@@ -496,7 +498,7 @@
|
|
id={selectedFunction?.id ?? null}
|
|
id={selectedFunction?.id ?? null}
|
|
on:save={async () => {
|
|
on:save={async () => {
|
|
await tick();
|
|
await tick();
|
|
- models.set(await getModels(localStorage.token));
|
|
|
|
|
|
+ models.set(await getModels(localStorage.token, $settings?.directConnections ?? null));
|
|
}}
|
|
}}
|
|
/>
|
|
/>
|
|
|
|
|
|
@@ -517,7 +519,7 @@
|
|
|
|
|
|
toast.success($i18n.t('Functions imported successfully'));
|
|
toast.success($i18n.t('Functions imported successfully'));
|
|
functions.set(await getFunctions(localStorage.token));
|
|
functions.set(await getFunctions(localStorage.token));
|
|
- models.set(await getModels(localStorage.token));
|
|
|
|
|
|
+ models.set(await getModels(localStorage.token, $settings?.directConnections ?? null));
|
|
};
|
|
};
|
|
|
|
|
|
reader.readAsText(importFiles[0]);
|
|
reader.readAsText(importFiles[0]);
|