new flow for Pi provider/model settings

This commit is contained in:
2026-02-22 20:19:11 +00:00
parent 1372f53782
commit f1e3ce4b76
15 changed files with 249 additions and 460 deletions
@@ -131,6 +131,7 @@ export const AIHarnessesSection = () => {
try {
await client.put('/server-settings/pi-mono/api-keys', { key: env, value });
queryClient.invalidateQueries({ queryKey: ['PI_MONO_API_KEYS'] });
queryClient.invalidateQueries({ queryKey: ['PI_MODELS'] });
setKeyInputs((prev) => {
const next = { ...prev };
delete next[env];
@@ -146,6 +147,7 @@ export const AIHarnessesSection = () => {
await client.put('/server-settings/pi-mono/api-keys', { key: env, value: '' });
}
queryClient.invalidateQueries({ queryKey: ['PI_MONO_API_KEYS'] });
queryClient.invalidateQueries({ queryKey: ['PI_MODELS'] });
if (editingProvider === provider.key) setEditingProvider(null);
};
@@ -225,6 +227,7 @@ export const AIHarnessesSection = () => {
auth,
});
queryClient.invalidateQueries({ queryKey: ['PI_MONO_LOCAL_PROVIDERS'] });
queryClient.invalidateQueries({ queryKey: ['PI_MODELS'] });
toast.success(`Connected to ${probe.name}`);
resetLocalForm();
} catch {
@@ -236,6 +239,7 @@ export const AIHarnessesSection = () => {
const removeLocalProvider = async (id: string) => {
await client.delete(`/server-settings/pi-mono/local-providers/${id}`);
queryClient.invalidateQueries({ queryKey: ['PI_MONO_LOCAL_PROVIDERS'] });
queryClient.invalidateQueries({ queryKey: ['PI_MODELS'] });
};
return (