mirror of
https://github.com/domfelipe/mika-agent-assist.git
synced 2026-08-07 06:56:44 +00:00
Changes
Co-authored-by: domfelipe <53182096+domfelipe@users.noreply.github.com>
This commit is contained in:
parent
eaf69d5de9
commit
929e641792
4 changed files with 68 additions and 31 deletions
|
|
@ -102,14 +102,19 @@ function IntegrationDetailPage() {
|
|||
|
||||
async function handleTest() {
|
||||
setTesting(true);
|
||||
const { data, error } = await invokeFunction<{ ok: boolean; account?: string }>(
|
||||
const { data, error } = await invokeFunction<{
|
||||
ok?: boolean;
|
||||
success?: boolean;
|
||||
account?: string;
|
||||
account_info?: unknown;
|
||||
}>(
|
||||
"test-integration",
|
||||
{ integration_id: integration!.id },
|
||||
);
|
||||
setTesting(false);
|
||||
if (error) {
|
||||
toast.error(error.message);
|
||||
} else if (data?.ok) {
|
||||
} else if (data?.ok || data?.success) {
|
||||
toast.success("Conexão funcionando perfeitamente.");
|
||||
} else {
|
||||
toast.warning("Conexão respondeu, mas com aviso. Verifique status.");
|
||||
|
|
@ -117,6 +122,7 @@ function IntegrationDetailPage() {
|
|||
queryClient.invalidateQueries({ queryKey: ["user-integrations"] });
|
||||
}
|
||||
|
||||
|
||||
async function handleRefresh() {
|
||||
setRefreshing(true);
|
||||
const { data, error } = await invokeFunction<{
|
||||
|
|
@ -289,22 +295,13 @@ function IntegrationDetailPage() {
|
|||
|
||||
<DisconnectMCPDialog
|
||||
open={disconnectOpen}
|
||||
onOpenChange={(o) => {
|
||||
setDisconnectOpen(o);
|
||||
if (!o) {
|
||||
// se desconectou, volta para a lista
|
||||
queryClient.invalidateQueries({ queryKey: ["user-integrations"] }).then(() => {
|
||||
const stillConnected = integs.some((i) => i.id === integration.id);
|
||||
if (!stillConnected) {
|
||||
navigate({ to: "/painel/integracoes", search: {} });
|
||||
}
|
||||
});
|
||||
}
|
||||
}}
|
||||
onOpenChange={setDisconnectOpen}
|
||||
onDisconnected={() => navigate({ to: "/painel/integracoes", search: {} })}
|
||||
integrationId={integration.id}
|
||||
mcpSlug={mcp.slug}
|
||||
mcpName={mcp.name}
|
||||
/>
|
||||
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue