From b3b0f900c5f6e76f91a44922634e8ffc539c6bc0 Mon Sep 17 00:00:00 2001 From: DCCONSTRUCTIONS Date: Wed, 30 Sep 2026 20:58:53 +0300 Subject: [PATCH] refactor(ui): unify registry lists and functional form labels --- README.md | 4 +- .../device-manager/src/DeviceControlViews.tsx | 157 +++++++++--------- apps/device-manager/src/DeviceManagerApp.tsx | 4 +- apps/device-manager/src/styles.css | 4 +- 4 files changed, 80 insertions(+), 89 deletions(-) diff --git a/README.md b/README.md index 3bbfa35..e0d3277 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,9 @@ platform runner registry is validated separately in `NODEDC_PLATFORM`. The accepted Device Core policy is automatic deployment after a push to `main` passes its checks. See [Continuous deployment](docs/CONTINUOUS_DEPLOYMENT.md) for the pinned source qualification workflow, Synology setup and activation -status. Automatic production installation is not enabled yet. +status. Automatic production installation is active: the Synology controller fetches +qualified releases over outbound HTTPS and invokes the canonical runner. +No operator Mac or new inbound port is required. Artifact builders in `infra/deploy-runner` emit data-only tarballs. They never orchestrate Docker or mutate a live host. Promotion remains the established diff --git a/apps/device-manager/src/DeviceControlViews.tsx b/apps/device-manager/src/DeviceControlViews.tsx index 150e481..433576f 100644 --- a/apps/device-manager/src/DeviceControlViews.tsx +++ b/apps/device-manager/src/DeviceControlViews.tsx @@ -1,4 +1,4 @@ -import { useEffect, useMemo, useRef, useState, type FormEvent, type ReactNode } from "react"; +import { Children, isValidElement, useEffect, useMemo, useRef, useState, type FormEvent, type ReactNode } from "react"; import { Button, ConfirmationModal, @@ -567,7 +567,7 @@ function HostsView({ actions={<> {canManageInfrastructure && (isB2(host) || (!host.managementCredentialConfigured && !topology.serviceInstances.some((item) => item.hostRef === host.hostRef))) ? setSettingsHost(host)}> : null} - setExpandedHost(expanded ? null : host.hostRef)}> + setExpandedHost(expanded ? null : host.hostRef)}> } /> {expanded ? @@ -1051,10 +1051,10 @@ function CommandsView({ workspace, canDispatch, onRefresh, onError }: {
- {enabled ? "Типизированный командный канал активен" : "Command transport выключен"} + {enabled ? "Проверка сервиса устройства" : "Команды для этого канала недоступны"}

{enabled - ? "Доступна только безопасная проверка сервиса. Произвольные команды, прошивка, очистка памяти и перезагрузка отсутствуют. Код устройства существует только в памяти Core до отправки или истечения TTL." - : "Ни UI, ни BFF не имеют raw command builder. acknowledged означает подтверждение протокола, verified — отдельное доказательство состояния."}

+ ? "Выберите устройство и введите его шестизначный код." + : "Для этого подключения отправка команд ещё не настроена."}

{workspace.policies.commandTransport}
@@ -1096,12 +1096,12 @@ function CommandsView({ workspace, canDispatch, onRefresh, onError }: { ) : null} - + {workspace.commands.map((command) => ( @@ -1163,11 +1163,6 @@ function SettingsView({ workspace, canConfigure, onCreateConfiguration }: { }) { return ( -
- - - -
Новая версия настроек : null} @@ -1204,12 +1199,12 @@ function AdapterPackageDialog(props: DialogBaseProps) { const [packageKey, setPackageKey] = useState(""); const [displayName, setDisplayName] = useState(""); const [publisherRef, setPublisherRef] = useState(""); - return { + return { await ensureAdapterPackage({ packageKey, displayName, publisherRef, lifecycleState: "active" }); }}> setDisplayName(event.target.value)} required /> - setPublisherRef(event.target.value)} required /> + setPublisherRef(event.target.value)} required /> ; } @@ -1236,12 +1231,12 @@ function AdapterVersionDialog({ packages, ...props }: DialogBaseProps & { packag lifecycleState: "draft", }); }}> - ({ value: item.adapterPackageRef, label: item.displayName }))} /> setVersion(event.target.value)} required placeholder="1.0.0" /> - setRuntimeRef(event.target.value)} required /> - setDigest(event.target.value)} required placeholder="sha256:…" /> - setContractVersion(event.target.value)} required /> - setCapabilities(event.target.value)} description="Через запятую" /> + setRuntimeRef(event.target.value)} required /> + setDigest(event.target.value)} required placeholder="sha256:…" /> + setContractVersion(event.target.value)} required /> + setCapabilities(event.target.value)} description="Через запятую" /> ; } @@ -1261,7 +1256,7 @@ function ModelProfileDialog({ versions, ...props }: DialogBaseProps & { versions setVersionRef(versions[0]?.adapterVersionRef ?? ""); } }, [versionRef, versions]); - return { + return { await registerModelProfile({ adapterVersionRef: versionRef, profileRef, @@ -1276,16 +1271,16 @@ function ModelProfileDialog({ versions, ...props }: DialogBaseProps & { versions lifecycleState: "draft", }); }}> - ({ value: item.adapterVersionRef, label: item.version, description: item.runtimePackageRef }))} /> + setProfileRef(event.target.value)} required /> + setSchemaVersion(event.target.value)} required /> + setVendor(event.target.value)} required /> + setModel(event.target.value)} required /> + + setProtocol(event.target.value)} required /> + setSchemaRef(event.target.value)} required /> + setDigest(event.target.value)} required placeholder="sha256:…" /> + setCapabilities(event.target.value)} /> ; } @@ -1293,7 +1288,7 @@ function AssetDialog({ projectRef, ...props }: DialogBaseProps & { projectRef: s const [assetKey, setAssetKey] = useState(""); const [displayName, setDisplayName] = useState(""); const [assetTypeRef, setAssetTypeRef] = useState("asset-type:delivery-trike"); - return { + return { await ensureAsset({ projectRef, assetKey, @@ -1302,9 +1297,9 @@ function AssetDialog({ projectRef, ...props }: DialogBaseProps & { projectRef: s lifecycleState: "active", }); }}> - + setDisplayName(event.target.value)} required /> - setAssetTypeRef(event.target.value)} required description="Канонический тип или стабильная ссылка на тип, не модель трекера." /> + setAssetTypeRef(event.target.value)} required description="Канонический тип или стабильная ссылка на тип, не модель трекера." /> ; } @@ -1322,7 +1317,7 @@ function AssetBindingDialog({ workspace, ...props }: DialogBaseProps & { workspa setAssetRef(workspace.ontology.assets[0]?.assetRef ?? ""); } }, [assetRef, deviceRef, workspace]); - return { + return { await ensureAssetBinding({ projectRef: workspace.project.projectRef, bindingKey, @@ -1334,14 +1329,14 @@ function AssetBindingDialog({ workspace, ...props }: DialogBaseProps & { workspa }); }}> ({ value: item.assetRef, label: item.displayName, description: item.assetTypeRef }))} /> - - - setProvenanceRef(event.target.value)} required /> + setProvenanceRef(event.target.value)} required /> ; } @@ -1400,7 +1395,7 @@ function EndpointDialog({ workspace, initialHostRef, ...props }: DialogBaseProps { value: "monitoring", label: "Monitoring" }, { value: "service", label: "Service" }, ]} /> - setEndpointUri(event.target.value)} required placeholder="ssh://203.0.113.10:22/" description="HTTPS, SSH или TCP. URI с userinfo, query или fragment будет отклонён." /> + setEndpointUri(event.target.value)} required placeholder="ssh://203.0.113.10:22/" description="HTTPS, SSH или TCP, без паролей и параметров запроса." /> ; } @@ -1426,10 +1421,10 @@ function DeploymentDialog({ workspace, initialHostRef, ...props }: DialogBasePro }); }}> ({ value: item.hostRef, label: item.displayName }))} /> - ({ value: item.deploymentRef, label: item.displayName }))} /> + - - setTtlMinutes(event.target.value)} required inputMode="numeric" /> - setEvidence(event.target.value)} required /> -

