/
githubmirror
/
ydb-embedded-ui
Обзор
Документация
Войти
/
githubmirror
/
ydb-embedded-ui
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/components/TenantNameWrapper/utils.ts
19 строк
695 B
Артём Муфазалов
feat(HomePage): finish databases tab (#3324)
19 янв 2026, 14:29
Не верифицирован
19 янв 2026, 14:29
7fd5828
Код
Авторство
О чём код?
import type {PreparedTenant} from '../../store/reducers/tenants/types'; import type {AdditionalTenantsProps} from '../../types/additionalProps'; export function getTenantBackend( tenant: PreparedTenant, additionalTenantsProps?: AdditionalTenantsProps, ) { if (typeof additionalTenantsProps?.prepareTenantBackend !== 'function') { return undefined; } let nodeId: string | undefined; const nodeIds = tenant.NodeIds ?? tenant.sharedNodeIds; if (nodeIds && nodeIds.length > 0) { const index = Math.floor(Math.random() * nodeIds.length); nodeId = nodeIds[index].toString(); } return additionalTenantsProps.prepareTenantBackend(nodeId); }