fix(mcp): восстановить прокрутку раздела
Docker images / prepare-release (push) Successful in 14s
Docker images / backend-test (push) Successful in 12m5s
Docker images / frontend-image (push) Successful in 3m59s
Docker images / updater-image (push) Successful in 2m43s
Docker images / netflow-agent-image (push) Successful in 41s
Docker images / backend-image (push) Successful in 3m48s
Docker images / publish-release (push) Successful in 12s
Docker images / notify-webhook (push) Successful in 2s
Docker images / prepare-release (push) Successful in 14s
Docker images / backend-test (push) Successful in 12m5s
Docker images / frontend-image (push) Successful in 3m59s
Docker images / updater-image (push) Successful in 2m43s
Docker images / netflow-agent-image (push) Successful in 41s
Docker images / backend-image (push) Successful in 3m48s
Docker images / publish-release (push) Successful in 12s
Docker images / notify-webhook (push) Successful in 2s
This commit is contained in:
1 parent
f45b0f6afc
commit
cad54635a8
2 files changed
+15
-1
No files matched your search
@@ -798,5 +798,5 @@ function McpWorkspaceContent({ backendUrl, live }: { backendUrl: string; live: b
|
||||
const [operations, setOperations] = useState<McpOperationDescriptor[]>([]), [error, setError] = useState("")
|
||||
useEffect(() => { if (!live) return; const controller = new AbortController(); void api.catalog(controller.signal).then(catalog => setOperations(catalog.operations), failure => { if (!controller.signal.aborted) setError(errorText(failure)) }); return () => controller.abort() }, [api, live])
|
||||
const changeTab = (value: unknown) => { const next = String(value); const url = new URL(window.location.href); url.searchParams.set("tab", next); window.history.replaceState(null, "", url.pathname + url.search) }
|
||||
return <><PageHeader crumbs={[{ label: "MCP" }]} /><main className="flex min-w-0 flex-1 flex-col gap-5 p-4 md:p-6"><div className="flex items-center gap-3"><BotIcon className="size-7 text-muted-foreground" /><div><h1 className="text-xl font-semibold">MCP</h1><p className="text-sm text-muted-foreground">Доступ нейросетей, разрешения и контроль изменений</p></div></div>{!live ? <Panel title="Подключите backend"><p>Для выдачи реального AI-доступа выберите режим «Живые» и настройте авторизацию портала.</p></Panel> : <><ErrorMessage message={error} />{oauthRequestId && <Consent key={oauthRequestId} api={api} id={oauthRequestId} />}<Tabs value={tab} onValueChange={changeTab}><div className="overflow-x-auto pb-1"><TabsList variant="line">{Object.entries(tabs).filter(([key]) => key !== "settings" || can("mm:mcp:admin")).map(([key, title]) => <TabsTrigger key={key} value={key}>{title}</TabsTrigger>)}</TabsList></div><TabsContent value="overview"><Overview api={api} /></TabsContent><TabsContent value="connections"><div className="flex flex-col gap-4"><Connections api={api} operations={operations} />{can("mm:mcp:admin") && <AccessTools api={api} />}</div></TabsContent><TabsContent value="permissions"><Permissions api={api} operations={operations} /></TabsContent><TabsContent value="devices"><DeviceManagement api={api} /></TabsContent><TabsContent value="routing"><div className="flex flex-col gap-4"><RoutingProfiles api={api} /><RoutePathVerification api={api} /></div></TabsContent><TabsContent value="requests"><Records api={api} kind="requests" /></TabsContent><TabsContent value="plans"><div className="flex flex-col gap-4"><Records api={api} kind="plans" /><Records api={api} kind="operations" />{admin && <OperationRecovery key={recoveryId} api={api} operationId={recoveryId} />}<Records api={api} kind="drift" /></div></TabsContent>{can("mm:mcp:admin") && <TabsContent value="settings"><div className="flex flex-col gap-4"><Settings api={api} /><RestCoverage api={api} /><ManagementChannels api={api} />{can("mm:settings:admin") && <DatabaseRestore api={api} />}</div></TabsContent>}</Tabs></>}</main></>
|
||||
return <><PageHeader crumbs={[{ label: "MCP" }]} /><div className="flex min-h-0 min-w-0 flex-1 flex-col gap-5 overflow-y-auto p-4 md:p-6"><div className="flex items-center gap-3"><BotIcon className="size-7 text-muted-foreground" /><div><h1 className="text-xl font-semibold">MCP</h1><p className="text-sm text-muted-foreground">Доступ нейросетей, разрешения и контроль изменений</p></div></div>{!live ? <Panel title="Подключите backend"><p>Для выдачи реального AI-доступа выберите режим «Живые» и настройте авторизацию портала.</p></Panel> : <><ErrorMessage message={error} />{oauthRequestId && <Consent key={oauthRequestId} api={api} id={oauthRequestId} />}<Tabs value={tab} onValueChange={changeTab}><div className="overflow-x-auto pb-1"><TabsList variant="line">{Object.entries(tabs).filter(([key]) => key !== "settings" || can("mm:mcp:admin")).map(([key, title]) => <TabsTrigger key={key} value={key}>{title}</TabsTrigger>)}</TabsList></div><TabsContent value="overview"><Overview api={api} /></TabsContent><TabsContent value="connections"><div className="flex flex-col gap-4"><Connections api={api} operations={operations} />{can("mm:mcp:admin") && <AccessTools api={api} />}</div></TabsContent><TabsContent value="permissions"><Permissions api={api} operations={operations} /></TabsContent><TabsContent value="devices"><DeviceManagement api={api} /></TabsContent><TabsContent value="routing"><div className="flex flex-col gap-4"><RoutingProfiles api={api} /><RoutePathVerification api={api} /></div></TabsContent><TabsContent value="requests"><Records api={api} kind="requests" /></TabsContent><TabsContent value="plans"><div className="flex flex-col gap-4"><Records api={api} kind="plans" /><Records api={api} kind="operations" />{admin && <OperationRecovery key={recoveryId} api={api} operationId={recoveryId} />}<Records api={api} kind="drift" /></div></TabsContent>{can("mm:mcp:admin") && <TabsContent value="settings"><div className="flex flex-col gap-4"><Settings api={api} /><RestCoverage api={api} /><ManagementChannels api={api} />{can("mm:settings:admin") && <DatabaseRestore api={api} />}</div></TabsContent>}</Tabs></>}</div></>
|
||||
}
|
||||
@@ -40,6 +40,20 @@ async function setup(page: Page, fail = false) {
|
||||
return calls
|
||||
}
|
||||
|
||||
test("MCP: настройки прокручиваются до восстановления базы", async ({ page }) => {
|
||||
await page.setViewportSize({ width: 1100, height: 640 })
|
||||
await setup(page)
|
||||
await page.goto("/mcp?tab=settings")
|
||||
|
||||
const restoreHeading = page.getByRole("heading", { name: "Восстановление БД через MCP" })
|
||||
await expect(restoreHeading).toBeAttached()
|
||||
await expect(restoreHeading).not.toBeInViewport()
|
||||
await page.mouse.move(700, 400)
|
||||
await page.mouse.wheel(0, 3000)
|
||||
await expect(restoreHeading).toBeInViewport()
|
||||
await expect(page.getByRole("navigation", { name: "Путь страницы" })).toBeInViewport()
|
||||
})
|
||||
|
||||
test("MCP приостанавливает опрос по сигналу скрытия документа и возобновляет при показе", async ({ page }) => {
|
||||
const calls = await setup(page)
|
||||
const overviewCalls = () => calls.filter(call => call === "GET /api/mcp/overview").length
|
||||
|
||||
Reference in new issue
Block a user