Функция → мониторинги (core/feature-status.ts), серая кнопка входа через eGov и статус MCP, отказ startEgovFlow, журнал и сообщения в канал. После переезда живых обновлений на WebSocket (PEP-225): область `features` в LIVE_PLAIN_SCOPES, открыта без входа (SSE и WebSocket с `anonymous: true` — только открытые области), смотрится по таймеру вместе с `observe`, смена сбрасывает кэш статусов. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
75 lines
3.2 KiB
TypeScript
75 lines
3.2 KiB
TypeScript
import Link from "next/link";
|
|
import { CONNECT_HELP, featureGateView } from "@peppa/core";
|
|
import { FeatureGate } from "@/components/FeatureGate";
|
|
import { LiveRefresh } from "@/components/LiveRefresh";
|
|
import { PageHeader } from "@/components/common";
|
|
import { CopyText } from "@/components/CopyText";
|
|
import { Workspace } from "@/components/Workspace";
|
|
import { publicOrigin } from "@/lib/auth";
|
|
import { getLocale, getT } from "@/lib/i18n";
|
|
|
|
/** PEP-135: how to connect FORGE to one's own Claude or ChatGPT — step by step; texts live in core/connect-texts.ts. */
|
|
export default async function ConnectHelp() {
|
|
const t = CONNECT_HELP[await getLocale()] ?? CONNECT_HELP.ru;
|
|
const address = `${await publicOrigin()}/mcp`;
|
|
const tr = await getT();
|
|
const card = "flex flex-col gap-2 rounded-lg border bg-card px-4 py-3";
|
|
const h2 = "m-0 text-[15px] font-semibold";
|
|
return (
|
|
<Workspace>
|
|
<div className="max-w-2xl text-sm leading-relaxed">
|
|
<LiveRefresh scope="features" indicator={false} />
|
|
<PageHeader crumbs={<Link href="/help" className="text-muted-foreground hover:text-foreground">{t.back}</Link>} title={t.title}>
|
|
{t.lead}
|
|
</PageHeader>
|
|
<div className="flex flex-col gap-3">
|
|
<section className={card}>
|
|
<h2 className={h2}>{t.addressTitle}</h2>
|
|
<FeatureGate view={featureGateView("mcp")} title={tr("MCP временно недоступен")}>
|
|
<CopyText value={address} label={t.copy} done={t.copied} />
|
|
</FeatureGate>
|
|
<p className="m-0 text-muted-foreground">{t.addressNote}</p>
|
|
</section>
|
|
{t.apps.map((app) => (
|
|
<section key={app.id} id={app.id} className={card}>
|
|
<h2 className={h2}>{app.title}</h2>
|
|
<p className="m-0 text-muted-foreground">{app.need}</p>
|
|
<ol className="m-0 flex list-decimal flex-col gap-1.5 pl-5">
|
|
{app.steps.map((s) => (
|
|
<li key={s}>{s}</li>
|
|
))}
|
|
</ol>
|
|
</section>
|
|
))}
|
|
<section className={card}>
|
|
<h2 className={h2}>{t.askTitle}</h2>
|
|
<p className="m-0 text-muted-foreground">{t.askLead}</p>
|
|
<ul className="m-0 flex list-none flex-col gap-1.5 p-0">
|
|
{t.asks.map((a) => (
|
|
<li key={a} className="rounded-md border bg-muted/50 px-3 py-1.5">{a}</li>
|
|
))}
|
|
</ul>
|
|
</section>
|
|
<section className={card}>
|
|
<h2 className={h2}>{t.troubleTitle}</h2>
|
|
<dl className="m-0 flex flex-col gap-2">
|
|
{t.troubles.map((x) => (
|
|
<div key={x.q}>
|
|
<dt className="font-medium">{x.q}</dt>
|
|
<dd className="m-0 text-muted-foreground">{x.a}</dd>
|
|
</div>
|
|
))}
|
|
</dl>
|
|
</section>
|
|
<section className={card}>
|
|
<h2 className={h2}>{t.offTitle}</h2>
|
|
<p className="m-0">{t.off}</p>
|
|
<Link href="/settings#apps" className="text-primary">{t.offLink}</Link>
|
|
</section>
|
|
</div>
|
|
<p className="mt-4 mb-0 text-muted-foreground">{t.other}</p>
|
|
</div>
|
|
</Workspace>
|
|
);
|
|
}
|