Это ручное наблюдение с TTL. Автоматический probe должен писать тот же canonical contract от собственного source ref.

+ setTtlMinutes(event.target.value)} required inputMode="numeric" /> + setEvidence(event.target.value)} required /> +

Состояние действует до указанного срока.

; } @@ -1520,9 +1515,9 @@ function EdgeDialog(props: DialogBaseProps) { return { await ensureEdge({ edgeKey, displayName, deploymentRef: deploymentRef || null, lifecycleState: "provisioning" }); }}> - + setDisplayName(event.target.value)} required /> - setDeploymentRef(event.target.value)} description="Opaque artifact/deployment reference, не адрес и не credential." /> + setDeploymentRef(event.target.value)} description="" /> ; } @@ -1554,12 +1549,12 @@ function RouteDialog({ workspace, ...props }: DialogBaseProps & { workspace: Pro lifecycleState: "draft", }); }}> - + setDisplayName(event.target.value)} required /> - ({ value: item.modelProfileRef, label: `${item.vendor} ${item.model}`, description: item.protocol }))} /> - setListenerRef(event.target.value)} required /> -

Маршрут создаётся draft. Его activation остаётся отдельным осознанным изменением данных.

+ ({ value: item.modelProfileRef, label: `${item.vendor} ${item.model}`, description: item.protocol }))} /> + setListenerRef(event.target.value)} required /> +

После создания маршрут можно активировать в списке.

