diff --git a/apps/device-manager/public/installers/nodedc-arnavi-vps-0.2.2.pyz b/apps/device-manager/public/installers/nodedc-arnavi-vps-0.2.3.pyz similarity index 99% rename from apps/device-manager/public/installers/nodedc-arnavi-vps-0.2.2.pyz rename to apps/device-manager/public/installers/nodedc-arnavi-vps-0.2.3.pyz index 38558b3..a7eeddb 100644 Binary files a/apps/device-manager/public/installers/nodedc-arnavi-vps-0.2.2.pyz and b/apps/device-manager/public/installers/nodedc-arnavi-vps-0.2.3.pyz differ diff --git a/apps/device-manager/src/b2/B2HostSettings.tsx b/apps/device-manager/src/b2/B2HostSettings.tsx index 134f10d..ca277cd 100644 --- a/apps/device-manager/src/b2/B2HostSettings.tsx +++ b/apps/device-manager/src/b2/B2HostSettings.tsx @@ -20,7 +20,7 @@ export function B2HostSettings({ host, workspace, onClose, onChanged, onError }: const [expanded, setExpanded] = useState([]), [keyRows, setKeyRows] = useState([]); const [creating, setCreating] = useState(''), [name, setName] = useState(''); const [creationIntent, setCreationIntent] = useState<{ id: string; name: string } | null>(null); - const [history, setHistory] = useState([]); + const [hiddenHistory, setHiddenHistory] = useState([]); const [issued, setIssued] = useState<{ applicationId: string; clientId: string; value: string } | null>(null); const [credentialRows, setCredentialRows] = useState([]); const [confirm, setConfirm] = useState<{ action: string; fields: Record; text: string } | null>(null); @@ -46,6 +46,7 @@ export function B2HostSettings({ host, workspace, onClose, onChanged, onError }: setCredentialRows((rows) => [...new Set([...rows, clientId])]); } if (action === 'key-revoke' && issued?.clientId === data.clientId) setIssued(null); + if (action === 'application-delete' && issued?.applicationId === data.integrationId) setIssued(null); if (action === 'connect') { setConnection(''); setImportOpen(false); setSection('contours'); } setCreating(''); setName(''); setCreationIntent(null); try { await refresh(); await onChanged(); } catch (error) { onError(error); } @@ -65,13 +66,22 @@ export function B2HostSettings({ host, workspace, onClose, onChanged, onError }: const open = keyRows.includes(app.id), active = app.credentials.some((item) => item.enabled); return
  • setKeyRows(toggle(keyRows, app.id))}>} /> + actions={<> + {open && !legacy ? <> + setHiddenHistory(toggle(hiddenHistory, app.id))}> + {canManage ? <> + setConfirm({ action: 'key-issue', fields: { integrationId: app.id, replace: active }, text: active ? `Перевыпустить ключ «${app.name}»? Прежний ключ перестанет работать.` : `Выдать ключ «${app.name}»?` })}> + setConfirm({ action: 'application-delete', fields: { integrationId: app.id }, text: `Удалить «${app.name}» со всеми ключами и связями с контурами на этом VPS? Доступ приложения прекратится. Устройства, данные контуров и другие приложения сохранятся.` })}> + : null} + : null} + setKeyRows(toggle(keyRows, app.id))}> + } /> {open ?
    {legacy ? <>
    Тип подключения
    Прямая привязка Mission Core
    ID приложения
    {app.id}

    Это прежняя привязка сервера, без OAuth-ключа. Выпуск и отзыв ключей ниже относятся к приложениям API v2 и не изменяют эту привязку.

    : <> - {app.credentials.filter((item) => item.enabled || history.includes(app.id)).map((item) => { + {app.credentials.filter((item) => item.enabled || !hiddenHistory.includes(app.id)).map((item) => { const keyOpen = credentialRows.includes(item.client_id); const secret = issued?.applicationId === app.id && issued.clientId === item.client_id ? issued : null; return
  • @@ -87,10 +97,7 @@ export function B2HostSettings({ host, workspace, onClose, onChanged, onError }: : null}
  • ; })} -
    - {app.credentials.some((item) => !item.enabled) ? : null} - {canManage ? : null} -
    + {!app.credentials.length ?

    Ключи ещё не выданы

    : null} } : null} ; @@ -126,13 +133,16 @@ export function B2HostSettings({ host, workspace, onClose, onChanged, onError }: const available = (status?.contours || []).filter((contour) => !status?.links?.some((link) => link.contourId === contour.id)); return
  • setExpanded(toggle(expanded, item.projectRef))}>} /> + actions={<> + {open && linked && canManage ? { setCreating(item.projectRef); setName(''); setCreationIntent(null); }}> : null} + setExpanded(toggle(expanded, item.projectRef))}> + } /> {open ?
    {!linked ? <> {canManage ? : null} {available.length ?