feat(graph): add to web
This commit is contained in:
@@ -8,6 +8,7 @@ import { StylesPage } from "./features/styles/StylesPage";
|
||||
import { StyleEditorPage } from "./features/styles/StyleEditorPage";
|
||||
import { TokensPage } from "./features/tokens/TokensPage";
|
||||
import { GuidesPage } from "./features/guides/GuidesPage";
|
||||
import { GraphPage } from "./features/graph/GraphPage";
|
||||
import { CookieBanner } from "./legal/CookieBanner";
|
||||
import { LegalPage } from "./legal/LegalPage";
|
||||
|
||||
@@ -66,6 +67,14 @@ export function App() {
|
||||
</Guard>
|
||||
}
|
||||
/>
|
||||
<Route
|
||||
path="/graph"
|
||||
element={
|
||||
<Guard>
|
||||
<GraphPage />
|
||||
</Guard>
|
||||
}
|
||||
/>
|
||||
<Route
|
||||
path="/tokens"
|
||||
element={
|
||||
|
||||
@@ -88,6 +88,14 @@ export type SourceItem = {
|
||||
name: string;
|
||||
enabled: boolean;
|
||||
center: number[];
|
||||
status?: string;
|
||||
graphReady?: boolean;
|
||||
bounds?: {
|
||||
minLon: number;
|
||||
minLat: number;
|
||||
maxLon: number;
|
||||
maxLat: number;
|
||||
} | null;
|
||||
};
|
||||
|
||||
export const api = {
|
||||
|
||||
@@ -2,5 +2,6 @@ export const PRIMARY_NAV = [
|
||||
{ id: "overview", to: "/", label: "Обзор", soon: false },
|
||||
{ id: "guides", to: "/guides", label: "Инструкции", soon: false },
|
||||
{ id: "styles", to: "/styles", label: "Стили", soon: false },
|
||||
{ id: "graph", to: "/graph", label: "Граф", soon: false },
|
||||
{ id: "tokens", to: "/tokens", label: "Токены", soon: false },
|
||||
] as const;
|
||||
|
||||
@@ -0,0 +1,305 @@
|
||||
import { useCallback, useEffect, useMemo, useState } from "react";
|
||||
import { Link } from "react-router-dom";
|
||||
import {
|
||||
api,
|
||||
getPreviewToken,
|
||||
setPreviewToken,
|
||||
type SourceItem
|
||||
} from "../../api";
|
||||
import { Button, Flash, PageHeader, Section } from "../../components/ui";
|
||||
import { AppSelect, AppTextField } from "../../ui";
|
||||
import { useAuth } from "../auth/AuthContext";
|
||||
import "./graph.css";
|
||||
|
||||
type GraphMeta = {
|
||||
extractId: string;
|
||||
nodeCount: number;
|
||||
edgeCount: number;
|
||||
bounds?: { minLon: number; minLat: number; maxLon: number; maxLat: number } | null;
|
||||
builtAt: string;
|
||||
};
|
||||
|
||||
type GraphEdge = {
|
||||
id: number;
|
||||
fromId: number;
|
||||
toId: number;
|
||||
highway: string;
|
||||
name?: string | null;
|
||||
oneway: boolean;
|
||||
lengthM: number;
|
||||
};
|
||||
|
||||
type GraphPage<T> = {
|
||||
items: T[];
|
||||
nextAfter?: number | null;
|
||||
};
|
||||
|
||||
function formatNumber(value: number): string {
|
||||
return value.toLocaleString("ru-RU");
|
||||
}
|
||||
|
||||
function CopyField({ label, value }: { label: string; value: string }) {
|
||||
const [copied, setCopied] = useState(false);
|
||||
return (
|
||||
<figure className="graph-copy">
|
||||
<figcaption>
|
||||
<span>{label}</span>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => {
|
||||
void navigator.clipboard.writeText(value).then(() => {
|
||||
setCopied(true);
|
||||
window.setTimeout(() => setCopied(false), 1400);
|
||||
});
|
||||
}}
|
||||
>
|
||||
{copied ? "скопировано" : "копировать"}
|
||||
</button>
|
||||
</figcaption>
|
||||
<pre>{value}</pre>
|
||||
</figure>
|
||||
);
|
||||
}
|
||||
|
||||
function defaultBbox(center: number[] | undefined): string {
|
||||
const lon = center?.[0] ?? 37.6173;
|
||||
const lat = center?.[1] ?? 55.7558;
|
||||
const d = 0.08;
|
||||
return `${(lon - d).toFixed(4)},${(lat - d).toFixed(4)},${(lon + d).toFixed(4)},${(lat + d).toFixed(4)}`;
|
||||
}
|
||||
|
||||
export function GraphPage() {
|
||||
const { user } = useAuth();
|
||||
const [sources, setSources] = useState<SourceItem[]>([]);
|
||||
const [sourceId, setSourceId] = useState("");
|
||||
const [bbox, setBbox] = useState("37.5373,55.6758,37.6973,55.8358");
|
||||
const [token, setToken] = useState(() => getPreviewToken() ?? "");
|
||||
const [meta, setMeta] = useState<GraphMeta | null>(null);
|
||||
const [edges, setEdges] = useState<GraphEdge[]>([]);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [creating, setCreating] = useState(false);
|
||||
|
||||
const source = sources.find((item) => item.id === sourceId) ?? sources[0];
|
||||
const slug = user?.slug ?? "{slug}";
|
||||
const origin = window.location.origin;
|
||||
const activeToken = token.trim() || "ts_…";
|
||||
|
||||
const urls = useMemo(() => {
|
||||
const id = source?.id ?? "central-fed-district";
|
||||
const q = `token=${encodeURIComponent(activeToken)}`;
|
||||
return {
|
||||
meta: `${origin}/u/${slug}/graph/${id}?${q}`,
|
||||
nodes: `${origin}/u/${slug}/graph/${id}/nodes?bbox=${bbox}&${q}`,
|
||||
edges: `${origin}/u/${slug}/graph/${id}/edges?bbox=${bbox}&limit=50&${q}`
|
||||
};
|
||||
}, [origin, slug, source?.id, bbox, activeToken]);
|
||||
|
||||
useEffect(() => {
|
||||
void api
|
||||
.sources()
|
||||
.then((list) => {
|
||||
const enabled = list.filter((item) => item.enabled);
|
||||
setSources(enabled);
|
||||
setSourceId((current) => {
|
||||
if (current && enabled.some((item) => item.id === current)) {
|
||||
return current;
|
||||
}
|
||||
return enabled[0]?.id ?? "";
|
||||
});
|
||||
const first = enabled[0];
|
||||
if (first) {
|
||||
setBbox(defaultBbox(first.center));
|
||||
}
|
||||
})
|
||||
.catch((err: unknown) => setError(err instanceof Error ? err.message : "Не удалось загрузить источники"));
|
||||
}, []);
|
||||
|
||||
const loadGraph = useCallback(async () => {
|
||||
if (!user || !source) {
|
||||
return;
|
||||
}
|
||||
const secret = token.trim();
|
||||
if (!secret) {
|
||||
setError("Нужен токен — создайте в «Токены» или вставьте сюда.");
|
||||
return;
|
||||
}
|
||||
|
||||
setLoading(true);
|
||||
setError(null);
|
||||
const q = `token=${encodeURIComponent(secret)}`;
|
||||
const metaUrl = `${origin}/u/${user.slug}/graph/${source.id}?${q}`;
|
||||
const edgesUrl = `${origin}/u/${user.slug}/graph/${source.id}/edges?bbox=${encodeURIComponent(bbox)}&limit=50&${q}`;
|
||||
try {
|
||||
const metaRes = await fetch(metaUrl);
|
||||
if (!metaRes.ok) {
|
||||
const text = await metaRes.text();
|
||||
throw new Error(text || `${metaRes.status} ${metaRes.statusText}`);
|
||||
}
|
||||
const nextMeta = (await metaRes.json()) as GraphMeta;
|
||||
setMeta(nextMeta);
|
||||
|
||||
const edgesRes = await fetch(edgesUrl);
|
||||
if (!edgesRes.ok) {
|
||||
const text = await edgesRes.text();
|
||||
throw new Error(text || `${edgesRes.status} ${edgesRes.statusText}`);
|
||||
}
|
||||
const page = (await edgesRes.json()) as GraphPage<GraphEdge>;
|
||||
setEdges(page.items ?? []);
|
||||
} catch (err: unknown) {
|
||||
setMeta(null);
|
||||
setEdges([]);
|
||||
setError(err instanceof Error ? err.message : "Не удалось загрузить граф");
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
}, [user, source, token, origin, bbox]);
|
||||
|
||||
return (
|
||||
<div className="graph-page">
|
||||
<PageHeader
|
||||
eyebrow="Данные"
|
||||
title="Граф дорог"
|
||||
description="Лёгкий граф из OSM highway=* рядом с тайлами. Только персональный URL и токен."
|
||||
/>
|
||||
<Flash error={error} />
|
||||
|
||||
<Section title="Источник и bbox" description="Сторона bbox ≤ 2°. Вокруг центра округа — удобная стартовая рамка.">
|
||||
<div className="form-row graph-page__row">
|
||||
<AppSelect
|
||||
id="graph-source"
|
||||
label="Округ"
|
||||
value={source?.id ?? ""}
|
||||
onChange={(e) => {
|
||||
const next = e.target.value;
|
||||
setSourceId(next);
|
||||
const item = sources.find((s) => s.id === next);
|
||||
setBbox(defaultBbox(item?.center));
|
||||
setMeta(null);
|
||||
setEdges([]);
|
||||
}}
|
||||
>
|
||||
{sources.map((item) => (
|
||||
<option key={item.id} value={item.id}>
|
||||
{item.name}
|
||||
{item.graphReady === false ? " (граф ещё нет)" : ""}
|
||||
</option>
|
||||
))}
|
||||
</AppSelect>
|
||||
<AppTextField
|
||||
id="graph-bbox"
|
||||
label="bbox minLon,minLat,maxLon,maxLat"
|
||||
value={bbox}
|
||||
onChange={(e) => setBbox(e.target.value.trim())}
|
||||
/>
|
||||
</div>
|
||||
<div className="form-row graph-page__row">
|
||||
<AppTextField
|
||||
id="graph-token"
|
||||
label="Токен ts_…"
|
||||
value={token}
|
||||
onChange={(e) => {
|
||||
const value = e.target.value.trim();
|
||||
setToken(value);
|
||||
if (value.startsWith("ts_")) {
|
||||
setPreviewToken(value);
|
||||
}
|
||||
}}
|
||||
placeholder="ts_…"
|
||||
/>
|
||||
<Button variant="primary" disabled={loading || !source} onClick={() => void loadGraph()}>
|
||||
{loading ? "Загрузка…" : "Загрузить превью"}
|
||||
</Button>
|
||||
{!token ? (
|
||||
<Button
|
||||
variant="secondary"
|
||||
disabled={creating}
|
||||
onClick={() => {
|
||||
setCreating(true);
|
||||
void api
|
||||
.createToken("Граф")
|
||||
.then((created) => {
|
||||
setPreviewToken(created.token);
|
||||
setToken(created.token);
|
||||
})
|
||||
.catch((err: unknown) => setError(err instanceof Error ? err.message : "Не удалось создать токен"))
|
||||
.finally(() => setCreating(false));
|
||||
}}
|
||||
>
|
||||
Создать токен
|
||||
</Button>
|
||||
) : null}
|
||||
</div>
|
||||
{source?.graphReady === false ? (
|
||||
<p className="graph-page__hint">
|
||||
Для «{source.name}» граф ещё не собран. Дождитесь sync или вызовите{" "}
|
||||
<code>POST /api/v1/sync/{source.id}</code> — тайлы пересобирать не обязательно.
|
||||
</p>
|
||||
) : null}
|
||||
</Section>
|
||||
|
||||
<Section title="URL">
|
||||
<CopyField label="Метаданные" value={urls.meta} />
|
||||
<CopyField label="Узлы" value={urls.nodes} />
|
||||
<CopyField label="Рёбра" value={urls.edges} />
|
||||
<p className="graph-page__hint">
|
||||
Примеры кода и контракт ответа — в <Link to="/guides">Инструкциях</Link>, блок «Граф дорог».
|
||||
</p>
|
||||
</Section>
|
||||
|
||||
{meta ? (
|
||||
<Section title="Метаданные">
|
||||
<dl className="graph-meta">
|
||||
<div>
|
||||
<dt>Extract</dt>
|
||||
<dd>{meta.extractId}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt>Узлы</dt>
|
||||
<dd>{formatNumber(meta.nodeCount)}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt>Рёбра</dt>
|
||||
<dd>{formatNumber(meta.edgeCount)}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt>Собран</dt>
|
||||
<dd>{new Date(meta.builtAt).toLocaleString("ru-RU")}</dd>
|
||||
</div>
|
||||
</dl>
|
||||
</Section>
|
||||
) : null}
|
||||
|
||||
{edges.length > 0 ? (
|
||||
<Section title={`Рёбра в bbox (${edges.length})`}>
|
||||
<table className="data-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>id</th>
|
||||
<th>from → to</th>
|
||||
<th>highway</th>
|
||||
<th>имя</th>
|
||||
<th>м</th>
|
||||
<th>oneway</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{edges.map((edge) => (
|
||||
<tr key={edge.id}>
|
||||
<td>{edge.id}</td>
|
||||
<td>
|
||||
{edge.fromId} → {edge.toId}
|
||||
</td>
|
||||
<td>{edge.highway}</td>
|
||||
<td>{edge.name ?? "—"}</td>
|
||||
<td>{Math.round(edge.lengthM)}</td>
|
||||
<td>{edge.oneway ? "да" : "нет"}</td>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
</Section>
|
||||
) : null}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
.graph-page {
|
||||
width: min(960px, 100%);
|
||||
margin: 0 auto;
|
||||
padding-bottom: var(--space-8);
|
||||
}
|
||||
|
||||
.graph-page__row {
|
||||
align-items: end;
|
||||
}
|
||||
|
||||
.graph-page__hint {
|
||||
margin: var(--space-3) 0 0;
|
||||
color: var(--secondary-label);
|
||||
font-size: var(--text-footnote);
|
||||
}
|
||||
|
||||
.graph-page__hint code {
|
||||
font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
|
||||
}
|
||||
|
||||
.graph-copy {
|
||||
margin: 0 0 var(--space-3);
|
||||
border-radius: var(--radius-lg);
|
||||
overflow: hidden;
|
||||
background: #11161c;
|
||||
color: #e8eef4;
|
||||
}
|
||||
|
||||
.graph-copy figcaption {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 8px 12px;
|
||||
font-size: var(--text-caption1);
|
||||
letter-spacing: 0.04em;
|
||||
text-transform: uppercase;
|
||||
color: rgb(232 238 244 / 55%);
|
||||
border-bottom: 1px solid rgb(255 255 255 / 8%);
|
||||
}
|
||||
|
||||
.graph-copy button {
|
||||
border: 0;
|
||||
background: transparent;
|
||||
color: #3cd68c;
|
||||
cursor: pointer;
|
||||
text-transform: none;
|
||||
letter-spacing: 0;
|
||||
}
|
||||
|
||||
.graph-copy pre {
|
||||
margin: 0;
|
||||
padding: 12px 14px 14px;
|
||||
overflow: auto;
|
||||
font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
|
||||
font-size: 12.5px;
|
||||
line-height: 1.45;
|
||||
white-space: pre-wrap;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.graph-meta {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
|
||||
gap: var(--space-3);
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.graph-meta div {
|
||||
padding: var(--space-3);
|
||||
border-radius: var(--radius-lg);
|
||||
background: var(--grouped-background);
|
||||
}
|
||||
|
||||
.graph-meta dt {
|
||||
margin: 0 0 4px;
|
||||
font-size: var(--text-caption1);
|
||||
letter-spacing: 0.04em;
|
||||
text-transform: uppercase;
|
||||
color: var(--secondary-label);
|
||||
}
|
||||
|
||||
.graph-meta dd {
|
||||
margin: 0;
|
||||
font-size: var(--text-title3);
|
||||
letter-spacing: -0.02em;
|
||||
}
|
||||
@@ -38,6 +38,7 @@ export function GuidesPage() {
|
||||
const source = sources[0]?.id ?? "central-fed-district";
|
||||
const origin = window.location.origin;
|
||||
const slug = user?.slug ?? "{slug}";
|
||||
const tokenSuffix = token ? `token=${token}` : "token=ts_…";
|
||||
|
||||
useEffect(() => {
|
||||
void api
|
||||
@@ -46,10 +47,11 @@ export function GuidesPage() {
|
||||
.catch((err: unknown) => setError(err instanceof Error ? err.message : "Не удалось загрузить источники"));
|
||||
}, []);
|
||||
|
||||
const styleUrl = `${origin}/u/${slug}/styles/osm-bright?source=${source}${token ? `&token=${token}` : "&token=ts_…"}`;
|
||||
const tilesUrl = `${origin}/u/${slug}/tiles/${source}/{z}/{x}/{y}.pbf?token=${token ?? "ts_…"}`;
|
||||
const graphUrl = `${origin}/u/${slug}/graph/${source}?token=${token ?? "ts_…"}`;
|
||||
const graphEdgesUrl = `${origin}/u/${slug}/graph/${source}/edges?bbox=37.5,55.7,37.7,55.8&token=${token ?? "ts_…"}`;
|
||||
const styleUrl = `${origin}/u/${slug}/styles/osm-bright?source=${source}&${tokenSuffix}`;
|
||||
const tilesUrl = `${origin}/u/${slug}/tiles/${source}/{z}/{x}/{y}.pbf?${tokenSuffix}`;
|
||||
const graphUrl = `${origin}/u/${slug}/graph/${source}?${tokenSuffix}`;
|
||||
const graphNodesUrl = `${origin}/u/${slug}/graph/${source}/nodes?bbox=37.5,55.7,37.7,55.8&${tokenSuffix}`;
|
||||
const graphEdgesUrl = `${origin}/u/${slug}/graph/${source}/edges?bbox=37.5,55.7,37.7,55.8&limit=100&${tokenSuffix}`;
|
||||
|
||||
const html = useMemo(
|
||||
() => `<link href="https://unpkg.com/maplibre-gl@5.6.1/dist/maplibre-gl.css" rel="stylesheet" />
|
||||
@@ -79,6 +81,31 @@ const map = new maplibregl.Map({
|
||||
[styleUrl]
|
||||
);
|
||||
|
||||
const graphFetch = useMemo(
|
||||
() => `const token = "ts_…";
|
||||
const source = "${source}";
|
||||
const bbox = "37.5,55.7,37.7,55.8"; // minLon,minLat,maxLon,maxLat, сторона ≤ 2°
|
||||
|
||||
const meta = await fetch(\`/u/${slug}/graph/\${source}?token=\${token}\`).then((r) => r.json());
|
||||
// { extractId, nodeCount, edgeCount, bounds, builtAt, links }
|
||||
|
||||
let after = 0;
|
||||
const edges = [];
|
||||
for (;;) {
|
||||
const page = await fetch(
|
||||
\`/u/${slug}/graph/\${source}/edges?bbox=\${bbox}&after=\${after}&limit=5000&token=\${token}\`
|
||||
).then((r) => r.json());
|
||||
edges.push(...page.items);
|
||||
if (page.nextAfter == null) break;
|
||||
after = page.nextAfter;
|
||||
}
|
||||
// page.items[]: { id, fromId, toId, highway, name, oneway, lengthM }
|
||||
// oneway=false → ребро двустороннее (ездить можно в обе стороны)`,
|
||||
[slug, source]
|
||||
);
|
||||
|
||||
const graphCurl = `curl -s "${graphEdgesUrl}"`;
|
||||
|
||||
return (
|
||||
<div className="guides">
|
||||
<PageHeader
|
||||
@@ -91,7 +118,10 @@ const map = new maplibregl.Map({
|
||||
<ol className="guide-steps">
|
||||
<li>
|
||||
<strong>1. Токен</strong>
|
||||
<p>В разделе «Токены» создайте ключ. Он показывается один раз и дальше уходит только в query <code>token=</code> или Bearer.</p>
|
||||
<p>
|
||||
В разделе <Link to="/tokens">Токены</Link> создайте ключ. Он показывается один раз и дальше уходит только в
|
||||
query <code>token=</code> или Bearer.
|
||||
</p>
|
||||
{!token ? (
|
||||
<Button
|
||||
variant="primary"
|
||||
@@ -123,7 +153,7 @@ const map = new maplibregl.Map({
|
||||
</p>
|
||||
</li>
|
||||
<li>
|
||||
<strong>3. URL</strong>
|
||||
<strong>3. URL карты</strong>
|
||||
<p>MapLibre просит style JSON. Сервер сам подставит тайлы с тем же токеном.</p>
|
||||
</li>
|
||||
<li>
|
||||
@@ -136,20 +166,31 @@ const map = new maplibregl.Map({
|
||||
<li>
|
||||
<strong>5. Граф дорог</strong>
|
||||
<p>
|
||||
После sync рядом с тайлами лежит SQLite-граф (<code>highway=*</code>, рёбра между перекрёстками). Отдаётся только с
|
||||
токеном. Узлы/рёбра — по <code>bbox</code> (≤ 2°), пагинация <code>after</code>.
|
||||
На sync из того же PBF собирается SQLite-граф (<code>highway</code> motorway…service): узлы — перекрёстки,
|
||||
рёбра — сегменты с <code>lengthM</code> и <code>oneway</code>. Смотреть и дергать API — в разделе{" "}
|
||||
<Link to="/graph">Граф</Link>.
|
||||
</p>
|
||||
</li>
|
||||
</ol>
|
||||
|
||||
<h2 className="guides__h">Карта</h2>
|
||||
<CopyBlock label="Style JSON" value={styleUrl} />
|
||||
<CopyBlock
|
||||
label="Несколько округов"
|
||||
value={`${origin}/u/${slug}/styles/osm-bright?source=${sources.map((item) => item.id).join(",") || "central-fed-district,volga-fed-district"}${token ? `&token=${token}` : "&token=ts_…"}`}
|
||||
value={`${origin}/u/${slug}/styles/osm-bright?source=${sources.map((item) => item.id).join(",") || "central-fed-district,volga-fed-district"}&${tokenSuffix}`}
|
||||
/>
|
||||
<CopyBlock label="Тайлы MVT" value={tilesUrl} />
|
||||
<CopyBlock label="Граф (метаданные)" value={graphUrl} />
|
||||
<CopyBlock label="Граф: рёбра в bbox" value={graphEdgesUrl} />
|
||||
|
||||
<h2 className="guides__h">Граф дорог</h2>
|
||||
<p className="guides__lead">
|
||||
Только с токеном. Выгрузка всего округа целиком запрещена: всегда указывайте <code>bbox</code> (сторона ≤ 2°),
|
||||
дальше листайте через <code>after</code> / <code>nextAfter</code>.
|
||||
</p>
|
||||
<CopyBlock label="Метаданные" value={graphUrl} />
|
||||
<CopyBlock label="Узлы в bbox" value={graphNodesUrl} />
|
||||
<CopyBlock label="Рёбра в bbox" value={graphEdgesUrl} />
|
||||
<CopyBlock label="curl" value={graphCurl} />
|
||||
<CopyBlock label="fetch + пагинация" value={graphFetch} />
|
||||
|
||||
<h2 className="guides__h">HTML</h2>
|
||||
<CopyBlock label="Минимальная страница" value={html} />
|
||||
|
||||
@@ -14,6 +14,17 @@
|
||||
letter-spacing: -0.02em;
|
||||
}
|
||||
|
||||
.guides__lead {
|
||||
margin: 0 var(--gutter) var(--space-4);
|
||||
color: var(--secondary-label);
|
||||
font-size: var(--text-subhead);
|
||||
}
|
||||
|
||||
.guides__lead code {
|
||||
font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
|
||||
font-size: 0.92em;
|
||||
}
|
||||
|
||||
.guide-steps {
|
||||
list-style: none;
|
||||
margin: 0 var(--gutter) var(--space-5);
|
||||
|
||||
@@ -25,7 +25,7 @@ export function TokensPage() {
|
||||
<PageHeader
|
||||
eyebrow="Доступ"
|
||||
title="Токены"
|
||||
description="Ключ показывается один раз. Им открывают персональные /u/{slug}/tiles и стили."
|
||||
description="Ключ показывается один раз. Им открывают /u/{slug}/tiles, стили и граф дорог."
|
||||
/>
|
||||
<Section title="Создать">
|
||||
<div className="form-row">
|
||||
|
||||
@@ -66,7 +66,8 @@ export function DashboardPage() {
|
||||
/>
|
||||
<Section title="Подключение" description="Публичные стили и тайлы закрыты — только /u/{slug} и токен.">
|
||||
<p className="section__desc" style={{ padding: 0 }}>
|
||||
Примеры кода, HTML и живая карта — в разделе <Link to="/guides">Инструкции</Link>.
|
||||
Примеры кода — в <Link to="/guides">Инструкциях</Link>. Граф дорог — в разделе{" "}
|
||||
<Link to="/graph">Граф</Link>.
|
||||
</p>
|
||||
</Section>
|
||||
<Section title="По дням">
|
||||
|
||||
Reference in New Issue
Block a user