/
vshmidt
/
label-studio
Обзор
Документация
Войти
/
vshmidt
/
label-studio
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
web/libs/editor/src/utils/docs.ts
29 строк
1 KB
Ricardo Cabral
feat: BROS-73: [FE] Create empty states for panels: info, regions, relations, history (#7694)
16 июн 2025, 15:53
Не верифицирован
16 июн 2025, 15:53
bd69adb
Код
Авторство
О чём код?
/** * Returns the base URL for documentation depending on deployment type. * - Enterprise: https://docs.humansignal.com/ * - Open Source: https://labelstud.io/ */ export function getDocsBaseUrl(): string { if (typeof window !== "undefined" && window.APP_SETTINGS?.billing?.enterprise) { return "https://docs.humansignal.com/"; } return "https://labelstud.io/"; } /** * Returns a full documentation URL for the current deployment type. * * Usage: * getDocsUrl('guide/labeling') // same path for both domains * getDocsUrl('guide/labeling', 'guide/label-guide') // first param for labelstud.io, second for docs.humansignal.com * * @param pathOSS - Path for labelstud.io (and default for both if only one param) * @param pathEnterprise - Optional path for docs.humansignal.com * @returns {string} Full documentation URL */ export function getDocsUrl(pathOSS: string, pathEnterprise?: string): string { const base = getDocsBaseUrl(); const isEnterprise = typeof window !== "undefined" && window.APP_SETTINGS?.billing?.enterprise; const path = isEnterprise && pathEnterprise ? pathEnterprise : pathOSS; return `${base.replace(/\/$/, "")}/${path.replace(/^\//, "")}`; }