; } @@ -1579,7 +1574,7 @@ function BindingDialog({ workspace, ...props }: DialogBaseProps & { workspace: P setSourceValue(sources[0]?.value ?? ""); } }, [sourceValue, sources]); - return { + return { const [kind, ref] = sourceValue.split("|"); await ensureDeviceBinding({ projectRef: workspace.project.projectRef, @@ -1591,12 +1586,12 @@ function BindingDialog({ workspace, ...props }: DialogBaseProps & { workspace: P capabilities: commaList(capabilities), }); }}> - + setDisplayName(event.target.value)} required /> - setTargetKind(event.target.value)} required placeholder="foundry.application" /> - setTargetRef(event.target.value)} required /> - setCapabilities(event.target.value)} description="observe, inspect, configure, command" required /> + setTargetKind(event.target.value)} required placeholder="foundry.application" /> + setTargetRef(event.target.value)} required /> + setCapabilities(event.target.value)} description="observe, inspect, configure, command" required /> ; } @@ -1606,7 +1601,7 @@ function GrantDialog({ projectRef, ...props }: DialogBaseProps & { projectRef: s const [role, setRole] = useState("viewer"); const [allow, setAllow] = useState(""); const [deny, setDeny] = useState(""); - return { + return { await upsertProjectGrant({ projectRef, principalKind, @@ -1617,11 +1612,11 @@ function GrantDialog({ projectRef, ...props }: DialogBaseProps & { projectRef: s lifecycleState: "active", }); }}> - ({ value, label: value, disabled: value === "owner" && principalKind === "group" }))} /> - setAllow(event.target.value)} description="Опциональные точечные добавления" /> - setDeny(event.target.value)} description="Deny имеет приоритет" /> + ({ value, label: value, disabled: value === "owner" && principalKind === "group" }))} /> + setAllow(event.target.value)} description="Опциональные точечные добавления" /> + setDeny(event.target.value)} description="Запреты имеют приоритет" /> ; } @@ -1712,7 +1707,7 @@ function ControlSection({ title, count, children }: { title: string; count: numb function ResourceGrid({ children, empty }: { children: ReactNode; empty: string }) { const hasChildren = Array.isArray(children) ? children.length > 0 : Boolean(children); - return hasChildren ?
{children}
:
{empty}
; + return hasChildren ? {Children.toArray(children).map((child, index) =>
  • {child}
  • )}
    :
    {empty}
    ; } function ResourceCard({ eyebrow, title, description, status, meta, action = null }: { eyebrow: string; title: string; description: string; status: string; meta: string[]; action?: ReactNode }) { @@ -1727,7 +1722,7 @@ function ResourceCard({ eyebrow, title, description, status, meta, action = null function ResourceList({ children, empty }: { children: ReactNode; empty: string }) { const hasChildren = Array.isArray(children) ? children.length > 0 : Boolean(children); - return hasChildren ?
    {children}
    :
    {empty}
    ; + return hasChildren ? {Children.toArray(children).map((child, index) =>
  • {child}
  • )}
    :
    {empty}
    ; } function ResourceRow({ title, description, status, trailing }: { title: string; description: string; status: string; trailing: ReactNode }) { @@ -1737,10 +1732,6 @@ function ResourceRow({ title, description, status, trailing }: { title: string; actions={typeof trailing === "string" ? undefined : trailing} />; } -function PolicyCard({ label, value }: { label: string; value: string }) { - return
    {label}{value}
    ; -} - function commaList(value: string) { return [...new Set(value.split(",").map((item) => item.trim()).filter(Boolean))].sort(); } diff --git a/apps/device-manager/src/DeviceManagerApp.tsx b/apps/device-manager/src/DeviceManagerApp.tsx index c0f97ec..7045caa 100644 --- a/apps/device-manager/src/DeviceManagerApp.tsx +++ b/apps/device-manager/src/DeviceManagerApp.tsx @@ -100,7 +100,7 @@ const sectionNavigation: Record = { ], infrastructure: [ { id: "hosts", label: "VPS и хосты", icon: "building", capability: "telemetry.observe" }, - { id: "infrastructure", label: "Edges и маршруты", icon: "globe", capability: "telemetry.observe" }, + { id: "infrastructure", label: "Узлы и маршруты", icon: "globe", capability: "telemetry.observe" }, { id: "catalog", label: "Модели и адаптеры", icon: "database", capability: "project.read" }, ], management: [ @@ -942,7 +942,7 @@ function ProjectSettingsDialog({ open, workspace, presentation, onClose, onSaved avatarUrl: iconPreview ?? undefined, }} sections={[ - { id: "identity", label: "Идентичность", icon: "profile", group: "Проект" }, + { id: "identity", label: "Основное", icon: "profile", group: "Проект" }, { id: "media", label: "Медиа", icon: "image", group: "Оформление" }, ]} activeSection={section} diff --git a/apps/device-manager/src/styles.css b/apps/device-manager/src/styles.css index a2ba34b..f06d2b1 100644 --- a/apps/device-manager/src/styles.css +++ b/apps/device-manager/src/styles.css @@ -121,9 +121,7 @@ } .device-control-form { - max-height: min(62vh, 680px); - overflow-y: auto; - padding-right: 3px; + min-width: 0; } .infrastructure-system-workspace {